[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <25821.1229013359@death.nxdomain.ibm.com>
Date: Thu, 11 Dec 2008 08:35:59 -0800
From: Jay Vosburgh <fubar@...ibm.com>
To: Poornima Kamath <poornimak@...ab.com>
cc: netdev@...r.kernel.org
Subject: Re: Detecting backup slaves of bonding interface in network driver
Poornima Kamath <poornimak@...ab.com> wrote:
>I have a network driver which creates virtual ethernet interfaces. I am
>using the bonding driver in the active backup mode for failover.
>I want to detect the interfaces which are backup slaves in the driver.
What device is it, and why do you want to do this?
I ask not just out of curiosity, but because there are other
devices that have problems with bonding's handling of some things, and
there are already special options for those devices. If your device,
e.g., can't handle having the same MAC on multiple ports, then your
problem may be resolved with one of the fail_over_mac option settings.
>I found that the bonding driver sets the IFF_SLAVE_INACTIVE private flag
>of net_device structure for all the backup slaves.
>But I dont see any callbacks in my driver when this flag is set.
>I am planning to check the netdevice flags in the driver. Is it
>recommended to check the private flags of net_device ?
>Or is there some better way in which I can find the backup slaves?
Those flags are private to the driver (bonding, in this case),
and there is no callback generated when they change. The
IFF_SLAVE_INACTIVE is what you want (it's set in priv_flags for backup
slaves), but it's purpose is to identify backup slaves so that most
incoming packets on them can be dropped. It's possible that the flag
may change or be eliminated in the future.
Also, note that there is a notifier generated by bonding when a
failover occurs (NETDEV_BONDING_FAILOVER), this was added to the
mainline about six months ago. You may be able to use that to determine
when to check things.
-J
---
-Jay Vosburgh, IBM Linux Technology Center, fubar@...ibm.com
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists