Deleted Added
full compact
ieee8023ad_lacp.h (169741) ieee8023ad_lacp.h (170599)
1/* $NetBSD: ieee8023ad_impl.h,v 1.2 2005/12/10 23:21:39 elad Exp $ */
2
3/*-
4 * Copyright (c)2005 YAMAMOTO Takashi,
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 11 unchanged lines hidden (view full) ---

20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
1/* $NetBSD: ieee8023ad_impl.h,v 1.2 2005/12/10 23:21:39 elad Exp $ */
2
3/*-
4 * Copyright (c)2005 YAMAMOTO Takashi,
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 11 unchanged lines hidden (view full) ---

20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/net/ieee8023ad_lacp.h 169741 2007-05-19 09:37:04Z thompsa $
28 * $FreeBSD: head/sys/net/ieee8023ad_lacp.h 170599 2007-06-12 07:29:11Z thompsa $
29 */
30
31/*
32 * IEEE802.3ad LACP
33 *
34 * implementation details.
35 */
36

--- 19 unchanged lines hidden (view full) ---

56#define LACP_STATE_TIMEOUT (1<<1)
57#define LACP_STATE_AGGREGATION (1<<2)
58#define LACP_STATE_SYNC (1<<3)
59#define LACP_STATE_COLLECTING (1<<4)
60#define LACP_STATE_DISTRIBUTING (1<<5)
61#define LACP_STATE_DEFAULTED (1<<6)
62#define LACP_STATE_EXPIRED (1<<7)
63
29 */
30
31/*
32 * IEEE802.3ad LACP
33 *
34 * implementation details.
35 */
36

--- 19 unchanged lines hidden (view full) ---

56#define LACP_STATE_TIMEOUT (1<<1)
57#define LACP_STATE_AGGREGATION (1<<2)
58#define LACP_STATE_SYNC (1<<3)
59#define LACP_STATE_COLLECTING (1<<4)
60#define LACP_STATE_DISTRIBUTING (1<<5)
61#define LACP_STATE_DEFAULTED (1<<6)
62#define LACP_STATE_EXPIRED (1<<7)
63
64#define LACP_PORT_NTT 0x00000001
65#define LACP_PORT_MARK 0x00000002
66#define LACP_PORT_PROMISC 0x00000004
67#define LACP_PORT_LADDRCHANGED 0x00000008
68#define LACP_PORT_ATTACHED 0x00000010
69#define LACP_PORT_LARVAL 0x00000020
70#define LACP_PORT_DETACHING 0x00000040
64#define LACP_PORT_NTT 0x00000001
65#define LACP_PORT_MARK 0x00000002
71
72#define LACP_STATE_BITS \
73 "\020" \
74 "\001ACTIVITY" \
75 "\002TIMEOUT" \
76 "\003AGGREGATION" \
77 "\004SYNC" \
78 "\005COLLECTING" \

--- 48 unchanged lines hidden (view full) ---

127} __packed;
128
129struct lacp_portid {
130 uint16_t lpi_prio;
131 uint16_t lpi_portno;
132} __packed;
133
134struct lacp_peerinfo {
66
67#define LACP_STATE_BITS \
68 "\020" \
69 "\001ACTIVITY" \
70 "\002TIMEOUT" \
71 "\003AGGREGATION" \
72 "\004SYNC" \
73 "\005COLLECTING" \

--- 48 unchanged lines hidden (view full) ---

122} __packed;
123
124struct lacp_portid {
125 uint16_t lpi_prio;
126 uint16_t lpi_portno;
127} __packed;
128
129struct lacp_peerinfo {
135 struct lacp_systemid lip_systemid;
130 struct lacp_systemid lip_systemid;
136 uint16_t lip_key;
131 uint16_t lip_key;
137 struct lacp_portid lip_portid;
132 struct lacp_portid lip_portid;
138 uint8_t lip_state;
139 uint8_t lip_resv[3];
140} __packed;
141
142struct lacp_collectorinfo {
143 uint16_t lci_maxdelay;
144 uint8_t lci_resv[12];
145} __packed;

--- 77 unchanged lines hidden (view full) ---

223
224struct lacp_aggregator {
225 TAILQ_ENTRY(lacp_aggregator) la_q;
226 int la_refcnt; /* num of ports which selected us */
227 int la_nports; /* num of distributing ports */
228 TAILQ_HEAD(, lacp_port) la_ports; /* distributing ports */
229 struct lacp_peerinfo la_partner;
230 struct lacp_peerinfo la_actor;
133 uint8_t lip_state;
134 uint8_t lip_resv[3];
135} __packed;
136
137struct lacp_collectorinfo {
138 uint16_t lci_maxdelay;
139 uint8_t lci_resv[12];
140} __packed;

--- 77 unchanged lines hidden (view full) ---

218
219struct lacp_aggregator {
220 TAILQ_ENTRY(lacp_aggregator) la_q;
221 int la_refcnt; /* num of ports which selected us */
222 int la_nports; /* num of distributing ports */
223 TAILQ_HEAD(, lacp_port) la_ports; /* distributing ports */
224 struct lacp_peerinfo la_partner;
225 struct lacp_peerinfo la_actor;
231 int la_pending; /* number of ports which is waiting wait_while */
226 int la_pending; /* number of ports in wait_while */
232};
233
234struct lacp_softc {
227};
228
229struct lacp_softc {
235 struct lagg_softc *lsc_lagg;
230 struct lagg_softc *lsc_softc;
236 struct lacp_aggregator *lsc_active_aggregator;
237 TAILQ_HEAD(, lacp_aggregator) lsc_aggregators;
238 boolean_t lsc_suppress_distributing;
239 struct callout lsc_transit_callout;
240 struct callout lsc_callout;
241 LIST_HEAD(, lacp_port) lsc_ports;
242 u_int32_t lsc_hashkey;
243 struct task lsc_qtask;

--- 8 unchanged lines hidden (view full) ---

252#define LACP_FAST_PERIODIC_TIME (1)
253#define LACP_SLOW_PERIODIC_TIME (30)
254#define LACP_SHORT_TIMEOUT_TIME (3 * LACP_FAST_PERIODIC_TIME)
255#define LACP_LONG_TIMEOUT_TIME (3 * LACP_SLOW_PERIODIC_TIME)
256#define LACP_CHURN_DETECTION_TIME (60)
257#define LACP_AGGREGATE_WAIT_TIME (2)
258#define LACP_TRANSIT_DELAY 3000 /* in msec */
259
231 struct lacp_aggregator *lsc_active_aggregator;
232 TAILQ_HEAD(, lacp_aggregator) lsc_aggregators;
233 boolean_t lsc_suppress_distributing;
234 struct callout lsc_transit_callout;
235 struct callout lsc_callout;
236 LIST_HEAD(, lacp_port) lsc_ports;
237 u_int32_t lsc_hashkey;
238 struct task lsc_qtask;

--- 8 unchanged lines hidden (view full) ---

247#define LACP_FAST_PERIODIC_TIME (1)
248#define LACP_SLOW_PERIODIC_TIME (30)
249#define LACP_SHORT_TIMEOUT_TIME (3 * LACP_FAST_PERIODIC_TIME)
250#define LACP_LONG_TIMEOUT_TIME (3 * LACP_SLOW_PERIODIC_TIME)
251#define LACP_CHURN_DETECTION_TIME (60)
252#define LACP_AGGREGATE_WAIT_TIME (2)
253#define LACP_TRANSIT_DELAY 3000 /* in msec */
254
260/*
261int tlv_check(const void *, size_t, const struct tlvhdr *,
262 const struct tlv_template *, boolean_t);
263*/
264
265#define LACP_STATE_EQ(s1, s2, mask) \
266 ((((s1) ^ (s2)) & (mask)) == 0)
267
268#define LACP_SYS_PRI(peer) (peer).lip_systemid.lsi_prio
269
270#define LACP_PORT(_lp) ((struct lacp_port *)(_lp)->lp_psc)
271#define LACP_SOFTC(_sc) ((struct lacp_softc *)(_sc)->sc_psc)
272

--- 25 unchanged lines hidden ---
255#define LACP_STATE_EQ(s1, s2, mask) \
256 ((((s1) ^ (s2)) & (mask)) == 0)
257
258#define LACP_SYS_PRI(peer) (peer).lip_systemid.lsi_prio
259
260#define LACP_PORT(_lp) ((struct lacp_port *)(_lp)->lp_psc)
261#define LACP_SOFTC(_sc) ((struct lacp_softc *)(_sc)->sc_psc)
262

--- 25 unchanged lines hidden ---