34 #ifndef RTE_ETH_BOND_8023AD_PRIVATE_H_
35 #define RTE_ETH_BOND_8023AD_PRIVATE_H_
43 #include "rte_eth_bond_8023ad.h"
45 #define BOND_MODE_8023AX_UPDATE_TIMEOUT_MS 100
47 #define BOND_MODE_8023AX_SLAVE_RX_PKTS 3
49 #define BOND_MODE_8023AX_SLAVE_TX_PKTS 1
53 #define BOND_8023AD_FAST_PERIODIC_MS 900
54 #define BOND_8023AD_SLOW_PERIODIC_MS 29000
55 #define BOND_8023AD_SHORT_TIMEOUT_MS 3000
56 #define BOND_8023AD_LONG_TIMEOUT_MS 90000
57 #define BOND_8023AD_CHURN_DETECTION_TIMEOUT_MS 60000
58 #define BOND_8023AD_AGGREGATE_WAIT_TIMEOUT_MS 2000
59 #define BOND_8023AD_TX_MACHINE_PERIOD_MS 500
60 #define BOND_8023AD_RX_MARKER_PERIOD_MS 2000
67 #define BOND_8023AD_WARNINGS_PERIOD_MS 1000
74 #define SM_FLAGS_BEGIN 0x0001
75 #define SM_FLAGS_LACP_ENABLED 0x0002
76 #define SM_FLAGS_ACTOR_CHURN 0x0004
77 #define SM_FLAGS_PARTNER_CHURN 0x0008
78 #define SM_FLAGS_MOVED 0x0100
79 #define SM_FLAGS_PARTNER_SHORT_TIMEOUT 0x0200
80 #define SM_FLAGS_NTT 0x0400
82 #define BOND_LINK_FULL_DUPLEX_KEY 0x01
83 #define BOND_LINK_SPEED_KEY_10M 0x02
84 #define BOND_LINK_SPEED_KEY_100M 0x04
85 #define BOND_LINK_SPEED_KEY_1000M 0x08
86 #define BOND_LINK_SPEED_KEY_10G 0x10
87 #define BOND_LINK_SPEED_KEY_20G 0x11
88 #define BOND_LINK_SPEED_KEY_40G 0x12
90 #define WRN_RX_MARKER_TO_FAST 0x01
91 #define WRN_UNKNOWN_SLOW_TYPE 0x02
92 #define WRN_UNKNOWN_MARKER_TYPE 0x04
93 #define WRN_NOT_LACP_CAPABLE 0x08
94 #define WRN_RX_QUEUE_FULL 0x10
95 #define WRN_TX_QUEUE_FULL 0x20
97 #define CHECK_FLAGS(_variable, _f) ((_variable) & (_f))
98 #define SET_FLAGS(_variable, _f) ((_variable) |= (_f))
99 #define CLEAR_FLAGS(_variable, _f) ((_variable) &= ~(_f))
101 #define SM_FLAG(_p, _f) (!!CHECK_FLAGS((_p)->sm_flags, SM_FLAGS_ ## _f))
102 #define SM_FLAG_SET(_p, _f) SET_FLAGS((_p)->sm_flags, SM_FLAGS_ ## _f)
103 #define SM_FLAG_CLR(_p, _f) CLEAR_FLAGS((_p)->sm_flags, SM_FLAGS_ ## _f)
105 #define ACTOR_STATE(_p, _f) (!!CHECK_FLAGS((_p)->actor_state, STATE_ ## _f))
106 #define ACTOR_STATE_SET(_p, _f) SET_FLAGS((_p)->actor_state, STATE_ ## _f)
107 #define ACTOR_STATE_CLR(_p, _f) CLEAR_FLAGS((_p)->actor_state, STATE_ ## _f)
109 #define PARTNER_STATE(_p, _f) (!!CHECK_FLAGS((_p)->partner_state, STATE_ ## _f))
110 #define PARTNER_STATE_SET(_p, _f) SET_FLAGS((_p)->partner_state, STATE_ ## _f)
111 #define PARTNER_STATE_CLR(_p, _f) CLEAR_FLAGS((_p)->partner_state, STATE_ ## _f)
138 enum rte_bond_8023ad_selection selected;
140 uint64_t current_while_timer;
141 uint64_t periodic_timer;
142 uint64_t wait_while_timer;
143 uint64_t tx_machine_timer;
144 uint64_t tx_marker_timer;
163 uint64_t warning_timer;
164 volatile uint16_t warnings_to_show;
167 struct mode8023ad_private {
168 uint64_t fast_periodic_timeout;
169 uint64_t slow_periodic_timeout;
170 uint64_t short_timeout;
171 uint64_t long_timeout;
172 uint64_t aggregate_wait_timeout;
173 uint64_t tx_period_timeout;
174 uint64_t rx_marker_timeout;
175 uint64_t update_timeout_us;
176 rte_eth_bond_8023ad_ext_slowrx_fn slowrx_cb;
185 extern struct port mode_8023ad_ports[];
202 bond_mode_8023ad_setup(
struct rte_eth_dev *dev,
203 struct rte_eth_bond_8023ad_conf *conf);
215 bond_mode_8023ad_enable(
struct rte_eth_dev *dev);
226 int bond_mode_8023ad_disable(
struct rte_eth_dev *dev);
238 bond_mode_8023ad_start(
struct rte_eth_dev *dev);
249 bond_mode_8023ad_stop(
struct rte_eth_dev *dev);
261 uint8_t slave_id,
struct rte_mbuf *pkt);
275 bond_mode_8023ad_activate_slave(
struct rte_eth_dev *dev, uint8_t
port_id);
289 bond_mode_8023ad_deactivate_slave(
struct rte_eth_dev *dev, uint8_t slave_pos);
296 bond_mode_8023ad_mac_address_update(
struct rte_eth_dev *bond_dev);