netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bonding driver - how to recognize the active slave
@ 2012-12-20 20:38 Erez Shitrit
  2012-12-20 21:19 ` Eric Dumazet
  0 siblings, 1 reply; 5+ messages in thread
From: Erez Shitrit @ 2012-12-20 20:38 UTC (permalink / raw)
  To: netdev@vger.kernel.org

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bonding driver - how to recognize the active slave
  2012-12-20 20:38 bonding driver - how to recognize the active slave Erez Shitrit
@ 2012-12-20 21:19 ` Eric Dumazet
  2012-12-20 22:21   ` Or Gerlitz
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2012-12-20 21:19 UTC (permalink / raw)
  To: Erez Shitrit; +Cc: netdev@vger.kernel.org

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bonding driver - how to recognize the active slave
  2012-12-20 21:19 ` Eric Dumazet
@ 2012-12-20 22:21   ` Or Gerlitz
  2012-12-20 22:52     ` Eric Dumazet
  2012-12-21 11:34     ` Jiri Pirko
  0 siblings, 2 replies; 5+ messages in thread
From: Or Gerlitz @ 2012-12-20 22:21 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Erez Shitrit, netdev@vger.kernel.org

On Thu, Dec 20, 2012 at 11:19 PM, Eric Dumazet <erdnetdev@gmail.com> 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bonding driver - how to recognize the active slave
  2012-12-20 22:21   ` Or Gerlitz
@ 2012-12-20 22:52     ` Eric Dumazet
  2012-12-21 11:34     ` Jiri Pirko
  1 sibling, 0 replies; 5+ messages in thread
From: Eric Dumazet @ 2012-12-20 22:52 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Erez Shitrit, netdev@vger.kernel.org

On Fri, 2012-12-21 at 00:21 +0200, Or Gerlitz wrote:
> On Thu, Dec 20, 2012 at 11:19 PM, Eric Dumazet <erdnetdev@gmail.com> 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.

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 <jpirko@redhat.com>
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 <jpirko@redhat.com>
    Reviewed-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
    Signed-off-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bonding driver - how to recognize the active slave
  2012-12-20 22:21   ` Or Gerlitz
  2012-12-20 22:52     ` Eric Dumazet
@ 2012-12-21 11:34     ` Jiri Pirko
  1 sibling, 0 replies; 5+ messages in thread
From: Jiri Pirko @ 2012-12-21 11:34 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Eric Dumazet, Erez Shitrit, netdev@vger.kernel.org

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 <erdnetdev@gmail.com> 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.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-12-21 11:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-20 20:38 bonding driver - how to recognize the active slave Erez Shitrit
2012-12-20 21:19 ` Eric Dumazet
2012-12-20 22:21   ` Or Gerlitz
2012-12-20 22:52     ` Eric Dumazet
2012-12-21 11:34     ` Jiri Pirko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).