34 #ifndef RTE_ETH_BOND_8023AD_H_
35 #define RTE_ETH_BOND_8023AD_H_
46 #define STATE_LACP_ACTIVE 0x01
47 #define STATE_LACP_SHORT_TIMEOUT 0x02
48 #define STATE_AGGREGATION 0x04
49 #define STATE_SYNCHRONIZATION 0x08
50 #define STATE_COLLECTING 0x10
51 #define STATE_DISTRIBUTING 0x20
53 #define STATE_DEFAULTED 0x40
54 #define STATE_EXPIRED 0x80
56 #define TLV_TYPE_ACTOR_INFORMATION 0x01
57 #define TLV_TYPE_PARTNER_INFORMATION 0x02
58 #define TLV_TYPE_COLLECTOR_INFORMATION 0x03
59 #define TLV_TYPE_TERMINATOR_INFORMATION 0x00
61 #define SLOW_SUBTYPE_LACP 0x01
62 #define SLOW_SUBTYPE_MARKER 0x02
64 #define MARKER_TLV_TYPE_INFO 0x01
65 #define MARKER_TLV_TYPE_RESP 0x02
67 typedef void (*rte_eth_bond_8023ad_ext_slowrx_fn)(uint8_t slave_id,
70 enum rte_bond_8023ad_selection {
79 uint8_t reserved_119[119];
80 } __attribute__((__packed__));
86 } __attribute__((__packed__));
89 uint16_t system_priority;
95 uint16_t port_priority;
99 } __attribute__((__packed__));
101 struct lacpdu_actor_partner_params {
102 uint8_t tlv_type_info;
104 struct port_params port_params;
106 uint8_t reserved_3[3];
107 } __attribute__((__packed__));
112 uint8_t version_number;
114 struct lacpdu_actor_partner_params actor;
115 struct lacpdu_actor_partner_params partner;
117 uint8_t tlv_type_collector_info;
118 uint8_t collector_info_length;
119 uint16_t collector_max_delay;
120 uint8_t reserved_12[12];
122 uint8_t tlv_type_terminator;
123 uint8_t terminator_length;
124 uint8_t reserved_50[50];
125 } __attribute__((__packed__));
131 } __attribute__((__packed__));
135 uint8_t version_number;
137 uint8_t tlv_type_marker;
139 uint16_t requester_port;
141 uint32_t requester_transaction_id;
142 uint8_t reserved_2[2];
144 uint8_t tlv_type_terminator;
145 uint8_t terminator_length;
146 uint8_t reserved_90[90];
147 } __attribute__((__packed__));
149 struct marker_header {
151 struct marker marker;
152 } __attribute__((__packed__));
154 struct rte_eth_bond_8023ad_conf {
155 uint32_t fast_periodic_ms;
156 uint32_t slow_periodic_ms;
157 uint32_t short_timeout_ms;
158 uint32_t long_timeout_ms;
159 uint32_t aggregate_wait_timeout_ms;
160 uint32_t tx_period_ms;
161 uint32_t rx_marker_period_ms;
162 uint32_t update_timeout_ms;
163 rte_eth_bond_8023ad_ext_slowrx_fn slowrx_cb;
166 struct rte_eth_bond_8023ad_slave_info {
167 enum rte_bond_8023ad_selection selected;
169 struct port_params actor;
170 uint8_t partner_state;
171 struct port_params partner;
188 rte_eth_bond_8023ad_conf_get(uint8_t port_id,
189 struct rte_eth_bond_8023ad_conf *conf);
191 rte_eth_bond_8023ad_conf_get_v20(uint8_t port_id,
192 struct rte_eth_bond_8023ad_conf *conf);
194 rte_eth_bond_8023ad_conf_get_v1607(uint8_t port_id,
195 struct rte_eth_bond_8023ad_conf *conf);
209 rte_eth_bond_8023ad_setup(uint8_t port_id,
210 struct rte_eth_bond_8023ad_conf *conf);
212 rte_eth_bond_8023ad_setup_v20(uint8_t port_id,
213 struct rte_eth_bond_8023ad_conf *conf);
215 rte_eth_bond_8023ad_setup_v1607(uint8_t port_id,
216 struct rte_eth_bond_8023ad_conf *conf);
231 rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id,
232 struct rte_eth_bond_8023ad_slave_info *conf);
249 rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id,
int enabled);
262 rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id);
275 rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id,
int enabled);
288 rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id);
302 rte_eth_bond_8023ad_ext_slowtx(uint8_t port_id, uint8_t slave_id,