Date: Tue, 15 Sep 2015 05:19:11 +0000 (UTC) From: Hiren Panchasara <hiren@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r287808 - in stable/10: sbin/ifconfig sys/net Message-ID: <201509150519.t8F5JBnI073764@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hiren Date: Tue Sep 15 05:19:10 2015 New Revision: 287808 URL: https://svnweb.freebsd.org/changeset/base/287808 Log: MFC r286700 Make LAG LACP fast timeout tunable through IOCTL. Modified: stable/10/sbin/ifconfig/ifconfig.8 stable/10/sbin/ifconfig/iflagg.c stable/10/sys/net/ieee8023ad_lacp.c stable/10/sys/net/ieee8023ad_lacp.h stable/10/sys/net/if_lagg.c stable/10/sys/net/if_lagg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/10/sbin/ifconfig/ifconfig.8 Tue Sep 15 05:16:26 2015 (r287807) +++ stable/10/sbin/ifconfig/ifconfig.8 Tue Sep 15 05:19:10 2015 (r287808) @@ -2445,6 +2445,10 @@ Disable local hash computation for RSS h Set a shift parameter for RSS local hash computation. Hash is calculated by using flowid bits in a packet header mbuf which are shifted by the number of this parameter. +.It Cm lacp_fast_timeout +Enable lacp fast-timeout on the interface. +.It Cm -lacp_fast_timeout +Disable lacp fast-timeout on the interface. .El .Pp The following parameters are specific to IP tunnel interfaces, Modified: stable/10/sbin/ifconfig/iflagg.c ============================================================================== --- stable/10/sbin/ifconfig/iflagg.c Tue Sep 15 05:16:26 2015 (r287807) +++ stable/10/sbin/ifconfig/iflagg.c Tue Sep 15 05:19:10 2015 (r287808) @@ -115,6 +115,8 @@ setlaggsetopt(const char *val, int d, in case -LAGG_OPT_LACP_TXTEST: case LAGG_OPT_LACP_RXTEST: case -LAGG_OPT_LACP_RXTEST: + case LAGG_OPT_LACP_TIMEOUT: + case -LAGG_OPT_LACP_TIMEOUT: break; default: err(1, "Invalid lagg option"); @@ -293,6 +295,8 @@ static struct cmd lagg_cmds[] = { DEF_CMD("-lacp_txtest", -LAGG_OPT_LACP_TXTEST, setlaggsetopt), DEF_CMD("lacp_rxtest", LAGG_OPT_LACP_RXTEST, setlaggsetopt), DEF_CMD("-lacp_rxtest", -LAGG_OPT_LACP_RXTEST, setlaggsetopt), + DEF_CMD("lacp_fast_timeout", LAGG_OPT_LACP_TIMEOUT, setlaggsetopt), + DEF_CMD("-lacp_fast_timeout", -LAGG_OPT_LACP_TIMEOUT, setlaggsetopt), DEF_CMD_ARG("flowid_shift", setlaggflowidshift), }; static struct afswtch af_lagg = { Modified: stable/10/sys/net/ieee8023ad_lacp.c ============================================================================== --- stable/10/sys/net/ieee8023ad_lacp.c Tue Sep 15 05:16:26 2015 (r287807) +++ stable/10/sys/net/ieee8023ad_lacp.c Tue Sep 15 05:19:10 2015 (r287808) @@ -519,7 +519,7 @@ lacp_port_create(struct lagg_port *lgp) int error; boolean_t active = TRUE; /* XXX should be configurable */ - boolean_t fast = FALSE; /* XXX should be configurable */ + boolean_t fast = FALSE; /* Configurable via ioctl */ bzero((char *)&sdl, sizeof(sdl)); sdl.sdl_len = sizeof(sdl); Modified: stable/10/sys/net/ieee8023ad_lacp.h ============================================================================== --- stable/10/sys/net/ieee8023ad_lacp.h Tue Sep 15 05:16:26 2015 (r287807) +++ stable/10/sys/net/ieee8023ad_lacp.h Tue Sep 15 05:19:10 2015 (r287808) @@ -251,6 +251,7 @@ struct lacp_softc { u_int32_t lsc_tx_test; } lsc_debug; u_int32_t lsc_strict_mode; + boolean_t lsc_fast_timeout; /* if set, fast timeout */ }; #define LACP_TYPE_ACTORINFO 1 Modified: stable/10/sys/net/if_lagg.c ============================================================================== --- stable/10/sys/net/if_lagg.c Tue Sep 15 05:16:26 2015 (r287807) +++ stable/10/sys/net/if_lagg.c Tue Sep 15 05:19:10 2015 (r287808) @@ -1081,6 +1081,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd ro->ro_opts |= LAGG_OPT_LACP_RXTEST; if (lsc->lsc_strict_mode != 0) ro->ro_opts |= LAGG_OPT_LACP_STRICT; + if (lsc->lsc_fast_timeout != 0) + ro->ro_opts |= LAGG_OPT_LACP_TIMEOUT; ro->ro_active = sc->sc_active; } else { @@ -1116,6 +1118,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd case -LAGG_OPT_LACP_RXTEST: case LAGG_OPT_LACP_STRICT: case -LAGG_OPT_LACP_STRICT: + case LAGG_OPT_LACP_TIMEOUT: + case -LAGG_OPT_LACP_TIMEOUT: valid = lacp = 1; break; default: @@ -1144,6 +1148,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd sc->sc_opts &= ~ro->ro_opts; } else { struct lacp_softc *lsc; + struct lacp_port *lp; lsc = (struct lacp_softc *)sc->sc_psc; @@ -1166,6 +1171,20 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd case -LAGG_OPT_LACP_STRICT: lsc->lsc_strict_mode = 0; break; + case LAGG_OPT_LACP_TIMEOUT: + LACP_LOCK(lsc); + LIST_FOREACH(lp, &lsc->lsc_ports, lp_next) + lp->lp_state |= LACP_STATE_TIMEOUT; + LACP_UNLOCK(lsc); + lsc->lsc_fast_timeout = 1; + break; + case -LAGG_OPT_LACP_TIMEOUT: + LACP_LOCK(lsc); + LIST_FOREACH(lp, &lsc->lsc_ports, lp_next) + lp->lp_state &= ~LACP_STATE_TIMEOUT; + LACP_UNLOCK(lsc); + lsc->lsc_fast_timeout = 0; + break; } } proto->ti_attach(sc); Modified: stable/10/sys/net/if_lagg.h ============================================================================== --- stable/10/sys/net/if_lagg.h Tue Sep 15 05:16:26 2015 (r287807) +++ stable/10/sys/net/if_lagg.h Tue Sep 15 05:19:10 2015 (r287808) @@ -148,6 +148,7 @@ struct lagg_reqopts { #define LAGG_OPT_LACP_STRICT 0x10 /* LACP strict mode */ #define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */ #define LAGG_OPT_LACP_RXTEST 0x40 /* LACP debug: rxtest */ +#define LAGG_OPT_LACP_TIMEOUT 0x80 /* LACP timeout */ u_int ro_count; /* number of ports */ u_int ro_active; /* active port count */ u_int ro_flapping; /* number of flapping */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509150519.t8F5JBnI073764>