DPDK 22.11.5
rte_eth_bond_8023ad.h
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
3 */
4
5#ifndef RTE_ETH_BOND_8023AD_H_
6#define RTE_ETH_BOND_8023AD_H_
7
8#include <rte_ether.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
17#define STATE_LACP_ACTIVE 0x01
18#define STATE_LACP_SHORT_TIMEOUT 0x02
19#define STATE_AGGREGATION 0x04
20#define STATE_SYNCHRONIZATION 0x08
21#define STATE_COLLECTING 0x10
22#define STATE_DISTRIBUTING 0x20
24#define STATE_DEFAULTED 0x40
25#define STATE_EXPIRED 0x80
26
27#define TLV_TYPE_ACTOR_INFORMATION 0x01
28#define TLV_TYPE_PARTNER_INFORMATION 0x02
29#define TLV_TYPE_COLLECTOR_INFORMATION 0x03
30#define TLV_TYPE_TERMINATOR_INFORMATION 0x00
31
32#define SLOW_SUBTYPE_LACP 0x01
33#define SLOW_SUBTYPE_MARKER 0x02
34
35#define MARKER_TLV_TYPE_INFO 0x01
36#define MARKER_TLV_TYPE_RESP 0x02
37
38typedef void (*rte_eth_bond_8023ad_ext_slowrx_fn)(uint16_t slave_id,
39 struct rte_mbuf *lacp_pkt);
40
41enum rte_bond_8023ad_selection {
42 UNSELECTED,
43 STANDBY,
44 SELECTED
45};
46
47enum rte_bond_8023ad_agg_selection {
48 AGG_BANDWIDTH,
49 AGG_COUNT,
50 AGG_STABLE
51};
52
55 uint8_t subtype;
56 uint8_t reserved_119[119];
58
61 struct rte_ether_hdr eth_hdr;
64
65struct port_params {
66 uint16_t system_priority;
68 struct rte_ether_addr system;
70 uint16_t key;
72 uint16_t port_priority;
74 uint16_t port_number;
77
78struct lacpdu_actor_partner_params {
79 uint8_t tlv_type_info;
80 uint8_t info_length;
81 struct port_params port_params;
82 uint8_t state;
83 uint8_t reserved_3[3];
85
87struct lacpdu {
88 uint8_t subtype;
89 uint8_t version_number;
90
91 struct lacpdu_actor_partner_params actor;
92 struct lacpdu_actor_partner_params partner;
93
94 uint8_t tlv_type_collector_info;
95 uint8_t collector_info_length;
96 uint16_t collector_max_delay;
97 uint8_t reserved_12[12];
98
99 uint8_t tlv_type_terminator;
100 uint8_t terminator_length;
101 uint8_t reserved_50[50];
103
106 struct rte_ether_hdr eth_hdr;
107 struct lacpdu lacpdu;
109
110struct marker {
111 uint8_t subtype;
112 uint8_t version_number;
113
114 uint8_t tlv_type_marker;
115 uint8_t info_length;
116 uint16_t requester_port;
117 struct rte_ether_addr requester_system;
118 uint32_t requester_transaction_id;
119 uint8_t reserved_2[2];
120
121 uint8_t tlv_type_terminator;
122 uint8_t terminator_length;
123 uint8_t reserved_90[90];
125
126struct marker_header {
127 struct rte_ether_hdr eth_hdr;
128 struct marker marker;
130
131struct rte_eth_bond_8023ad_conf {
132 uint32_t fast_periodic_ms;
133 uint32_t slow_periodic_ms;
134 uint32_t short_timeout_ms;
135 uint32_t long_timeout_ms;
136 uint32_t aggregate_wait_timeout_ms;
137 uint32_t tx_period_ms;
138 uint32_t rx_marker_period_ms;
139 uint32_t update_timeout_ms;
140 rte_eth_bond_8023ad_ext_slowrx_fn slowrx_cb;
141 enum rte_bond_8023ad_agg_selection agg_selection;
142};
143
144struct rte_eth_bond_8023ad_slave_info {
145 enum rte_bond_8023ad_selection selected;
146 uint8_t actor_state;
147 struct port_params actor;
148 uint8_t partner_state;
149 struct port_params partner;
150 uint16_t agg_port_id;
151};
152
165int
166rte_eth_bond_8023ad_conf_get(uint16_t port_id,
167 struct rte_eth_bond_8023ad_conf *conf);
168
180int
181rte_eth_bond_8023ad_setup(uint16_t port_id,
182 struct rte_eth_bond_8023ad_conf *conf);
183
196int
197rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id,
198 struct rte_eth_bond_8023ad_slave_info *conf);
199
210int
211rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t slave_id,
212 int enabled);
213
224int
225rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t slave_id);
226
237int
238rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t slave_id,
239 int enabled);
240
251int
252rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t slave_id);
253
265int
266rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t slave_id,
267 struct rte_mbuf *lacp_pkt);
268
291int
292rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port_id);
293
308int
309rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port_id);
310
311/*
312 * Get aggregator mode for 8023ad
313 * @param port_id Bonding device id
314 *
315 * @return
316 * aggregator mode on success, negative value otherwise
317 */
318int
319rte_eth_bond_8023ad_agg_selection_get(uint16_t port_id);
320
327int
328rte_eth_bond_8023ad_agg_selection_set(uint16_t port_id,
329 enum rte_bond_8023ad_agg_selection agg_selection);
330
331#ifdef __cplusplus
332}
333#endif
334
335#endif /* RTE_ETH_BOND_8023AD_H_ */
#define __rte_packed
Definition: rte_common.h:83
__extension__ struct rte_eth_link __rte_aligned(8)