[PATCH] if_lagg driver enhancements.

Gleb Smirnoff glebius at FreeBSD.org
Wed Feb 8 13:26:50 UTC 2012


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.


More information about the freebsd-net mailing list