]> xenbits.xensource.com Git - people/liuw/freebsd.git/commitdiff
Add sysctl to control LACP strict compliance default
authorsmh <smh@FreeBSD.org>
Fri, 6 Nov 2015 15:33:27 +0000 (15:33 +0000)
committersmh <smh@FreeBSD.org>
Fri, 6 Nov 2015 15:33:27 +0000 (15:33 +0000)
Add net.link.lagg.lacp.default_strict_mode which defines
the default value for LACP strict compliance for created
lagg devices.

Also:
* Add lacp_strict option to ifconfig(8).
* Fix lagg(4) creation examples.
* Minor style(9) fix.

MFC after: 1 week

sbin/ifconfig/ifconfig.8
share/man/man4/lagg.4
sys/net/ieee8023ad_lacp.c

index 9e31e5b22cb2a763a602d0895248dee4f644cc9f..a5d7380ff68d8afade87ddb4a651aa112c6a0627 100644 (file)
@@ -28,7 +28,7 @@
 .\"     From: @(#)ifconfig.8   8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd Aug 12, 2015
+.Dd November 6, 2015
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -2400,6 +2400,21 @@ which are shifted by the number of this parameter.
 Enable lacp fast-timeout on the interface.
 .It Cm -lacp_fast_timeout
 Disable lacp fast-timeout on the interface.
+.It Cm lacp_strict
+Enable lacp strict compliance on the interface.
+The default value can be set via the
+.Va net.link.lagg.lacp.default_strict_mode
+.Xr sysctl 8
+variable.
+.Li 0
+means
+.Dq disabled
+and
+.Li 1
+means
+.Dq enabled .
+.It Cm -lacp_strict
+Disable lacp strict compliance on the interface.
 .El
 .Pp
 The following parameters are specific to IP tunnel interfaces,
index 0b66c3df5e5dea05e9223e491df26626fbade765..da070f158d0e11fe075c730309b68407e7c25b58 100644 (file)
@@ -16,7 +16,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 1, 2014
+.Dd November 6, 2015
 .Dt LAGG 4
 .Os
 .Sh NAME
@@ -156,6 +156,7 @@ Gigabit Ethernet interfaces:
 .Bd -literal -offset indent
 # ifconfig bge0 up
 # ifconfig bge1 up
+# ifconfig lagg0 create
 # ifconfig lagg0 laggproto lacp laggport bge0 laggport bge1 \e
        192.168.1.1 netmask 255.255.255.0
 .Ed
@@ -168,6 +169,7 @@ device will be used:
 # ifconfig em0 up
 # ifconfig ath0 ether 00:11:22:33:44:55
 # ifconfig create wlan0 wlandev ath0 ssid my_net up
+# ifconfig lagg0 create
 # ifconfig lagg0 laggproto failover laggport em0 laggport wlan0 \e
        192.168.1.1 netmask 255.255.255.0
 .Ed
index 1af4ffc91f205bac23daa4a220dd9890a5859f82..4863ac98035b41edb5e788da150a7e851d0a4cab 100644 (file)
@@ -196,6 +196,11 @@ SYSCTL_NODE(_net_link_lagg, OID_AUTO, lacp, CTLFLAG_RD, 0, "ieee802.3ad");
 SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, debug, CTLFLAG_RWTUN | CTLFLAG_VNET,
     &VNET_NAME(lacp_debug), 0, "Enable LACP debug logging (1=debug, 2=trace)");
 
+static VNET_DEFINE(int, lacp_default_strict_mode) = 1;
+SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, default_strict_mode, CTLFLAG_RWTUN,
+    &VNET_NAME(lacp_default_strict_mode), 0,
+    "LACP strict protocol compliance default");
+
 #define LACP_DPRINTF(a) if (V_lacp_debug & 0x01) { lacp_dprintf a ; }
 #define LACP_TRACE(a) if (V_lacp_debug & 0x02) { lacp_dprintf(a,"%s\n",__func__); }
 #define LACP_TPRINTF(a) if (V_lacp_debug & 0x04) { lacp_dprintf a ; }
@@ -765,7 +770,7 @@ lacp_attach(struct lagg_softc *sc)
 
        lsc->lsc_hashkey = m_ether_tcpip_hash_init();
        lsc->lsc_active_aggregator = NULL;
-       lsc->lsc_strict_mode = 1;
+       lsc->lsc_strict_mode = VNET(lacp_default_strict_mode);
        LACP_LOCK_INIT(lsc);
        TAILQ_INIT(&lsc->lsc_aggregators);
        LIST_INIT(&lsc->lsc_ports);
@@ -1702,7 +1707,7 @@ lacp_sm_rx_record_default(struct lacp_port *lp)
        if (lp->lp_lsc->lsc_strict_mode)
                lp->lp_partner = lacp_partner_admin_strict;
        else
-               lp->lp_partner = lacp_partner_admin_optimistic;;
+               lp->lp_partner = lacp_partner_admin_optimistic;
        lp->lp_state |= LACP_STATE_DEFAULTED;
        lacp_sm_ptx_update_timeout(lp, oldpstate);
 }