xref: /titanic_44/usr/src/uts/common/sys/aggr_lacp.h (revision da14cebe459d3275048785f25bd869cb09b5307f)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
595c1c84bSRamesh Kumar Katla  * Common Development and Distribution License (the "License").
695c1c84bSRamesh Kumar Katla  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
2295c1c84bSRamesh Kumar Katla  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_SYS_AGGR_LACP_H
277c478bd9Sstevel@tonic-gate #define	_SYS_AGGR_LACP_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #include <sys/aggr.h>
307c478bd9Sstevel@tonic-gate #include <sys/ethernet.h>
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
337c478bd9Sstevel@tonic-gate extern "C" {
347c478bd9Sstevel@tonic-gate #endif
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #ifdef _KERNEL
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate /*
397c478bd9Sstevel@tonic-gate  * 802.3ad LACP version number
407c478bd9Sstevel@tonic-gate  */
417c478bd9Sstevel@tonic-gate #define	LACP_VERSION	0x01	/* LACP version from 802.3ad */
427c478bd9Sstevel@tonic-gate #define	LACP_SUBTYPE	0x1
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate /*
457c478bd9Sstevel@tonic-gate  * TLV type (type/length/value carried in the LACPDU structure.
467c478bd9Sstevel@tonic-gate  */
477c478bd9Sstevel@tonic-gate #define	ACTOR_TLV	0x01	/* actor TLV type */
487c478bd9Sstevel@tonic-gate #define	PARTNER_TLV	0x02	/* partner TLV type */
497c478bd9Sstevel@tonic-gate #define	COLLECTOR_TLV	0x03	/* collector TLV type */
507c478bd9Sstevel@tonic-gate #define	TERMINATOR_TLV	0x00	/* end of message */
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate /*
537c478bd9Sstevel@tonic-gate  * Length fields as per 802.3ad.
547c478bd9Sstevel@tonic-gate  */
557c478bd9Sstevel@tonic-gate #define	LACP_COLLECTOR_INFO_LEN		0x10
567c478bd9Sstevel@tonic-gate #define	LACP_TERMINATOR_INFO_LEN	0x00
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate /* LACP Receive State Machine states */
597c478bd9Sstevel@tonic-gate typedef	enum {
607c478bd9Sstevel@tonic-gate 	LACP_INITIALIZE		= 0,
617c478bd9Sstevel@tonic-gate 	LACP_PORT_DISABLED	= 1,
627c478bd9Sstevel@tonic-gate 	LACP_EXPIRED		= 2,
637c478bd9Sstevel@tonic-gate 	LACP_DISABLED		= 3,
647c478bd9Sstevel@tonic-gate 	LACP_DEFAULTED		= 4,
657c478bd9Sstevel@tonic-gate 	LACP_CURRENT		= 5
667c478bd9Sstevel@tonic-gate } lacp_receive_state_t;
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate #define	LACP_RECEIVE_STATE_STRINGS {	\
697c478bd9Sstevel@tonic-gate 	"LACP_INITIALIZE",		\
707c478bd9Sstevel@tonic-gate 	"LACP_PORT_DISABLED",		\
717c478bd9Sstevel@tonic-gate 	"LACP_EXPIRED",			\
727c478bd9Sstevel@tonic-gate 	"LACP_DISABLED",		\
737c478bd9Sstevel@tonic-gate 	"LACP_DEFAULTED",		\
747c478bd9Sstevel@tonic-gate 	"LACP_CURRENT"			\
757c478bd9Sstevel@tonic-gate }
767c478bd9Sstevel@tonic-gate 
777c478bd9Sstevel@tonic-gate /* LACP Periodic State Machine states */
787c478bd9Sstevel@tonic-gate typedef	enum {
797c478bd9Sstevel@tonic-gate 	LACP_NO_PERIODIC		= 0,
807c478bd9Sstevel@tonic-gate 	LACP_FAST_PERIODIC		= 1,
817c478bd9Sstevel@tonic-gate 	LACP_SLOW_PERIODIC		= 2,
827c478bd9Sstevel@tonic-gate 	LACP_PERIODIC_TX		= 3
837c478bd9Sstevel@tonic-gate } lacp_periodic_state_t;
847c478bd9Sstevel@tonic-gate 
857c478bd9Sstevel@tonic-gate #define	LACP_PERIODIC_STRINGS {		\
867c478bd9Sstevel@tonic-gate 	"LACP_NO_PERIODIC",		\
877c478bd9Sstevel@tonic-gate 	"LACP_FAST_PERIODIC",		\
887c478bd9Sstevel@tonic-gate 	"LACP_SLOW_PERIODIC",		\
897c478bd9Sstevel@tonic-gate 	"LACP_PERIODIC_TX"		\
907c478bd9Sstevel@tonic-gate }
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate 
937c478bd9Sstevel@tonic-gate /* LACP Mux State Machine states */
947c478bd9Sstevel@tonic-gate typedef	enum {
957c478bd9Sstevel@tonic-gate 	LACP_DETACHED			= 0,
967c478bd9Sstevel@tonic-gate 	LACP_WAITING			= 1,
977c478bd9Sstevel@tonic-gate 	LACP_ATTACHED			= 2,
987c478bd9Sstevel@tonic-gate 	LACP_COLLECTING_DISTRIBUTING	= 3
997c478bd9Sstevel@tonic-gate } lacp_mux_state_t;
1007c478bd9Sstevel@tonic-gate 
1017c478bd9Sstevel@tonic-gate #define	LACP_MUX_STRINGS {		\
1027c478bd9Sstevel@tonic-gate 	"LACP_DETACHED",		\
1037c478bd9Sstevel@tonic-gate 	"LACP_WAITING",			\
1047c478bd9Sstevel@tonic-gate 	"LACP_ATTACHED",		\
1057c478bd9Sstevel@tonic-gate 	"LACP_COLLECTING_DISTRIBUTING"	\
1067c478bd9Sstevel@tonic-gate }
1077c478bd9Sstevel@tonic-gate 
1087c478bd9Sstevel@tonic-gate /* LACP Churn State Machine states */
1097c478bd9Sstevel@tonic-gate typedef	enum {
1107c478bd9Sstevel@tonic-gate 	LACP_NO_ACTOR_CHURN		= 0,
1117c478bd9Sstevel@tonic-gate 	LACP_ACTOR_CHURN_MONITOR	= 1,
1127c478bd9Sstevel@tonic-gate 	LACP_ACTOR_CHURN		= 2
1137c478bd9Sstevel@tonic-gate } lacp_churn_state_t;
1147c478bd9Sstevel@tonic-gate 
1157c478bd9Sstevel@tonic-gate /*
1167c478bd9Sstevel@tonic-gate  * 802.3ad timer constants.  (IEEE 802.3ad: section 43.4.4)
1177c478bd9Sstevel@tonic-gate  *
1187c478bd9Sstevel@tonic-gate  * All timers specified have a implementation tolerance of +- 250 ms.
1197c478bd9Sstevel@tonic-gate  */
1207c478bd9Sstevel@tonic-gate #define	FAST_PERIODIC_TIME		1	/* using short timeouts (tx) */
1217c478bd9Sstevel@tonic-gate #define	SLOW_PERIODIC_TIME		30	/* using long timeouts (tx) */
1227c478bd9Sstevel@tonic-gate #define	SHORT_TIMEOUT_TIME		3	/* before invalidate LACPDU */
1237c478bd9Sstevel@tonic-gate #define	LONG_TIMEOUT_TIME		90	/* before invalidate LACPDU */
1247c478bd9Sstevel@tonic-gate #define	CHURN_DETECTION_TIME		60	/* sync between actor/partner */
1257c478bd9Sstevel@tonic-gate #define	AGGREGATE_WAIT_TIME		2  /* Delay wait to aggregate links */
1267c478bd9Sstevel@tonic-gate 
1277c478bd9Sstevel@tonic-gate /*
1287c478bd9Sstevel@tonic-gate  * 802.3ad Variables associated with the system (section 43.4.5)
1297c478bd9Sstevel@tonic-gate  */
1307c478bd9Sstevel@tonic-gate typedef struct system_info {
1317c478bd9Sstevel@tonic-gate 	struct ether_addr system_id;	/* MAC address assigned by admin */
1327c478bd9Sstevel@tonic-gate 	uint16_t system_priority; 	/* system priority assigned by admin */
1337c478bd9Sstevel@tonic-gate } system_info_t;
1347c478bd9Sstevel@tonic-gate 
1357c478bd9Sstevel@tonic-gate typedef struct lacp_timer {
1367c478bd9Sstevel@tonic-gate 	uint32_t	val;
1377c478bd9Sstevel@tonic-gate 	timeout_id_t	id;
1387c478bd9Sstevel@tonic-gate } lacp_timer_t;
1397c478bd9Sstevel@tonic-gate 
1407c478bd9Sstevel@tonic-gate /*
1417c478bd9Sstevel@tonic-gate  * 802.3ad Variables associated with each aggregation (section 43.4.6)
1427c478bd9Sstevel@tonic-gate  *	Note: These are on a per aggregation basis.
1437c478bd9Sstevel@tonic-gate  */
1447c478bd9Sstevel@tonic-gate typedef struct Agg {
1457c478bd9Sstevel@tonic-gate 	uint32_t	AggregatorIdentifier;	/* not used */
1467c478bd9Sstevel@tonic-gate 	boolean_t	IndividualAggr;		/* individual aggregator */
1477c478bd9Sstevel@tonic-gate 	uint32_t	ActorAdminKey;		/* assigned by admin. */
1487c478bd9Sstevel@tonic-gate 	uint32_t	ActorOperKey;		/* assigned by admin. */
1497c478bd9Sstevel@tonic-gate 	struct ether_addr PartnerSystem;	/* partner system ID */
1507c478bd9Sstevel@tonic-gate 	uint32_t	PartnerSystemPriority;	/* partner system priority */
1517c478bd9Sstevel@tonic-gate 	uint32_t	PartnerOperAggrKey;	/* parter oper aggr. key */
1527c478bd9Sstevel@tonic-gate 	boolean_t	ReceiveState;		/* Enabled/Disabled */
1537c478bd9Sstevel@tonic-gate 	boolean_t	TransmitState;		/* Enabled/Disabled */
1547c478bd9Sstevel@tonic-gate 
1557c478bd9Sstevel@tonic-gate 	uint16_t	ActorSystemPriority;	/* System Priority */
1567c478bd9Sstevel@tonic-gate 	uint16_t	CollectorMaxDelay;	/* tens of Usecs */
1577c478bd9Sstevel@tonic-gate 	aggr_lacp_timer_t PeriodicTimer;	/* AGGR_LACP_{LONG,SHORT} */
1587c478bd9Sstevel@tonic-gate 	uint64_t	TimeOfLastOperChange;	/* Time in state */
1597c478bd9Sstevel@tonic-gate 	boolean_t	ready;			/* Ready_N for all ports TRUE */
1607c478bd9Sstevel@tonic-gate } Agg_t;
1617c478bd9Sstevel@tonic-gate 
1627c478bd9Sstevel@tonic-gate /*
1637c478bd9Sstevel@tonic-gate  * 802.3ad Variables used for managing the operation of
1647c478bd9Sstevel@tonic-gate  * the state machines (section 43.4.8)
1657c478bd9Sstevel@tonic-gate  * Note: These are on a per port basis.
1667c478bd9Sstevel@tonic-gate  */
1677c478bd9Sstevel@tonic-gate typedef	enum {
1687c478bd9Sstevel@tonic-gate 	AGGR_UNSELECTED,	/* aggregator not selected */
1697c478bd9Sstevel@tonic-gate 	AGGR_SELECTED,		/* aggregator selected */
1707c478bd9Sstevel@tonic-gate 	AGGR_STANDBY		/* port in standby */
1717c478bd9Sstevel@tonic-gate } lacp_selected_t;
1727c478bd9Sstevel@tonic-gate 
1737c478bd9Sstevel@tonic-gate typedef struct state_machine {
1747c478bd9Sstevel@tonic-gate 	uint32_t	lacp_on : 1,		/* LACP on or off */
1757c478bd9Sstevel@tonic-gate 			begin : 1,		/* LACP init(or reinit.) */
1767c478bd9Sstevel@tonic-gate 			lacp_enabled : 1,	/* Full/Half Duplex */
1777c478bd9Sstevel@tonic-gate 			port_enabled : 1,	/* Link Up/Down */
1787c478bd9Sstevel@tonic-gate 			actor_churn : 1,	/* failed to converge */
1797c478bd9Sstevel@tonic-gate 			partner_churn : 1,
1807c478bd9Sstevel@tonic-gate 			ready_n : 1,		/* waiting */
1817c478bd9Sstevel@tonic-gate 			port_moved : 1,		/* any port is not waiting */
1827c478bd9Sstevel@tonic-gate 			pad_bits : 24;
1837c478bd9Sstevel@tonic-gate 	/* "Ready" is accessed from the aggregator structure */
1847c478bd9Sstevel@tonic-gate 	lacp_selected_t	selected;	/* SELECTED/UNSELECTED/STANDBY */
1857c478bd9Sstevel@tonic-gate 	uint32_t	current_while_timer_exp; /* # of times timer expired */
1867c478bd9Sstevel@tonic-gate 	lacp_periodic_state_t	periodic_state;	/* State of periodic machine */
1877c478bd9Sstevel@tonic-gate 	lacp_receive_state_t	receive_state;	/* State of receive machine */
1887c478bd9Sstevel@tonic-gate 	lacp_mux_state_t	mux_state;	/* State of mux machine */
1897c478bd9Sstevel@tonic-gate 	lacp_churn_state_t	churn_state;	/* State of churn machine */
1907c478bd9Sstevel@tonic-gate } state_machine_t;
1917c478bd9Sstevel@tonic-gate 
1927c478bd9Sstevel@tonic-gate /*
193*da14cebeSEric Cheng  * The following three flags are set when specific timer is timed out; used
194*da14cebeSEric Cheng  * by the LACP timer handler thread.
195*da14cebeSEric Cheng  */
196*da14cebeSEric Cheng #define	LACP_PERIODIC_TIMEOUT		0x01
197*da14cebeSEric Cheng #define	LACP_WAIT_WHILE_TIMEOUT		0x02
198*da14cebeSEric Cheng #define	LACP_CURRENT_WHILE_TIMEOUT	0x04
199*da14cebeSEric Cheng /*
200*da14cebeSEric Cheng  * Set when the port is being deleted; used to inform the LACP timer handler
201*da14cebeSEric Cheng  * thread to exit.
202*da14cebeSEric Cheng  */
203*da14cebeSEric Cheng #define	LACP_THREAD_EXIT		0x08
204*da14cebeSEric Cheng 
205*da14cebeSEric Cheng /*
2067c478bd9Sstevel@tonic-gate  * 802.3ad Variables associated with each port (section 43.4.7)
2077c478bd9Sstevel@tonic-gate  */
2087c478bd9Sstevel@tonic-gate typedef struct aggr_lacp_port {
2097c478bd9Sstevel@tonic-gate 	uint16_t	ActorPortNumber;	/* actor port number */
2107c478bd9Sstevel@tonic-gate 	uint16_t	ActorPortPriority;	/* actor port priority */
2117c478bd9Sstevel@tonic-gate 	uint32_t	ActorPortAggrId;	/* aggregator id */
2127c478bd9Sstevel@tonic-gate 	boolean_t	NTT;			/* need to transmit */
2137c478bd9Sstevel@tonic-gate 	uint16_t	ActorAdminPortKey;	/* admin. port key */
2147c478bd9Sstevel@tonic-gate 	uint16_t	ActorOperPortKey;	/* oper port key */
2157c478bd9Sstevel@tonic-gate 	aggr_lacp_state_t ActorAdminPortState;	/* actor admin. port state */
2167c478bd9Sstevel@tonic-gate 	aggr_lacp_state_t ActorOperPortState;	/* actor oper. port state */
2177c478bd9Sstevel@tonic-gate 
2187c478bd9Sstevel@tonic-gate 	/*
2197c478bd9Sstevel@tonic-gate 	 * partner information
2207c478bd9Sstevel@tonic-gate 	 */
2217c478bd9Sstevel@tonic-gate 	struct ether_addr PartnerAdminSystem;	/* partner admin. system */
2227c478bd9Sstevel@tonic-gate 	struct ether_addr PartnerOperSystem;	/* partner oper.system */
2237c478bd9Sstevel@tonic-gate 	uint16_t PartnerAdminSysPriority;	/* partner admin. sys. pri. */
2247c478bd9Sstevel@tonic-gate 	uint16_t PartnerOperSysPriority;	/* partner oper. sys. pri. */
2257c478bd9Sstevel@tonic-gate 	uint16_t PartnerAdminKey;		/* partner admin. key */
2267c478bd9Sstevel@tonic-gate 	uint16_t PartnerOperKey;		/* partner oper. key */
2277c478bd9Sstevel@tonic-gate 	uint16_t PartnerAdminPortNum;		/* partner admin. port # */
2287c478bd9Sstevel@tonic-gate 	uint16_t PartnerOperPortNum;		/* partner oper. port # */
2297c478bd9Sstevel@tonic-gate 	uint16_t PartnerAdminPortPriority;	/* partner admin. port pri. */
2307c478bd9Sstevel@tonic-gate 	uint16_t PartnerOperPortPriority;	/* partner oper. port pri. */
2317c478bd9Sstevel@tonic-gate 	aggr_lacp_state_t PartnerAdminPortState; /* partner admin port state */
2327c478bd9Sstevel@tonic-gate 	aggr_lacp_state_t PartnerOperPortState; /* partner oper port state */
2337c478bd9Sstevel@tonic-gate 	uint16_t PartnerCollectorMaxDelay;	/* tens of microseconds */
2347c478bd9Sstevel@tonic-gate 
2357c478bd9Sstevel@tonic-gate 	/*
2367c478bd9Sstevel@tonic-gate 	 * State machine and Timer information.
2377c478bd9Sstevel@tonic-gate 	 */
2387c478bd9Sstevel@tonic-gate 	state_machine_t	sm;		/* state machine variables per port */
2397c478bd9Sstevel@tonic-gate 	lacp_timer_t	current_while_timer;
2407c478bd9Sstevel@tonic-gate 	lacp_timer_t	periodic_timer;
2417c478bd9Sstevel@tonic-gate 	lacp_timer_t	wait_while_timer;
242*da14cebeSEric Cheng 	uint32_t	lacp_timer_bits;
243*da14cebeSEric Cheng 	kthread_t	*lacp_timer_thread;
244*da14cebeSEric Cheng 	kmutex_t	lacp_timer_lock;
245*da14cebeSEric Cheng 	kcondvar_t	lacp_timer_cv;
2467c478bd9Sstevel@tonic-gate 	hrtime_t	time;
2477c478bd9Sstevel@tonic-gate } aggr_lacp_port_t;
2487c478bd9Sstevel@tonic-gate 
2497c478bd9Sstevel@tonic-gate typedef struct lacp_stats_s {
2507c478bd9Sstevel@tonic-gate 	uint64_t	LACPDUsRx;
2517c478bd9Sstevel@tonic-gate 	uint64_t	MarkerPDUsRx;
2527c478bd9Sstevel@tonic-gate 	uint64_t	MarkerResponsePDUsRx;
2537c478bd9Sstevel@tonic-gate 	uint64_t	UnknownRx;
2547c478bd9Sstevel@tonic-gate 	uint64_t	IllegalRx;
2557c478bd9Sstevel@tonic-gate 	uint64_t	LACPDUsTx;
2567c478bd9Sstevel@tonic-gate 	uint64_t	MarkerPDUsTx;
2577c478bd9Sstevel@tonic-gate 	uint64_t	MarkerResponsePDUsTx;
2587c478bd9Sstevel@tonic-gate } lacp_stats_t;
2597c478bd9Sstevel@tonic-gate 
2607c478bd9Sstevel@tonic-gate /*
2617c478bd9Sstevel@tonic-gate  * 802.3ad protocol information
2627c478bd9Sstevel@tonic-gate  */
2637c478bd9Sstevel@tonic-gate /*
2647c478bd9Sstevel@tonic-gate  * Actor/Partner information
2657c478bd9Sstevel@tonic-gate  */
2667c478bd9Sstevel@tonic-gate typedef struct link_info {
2677c478bd9Sstevel@tonic-gate 	uint8_t			tlv_type;	/* type/length/value */
2687c478bd9Sstevel@tonic-gate 	uint8_t			information_len; /* information length */
2697c478bd9Sstevel@tonic-gate 	uint16_t		system_priority; /* system priority */
2707c478bd9Sstevel@tonic-gate 	struct ether_addr	system_id;	/* encoded as MAC address */
2717c478bd9Sstevel@tonic-gate 	uint16_t		key;		/* operational key */
2727c478bd9Sstevel@tonic-gate 	uint16_t		port_priority;	/* port priority */
2737c478bd9Sstevel@tonic-gate 	uint16_t		port;		/* port */
2747c478bd9Sstevel@tonic-gate 	aggr_lacp_state_t	state;		/* state info */
2757c478bd9Sstevel@tonic-gate 	uint8_t			reserved[3];	/* reserved */
2767c478bd9Sstevel@tonic-gate } link_info_t;
2777c478bd9Sstevel@tonic-gate 
2787c478bd9Sstevel@tonic-gate /*
2797c478bd9Sstevel@tonic-gate  * Link Aggregation Control Protocol (LACPDU) structure
2807c478bd9Sstevel@tonic-gate  */
2817c478bd9Sstevel@tonic-gate typedef struct lacp {
2827c478bd9Sstevel@tonic-gate 	uint8_t			subtype;	/* = LACP */
2837c478bd9Sstevel@tonic-gate 	uint8_t			version;	/* LACP version */
2847c478bd9Sstevel@tonic-gate 	link_info_t		actor_info;	/* actor information */
2857c478bd9Sstevel@tonic-gate 	link_info_t		partner_info;	/* partner information */
2867c478bd9Sstevel@tonic-gate 	uint8_t			tlv_collector;	/* collector tlv */
2877c478bd9Sstevel@tonic-gate 	uint8_t			collector_len;	/* collector len */
2887c478bd9Sstevel@tonic-gate 	uint16_t		collector_max_delay; /* tens of miscrosecond */
2897c478bd9Sstevel@tonic-gate 	uint8_t			reserved[12];	/* reserved */
2907c478bd9Sstevel@tonic-gate 	uint8_t			tlv_terminator;	/* terminator tlv */
2917c478bd9Sstevel@tonic-gate 	uint8_t			terminator_len;	/* terminator len */
2927c478bd9Sstevel@tonic-gate 	uint8_t			lacp_reserved[50];	/* reserved */
2937c478bd9Sstevel@tonic-gate } lacp_t;
2947c478bd9Sstevel@tonic-gate 
2957c478bd9Sstevel@tonic-gate /*
2967c478bd9Sstevel@tonic-gate  * Marker protocol
2977c478bd9Sstevel@tonic-gate  */
2987c478bd9Sstevel@tonic-gate 
2997c478bd9Sstevel@tonic-gate #define	MARKER_VERSION	0x1		/* 802.3ad Marker version number */
3007c478bd9Sstevel@tonic-gate #define	MARKER_SUBTYPE	0x2
3017c478bd9Sstevel@tonic-gate #define	MARKER_INFO_RESPONSE_LENGTH	16
3027c478bd9Sstevel@tonic-gate 
3037c478bd9Sstevel@tonic-gate /*
3047c478bd9Sstevel@tonic-gate  * marker TLV_type
3057c478bd9Sstevel@tonic-gate  */
3067c478bd9Sstevel@tonic-gate #define	MARKER_INFO_TLV		0x01	/* marker information */
3077c478bd9Sstevel@tonic-gate #define	MARKER_RESPONSE_TLV	0x02	/* marker response information */
3087c478bd9Sstevel@tonic-gate 
3097c478bd9Sstevel@tonic-gate typedef struct marker_pdu {
3107c478bd9Sstevel@tonic-gate 	struct ether_addr	dest_addr;	/* Slow protocol multicast */
3117c478bd9Sstevel@tonic-gate 	struct ether_addr	src_addr;	/* Source address */
3127c478bd9Sstevel@tonic-gate 	uint16_t		type;		/* Slow protocol type */
3137c478bd9Sstevel@tonic-gate 	uint8_t			subtype;	/* = Marker 0x2 */
3147c478bd9Sstevel@tonic-gate 	uint8_t			version;	/* Marker version 0x01 */
3157c478bd9Sstevel@tonic-gate 	uint8_t			tlv_marker;	/* marker tlv */
3167c478bd9Sstevel@tonic-gate 	uint8_t			marker_len;	/* marker len */
3177c478bd9Sstevel@tonic-gate 	uint16_t		requestor_port; /* requestor port */
3187c478bd9Sstevel@tonic-gate 	struct ether_addr	system_id;	/* requestor system */
3197c478bd9Sstevel@tonic-gate 	uint8_t			transaction_id[4];	/* transaction id */
3207c478bd9Sstevel@tonic-gate 	uint8_t			pad[2];		/* zeros to align */
3217c478bd9Sstevel@tonic-gate 	uint8_t			reserved[90];	/* reserved */
3227c478bd9Sstevel@tonic-gate 	uint32_t		fcs;		/* generated by MAC */
3237c478bd9Sstevel@tonic-gate } marker_pdu_t;
3247c478bd9Sstevel@tonic-gate 
3257c478bd9Sstevel@tonic-gate /*
3267c478bd9Sstevel@tonic-gate  * 802.3ad Link Aggregation Group Identifier (IEEE 802.3ad 43.3.6)
3277c478bd9Sstevel@tonic-gate  * port identifire = port priority and port number.
3287c478bd9Sstevel@tonic-gate  */
3297c478bd9Sstevel@tonic-gate typedef struct lag_id {
3307c478bd9Sstevel@tonic-gate 	uint16_t		system_priority;	/* system priority */
3317c478bd9Sstevel@tonic-gate 	struct ether_addr	system_id;		/* system identifier */
3327c478bd9Sstevel@tonic-gate 	uint16_t		oper_key;		/* operational key */
3337c478bd9Sstevel@tonic-gate 	uint16_t		port_priority;		/* port priority */
3347c478bd9Sstevel@tonic-gate 	uint16_t		port_number;		/* 0: aggregatable */
3357c478bd9Sstevel@tonic-gate } lag_id_t;
3367c478bd9Sstevel@tonic-gate 
3377c478bd9Sstevel@tonic-gate #endif /* _KERNEL */
3387c478bd9Sstevel@tonic-gate 
3397c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3407c478bd9Sstevel@tonic-gate }
3417c478bd9Sstevel@tonic-gate #endif
3427c478bd9Sstevel@tonic-gate 
3437c478bd9Sstevel@tonic-gate #endif	/* _SYS_AGGR_LACP_H */
344