svn commit: r211059 - head/sys/netinet

Gleb Smirnoff glebius at FreeBSD.org
Thu Sep 2 12:55:36 UTC 2010


  Xin,

  sorry for late answer.

On Sun, Aug 08, 2010 at 07:04:27AM +0000, Xin LI wrote:
X> Author: delphij
X> Date: Sun Aug  8 07:04:27 2010
X> New Revision: 211059
X> URL: http://svn.freebsd.org/changeset/base/211059
X> 
X> Log:
X>   Address an edge condition that we found at work, where the carp(4)
X>   interface goes to issue LINK_UP, then LINK_DOWN, then LINK_UP at
X>   cold boot.  This behavior is not observed when carp(4) interface
X>   is created slightly later, when the underlying interface is fully
X>   up.
X>   
X>   Before this change what happen at boot is roughly:
X>   
X>    - ifconfig creates em0 interface;
X>    - ifconfig clones a carp device using em0;
X>      (em0's link state is DOWN at this point)
X>    - carp state: INIT -> BACKUP [*]
X>    - carp state: BACKUP -> MASTER
X>    - [Some negotiate between em0 and switch]
X>    - em0 kicks up link state change event
X>      (em0's link state is now up DOWN at this point)
X>    - do_link_state_change() -> carp_carpdev_state()
X>    - carp state: MASTER -> INIT (via carp_set_state(sc, INIT)) [+]
X>    - carp state: INIT -> BACKUP
X>    - carp state: BACKUP -> MASTER
X>   
X>   At the [*] stage, em0 did not received any broadcast message from other
X>   node, and assume our node is the master, thus carp(4) sets the link
X>   state to "UP" after becoming a master.  At [+], the master status
X>   is forcely set to "INIT", then an election is casted, after which our
X>   node would actually become a master.
X>   
X>   We believe that at the [*] stage, the master status should remain as
X>   "INIT" since the underlying parent interface's link state is not up.

Yes, it should. The current problem is that some underlying network interfaces
may not yet support link state notification, so carp(4) treats LINK_STATE_UNKNOWN
as UP.

Once all ethernet devices in tree maintain end report their link state change,
we can switch to treating LINK_STATE_UNKNOWN as DOWN.

-- 
Totus tuus, Glebius.


More information about the svn-src-all mailing list