bonding driver - how to recognize the active slave

5 messages, 4 authors, 2012-12-21 · open the first message on its own page

bonding driver - how to recognize the active slave

From: Erez Shitrit <hidden>
Date: 2012-12-20 20:38:39

Hi,
Is there any way to know who is the active slave in active-passive mode?

Is there any indication for that in netdevice flags? Or some other way?
(I would like to get in my network interface driver which can be a slave of the bonding interface)

I saw that there is the flag IFF_SLAVE_INACTIVE but it is not used as far as I can see.

Thanks, Erez

Re: bonding driver - how to recognize the active slave

From: Eric Dumazet <hidden>
Date: 2012-12-20 21:19:33

On Thu, 2012-12-20 at 20:38 +0000, Erez Shitrit wrote:
Hi,
Is there any way to know who is the active slave in active-passive mode?

Is there any indication for that in netdevice flags? Or some other way?
(I would like to get in my network interface driver which can be a slave of the bonding interface)

I saw that there is the flag IFF_SLAVE_INACTIVE but it is not used as far as I can see.

cat /sys/class/net/bond0/bonding/active_slave

Re: bonding driver - how to recognize the active slave

From: Or Gerlitz <hidden>
Date: 2012-12-20 22:27:35

On Thu, Dec 20, 2012 at 11:19 PM, Eric Dumazet [off-list ref] wrote:
cat /sys/class/net/bond0/bonding/active_slave
sure, I think Erez would like to know that from within a network
device kernel code, e.g maybe register to netdev kernel events and on
the event of bonding fail-over identify the active slave for
active-backup mode, etc.

Or.

Re: bonding driver - how to recognize the active slave

From: Eric Dumazet <hidden>
Date: 2012-12-20 22:52:17

On Fri, 2012-12-21 at 00:21 +0200, Or Gerlitz wrote:
On Thu, Dec 20, 2012 at 11:19 PM, Eric Dumazet [off-list ref] wrote:
quoted
cat /sys/class/net/bond0/bonding/active_slave
sure, I think Erez would like to know that from within a network
device kernel code, e.g maybe register to netdev kernel events and on
the event of bonding fail-over identify the active slave for
active-backup mode, etc.
OK, but then why a network driver should be aware of this bonding
detail ?

It seems part of this commit could be reverted,
ie setting IFF_SLAVE_INACTIVE again.

commit 2d7011ca79f1a8792e04d131b8ea21db179ab917
Author: Jiri Pirko [off-list ref]
Date:   Wed Mar 16 08:46:43 2011 +0000

    bonding: get rid of IFF_SLAVE_INACTIVE netdev->priv_flag
    
    Since bond-related code was moved from net/core/dev.c into bonding,
    IFF_SLAVE_INACTIVE is no longer needed. Replace is with flag "inactive"
    stored in slave structure
    
    Signed-off-by: Jiri Pirko [off-list ref]
    Reviewed-by: Nicolas de Pesloüan [off-list ref]
    Signed-off-by: David S. Miller [off-list ref]

Re: bonding driver - how to recognize the active slave

From: Jiri Pirko <jiri@resnulli.us>
Date: 2012-12-21 11:34:37

Thu, Dec 20, 2012 at 11:21:00PM CET, or.gerlitz@gmail.com wrote:
On Thu, Dec 20, 2012 at 11:19 PM, Eric Dumazet [off-list ref] wrote:
quoted
cat /sys/class/net/bond0/bonding/active_slave
sure, I think Erez would like to know that from within a network
device kernel code, e.g maybe register to netdev kernel events and on
the event of bonding fail-over identify the active slave for
active-backup mode, etc.
I wonder why device should care of such thing? Would it behave
differently?
Or.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help