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)(uint16_t slave_id,
70 enum rte_bond_8023ad_selection {
76 enum rte_bond_8023ad_agg_selection {
85 uint8_t reserved_119[119];
86 } __attribute__((__packed__));
92 } __attribute__((__packed__));
95 uint16_t system_priority;
101 uint16_t port_priority;
103 uint16_t port_number;
105 } __attribute__((__packed__));
107 struct lacpdu_actor_partner_params {
108 uint8_t tlv_type_info;
110 struct port_params port_params;
112 uint8_t reserved_3[3];
113 } __attribute__((__packed__));
118 uint8_t version_number;
120 struct lacpdu_actor_partner_params actor;
121 struct lacpdu_actor_partner_params partner;
123 uint8_t tlv_type_collector_info;
124 uint8_t collector_info_length;
125 uint16_t collector_max_delay;
126 uint8_t reserved_12[12];
128 uint8_t tlv_type_terminator;
129 uint8_t terminator_length;
130 uint8_t reserved_50[50];
131 } __attribute__((__packed__));
137 } __attribute__((__packed__));
141 uint8_t version_number;
143 uint8_t tlv_type_marker;
145 uint16_t requester_port;
147 uint32_t requester_transaction_id;
148 uint8_t reserved_2[2];
150 uint8_t tlv_type_terminator;
151 uint8_t terminator_length;
152 uint8_t reserved_90[90];
153 } __attribute__((__packed__));
155 struct marker_header {
157 struct marker marker;
158 } __attribute__((__packed__));
160 struct rte_eth_bond_8023ad_conf {
161 uint32_t fast_periodic_ms;
162 uint32_t slow_periodic_ms;
163 uint32_t short_timeout_ms;
164 uint32_t long_timeout_ms;
165 uint32_t aggregate_wait_timeout_ms;
166 uint32_t tx_period_ms;
167 uint32_t rx_marker_period_ms;
168 uint32_t update_timeout_ms;
169 rte_eth_bond_8023ad_ext_slowrx_fn slowrx_cb;
170 enum rte_bond_8023ad_agg_selection agg_selection;
173 struct rte_eth_bond_8023ad_slave_info {
174 enum rte_bond_8023ad_selection selected;
176 struct port_params actor;
177 uint8_t partner_state;
178 struct port_params partner;
179 uint16_t agg_port_id;
195 rte_eth_bond_8023ad_conf_get(uint16_t port_id,
196 struct rte_eth_bond_8023ad_conf *conf);
210 rte_eth_bond_8023ad_setup(uint16_t port_id,
211 struct rte_eth_bond_8023ad_conf *conf);
226 rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id,
227 struct rte_eth_bond_8023ad_slave_info *conf);
244 rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t slave_id,
258 rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t slave_id);
271 rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t slave_id,
285 rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t slave_id);
299 rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t slave_id,
325 rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port_id);
342 rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port_id);
352 rte_eth_bond_8023ad_agg_selection_get(uint16_t port_id);
361 rte_eth_bond_8023ad_agg_selection_set(uint16_t port_id,
362 enum rte_bond_8023ad_agg_selection agg_selection);