5 #ifndef _RTE_ETH_BOND_PRIVATE_H_ 6 #define _RTE_ETH_BOND_PRIVATE_H_ 13 #include "rte_eth_bond_8023ad_private.h" 14 #include "rte_eth_bond_alb.h" 16 #define PMD_BOND_SLAVE_PORT_KVARG ("slave") 17 #define PMD_BOND_PRIMARY_SLAVE_KVARG ("primary") 18 #define PMD_BOND_MODE_KVARG ("mode") 19 #define PMD_BOND_AGG_MODE_KVARG ("agg_mode") 20 #define PMD_BOND_XMIT_POLICY_KVARG ("xmit_policy") 21 #define PMD_BOND_SOCKET_ID_KVARG ("socket_id") 22 #define PMD_BOND_MAC_ADDR_KVARG ("mac") 23 #define PMD_BOND_LSC_POLL_PERIOD_KVARG ("lsc_poll_period_ms") 24 #define PMD_BOND_LINK_UP_PROP_DELAY_KVARG ("up_delay") 25 #define PMD_BOND_LINK_DOWN_PROP_DELAY_KVARG ("down_delay") 27 #define PMD_BOND_XMIT_POLICY_LAYER2_KVARG ("l2") 28 #define PMD_BOND_XMIT_POLICY_LAYER23_KVARG ("l23") 29 #define PMD_BOND_XMIT_POLICY_LAYER34_KVARG ("l34") 31 #define RTE_BOND_LOG(lvl, msg, ...) \ 32 RTE_LOG(lvl, PMD, "%s(%d) - " msg "\n", __func__, __LINE__, ##__VA_ARGS__) 34 #define BONDING_MODE_INVALID 0xFF 36 extern const char *pmd_bond_init_valid_arguments[];
38 extern struct rte_vdev_driver pmd_bond_drv;
54 struct bond_tx_queue {
71 struct bond_slave_details {
74 uint8_t link_status_poll_enabled;
75 uint8_t link_status_wait_to_complete;
76 uint8_t last_link_status;
83 typedef void (*burst_xmit_hash_t)(
struct rte_mbuf **buf, uint16_t nb_pkts,
84 uint8_t slave_count, uint16_t *slaves);
109 uint8_t link_status_polling_enabled;
110 uint32_t link_status_polling_interval_ms;
112 uint32_t link_down_delay_ms;
113 uint32_t link_up_delay_ms;
123 struct bond_slave_details
slaves[RTE_MAX_ETHPORTS];
126 struct mode8023ad_private mode4;
129 struct mode_alb_private mode6;
131 uint32_t rx_offload_capa;
139 RTE_RETA_GROUP_SIZE];
145 uint8_t slave_update_idx;
147 uint32_t candidate_max_rx_pktlen;
148 uint32_t max_rx_pktlen;
150 void *vlan_filter_bmpmem;
154 extern const struct eth_dev_ops default_dev_ops;
157 check_for_master_bonded_ethdev(
const struct rte_eth_dev *eth_dev);
160 check_for_bonded_ethdev(
const struct rte_eth_dev *eth_dev);
164 static inline uint16_t
165 find_slave_by_id(uint16_t *slaves, uint16_t slaves_count, uint16_t slave_id) {
168 for (pos = 0; pos < slaves_count; pos++) {
169 if (slave_id == slaves[pos])
177 valid_port_id(uint16_t port_id);
180 valid_bonded_port_id(uint16_t port_id);
183 valid_slave_port_id(uint16_t port_id, uint8_t mode);
186 deactivate_slave(
struct rte_eth_dev *eth_dev, uint16_t port_id);
189 activate_slave(
struct rte_eth_dev *eth_dev, uint16_t port_id);
192 link_properties_set(
struct rte_eth_dev *bonded_eth_dev,
195 link_properties_valid(
struct rte_eth_dev *bonded_eth_dev,
199 mac_address_set(
struct rte_eth_dev *eth_dev,
struct ether_addr *new_mac_addr);
202 mac_address_get(
struct rte_eth_dev *eth_dev,
struct ether_addr *dst_mac_addr);
205 mac_address_slaves_update(
struct rte_eth_dev *bonded_eth_dev);
208 bond_ethdev_mode_set(
struct rte_eth_dev *eth_dev,
int mode);
211 slave_configure(
struct rte_eth_dev *bonded_eth_dev,
212 struct rte_eth_dev *slave_eth_dev);
216 struct rte_eth_dev *slave_eth_dev);
220 struct rte_eth_dev *slave_eth_dev);
223 burst_xmit_l2_hash(
struct rte_mbuf **buf, uint16_t nb_pkts,
224 uint8_t slave_count, uint16_t *slaves);
227 burst_xmit_l23_hash(
struct rte_mbuf **buf, uint16_t nb_pkts,
228 uint8_t slave_count, uint16_t *slaves);
231 burst_xmit_l34_hash(
struct rte_mbuf **buf, uint16_t nb_pkts,
232 uint8_t slave_count, uint16_t *slaves);
237 uint16_t slave_port_id);
241 void *param,
void *ret_param);
244 bond_ethdev_parse_slave_port_kvarg(
const char *key,
245 const char *value,
void *extra_args);
248 bond_ethdev_parse_slave_mode_kvarg(
const char *key,
249 const char *value,
void *extra_args);
252 bond_ethdev_parse_slave_agg_mode_kvarg(
const char *key
__rte_unused,
253 const char *value,
void *extra_args);
256 bond_ethdev_parse_socket_id_kvarg(
const char *key,
257 const char *value,
void *extra_args);
260 bond_ethdev_parse_primary_slave_port_id_kvarg(
const char *key,
261 const char *value,
void *extra_args);
264 bond_ethdev_parse_balance_xmit_policy_kvarg(
const char *key,
265 const char *value,
void *extra_args);
268 bond_ethdev_parse_bond_mac_addr_kvarg(
const char *key,
269 const char *value,
void *extra_args);
272 bond_ethdev_parse_time_ms_kvarg(
const char *key,
273 const char *value,
void *extra_args);
285 bond_ethdev_stop(
struct rte_eth_dev *eth_dev);
288 bond_ethdev_close(
struct rte_eth_dev *dev);
uint8_t balance_xmit_policy
uint16_t user_defined_primary_port
burst_xmit_hash_t burst_xmit_hash
struct bond_dev_private * dev_private
uint64_t flow_type_rss_offloads
uint16_t active_slave_count
uint16_t current_primary_port
uint16_t active_slaves[RTE_MAX_ETHPORTS]
struct rte_mempool * mb_pool
struct bond_slave_details slaves[RTE_MAX_ETHPORTS]
uint16_t tlb_slaves_order[RTE_MAX_ETHPORTS]
uint16_t slaves[RTE_MAX_ETHPORTS]
struct rte_eth_rxconf rx_conf