summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorhiren <hiren@FreeBSD.org>2015-08-12 20:21:04 +0000
committerhiren <hiren@FreeBSD.org>2015-08-12 20:21:04 +0000
commit99dda03ed417a5c7340f0b5098d754bfd92011d7 (patch)
treede71c825a5b2bd87b45dba96fe7e6c2b73a4e827 /sys
parenta83dfa76512c701e26ed4be2b780506a15072e65 (diff)
downloadFreeBSD-src-99dda03ed417a5c7340f0b5098d754bfd92011d7.zip
FreeBSD-src-99dda03ed417a5c7340f0b5098d754bfd92011d7.tar.gz
Make LAG LACP fast timeout tunable through IOCTL.
Differential Revision: D3300 Submitted by: LN Sundararajan <lakshmi.n at msystechnologies> Reviewed by: wblock, smh, gnn, hiren, rpokala at panasas MFC after: 2 weeks Sponsored by: Panasas
Diffstat (limited to 'sys')
-rw-r--r--sys/net/ieee8023ad_lacp.c2
-rw-r--r--sys/net/ieee8023ad_lacp.h1
-rw-r--r--sys/net/if_lagg.c19
-rw-r--r--sys/net/if_lagg.h1
4 files changed, 22 insertions, 1 deletions
diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c
index 64aafb1..1af4ffc 100644
--- a/sys/net/ieee8023ad_lacp.c
+++ b/sys/net/ieee8023ad_lacp.c
@@ -522,7 +522,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 */
link_init_sdl(ifp, (struct sockaddr *)&sdl, IFT_ETHER);
sdl.sdl_alen = ETHER_ADDR_LEN;
diff --git a/sys/net/ieee8023ad_lacp.h b/sys/net/ieee8023ad_lacp.h
index e814f83..8f0f51a 100644
--- a/sys/net/ieee8023ad_lacp.h
+++ b/sys/net/ieee8023ad_lacp.h
@@ -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
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index dcd005a..b623493 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -1257,6 +1257,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
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 {
@@ -1292,6 +1294,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
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:
@@ -1320,6 +1324,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
sc->sc_opts &= ~ro->ro_opts;
} else {
struct lacp_softc *lsc;
+ struct lacp_port *lp;
lsc = (struct lacp_softc *)sc->sc_psc;
@@ -1342,6 +1347,20 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
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;
}
}
LAGG_WUNLOCK(sc);
diff --git a/sys/net/if_lagg.h b/sys/net/if_lagg.h
index a45fa16..bb5ea23 100644
--- a/sys/net/if_lagg.h
+++ b/sys/net/if_lagg.h
@@ -150,6 +150,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 */
OpenPOWER on IntegriCloud