1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate #ifndef _SYS_AGGR_LACP_H 28*7c478bd9Sstevel@tonic-gate #define _SYS_AGGR_LACP_H 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*7c478bd9Sstevel@tonic-gate 32*7c478bd9Sstevel@tonic-gate #include <sys/aggr.h> 33*7c478bd9Sstevel@tonic-gate #include <sys/ethernet.h> 34*7c478bd9Sstevel@tonic-gate 35*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 36*7c478bd9Sstevel@tonic-gate extern "C" { 37*7c478bd9Sstevel@tonic-gate #endif 38*7c478bd9Sstevel@tonic-gate 39*7c478bd9Sstevel@tonic-gate #ifdef _KERNEL 40*7c478bd9Sstevel@tonic-gate 41*7c478bd9Sstevel@tonic-gate /* 42*7c478bd9Sstevel@tonic-gate * 802.3ad LACP version number 43*7c478bd9Sstevel@tonic-gate */ 44*7c478bd9Sstevel@tonic-gate #define LACP_VERSION 0x01 /* LACP version from 802.3ad */ 45*7c478bd9Sstevel@tonic-gate #define LACP_SUBTYPE 0x1 46*7c478bd9Sstevel@tonic-gate 47*7c478bd9Sstevel@tonic-gate /* 48*7c478bd9Sstevel@tonic-gate * TLV type (type/length/value carried in the LACPDU structure. 49*7c478bd9Sstevel@tonic-gate */ 50*7c478bd9Sstevel@tonic-gate #define ACTOR_TLV 0x01 /* actor TLV type */ 51*7c478bd9Sstevel@tonic-gate #define PARTNER_TLV 0x02 /* partner TLV type */ 52*7c478bd9Sstevel@tonic-gate #define COLLECTOR_TLV 0x03 /* collector TLV type */ 53*7c478bd9Sstevel@tonic-gate #define TERMINATOR_TLV 0x00 /* end of message */ 54*7c478bd9Sstevel@tonic-gate 55*7c478bd9Sstevel@tonic-gate /* 56*7c478bd9Sstevel@tonic-gate * Length fields as per 802.3ad. 57*7c478bd9Sstevel@tonic-gate */ 58*7c478bd9Sstevel@tonic-gate #define LACP_COLLECTOR_INFO_LEN 0x10 59*7c478bd9Sstevel@tonic-gate #define LACP_TERMINATOR_INFO_LEN 0x00 60*7c478bd9Sstevel@tonic-gate 61*7c478bd9Sstevel@tonic-gate /* LACP Receive State Machine states */ 62*7c478bd9Sstevel@tonic-gate typedef enum { 63*7c478bd9Sstevel@tonic-gate LACP_INITIALIZE = 0, 64*7c478bd9Sstevel@tonic-gate LACP_PORT_DISABLED = 1, 65*7c478bd9Sstevel@tonic-gate LACP_EXPIRED = 2, 66*7c478bd9Sstevel@tonic-gate LACP_DISABLED = 3, 67*7c478bd9Sstevel@tonic-gate LACP_DEFAULTED = 4, 68*7c478bd9Sstevel@tonic-gate LACP_CURRENT = 5 69*7c478bd9Sstevel@tonic-gate } lacp_receive_state_t; 70*7c478bd9Sstevel@tonic-gate 71*7c478bd9Sstevel@tonic-gate #define LACP_RECEIVE_STATE_STRINGS { \ 72*7c478bd9Sstevel@tonic-gate "LACP_INITIALIZE", \ 73*7c478bd9Sstevel@tonic-gate "LACP_PORT_DISABLED", \ 74*7c478bd9Sstevel@tonic-gate "LACP_EXPIRED", \ 75*7c478bd9Sstevel@tonic-gate "LACP_DISABLED", \ 76*7c478bd9Sstevel@tonic-gate "LACP_DEFAULTED", \ 77*7c478bd9Sstevel@tonic-gate "LACP_CURRENT" \ 78*7c478bd9Sstevel@tonic-gate } 79*7c478bd9Sstevel@tonic-gate 80*7c478bd9Sstevel@tonic-gate /* LACP Periodic State Machine states */ 81*7c478bd9Sstevel@tonic-gate typedef enum { 82*7c478bd9Sstevel@tonic-gate LACP_NO_PERIODIC = 0, 83*7c478bd9Sstevel@tonic-gate LACP_FAST_PERIODIC = 1, 84*7c478bd9Sstevel@tonic-gate LACP_SLOW_PERIODIC = 2, 85*7c478bd9Sstevel@tonic-gate LACP_PERIODIC_TX = 3 86*7c478bd9Sstevel@tonic-gate } lacp_periodic_state_t; 87*7c478bd9Sstevel@tonic-gate 88*7c478bd9Sstevel@tonic-gate #define LACP_PERIODIC_STRINGS { \ 89*7c478bd9Sstevel@tonic-gate "LACP_NO_PERIODIC", \ 90*7c478bd9Sstevel@tonic-gate "LACP_FAST_PERIODIC", \ 91*7c478bd9Sstevel@tonic-gate "LACP_SLOW_PERIODIC", \ 92*7c478bd9Sstevel@tonic-gate "LACP_PERIODIC_TX" \ 93*7c478bd9Sstevel@tonic-gate } 94*7c478bd9Sstevel@tonic-gate 95*7c478bd9Sstevel@tonic-gate 96*7c478bd9Sstevel@tonic-gate /* LACP Mux State Machine states */ 97*7c478bd9Sstevel@tonic-gate typedef enum { 98*7c478bd9Sstevel@tonic-gate LACP_DETACHED = 0, 99*7c478bd9Sstevel@tonic-gate LACP_WAITING = 1, 100*7c478bd9Sstevel@tonic-gate LACP_ATTACHED = 2, 101*7c478bd9Sstevel@tonic-gate LACP_COLLECTING_DISTRIBUTING = 3 102*7c478bd9Sstevel@tonic-gate } lacp_mux_state_t; 103*7c478bd9Sstevel@tonic-gate 104*7c478bd9Sstevel@tonic-gate #define LACP_MUX_STRINGS { \ 105*7c478bd9Sstevel@tonic-gate "LACP_DETACHED", \ 106*7c478bd9Sstevel@tonic-gate "LACP_WAITING", \ 107*7c478bd9Sstevel@tonic-gate "LACP_ATTACHED", \ 108*7c478bd9Sstevel@tonic-gate "LACP_COLLECTING_DISTRIBUTING" \ 109*7c478bd9Sstevel@tonic-gate } 110*7c478bd9Sstevel@tonic-gate 111*7c478bd9Sstevel@tonic-gate /* LACP Churn State Machine states */ 112*7c478bd9Sstevel@tonic-gate typedef enum { 113*7c478bd9Sstevel@tonic-gate LACP_NO_ACTOR_CHURN = 0, 114*7c478bd9Sstevel@tonic-gate LACP_ACTOR_CHURN_MONITOR = 1, 115*7c478bd9Sstevel@tonic-gate LACP_ACTOR_CHURN = 2 116*7c478bd9Sstevel@tonic-gate } lacp_churn_state_t; 117*7c478bd9Sstevel@tonic-gate 118*7c478bd9Sstevel@tonic-gate /* 119*7c478bd9Sstevel@tonic-gate * 802.3ad timer constants. (IEEE 802.3ad: section 43.4.4) 120*7c478bd9Sstevel@tonic-gate * 121*7c478bd9Sstevel@tonic-gate * All timers specified have a implementation tolerance of +- 250 ms. 122*7c478bd9Sstevel@tonic-gate */ 123*7c478bd9Sstevel@tonic-gate #define FAST_PERIODIC_TIME 1 /* using short timeouts (tx) */ 124*7c478bd9Sstevel@tonic-gate #define SLOW_PERIODIC_TIME 30 /* using long timeouts (tx) */ 125*7c478bd9Sstevel@tonic-gate #define SHORT_TIMEOUT_TIME 3 /* before invalidate LACPDU */ 126*7c478bd9Sstevel@tonic-gate #define LONG_TIMEOUT_TIME 90 /* before invalidate LACPDU */ 127*7c478bd9Sstevel@tonic-gate #define CHURN_DETECTION_TIME 60 /* sync between actor/partner */ 128*7c478bd9Sstevel@tonic-gate #define AGGREGATE_WAIT_TIME 2 /* Delay wait to aggregate links */ 129*7c478bd9Sstevel@tonic-gate 130*7c478bd9Sstevel@tonic-gate /* 131*7c478bd9Sstevel@tonic-gate * 802.3ad Variables associated with the system (section 43.4.5) 132*7c478bd9Sstevel@tonic-gate */ 133*7c478bd9Sstevel@tonic-gate typedef struct system_info { 134*7c478bd9Sstevel@tonic-gate struct ether_addr system_id; /* MAC address assigned by admin */ 135*7c478bd9Sstevel@tonic-gate uint16_t system_priority; /* system priority assigned by admin */ 136*7c478bd9Sstevel@tonic-gate } system_info_t; 137*7c478bd9Sstevel@tonic-gate 138*7c478bd9Sstevel@tonic-gate typedef struct lacp_timer { 139*7c478bd9Sstevel@tonic-gate uint32_t val; 140*7c478bd9Sstevel@tonic-gate timeout_id_t id; 141*7c478bd9Sstevel@tonic-gate } lacp_timer_t; 142*7c478bd9Sstevel@tonic-gate 143*7c478bd9Sstevel@tonic-gate /* 144*7c478bd9Sstevel@tonic-gate * 802.3ad Variables associated with each aggregation (section 43.4.6) 145*7c478bd9Sstevel@tonic-gate * Note: These are on a per aggregation basis. 146*7c478bd9Sstevel@tonic-gate */ 147*7c478bd9Sstevel@tonic-gate typedef struct Agg { 148*7c478bd9Sstevel@tonic-gate uint32_t AggregatorIdentifier; /* not used */ 149*7c478bd9Sstevel@tonic-gate boolean_t IndividualAggr; /* individual aggregator */ 150*7c478bd9Sstevel@tonic-gate uint32_t ActorAdminKey; /* assigned by admin. */ 151*7c478bd9Sstevel@tonic-gate uint32_t ActorOperKey; /* assigned by admin. */ 152*7c478bd9Sstevel@tonic-gate struct ether_addr PartnerSystem; /* partner system ID */ 153*7c478bd9Sstevel@tonic-gate uint32_t PartnerSystemPriority; /* partner system priority */ 154*7c478bd9Sstevel@tonic-gate uint32_t PartnerOperAggrKey; /* parter oper aggr. key */ 155*7c478bd9Sstevel@tonic-gate boolean_t ReceiveState; /* Enabled/Disabled */ 156*7c478bd9Sstevel@tonic-gate boolean_t TransmitState; /* Enabled/Disabled */ 157*7c478bd9Sstevel@tonic-gate 158*7c478bd9Sstevel@tonic-gate uint16_t ActorSystemPriority; /* System Priority */ 159*7c478bd9Sstevel@tonic-gate uint16_t CollectorMaxDelay; /* tens of Usecs */ 160*7c478bd9Sstevel@tonic-gate aggr_lacp_timer_t PeriodicTimer; /* AGGR_LACP_{LONG,SHORT} */ 161*7c478bd9Sstevel@tonic-gate uint64_t TimeOfLastOperChange; /* Time in state */ 162*7c478bd9Sstevel@tonic-gate boolean_t ready; /* Ready_N for all ports TRUE */ 163*7c478bd9Sstevel@tonic-gate 164*7c478bd9Sstevel@tonic-gate kmutex_t gl_lock; 165*7c478bd9Sstevel@tonic-gate } Agg_t; 166*7c478bd9Sstevel@tonic-gate 167*7c478bd9Sstevel@tonic-gate /* 168*7c478bd9Sstevel@tonic-gate * 802.3ad Variables used for managing the operation of 169*7c478bd9Sstevel@tonic-gate * the state machines (section 43.4.8) 170*7c478bd9Sstevel@tonic-gate * Note: These are on a per port basis. 171*7c478bd9Sstevel@tonic-gate */ 172*7c478bd9Sstevel@tonic-gate typedef enum { 173*7c478bd9Sstevel@tonic-gate AGGR_UNSELECTED, /* aggregator not selected */ 174*7c478bd9Sstevel@tonic-gate AGGR_SELECTED, /* aggregator selected */ 175*7c478bd9Sstevel@tonic-gate AGGR_STANDBY /* port in standby */ 176*7c478bd9Sstevel@tonic-gate } lacp_selected_t; 177*7c478bd9Sstevel@tonic-gate 178*7c478bd9Sstevel@tonic-gate typedef struct state_machine { 179*7c478bd9Sstevel@tonic-gate uint32_t lacp_on : 1, /* LACP on or off */ 180*7c478bd9Sstevel@tonic-gate begin : 1, /* LACP init(or reinit.) */ 181*7c478bd9Sstevel@tonic-gate lacp_enabled : 1, /* Full/Half Duplex */ 182*7c478bd9Sstevel@tonic-gate port_enabled : 1, /* Link Up/Down */ 183*7c478bd9Sstevel@tonic-gate actor_churn : 1, /* failed to converge */ 184*7c478bd9Sstevel@tonic-gate partner_churn : 1, 185*7c478bd9Sstevel@tonic-gate ready_n : 1, /* waiting */ 186*7c478bd9Sstevel@tonic-gate port_moved : 1, /* any port is not waiting */ 187*7c478bd9Sstevel@tonic-gate pad_bits : 24; 188*7c478bd9Sstevel@tonic-gate /* "Ready" is accessed from the aggregator structure */ 189*7c478bd9Sstevel@tonic-gate lacp_selected_t selected; /* SELECTED/UNSELECTED/STANDBY */ 190*7c478bd9Sstevel@tonic-gate uint32_t current_while_timer_exp; /* # of times timer expired */ 191*7c478bd9Sstevel@tonic-gate lacp_periodic_state_t periodic_state; /* State of periodic machine */ 192*7c478bd9Sstevel@tonic-gate lacp_receive_state_t receive_state; /* State of receive machine */ 193*7c478bd9Sstevel@tonic-gate lacp_mux_state_t mux_state; /* State of mux machine */ 194*7c478bd9Sstevel@tonic-gate lacp_churn_state_t churn_state; /* State of churn machine */ 195*7c478bd9Sstevel@tonic-gate } state_machine_t; 196*7c478bd9Sstevel@tonic-gate 197*7c478bd9Sstevel@tonic-gate /* 198*7c478bd9Sstevel@tonic-gate * 802.3ad Variables associated with each port (section 43.4.7) 199*7c478bd9Sstevel@tonic-gate */ 200*7c478bd9Sstevel@tonic-gate typedef struct aggr_lacp_port { 201*7c478bd9Sstevel@tonic-gate uint16_t ActorPortNumber; /* actor port number */ 202*7c478bd9Sstevel@tonic-gate uint16_t ActorPortPriority; /* actor port priority */ 203*7c478bd9Sstevel@tonic-gate uint32_t ActorPortAggrId; /* aggregator id */ 204*7c478bd9Sstevel@tonic-gate boolean_t NTT; /* need to transmit */ 205*7c478bd9Sstevel@tonic-gate uint16_t ActorAdminPortKey; /* admin. port key */ 206*7c478bd9Sstevel@tonic-gate uint16_t ActorOperPortKey; /* oper port key */ 207*7c478bd9Sstevel@tonic-gate aggr_lacp_state_t ActorAdminPortState; /* actor admin. port state */ 208*7c478bd9Sstevel@tonic-gate aggr_lacp_state_t ActorOperPortState; /* actor oper. port state */ 209*7c478bd9Sstevel@tonic-gate 210*7c478bd9Sstevel@tonic-gate /* 211*7c478bd9Sstevel@tonic-gate * partner information 212*7c478bd9Sstevel@tonic-gate */ 213*7c478bd9Sstevel@tonic-gate struct ether_addr PartnerAdminSystem; /* partner admin. system */ 214*7c478bd9Sstevel@tonic-gate struct ether_addr PartnerOperSystem; /* partner oper.system */ 215*7c478bd9Sstevel@tonic-gate uint16_t PartnerAdminSysPriority; /* partner admin. sys. pri. */ 216*7c478bd9Sstevel@tonic-gate uint16_t PartnerOperSysPriority; /* partner oper. sys. pri. */ 217*7c478bd9Sstevel@tonic-gate uint16_t PartnerAdminKey; /* partner admin. key */ 218*7c478bd9Sstevel@tonic-gate uint16_t PartnerOperKey; /* partner oper. key */ 219*7c478bd9Sstevel@tonic-gate uint16_t PartnerAdminPortNum; /* partner admin. port # */ 220*7c478bd9Sstevel@tonic-gate uint16_t PartnerOperPortNum; /* partner oper. port # */ 221*7c478bd9Sstevel@tonic-gate uint16_t PartnerAdminPortPriority; /* partner admin. port pri. */ 222*7c478bd9Sstevel@tonic-gate uint16_t PartnerOperPortPriority; /* partner oper. port pri. */ 223*7c478bd9Sstevel@tonic-gate aggr_lacp_state_t PartnerAdminPortState; /* partner admin port state */ 224*7c478bd9Sstevel@tonic-gate aggr_lacp_state_t PartnerOperPortState; /* partner oper port state */ 225*7c478bd9Sstevel@tonic-gate uint16_t PartnerCollectorMaxDelay; /* tens of microseconds */ 226*7c478bd9Sstevel@tonic-gate 227*7c478bd9Sstevel@tonic-gate /* 228*7c478bd9Sstevel@tonic-gate * State machine and Timer information. 229*7c478bd9Sstevel@tonic-gate */ 230*7c478bd9Sstevel@tonic-gate state_machine_t sm; /* state machine variables per port */ 231*7c478bd9Sstevel@tonic-gate lacp_timer_t current_while_timer; 232*7c478bd9Sstevel@tonic-gate lacp_timer_t periodic_timer; 233*7c478bd9Sstevel@tonic-gate lacp_timer_t wait_while_timer; 234*7c478bd9Sstevel@tonic-gate hrtime_t time; 235*7c478bd9Sstevel@tonic-gate } aggr_lacp_port_t; 236*7c478bd9Sstevel@tonic-gate 237*7c478bd9Sstevel@tonic-gate typedef struct lacp_stats_s { 238*7c478bd9Sstevel@tonic-gate uint64_t LACPDUsRx; 239*7c478bd9Sstevel@tonic-gate uint64_t MarkerPDUsRx; 240*7c478bd9Sstevel@tonic-gate uint64_t MarkerResponsePDUsRx; 241*7c478bd9Sstevel@tonic-gate uint64_t UnknownRx; 242*7c478bd9Sstevel@tonic-gate uint64_t IllegalRx; 243*7c478bd9Sstevel@tonic-gate uint64_t LACPDUsTx; 244*7c478bd9Sstevel@tonic-gate uint64_t MarkerPDUsTx; 245*7c478bd9Sstevel@tonic-gate uint64_t MarkerResponsePDUsTx; 246*7c478bd9Sstevel@tonic-gate } lacp_stats_t; 247*7c478bd9Sstevel@tonic-gate 248*7c478bd9Sstevel@tonic-gate /* 249*7c478bd9Sstevel@tonic-gate * 802.3ad protocol information 250*7c478bd9Sstevel@tonic-gate */ 251*7c478bd9Sstevel@tonic-gate /* 252*7c478bd9Sstevel@tonic-gate * Actor/Partner information 253*7c478bd9Sstevel@tonic-gate */ 254*7c478bd9Sstevel@tonic-gate typedef struct link_info { 255*7c478bd9Sstevel@tonic-gate uint8_t tlv_type; /* type/length/value */ 256*7c478bd9Sstevel@tonic-gate uint8_t information_len; /* information length */ 257*7c478bd9Sstevel@tonic-gate uint16_t system_priority; /* system priority */ 258*7c478bd9Sstevel@tonic-gate struct ether_addr system_id; /* encoded as MAC address */ 259*7c478bd9Sstevel@tonic-gate uint16_t key; /* operational key */ 260*7c478bd9Sstevel@tonic-gate uint16_t port_priority; /* port priority */ 261*7c478bd9Sstevel@tonic-gate uint16_t port; /* port */ 262*7c478bd9Sstevel@tonic-gate aggr_lacp_state_t state; /* state info */ 263*7c478bd9Sstevel@tonic-gate uint8_t reserved[3]; /* reserved */ 264*7c478bd9Sstevel@tonic-gate } link_info_t; 265*7c478bd9Sstevel@tonic-gate 266*7c478bd9Sstevel@tonic-gate /* 267*7c478bd9Sstevel@tonic-gate * Link Aggregation Control Protocol (LACPDU) structure 268*7c478bd9Sstevel@tonic-gate */ 269*7c478bd9Sstevel@tonic-gate typedef struct lacp { 270*7c478bd9Sstevel@tonic-gate uint8_t subtype; /* = LACP */ 271*7c478bd9Sstevel@tonic-gate uint8_t version; /* LACP version */ 272*7c478bd9Sstevel@tonic-gate link_info_t actor_info; /* actor information */ 273*7c478bd9Sstevel@tonic-gate link_info_t partner_info; /* partner information */ 274*7c478bd9Sstevel@tonic-gate uint8_t tlv_collector; /* collector tlv */ 275*7c478bd9Sstevel@tonic-gate uint8_t collector_len; /* collector len */ 276*7c478bd9Sstevel@tonic-gate uint16_t collector_max_delay; /* tens of miscrosecond */ 277*7c478bd9Sstevel@tonic-gate uint8_t reserved[12]; /* reserved */ 278*7c478bd9Sstevel@tonic-gate uint8_t tlv_terminator; /* terminator tlv */ 279*7c478bd9Sstevel@tonic-gate uint8_t terminator_len; /* terminator len */ 280*7c478bd9Sstevel@tonic-gate uint8_t lacp_reserved[50]; /* reserved */ 281*7c478bd9Sstevel@tonic-gate } lacp_t; 282*7c478bd9Sstevel@tonic-gate 283*7c478bd9Sstevel@tonic-gate /* 284*7c478bd9Sstevel@tonic-gate * Marker protocol 285*7c478bd9Sstevel@tonic-gate */ 286*7c478bd9Sstevel@tonic-gate 287*7c478bd9Sstevel@tonic-gate #define MARKER_VERSION 0x1 /* 802.3ad Marker version number */ 288*7c478bd9Sstevel@tonic-gate #define MARKER_SUBTYPE 0x2 289*7c478bd9Sstevel@tonic-gate #define MARKER_INFO_RESPONSE_LENGTH 16 290*7c478bd9Sstevel@tonic-gate 291*7c478bd9Sstevel@tonic-gate /* 292*7c478bd9Sstevel@tonic-gate * marker TLV_type 293*7c478bd9Sstevel@tonic-gate */ 294*7c478bd9Sstevel@tonic-gate #define MARKER_INFO_TLV 0x01 /* marker information */ 295*7c478bd9Sstevel@tonic-gate #define MARKER_RESPONSE_TLV 0x02 /* marker response information */ 296*7c478bd9Sstevel@tonic-gate 297*7c478bd9Sstevel@tonic-gate typedef struct marker_pdu { 298*7c478bd9Sstevel@tonic-gate struct ether_addr dest_addr; /* Slow protocol multicast */ 299*7c478bd9Sstevel@tonic-gate struct ether_addr src_addr; /* Source address */ 300*7c478bd9Sstevel@tonic-gate uint16_t type; /* Slow protocol type */ 301*7c478bd9Sstevel@tonic-gate uint8_t subtype; /* = Marker 0x2 */ 302*7c478bd9Sstevel@tonic-gate uint8_t version; /* Marker version 0x01 */ 303*7c478bd9Sstevel@tonic-gate uint8_t tlv_marker; /* marker tlv */ 304*7c478bd9Sstevel@tonic-gate uint8_t marker_len; /* marker len */ 305*7c478bd9Sstevel@tonic-gate uint16_t requestor_port; /* requestor port */ 306*7c478bd9Sstevel@tonic-gate struct ether_addr system_id; /* requestor system */ 307*7c478bd9Sstevel@tonic-gate uint8_t transaction_id[4]; /* transaction id */ 308*7c478bd9Sstevel@tonic-gate uint8_t pad[2]; /* zeros to align */ 309*7c478bd9Sstevel@tonic-gate uint8_t reserved[90]; /* reserved */ 310*7c478bd9Sstevel@tonic-gate uint32_t fcs; /* generated by MAC */ 311*7c478bd9Sstevel@tonic-gate } marker_pdu_t; 312*7c478bd9Sstevel@tonic-gate 313*7c478bd9Sstevel@tonic-gate /* 314*7c478bd9Sstevel@tonic-gate * 802.3ad Link Aggregation Group Identifier (IEEE 802.3ad 43.3.6) 315*7c478bd9Sstevel@tonic-gate * port identifire = port priority and port number. 316*7c478bd9Sstevel@tonic-gate */ 317*7c478bd9Sstevel@tonic-gate typedef struct lag_id { 318*7c478bd9Sstevel@tonic-gate uint16_t system_priority; /* system priority */ 319*7c478bd9Sstevel@tonic-gate struct ether_addr system_id; /* system identifier */ 320*7c478bd9Sstevel@tonic-gate uint16_t oper_key; /* operational key */ 321*7c478bd9Sstevel@tonic-gate uint16_t port_priority; /* port priority */ 322*7c478bd9Sstevel@tonic-gate uint16_t port_number; /* 0: aggregatable */ 323*7c478bd9Sstevel@tonic-gate } lag_id_t; 324*7c478bd9Sstevel@tonic-gate 325*7c478bd9Sstevel@tonic-gate #endif /* _KERNEL */ 326*7c478bd9Sstevel@tonic-gate 327*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 328*7c478bd9Sstevel@tonic-gate } 329*7c478bd9Sstevel@tonic-gate #endif 330*7c478bd9Sstevel@tonic-gate 331*7c478bd9Sstevel@tonic-gate #endif /* _SYS_AGGR_LACP_H */ 332