From owner-svn-src-head@FreeBSD.ORG Thu Sep 2 12:55:36 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8632E10658AE; Thu, 2 Sep 2010 12:55:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id E460D8FC24; Thu, 2 Sep 2010 12:55:35 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.4/8.14.4) with ESMTP id o82CPtfu009490; Thu, 2 Sep 2010 16:25:55 +0400 (MSD) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.4/8.14.4/Submit) id o82CPsx0009489; Thu, 2 Sep 2010 16:25:54 +0400 (MSD) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 2 Sep 2010 16:25:54 +0400 From: Gleb Smirnoff To: Xin LI Message-ID: <20100902122554.GC90731@FreeBSD.org> References: <201008080704.o7874RFS090260@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201008080704.o7874RFS090260@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211059 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Sep 2010 12:55:36 -0000 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.