FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
lacp.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <stdint.h>
17 #include <vlib/vlib.h>
18 #include <vlib/unix/unix.h>
19 #include <vnet/plugin/plugin.h>
20 #include <vpp/app/version.h>
21 #include <vppinfra/hash.h>
22 #include <vnet/bonding/node.h>
23 #include <lacp/node.h>
24 #include <vpp/stats/stat_segment.h>
25 
27 
28 /*
29  * Generate lacp pdu
30  */
31 static void
32 lacp_fill_pdu (lacp_pdu_t * lacpdu, member_if_t * mif)
33 {
34  /* Actor TLV */
35  lacpdu->actor.port_info = mif->actor;
36 
37  /* Partner TLV */
38  lacpdu->partner.port_info = mif->partner;
39 }
40 
41 /*
42  * send a lacp pkt on an ethernet interface
43  */
44 static void
46 {
47  lacp_main_t *lm = &lacp_main;
48  u32 *to_next;
49  ethernet_lacp_pdu_t *h0;
51  u32 bi0;
52  vlib_buffer_t *b0;
53  vlib_frame_t *f;
54  vnet_main_t *vnm = lm->vnet_main;
55 
56  /*
57  * see lacp_periodic_init() to understand what's already painted
58  * into the buffer by the packet template mechanism
59  */
61  (vm, &lm->packet_templates[mif->packet_template_index], &bi0);
62 
63  if (!h0)
64  return;
65 
66  /* Add the interface's ethernet source address */
67  hw = vnet_get_sup_hw_interface (vnm, mif->sw_if_index);
68 
69  clib_memcpy (h0->ethernet.src_address, hw->hw_address,
70  vec_len (hw->hw_address));
71 
72  lacp_fill_pdu (&h0->lacp, mif);
73 
74  /* Set the outbound packet length */
75  b0 = vlib_get_buffer (vm, bi0);
76  b0->current_length = sizeof (ethernet_lacp_pdu_t);
77  b0->current_data = 0;
79 
80  /* And the outbound interface */
81  vnet_buffer (b0)->sw_if_index[VLIB_TX] = hw->sw_if_index;
82 
83  /* And output the packet on the correct interface */
85 
86  to_next = vlib_frame_vector_args (f);
87  to_next[0] = bi0;
88  f->n_vectors = 1;
89 
91 
93  mif->pdu_sent++;
94 }
95 
96 /*
97  * Decide which lacp packet template to use
98  */
99 static int
101 {
103 
104  return 0;
105 }
106 
107 void
109 {
110  if ((mif->mode != BOND_MODE_LACP) || (mif->port_enabled == 0))
111  {
113  return;
114  }
115 
116  if (mif->packet_template_index == (u8) ~ 0)
117  {
118  /* If we don't know how to talk to this peer, don't try again */
119  if (lacp_pick_packet_template (mif))
120  {
122  return;
123  }
124  }
125 
126  switch (mif->packet_template_index)
127  {
130  break;
131 
132  default:
133  ASSERT (0);
134  }
135 }
136 
137 void
139 {
140  bond_main_t *bm = &bond_main;
141  member_if_t *mif;
142  bond_if_t *bif;
143  u8 actor_state, partner_state;
144 
145  /* *INDENT-OFF* */
146  pool_foreach (mif, bm->neighbors)
147  {
148  if (mif->port_enabled == 0)
149  continue;
150 
151  actor_state = mif->actor.state;
152  partner_state = mif->partner.state;
155  {
157  LACP_RX_EVENT_TIMER_EXPIRED, &mif->rx_state);
158  }
159 
162  {
164  LACP_PTX_EVENT_TIMER_EXPIRED, &mif->ptx_state);
165  }
168  {
169  mif->ready_n = 1;
171  lacp_selection_logic (vm, mif);
172  }
173  if (actor_state != mif->actor.state)
174  {
177  [mif->sw_if_index].actor_state,
178  mif->actor.state);
179  }
180  if (partner_state != mif->partner.state)
181  {
184  [mif->sw_if_index].partner_state,
185  mif->partner.state);
186  }
187  }
188  /* *INDENT-ON* */
189 }
190 
191 static void
193  member_if_t * mif, u8 enable)
194 {
195  lacp_main_t *lm = &lacp_main;
196  uword port_number;
197 
198  if (enable)
199  {
201  port_number = clib_bitmap_first_clear (bif->port_number_bitmap);
203  port_number, 1);
204  // bitmap starts at 0. Our port number starts at 1.
205  lacp_init_neighbor (mif, bif->hw_address, port_number + 1, mif->group);
207  lm->lacp_int++;
208  if (lm->lacp_int == 1)
209  {
212  }
213  }
214  else
215  {
216  ASSERT (lm->lacp_int >= 1);
217  if (lm->lacp_int == 0)
218  {
219  /* *INDENT-OFF* */
220  ELOG_TYPE_DECLARE (e) =
221  {
222  .format = "lacp-int-en-dis: BUG lacp_int == 0",
223  };
224  /* *INDENT-ON* */
226  }
227  else
228  {
229  lm->lacp_int--;
230  if (lm->lacp_int == 0)
233  }
234  }
235 }
236 
237 static clib_error_t *
239 {
240  lacp_main_t *lm = &lacp_main;
241  ethernet_lacp_pdu_t h;
242  ethernet_marker_pdu_t m;
243  u8 dst[] = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x02 };
244 
245  /* initialize binary API */
247 
248  /* Create the ethernet lacp packet template */
249 
250  clib_memset (&h, 0, sizeof (h));
251 
252  memcpy (h.ethernet.dst_address, dst, sizeof (h.ethernet.dst_address));
253 
254  /* leave src address blank (fill in at send time) */
255 
256  h.ethernet.type = htons (ETHERNET_TYPE_SLOW_PROTOCOLS);
257 
258  h.lacp.subtype = LACP_SUBTYPE;
259  h.lacp.version_number = LACP_ACTOR_LACP_VERSION;
260 
261  /* Actor TLV */
262  h.lacp.actor.tlv_type = LACP_ACTOR_INFORMATION;
263  h.lacp.actor.tlv_length = sizeof (lacp_actor_partner_t);
264 
265  /* Partner TLV */
266  h.lacp.partner.tlv_type = LACP_PARTNER_INFORMATION;
267  h.lacp.partner.tlv_length = sizeof (lacp_actor_partner_t);
268 
269  /* Collector TLV */
270  h.lacp.collector.tlv_type = LACP_COLLECTOR_INFORMATION;
271  h.lacp.collector.tlv_length = sizeof (lacp_collector_t);
272  h.lacp.collector.max_delay = 0;
273 
274  /* Terminator TLV */
275  h.lacp.terminator.tlv_type = LACP_TERMINATOR_INFORMATION;
276  h.lacp.terminator.tlv_length = 0;
277 
280  /* data */ &h,
281  sizeof (h),
282  /* alloc chunk size */ 8,
283  "lacp-ethernet");
284 
285  /* Create the ethernet marker protocol packet template */
286 
287  clib_memset (&m, 0, sizeof (m));
288 
289  memcpy (m.ethernet.dst_address, dst, sizeof (m.ethernet.dst_address));
290 
291  /* leave src address blank (fill in at send time) */
292 
293  m.ethernet.type = htons (ETHERNET_TYPE_SLOW_PROTOCOLS);
294 
295  m.marker.subtype = MARKER_SUBTYPE;
296  m.marker.version_number = MARKER_PROTOCOL_VERSION;
297 
298  m.marker.marker_info.tlv_length = sizeof (marker_information_t);
299 
300  /* Terminator TLV */
301  m.marker.terminator.tlv_type = MARKER_TERMINATOR_INFORMATION;
302  m.marker.terminator.tlv_length = 0;
303 
306  /* data */ &m,
307  sizeof (m),
308  /* alloc chunk size */ 8,
309  "marker-ethernet");
310 
312 
313  return 0;
314 }
315 
316 int
318  member_if_t * mif, int event, int *state)
319 {
320  lacp_fsm_state_t *transition;
321  int rc = 0;
322 
323  transition = &machine->tables[*state].state_table[event];
324  LACP_DBG2 (mif, event, *state, machine, transition);
325  *state = transition->next_state;
326  if (transition->action)
327  rc = (*transition->action) ((void *) vm, (void *) mif);
328 
329  return rc;
330 }
331 
332 void
333 lacp_init_neighbor (member_if_t * mif, u8 * hw_address, u16 port_number,
334  u32 group)
335 {
345  mif->lacp_enabled = 1;
346  mif->loopback_port = 0;
347  mif->ready = 0;
348  mif->ready_n = 0;
349  mif->port_moved = 0;
350  mif->ntt = 0;
351  mif->selected = LACP_PORT_UNSELECTED;
352  mif->actor.state = LACP_STATE_AGGREGATION;
354  mif->actor.state |= LACP_STATE_LACP_TIMEOUT;
355  if (mif->is_passive == 0)
356  mif->actor.state |= LACP_STATE_LACP_ACTIVITY;
357  clib_memcpy (mif->actor.system, hw_address, 6);
358  mif->actor.system_priority = htons (LACP_DEFAULT_SYSTEM_PRIORITY);
359  mif->actor.key = htons (group);
360  mif->actor.port_number = htons (port_number);
361  mif->actor.port_priority = htons (LACP_DEFAULT_PORT_PRIORITY);
362 
363  mif->partner.system_priority = htons (LACP_DEFAULT_SYSTEM_PRIORITY);
364  mif->partner.key = htons (group);
365  mif->partner.port_number = htons (port_number);
366  mif->partner.port_priority = htons (LACP_DEFAULT_PORT_PRIORITY);
367  mif->partner.state = 0;
368 
369  mif->actor_admin = mif->actor;
370  mif->partner_admin = mif->partner;
371 }
372 
373 void
375 {
376  bond_main_t *bm = &bond_main;
378 
379  lacp_init_tx_machine (vm, mif);
380  lacp_init_mux_machine (vm, mif);
381  lacp_init_ptx_machine (vm, mif);
382  lacp_init_rx_machine (vm, mif);
384  [mif->sw_if_index].actor_state,
385  mif->actor.state);
387  [mif->sw_if_index].partner_state,
388  mif->partner.state);
389 }
390 
392 
393 static clib_error_t *
395 {
396  lacp_main_t *lm = &lacp_main;
397  member_if_t *mif;
398  vlib_main_t *vm = lm->vlib_main;
399 
401  if (mif)
402  {
403  if (mif->lacp_enabled == 0)
404  return 0;
405 
406  /* port_enabled is both admin up and hw link up */
409  if (mif->port_enabled == 0)
410  {
411  lacp_init_neighbor (mif, mif->actor_admin.system,
412  ntohs (mif->actor_admin.port_number),
413  ntohs (mif->actor_admin.key));
415  }
416  }
417 
418  return 0;
419 }
420 
422 
423 static clib_error_t *
425 {
426  lacp_main_t *lm = &lacp_main;
427  member_if_t *mif;
429  vlib_main_t *vm = lm->vlib_main;
430 
431  sw = vnet_get_hw_sw_interface (vnm, hw_if_index);
433  if (mif)
434  {
435  if (mif->lacp_enabled == 0)
436  return 0;
437 
438  /* port_enabled is both admin up and hw link up */
441  sw->sw_if_index));
442  if (mif->port_enabled == 0)
443  {
444  lacp_init_neighbor (mif, mif->actor_admin.system,
445  ntohs (mif->actor_admin.port_number),
446  ntohs (mif->actor_admin.key));
448  }
449  }
450 
451  return 0;
452 }
453 
455 
456 /* *INDENT-OFF* */
458  .version = VPP_BUILD_VER,
459  .description = "Link Aggregation Control Protocol (LACP)",
460 };
461 /* *INDENT-ON* */
462 
463 /*
464  * fd.io coding-style-patch-verification: ON
465  *
466  * Local Variables:
467  * eval: (c-set-style "gnu")
468  * End:
469  */
vlib.h
bond_main_t::stats
lacp_stats_t ** stats
Definition: node.h:388
vlib_frame_t::n_vectors
u16 n_vectors
Definition: node.h:387
lacp_init_mux_machine
void lacp_init_mux_machine(vlib_main_t *vm, member_if_t *mif)
Definition: mux_machine.c:233
lacp_timer_is_expired
static u8 lacp_timer_is_expired(vlib_main_t *vm, f64 timer)
Definition: node.h:174
vnet_sw_interface_is_link_up
static uword vnet_sw_interface_is_link_up(vnet_main_t *vnm, u32 sw_if_index)
Definition: interface_funcs.h:331
lacp_plugin_api_hookup
clib_error_t * lacp_plugin_api_hookup(vlib_main_t *vm)
Definition: lacp_api.c:119
member_if_t::last_lacpdu_sent_time
f64 last_lacpdu_sent_time
Definition: node.h:292
member_if_t::wait_while_timer
f64 wait_while_timer
Definition: node.h:310
ntohs
#define ntohs(x)
Definition: af_xdp.bpf.c:29
VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION
VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION(lacp_sw_interface_up_down)
vnet_sw_interface_t
Definition: interface.h:869
clib_memcpy
#define clib_memcpy(d, s, n)
Definition: string.h:197
bond_get_bond_if_by_dev_instance
static bond_if_t * bond_get_bond_if_by_dev_instance(u32 dev_instance)
Definition: node.h:517
lacp_timer_is_running
static u8 lacp_timer_is_running(f64 timer)
Definition: node.h:168
lacp_pick_packet_template
static int lacp_pick_packet_template(member_if_t *mif)
Definition: lacp.c:100
vlib_get_buffer
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:111
lacp_create_periodic_process
void lacp_create_periodic_process(void)
Definition: node.c:229
f
vlib_frame_t * f
Definition: interface_output.c:1098
lacp_machine_t::tables
lacp_fsm_machine_t * tables
Definition: machine.h:42
lacp_init_ptx_machine
void lacp_init_ptx_machine(vlib_main_t *vm, member_if_t *mif)
Definition: ptx_machine.c:220
member_if_t::ntt
u8 ntt
Definition: node.h:262
LACP_PACKET_TEMPLATE_ETHERNET
@ LACP_PACKET_TEMPLATE_ETHERNET
Definition: node.h:30
vnet_hw_interface_t::hw_address
u8 * hw_address
Definition: interface.h:649
vnet_hw_interface_t::sw_if_index
u32 sw_if_index
Definition: interface.h:670
VLIB_PLUGIN_REGISTER
VLIB_PLUGIN_REGISTER()
bond_main
bond_main_t bond_main
Definition: node.c:25
LACP_DEFAULT_SYSTEM_PRIORITY
#define LACP_DEFAULT_SYSTEM_PRIORITY
Definition: protocol.h:99
MARKER_PROTOCOL_VERSION
#define MARKER_PROTOCOL_VERSION
Definition: protocol.h:133
lacp_stats_t::partner_state
u32 partner_state
Definition: node.h:357
member_if_t::ttl_in_seconds
f32 ttl_in_seconds
Definition: node.h:221
u16
unsigned short u16
Definition: types.h:57
VNET_SW_INTERFACE_FLAG_ADMIN_UP
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
Definition: interface.h:844
LACP_SUBTYPE
#define LACP_SUBTYPE
Definition: protocol.h:25
LACP_PROCESS_EVENT_STOP
@ LACP_PROCESS_EVENT_STOP
Definition: node.h:43
member_if_t::last_marker_pdu_recd_time
f64 last_marker_pdu_recd_time
Definition: node.h:301
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
lacp_periodic_init
static clib_error_t * lacp_periodic_init(vlib_main_t *vm)
Definition: lacp.c:238
VNET_HW_INTERFACE_FLAG_LINK_UP
@ VNET_HW_INTERFACE_FLAG_LINK_UP
Definition: interface.h:509
state
vl_api_dhcp_client_state_t state
Definition: dhcp.api:201
lacp_main
lacp_main_t lacp_main
Definition: lacp.c:26
LACP_PROCESS_EVENT_START
@ LACP_PROCESS_EVENT_START
Definition: node.h:42
bond_register_callback
static void bond_register_callback(lacp_enable_disable_func func)
Definition: node.h:494
lacp_fsm_state_t
Definition: machine.h:26
member_if_t::last_lacpdu_recd_time
f64 last_lacpdu_recd_time
Definition: node.h:295
vlib_frame_t
Definition: node.h:372
vlib_get_frame_to_node
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
Definition: main.c:184
bond_if_t
Definition: node.h:168
member_if_t::rx_state
int rx_state
Definition: node.h:313
vlib_process_signal_event
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
Definition: node_funcs.h:1019
member_if_t::loopback_port
u8 loopback_port
Definition: node.h:325
clib_bitmap_first_clear
static uword clib_bitmap_first_clear(uword *ai)
Return the lowest numbered clear bit in a bitmap.
Definition: bitmap.h:432
member_if_t::pdu_sent
u64 pdu_sent
Definition: node.h:337
h
h
Definition: flowhash_template.h:372
LACP_DBG2
#define LACP_DBG2(n, e, s, m, t)
Definition: node.h:53
vnet_sw_interface_t::sw_if_index
u32 sw_if_index
Definition: interface.h:876
lacp_interface_enable_disable
static void lacp_interface_enable_disable(vlib_main_t *vm, bond_if_t *bif, member_if_t *mif, u8 enable)
Definition: lacp.c:192
vlib_buffer_t::current_data
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
Definition: buffer.h:119
vlib_put_frame_to_node
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
Definition: main.c:218
pool_foreach
#define pool_foreach(VAR, POOL)
Iterate through pool.
Definition: pool.h:534
hash.h
lacp_rx_machine
lacp_machine_t lacp_rx_machine
Definition: rx_machine.c:108
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142
ELOG_TYPE_DECLARE
#define ELOG_TYPE_DECLARE(f)
Definition: elog.h:442
lacp_selection_logic
int lacp_selection_logic(vlib_main_t *vm, member_if_t *mif)
Definition: selection.c:76
member_if_t::partner
lacp_port_info_t partner
Definition: node.h:254
bond_if_t::port_number_bitmap
uword * port_number_bitmap
Definition: node.h:206
vnet_buffer
#define vnet_buffer(b)
Definition: buffer.h:441
lacp_init_state_machines
void lacp_init_state_machines(vlib_main_t *vm, member_if_t *mif)
Definition: lacp.c:374
LACP_SHORT_TIMOUT_TIME
#define LACP_SHORT_TIMOUT_TIME
Definition: node.h:26
vlib_frame_vector_args
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:301
vlib_global_main
vlib_global_main_t vlib_global_main
Definition: main.c:1786
lacp_stats_t::actor_state
u32 actor_state
Definition: node.h:358
uword
u64 uword
Definition: types.h:112
member_if_t::periodic_timer
f64 periodic_timer
Definition: node.h:304
LACP_ACTOR_LACP_VERSION
#define LACP_ACTOR_LACP_VERSION
Definition: protocol.h:26
member_if_t::actor_churn_timer
f64 actor_churn_timer
Definition: node.h:289
member_if_t::actor
lacp_port_info_t actor
Definition: node.h:255
bond_main_t::neighbors
member_if_t * neighbors
Definition: node.h:370
member_if_t::actor_admin
lacp_port_info_t actor_admin
Definition: node.h:259
node.h
lacp_main_t::vnet_main
vnet_main_t * vnet_main
Definition: node.h:124
clib_bitmap_set
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap.
Definition: bitmap.h:167
member_if_t::sw_if_index
u32 sw_if_index
Definition: node.h:218
lacp_hw_interface_up_down
static clib_error_t * lacp_hw_interface_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
Definition: lacp.c:424
lacp_init_neighbor
void lacp_init_neighbor(member_if_t *mif, u8 *hw_address, u16 port_number, u32 group)
Definition: lacp.c:333
member_if_t::partner_churn_timer
f64 partner_churn_timer
Definition: node.h:307
vlib_global_main_t::elog_main
elog_main_t elog_main
Definition: main.h:302
vlib_buffer_t::current_length
u16 current_length
Nbytes between current data and the end of this buffer.
Definition: buffer.h:122
stat_segment.h
vnet_sw_interface_is_admin_up
static uword vnet_sw_interface_is_admin_up(vnet_main_t *vnm, u32 sw_if_index)
Definition: interface_funcs.h:265
member_if_t::selected
int selected
Definition: node.h:280
lacp_fill_pdu
static void lacp_fill_pdu(lacp_pdu_t *lacpdu, member_if_t *mif)
Definition: lacp.c:32
lacp_ptx_machine
lacp_machine_t lacp_ptx_machine
Definition: ptx_machine.c:69
plugin.h
member_if_t::port_moved
u8 port_moved
Definition: node.h:283
lacp_machine_dispatch
int lacp_machine_dispatch(lacp_machine_t *machine, vlib_main_t *vm, member_if_t *mif, int event, int *state)
Definition: lacp.c:317
member_if_t::port_enabled
u8 port_enabled
Definition: node.h:265
vnet_hw_interface_t
Definition: interface.h:638
vnet_main_t
Definition: vnet.h:76
lacp_main_t
Definition: node.h:117
vlib_packet_template_get_packet
void * vlib_packet_template_get_packet(vlib_main_t *vm, vlib_packet_template_t *t, u32 *bi_result)
Definition: buffer.c:377
lacp_main_t::packet_templates
vlib_packet_template_t packet_templates[LACP_N_PACKET_TEMPLATES]
Definition: node.h:130
lacp_main_t::lacp_int
volatile u32 lacp_int
Definition: node.h:136
member_if_t
Definition: node.h:213
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
member_if_t::ready
u8 ready
Definition: node.h:277
lacp_stop_timer
static void lacp_stop_timer(f64 *timer)
Definition: node.h:162
lacp_fsm_machine_t::state_table
lacp_fsm_state_t * state_table
Definition: machine.h:37
vnet_get_hw_sw_interface
static vnet_sw_interface_t * vnet_get_hw_sw_interface(vnet_main_t *vnm, u32 hw_if_index)
Definition: interface_funcs.h:72
u32
unsigned int u32
Definition: types.h:88
VLIB_INIT_FUNCTION
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:172
vnet_get_sup_hw_interface
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
Definition: interface_funcs.h:92
member_if_t::mode
u8 mode
Definition: node.h:328
lacp_sw_interface_up_down
static clib_error_t * lacp_sw_interface_up_down(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
Definition: lacp.c:394
member_if_t::current_while_timer
f64 current_while_timer
Definition: node.h:286
dst
vl_api_ip4_address_t dst
Definition: pnat.api:41
lacp_init_tx_machine
void lacp_init_tx_machine(vlib_main_t *vm, member_if_t *mif)
Definition: tx_machine.c:108
member_if_t::bif_dev_instance
u32 bif_dev_instance
Definition: node.h:323
bond_get_member_by_sw_if_index
static member_if_t * bond_get_member_by_sw_if_index(u32 sw_if_index)
Definition: node.h:525
lacp_periodic
void lacp_periodic(vlib_main_t *vm)
Definition: lacp.c:138
clib_memset
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_main_t
Definition: main.h:102
bond_if_t::hw_address
u8 hw_address[6]
Definition: node.h:208
lacp_send_ethernet_lacp_pdu
static void lacp_send_ethernet_lacp_pdu(vlib_main_t *vm, member_if_t *mif)
Definition: lacp.c:45
u8
unsigned char u8
Definition: types.h:56
lacp_send_lacp_pdu
void lacp_send_lacp_pdu(vlib_main_t *vm, member_if_t *mif)
Definition: lacp.c:108
clib_error_t
Definition: clib_error.h:21
member_if_t::partner_admin
lacp_port_info_t partner_admin
Definition: node.h:255
unix.h
vnet_hw_interface_t::output_node_index
u32 output_node_index
Definition: interface.h:653
vlib_init_function_t
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
Definition: init.h:51
MARKER_SUBTYPE
#define MARKER_SUBTYPE
Definition: protocol.h:132
member_if_t::packet_template_index
u8 packet_template_index
Definition: node.h:230
MARKER_PACKET_TEMPLATE_ETHERNET
@ MARKER_PACKET_TEMPLATE_ETHERNET
Definition: node.h:36
LACP_DEFAULT_PORT_PRIORITY
#define LACP_DEFAULT_PORT_PRIORITY
Definition: protocol.h:98
member_if_t::last_marker_pdu_sent_time
f64 last_marker_pdu_sent_time
Definition: node.h:298
lacp_fsm_state_t::next_state
int next_state
Definition: machine.h:29
ELOG_DATA
#define ELOG_DATA(em, f)
Definition: elog.h:484
vlib_packet_template_init
void vlib_packet_template_init(vlib_main_t *vm, vlib_packet_template_t *t, void *packet_data, uword n_packet_data_bytes, uword min_n_buffers_each_alloc, char *fmt,...)
Definition: buffer.c:355
member_if_t::ptx_state
int ptx_state
Definition: node.h:316
vlib_time_now
static f64 vlib_time_now(vlib_main_t *vm)
Definition: main.h:327
member_if_t::is_passive
u8 is_passive
Definition: node.h:251
bond_main_t
Definition: node.h:361
member_if_t::lacp_enabled
u8 lacp_enabled
Definition: node.h:271
lacp_machine_t
Definition: machine.h:40
stat_segment_set_state_counter
void stat_segment_set_state_counter(u32 index, u64 value)
Definition: stat_segment.c:962
vlib_buffer_t::total_length_not_including_first_buffer
u32 total_length_not_including_first_buffer
Only valid for first buffer in chain.
Definition: buffer.h:176
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
lacp_main_t::vlib_main
vlib_main_t * vlib_main
Definition: node.h:123
VLIB_TX
@ VLIB_TX
Definition: defs.h:47
lacp_fsm_state_t::action
action_func action
Definition: machine.h:28
bond_if_t::sw_if_index
u32 sw_if_index
Definition: node.h:184
lacp_main_t::marker_packet_templates
vlib_packet_template_t marker_packet_templates[MARKER_N_PACKET_TEMPLATES]
Definition: node.h:133
member_if_t::group
u32 group
Definition: node.h:319
member_if_t::ready_n
u8 ready_n
Definition: node.h:274
lacp_main_t::lacp_process_node_index
u32 lacp_process_node_index
Definition: node.h:127
node.h
lacp_init_rx_machine
void lacp_init_rx_machine(vlib_main_t *vm, member_if_t *mif)
Definition: rx_machine.c:424
VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION
VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION(lacp_hw_interface_up_down)
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111
flags
vl_api_wireguard_peer_flags_t flags
Definition: wireguard.api:105