Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Feb 2012 17:26:48 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Tushar Mulkar <tmulkar@sandvine.com>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@FreeBSD.org>
Subject:   Re: [PATCH] if_lagg driver enhancements.
Message-ID:  <20120208132648.GI13554@FreeBSD.org>
In-Reply-To: <26E6BFB8942F2949A1501D4878FAEA152CD50451@blr-exch-1.sandvine.com>
References:  <26E6BFB8942F2949A1501D4878FAEA152CD50451@blr-exch-1.sandvine.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120208132648.GI13554>