From owner-freebsd-net@FreeBSD.ORG Wed Feb 8 13:26:50 2012 Return-Path: Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF2A3106564A for ; Wed, 8 Feb 2012 13:26:50 +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 5225F8FC13 for ; Wed, 8 Feb 2012 13:26:50 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q18DQnhX022986; Wed, 8 Feb 2012 17:26:49 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q18DQmQI022985; Wed, 8 Feb 2012 17:26:48 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 8 Feb 2012 17:26:48 +0400 From: Gleb Smirnoff To: Tushar Mulkar Message-ID: <20120208132648.GI13554@FreeBSD.org> References: <26E6BFB8942F2949A1501D4878FAEA152CD50451@blr-exch-1.sandvine.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <26E6BFB8942F2949A1501D4878FAEA152CD50451@blr-exch-1.sandvine.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "freebsd-net@freebsd.org" Subject: Re: [PATCH] if_lagg driver enhancements. X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 13:26:50 -0000 On Tue, Feb 07, 2012 at 02:30:08PM +0000, Tushar Mulkar wrote: T> Hello, T> A patch is developed that has following enhancements in lagg driver T> T> - Sending a gratuitous ARP when link state changes on primary port of T> lag (kern/156226) T> - Support of new ioctl command to change primary port of the lag T> T> These enhancements are quite handy and useful. Please check if it can T> be added to FreeBSD IMHO, the patch introduces a layering violation, which is bad. This would lead to problems in future. From a quick look I don't see any right now, and patch is compatible with carp(4) just accidentially :) I would suggest the following approach: 1) Network protocols should register theirselves on the ifnet_link_event EVENTHANDLER(9). 2) The inet4 should send gratutious ARP on this event. 3) The inet6 should send NA. As you see the patch would be entirely not about lagg(4) :) We've got some minor obstacles on the suggested way: - The if_link_state_change() function suppresses any processing if the link hasn't changed, for example UP -> UP event. We can overcome this by adding a new pseudo state LINK_STATE_UPAGAIN (or LINK_STATE_UPCHANGED or LINK_STATE_UPANOTHER or any better name you can imagine). This pseudo state can't be stored in the ifp->if_link_state, but it can be used to keep the state LINK_STATE_UP, but force triggering link state hooks. I think this approach is more clean and error prone. It can lead only to extraneous gratutious ARP sent in some cases, which is not critical. -- Totus tuus, Glebius.