summaryrefslogtreecommitdiff
path: root/sys/net/trunklacp.h
diff options
context:
space:
mode:
authorccardenas <ccardenas@cvs.openbsd.org>2018-08-12 23:50:32 +0000
committerccardenas <ccardenas@cvs.openbsd.org>2018-08-12 23:50:32 +0000
commit812322fbfc21e66ff5e13cd48878b3148086cecc (patch)
tree9d2e91f5ad9d100446c7028fcf972348dfd1dc84 /sys/net/trunklacp.h
parented4ba547919184d93efa4623461e0a5bf3056aa3 (diff)
Add administrative options to LACP trunk implementation.
The trunk driver now has a new ioctl (SIOCxTRUNKOPTS), which for now only has options for LACP: * Mode - Active or Passive (default Active) * Timeout - Fast or Slow (default Slow) * System Priority - 1(high) to 65535(low) (default 32768/0x8000) * Port Priority - 1(high) to 65535(low) (default 32768/0x8000) * IFQ Priority - 0 to NUM_QUEUES (default 6) At the moment, ifconfig only has options for lacpmode and lacptimeout plumbed as those are the immediate need. The approach taken for the options was to make them on a "trunk" vs a "port" as what's typically seen on various NOSes (JunOS, NXOS, etc...) as it's uncommon for a host to have one link "Passive" and the other "Active" in a given trunk. Just like on a NOS, when applying lacpmode or lacptimeout, the settings are immediately applied to all existing ports in the trunk and to all future ports brought into the trunk. Tested by many on a plethora of NIC drivers and switches. Ok remi@
Diffstat (limited to 'sys/net/trunklacp.h')
-rw-r--r--sys/net/trunklacp.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/sys/net/trunklacp.h b/sys/net/trunklacp.h
index 869076aa4ea..1abc67f279e 100644
--- a/sys/net/trunklacp.h
+++ b/sys/net/trunklacp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: trunklacp.h,v 1.13 2018/05/12 02:02:34 ccardenas Exp $ */
+/* $OpenBSD: trunklacp.h,v 1.14 2018/08/12 23:50:31 ccardenas Exp $ */
/* $NetBSD: ieee8023ad_impl.h,v 1.2 2005/12/10 23:21:39 elad Exp $ */
/*
@@ -39,6 +39,19 @@
#define SLOWPROTOCOLS_SUBTYPE_LACP 1
#define SLOWPROTOCOLS_SUBTYPE_MARKER 2
+/*
+ * default administrative values
+ */
+#define LACP_DEFAULT_MODE 1 /* Active Mode */
+#define LACP_DEFAULT_TIMEOUT 0 /* Slow Timeout */
+#define LACP_DEFAULT_SYSTEM_PRIO 0x8000 /* Medium Priority */
+#define LACP_LOW_SYSTEM_PRIO 0xffff
+#define LACP_HIGH_SYSTEM_PRIO 0x0001
+#define LACP_DEFAULT_PORT_PRIO 0x8000 /* Medium Priority */
+#define LACP_LOW_PORT_PRIO 0xffff
+#define LACP_HIGH_PORT_PRIO 0x0001
+#define LACP_DEFAULT_IFQ_PRIO 6
+
struct slowprothdr {
u_int8_t sph_subtype;
u_int8_t sph_version;
@@ -221,6 +234,14 @@ struct lacp_aggregator {
int la_pending; /* number of ports in wait_while */
};
+struct lacp_admin_def {
+ u_int8_t lad_mode; /* active or passive */
+ u_int8_t lad_timeout; /* fast or slow */
+ u_int16_t lad_prio; /* system priority */
+ u_int16_t lad_portprio; /* port priority */
+ u_int8_t lad_ifqprio; /* ifq priority */
+};
+
struct lacp_softc {
struct trunk_softc *lsc_softc;
struct lacp_aggregator *lsc_active_aggregator;
@@ -233,6 +254,12 @@ struct lacp_softc {
volatile u_int lsc_activemap;
SIPHASH_KEY lsc_hashkey;
struct task lsc_input;
+ struct lacp_admin_def lsc_admin_defaults;
+#define lsc_mode lsc_admin_defaults.lad_mode
+#define lsc_timeout lsc_admin_defaults.lad_timeout
+#define lsc_sys_prio lsc_admin_defaults.lad_prio
+#define lsc_port_prio lsc_admin_defaults.lad_portprio
+#define lsc_ifq_prio lsc_admin_defaults.lad_ifqprio
};
#define LACP_TYPE_ACTORINFO 1