34 #ifndef _RTE_ETHDEV_H_
35 #define _RTE_ETHDEV_H_
176 #define RTE_ETHDEV_HAS_LRO_SUPPORT
185 #include "rte_dev_info.h"
220 uint64_t
q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
222 uint64_t
q_opackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
224 uint64_t
q_ibytes[RTE_ETHDEV_QUEUE_STAT_CNTRS];
226 uint64_t
q_obytes[RTE_ETHDEV_QUEUE_STAT_CNTRS];
228 uint64_t
q_errors[RTE_ETHDEV_QUEUE_STAT_CNTRS];
247 }__attribute__((aligned(8)));
249 #define ETH_LINK_SPEED_AUTONEG 0
250 #define ETH_LINK_SPEED_10 10
251 #define ETH_LINK_SPEED_100 100
252 #define ETH_LINK_SPEED_1000 1000
253 #define ETH_LINK_SPEED_10000 10000
254 #define ETH_LINK_SPEED_10G 10000
255 #define ETH_LINK_SPEED_20G 20000
256 #define ETH_LINK_SPEED_40G 40000
258 #define ETH_LINK_AUTONEG_DUPLEX 0
259 #define ETH_LINK_HALF_DUPLEX 1
260 #define ETH_LINK_FULL_DUPLEX 2
266 struct rte_eth_thresh {
275 #define ETH_MQ_RX_RSS_FLAG 0x1
276 #define ETH_MQ_RX_DCB_FLAG 0x2
277 #define ETH_MQ_RX_VMDQ_FLAG 0x4
308 #define ETH_RSS ETH_MQ_RX_RSS
309 #define VMDQ_DCB ETH_MQ_RX_VMDQ_DCB
310 #define ETH_DCB_RX ETH_MQ_RX_DCB
326 #define ETH_DCB_NONE ETH_MQ_TX_NONE
327 #define ETH_VMDQ_DCB_TX ETH_MQ_TX_VMDQ_DCB
328 #define ETH_DCB_TX ETH_MQ_TX_DCB
378 #define ETH_RSS_IPV4 (1ULL << RTE_ETH_FLOW_IPV4)
379 #define ETH_RSS_FRAG_IPV4 (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
380 #define ETH_RSS_NONFRAG_IPV4_TCP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
381 #define ETH_RSS_NONFRAG_IPV4_UDP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
382 #define ETH_RSS_NONFRAG_IPV4_SCTP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
383 #define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
384 #define ETH_RSS_IPV6 (1ULL << RTE_ETH_FLOW_IPV6)
385 #define ETH_RSS_FRAG_IPV6 (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
386 #define ETH_RSS_NONFRAG_IPV6_TCP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
387 #define ETH_RSS_NONFRAG_IPV6_UDP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
388 #define ETH_RSS_NONFRAG_IPV6_SCTP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
389 #define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
390 #define ETH_RSS_L2_PAYLOAD (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
391 #define ETH_RSS_IPV6_EX (1ULL << RTE_ETH_FLOW_IPV6_EX)
392 #define ETH_RSS_IPV6_TCP_EX (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
393 #define ETH_RSS_IPV6_UDP_EX (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
395 #define ETH_RSS_IP ( \
397 ETH_RSS_FRAG_IPV4 | \
398 ETH_RSS_NONFRAG_IPV4_OTHER | \
400 ETH_RSS_FRAG_IPV6 | \
401 ETH_RSS_NONFRAG_IPV6_OTHER | \
404 #define ETH_RSS_UDP ( \
405 ETH_RSS_NONFRAG_IPV4_UDP | \
406 ETH_RSS_NONFRAG_IPV6_UDP | \
409 #define ETH_RSS_TCP ( \
410 ETH_RSS_NONFRAG_IPV4_TCP | \
411 ETH_RSS_NONFRAG_IPV6_TCP | \
414 #define ETH_RSS_SCTP ( \
415 ETH_RSS_NONFRAG_IPV4_SCTP | \
416 ETH_RSS_NONFRAG_IPV6_SCTP)
419 #define ETH_RSS_PROTO_MASK ( \
421 ETH_RSS_FRAG_IPV4 | \
422 ETH_RSS_NONFRAG_IPV4_TCP | \
423 ETH_RSS_NONFRAG_IPV4_UDP | \
424 ETH_RSS_NONFRAG_IPV4_SCTP | \
425 ETH_RSS_NONFRAG_IPV4_OTHER | \
427 ETH_RSS_FRAG_IPV6 | \
428 ETH_RSS_NONFRAG_IPV6_TCP | \
429 ETH_RSS_NONFRAG_IPV6_UDP | \
430 ETH_RSS_NONFRAG_IPV6_SCTP | \
431 ETH_RSS_NONFRAG_IPV6_OTHER | \
432 ETH_RSS_L2_PAYLOAD | \
434 ETH_RSS_IPV6_TCP_EX | \
442 #define ETH_RSS_RETA_SIZE_64 64
443 #define ETH_RSS_RETA_SIZE_128 128
444 #define ETH_RSS_RETA_SIZE_512 512
445 #define RTE_RETA_GROUP_SIZE 64
448 #define ETH_VMDQ_MAX_VLAN_FILTERS 64
449 #define ETH_DCB_NUM_USER_PRIORITIES 8
450 #define ETH_VMDQ_DCB_NUM_QUEUES 128
451 #define ETH_DCB_NUM_QUEUES 128
454 #define ETH_DCB_PG_SUPPORT 0x00000001
455 #define ETH_DCB_PFC_SUPPORT 0x00000002
458 #define ETH_VLAN_STRIP_OFFLOAD 0x0001
459 #define ETH_VLAN_FILTER_OFFLOAD 0x0002
460 #define ETH_VLAN_EXTEND_OFFLOAD 0x0004
463 #define ETH_VLAN_STRIP_MASK 0x0001
464 #define ETH_VLAN_FILTER_MASK 0x0002
465 #define ETH_VLAN_EXTEND_MASK 0x0004
466 #define ETH_VLAN_ID_MAX 0x0FFF
469 #define ETH_NUM_RECEIVE_MAC_ADDR 128
472 #define ETH_VMDQ_NUM_UC_HASH_ARRAY 128
475 #define ETH_VMDQ_ACCEPT_UNTAG 0x0001
476 #define ETH_VMDQ_ACCEPT_HASH_MC 0x0002
477 #define ETH_VMDQ_ACCEPT_HASH_UC 0x0004
478 #define ETH_VMDQ_ACCEPT_BROADCAST 0x0008
479 #define ETH_VMDQ_ACCEPT_MULTICAST 0x0010
482 #define ETH_MIRROR_MAX_VLANS 64
484 #define ETH_MIRROR_VIRTUAL_POOL_UP 0x01
485 #define ETH_MIRROR_UPLINK_PORT 0x02
486 #define ETH_MIRROR_DOWNLINK_PORT 0x04
487 #define ETH_MIRROR_VLAN 0x08
488 #define ETH_MIRROR_VIRTUAL_POOL_DOWN 0x10
493 struct rte_eth_vlan_mirror {
519 uint8_t
reta[RTE_RETA_GROUP_SIZE];
544 struct rte_eth_dcb_rx_conf {
550 struct rte_eth_vmdq_dcb_tx_conf {
556 struct rte_eth_dcb_tx_conf {
562 struct rte_eth_vmdq_tx_conf {
590 struct rte_eth_vmdq_rx_conf {
592 uint8_t enable_default_pool;
593 uint8_t default_pool;
594 uint8_t enable_loop_back;
595 uint8_t nb_pool_maps;
629 #define ETH_TXQ_FLAGS_NOMULTSEGS 0x0001
630 #define ETH_TXQ_FLAGS_NOREFCOUNT 0x0002
631 #define ETH_TXQ_FLAGS_NOMULTMEMP 0x0004
632 #define ETH_TXQ_FLAGS_NOVLANOFFL 0x0100
633 #define ETH_TXQ_FLAGS_NOXSUMSCTP 0x0200
634 #define ETH_TXQ_FLAGS_NOXSUMUDP 0x0400
635 #define ETH_TXQ_FLAGS_NOXSUMTCP 0x0800
636 #define ETH_TXQ_FLAGS_NOOFFLOADS \
637 (ETH_TXQ_FLAGS_NOVLANOFFL | ETH_TXQ_FLAGS_NOXSUMSCTP | \
638 ETH_TXQ_FLAGS_NOXSUMUDP | ETH_TXQ_FLAGS_NOXSUMTCP)
639 #define ETH_TXQ_FLAGS_NOXSUMS \
640 (ETH_TXQ_FLAGS_NOXSUMSCTP | ETH_TXQ_FLAGS_NOXSUMUDP | \
641 ETH_TXQ_FLAGS_NOXSUMTCP)
904 #define DEV_RX_OFFLOAD_VLAN_STRIP 0x00000001
905 #define DEV_RX_OFFLOAD_IPV4_CKSUM 0x00000002
906 #define DEV_RX_OFFLOAD_UDP_CKSUM 0x00000004
907 #define DEV_RX_OFFLOAD_TCP_CKSUM 0x00000008
908 #define DEV_RX_OFFLOAD_TCP_LRO 0x00000010
909 #define DEV_RX_OFFLOAD_QINQ_STRIP 0x00000020
914 #define DEV_TX_OFFLOAD_VLAN_INSERT 0x00000001
915 #define DEV_TX_OFFLOAD_IPV4_CKSUM 0x00000002
916 #define DEV_TX_OFFLOAD_UDP_CKSUM 0x00000004
917 #define DEV_TX_OFFLOAD_TCP_CKSUM 0x00000008
918 #define DEV_TX_OFFLOAD_SCTP_CKSUM 0x00000010
919 #define DEV_TX_OFFLOAD_TCP_TSO 0x00000020
920 #define DEV_TX_OFFLOAD_UDP_TSO 0x00000040
921 #define DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000080
922 #define DEV_TX_OFFLOAD_QINQ_INSERT 0x00000100
924 struct rte_eth_dev_info {
926 const char *driver_name;
927 unsigned int if_index;
929 uint32_t min_rx_bufsize;
930 uint32_t max_rx_pktlen;
931 uint16_t max_rx_queues;
932 uint16_t max_tx_queues;
933 uint32_t max_mac_addrs;
934 uint32_t max_hash_mac_addrs;
937 uint16_t max_vmdq_pools;
938 uint32_t rx_offload_capa;
939 uint32_t tx_offload_capa;
942 uint8_t hash_key_size;
944 uint64_t flow_type_rss_offloads;
947 uint16_t vmdq_queue_base;
948 uint16_t vmdq_queue_num;
949 uint16_t vmdq_pool_base;
953 #define RTE_ETH_XSTATS_NAME_SIZE 64
969 struct rte_eth_dev_callback;
971 TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
979 typedef int (*eth_dev_configure_t)(
struct rte_eth_dev *dev);
982 typedef int (*eth_dev_start_t)(
struct rte_eth_dev *dev);
985 typedef void (*eth_dev_stop_t)(
struct rte_eth_dev *dev);
988 typedef int (*eth_dev_set_link_up_t)(
struct rte_eth_dev *dev);
991 typedef int (*eth_dev_set_link_down_t)(
struct rte_eth_dev *dev);
994 typedef void (*eth_dev_close_t)(
struct rte_eth_dev *dev);
997 typedef void (*eth_promiscuous_enable_t)(
struct rte_eth_dev *dev);
1000 typedef void (*eth_promiscuous_disable_t)(
struct rte_eth_dev *dev);
1003 typedef void (*eth_allmulticast_enable_t)(
struct rte_eth_dev *dev);
1006 typedef void (*eth_allmulticast_disable_t)(
struct rte_eth_dev *dev);
1009 typedef int (*eth_link_update_t)(
struct rte_eth_dev *dev,
1010 int wait_to_complete);
1013 typedef void (*eth_stats_get_t)(
struct rte_eth_dev *dev,
1017 typedef void (*eth_stats_reset_t)(
struct rte_eth_dev *dev);
1020 typedef int (*eth_xstats_get_t)(
struct rte_eth_dev *dev,
1024 typedef void (*eth_xstats_reset_t)(
struct rte_eth_dev *dev);
1027 typedef int (*eth_queue_stats_mapping_set_t)(
struct rte_eth_dev *dev,
1033 typedef void (*eth_dev_infos_get_t)(
struct rte_eth_dev *dev,
1034 struct rte_eth_dev_info *dev_info);
1037 typedef int (*eth_queue_start_t)(
struct rte_eth_dev *dev,
1041 typedef int (*eth_queue_stop_t)(
struct rte_eth_dev *dev,
1045 typedef int (*eth_rx_queue_setup_t)(
struct rte_eth_dev *dev,
1046 uint16_t rx_queue_id,
1047 uint16_t nb_rx_desc,
1048 unsigned int socket_id,
1053 typedef int (*eth_tx_queue_setup_t)(
struct rte_eth_dev *dev,
1054 uint16_t tx_queue_id,
1055 uint16_t nb_tx_desc,
1056 unsigned int socket_id,
1060 typedef int (*eth_rx_enable_intr_t)(
struct rte_eth_dev *dev,
1061 uint16_t rx_queue_id);
1064 typedef int (*eth_rx_disable_intr_t)(
struct rte_eth_dev *dev,
1065 uint16_t rx_queue_id);
1068 typedef void (*eth_queue_release_t)(
void *queue);
1071 typedef uint32_t (*eth_rx_queue_count_t)(
struct rte_eth_dev *dev,
1072 uint16_t rx_queue_id);
1075 typedef int (*eth_rx_descriptor_done_t)(
void *rxq, uint16_t offset);
1078 typedef int (*mtu_set_t)(
struct rte_eth_dev *dev, uint16_t mtu);
1081 typedef int (*vlan_filter_set_t)(
struct rte_eth_dev *dev,
1086 typedef void (*vlan_tpid_set_t)(
struct rte_eth_dev *dev,
1090 typedef void (*vlan_offload_set_t)(
struct rte_eth_dev *dev,
int mask);
1093 typedef int (*vlan_pvid_set_t)(
struct rte_eth_dev *dev,
1098 typedef void (*vlan_strip_queue_set_t)(
struct rte_eth_dev *dev,
1099 uint16_t rx_queue_id,
1103 typedef uint16_t (*eth_rx_burst_t)(
void *rxq,
1108 typedef uint16_t (*eth_tx_burst_t)(
void *txq,
1113 typedef int (*fdir_add_signature_filter_t)(
struct rte_eth_dev *dev,
1118 typedef int (*fdir_update_signature_filter_t)(
struct rte_eth_dev *dev,
1123 typedef int (*fdir_remove_signature_filter_t)(
struct rte_eth_dev *dev,
1127 typedef void (*fdir_infos_get_t)(
struct rte_eth_dev *dev,
1131 typedef int (*fdir_add_perfect_filter_t)(
struct rte_eth_dev *dev,
1133 uint16_t soft_id, uint8_t rx_queue,
1137 typedef int (*fdir_update_perfect_filter_t)(
struct rte_eth_dev *dev,
1139 uint16_t soft_id, uint8_t rx_queue,
1143 typedef int (*fdir_remove_perfect_filter_t)(
struct rte_eth_dev *dev,
1148 typedef int (*fdir_set_masks_t)(
struct rte_eth_dev *dev,
1152 typedef int (*flow_ctrl_get_t)(
struct rte_eth_dev *dev,
1156 typedef int (*flow_ctrl_set_t)(
struct rte_eth_dev *dev,
1160 typedef int (*priority_flow_ctrl_set_t)(
struct rte_eth_dev *dev,
1164 typedef int (*reta_update_t)(
struct rte_eth_dev *dev,
1166 uint16_t reta_size);
1169 typedef int (*reta_query_t)(
struct rte_eth_dev *dev,
1171 uint16_t reta_size);
1174 typedef int (*rss_hash_update_t)(
struct rte_eth_dev *dev,
1178 typedef int (*rss_hash_conf_get_t)(
struct rte_eth_dev *dev,
1182 typedef int (*eth_dev_led_on_t)(
struct rte_eth_dev *dev);
1185 typedef int (*eth_dev_led_off_t)(
struct rte_eth_dev *dev);
1188 typedef void (*eth_mac_addr_remove_t)(
struct rte_eth_dev *dev, uint32_t index);
1191 typedef void (*eth_mac_addr_add_t)(
struct rte_eth_dev *dev,
1197 typedef void (*eth_mac_addr_set_t)(
struct rte_eth_dev *dev,
1201 typedef int (*eth_uc_hash_table_set_t)(
struct rte_eth_dev *dev,
1206 typedef int (*eth_uc_all_hash_table_set_t)(
struct rte_eth_dev *dev,
1210 typedef int (*eth_set_vf_rx_mode_t)(
struct rte_eth_dev *dev,
1216 typedef int (*eth_set_vf_rx_t)(
struct rte_eth_dev *dev,
1221 typedef int (*eth_set_vf_tx_t)(
struct rte_eth_dev *dev,
1226 typedef int (*eth_set_vf_vlan_filter_t)(
struct rte_eth_dev *dev,
1232 typedef int (*eth_set_queue_rate_limit_t)(
struct rte_eth_dev *dev,
1237 typedef int (*eth_set_vf_rate_limit_t)(
struct rte_eth_dev *dev,
1243 typedef int (*eth_mirror_rule_set_t)(
struct rte_eth_dev *dev,
1249 typedef int (*eth_mirror_rule_reset_t)(
struct rte_eth_dev *dev,
1253 typedef int (*eth_udp_tunnel_add_t)(
struct rte_eth_dev *dev,
1257 typedef int (*eth_udp_tunnel_del_t)(
struct rte_eth_dev *dev,
1261 typedef int (*eth_set_mc_addr_list_t)(
struct rte_eth_dev *dev,
1263 uint32_t nb_mc_addr);
1266 typedef int (*eth_timesync_enable_t)(
struct rte_eth_dev *dev);
1269 typedef int (*eth_timesync_disable_t)(
struct rte_eth_dev *dev);
1272 typedef int (*eth_timesync_read_rx_timestamp_t)(
struct rte_eth_dev *dev,
1273 struct timespec *timestamp,
1277 typedef int (*eth_timesync_read_tx_timestamp_t)(
struct rte_eth_dev *dev,
1278 struct timespec *timestamp);
1281 typedef int (*eth_get_reg_length_t)(
struct rte_eth_dev *dev);
1284 typedef int (*eth_get_reg_t)(
struct rte_eth_dev *dev,
1285 struct rte_dev_reg_info *info);
1288 typedef int (*eth_get_eeprom_length_t)(
struct rte_eth_dev *dev);
1291 typedef int (*eth_get_eeprom_t)(
struct rte_eth_dev *dev,
1292 struct rte_dev_eeprom_info *info);
1295 typedef int (*eth_set_eeprom_t)(
struct rte_eth_dev *dev,
1296 struct rte_dev_eeprom_info *info);
1299 #ifdef RTE_NIC_BYPASS
1302 RTE_BYPASS_MODE_NONE,
1303 RTE_BYPASS_MODE_NORMAL,
1304 RTE_BYPASS_MODE_BYPASS,
1305 RTE_BYPASS_MODE_ISOLATE,
1306 RTE_BYPASS_MODE_NUM,
1309 #define RTE_BYPASS_MODE_VALID(x) \
1310 ((x) > RTE_BYPASS_MODE_NONE && (x) < RTE_BYPASS_MODE_NUM)
1313 RTE_BYPASS_EVENT_NONE,
1314 RTE_BYPASS_EVENT_START,
1315 RTE_BYPASS_EVENT_OS_ON = RTE_BYPASS_EVENT_START,
1316 RTE_BYPASS_EVENT_POWER_ON,
1317 RTE_BYPASS_EVENT_OS_OFF,
1318 RTE_BYPASS_EVENT_POWER_OFF,
1319 RTE_BYPASS_EVENT_TIMEOUT,
1320 RTE_BYPASS_EVENT_NUM
1323 #define RTE_BYPASS_EVENT_VALID(x) \
1324 ((x) > RTE_BYPASS_EVENT_NONE && (x) < RTE_BYPASS_MODE_NUM)
1328 RTE_BYPASS_TMT_1_5_SEC,
1329 RTE_BYPASS_TMT_2_SEC,
1330 RTE_BYPASS_TMT_3_SEC,
1331 RTE_BYPASS_TMT_4_SEC,
1332 RTE_BYPASS_TMT_8_SEC,
1333 RTE_BYPASS_TMT_16_SEC,
1334 RTE_BYPASS_TMT_32_SEC,
1338 #define RTE_BYPASS_TMT_VALID(x) \
1339 ((x) == RTE_BYPASS_TMT_OFF || \
1340 ((x) > RTE_BYPASS_TMT_OFF && (x) < RTE_BYPASS_TMT_NUM))
1342 typedef void (*bypass_init_t)(
struct rte_eth_dev *dev);
1343 typedef int32_t (*bypass_state_set_t)(
struct rte_eth_dev *dev, uint32_t *new_state);
1344 typedef int32_t (*bypass_state_show_t)(
struct rte_eth_dev *dev, uint32_t *state);
1345 typedef int32_t (*bypass_event_set_t)(
struct rte_eth_dev *dev, uint32_t state, uint32_t event);
1346 typedef int32_t (*bypass_event_show_t)(
struct rte_eth_dev *dev, uint32_t event_shift, uint32_t *event);
1347 typedef int32_t (*bypass_wd_timeout_set_t)(
struct rte_eth_dev *dev, uint32_t timeout);
1348 typedef int32_t (*bypass_wd_timeout_show_t)(
struct rte_eth_dev *dev, uint32_t *wd_timeout);
1349 typedef int32_t (*bypass_ver_show_t)(
struct rte_eth_dev *dev, uint32_t *ver);
1350 typedef int32_t (*bypass_wd_reset_t)(
struct rte_eth_dev *dev);
1353 typedef int (*eth_filter_ctrl_t)(
struct rte_eth_dev *dev,
1362 struct eth_dev_ops {
1363 eth_dev_configure_t dev_configure;
1364 eth_dev_start_t dev_start;
1365 eth_dev_stop_t dev_stop;
1366 eth_dev_set_link_up_t dev_set_link_up;
1367 eth_dev_set_link_down_t dev_set_link_down;
1368 eth_dev_close_t dev_close;
1369 eth_promiscuous_enable_t promiscuous_enable;
1370 eth_promiscuous_disable_t promiscuous_disable;
1371 eth_allmulticast_enable_t allmulticast_enable;
1372 eth_allmulticast_disable_t allmulticast_disable;
1373 eth_link_update_t link_update;
1374 eth_stats_get_t stats_get;
1375 eth_stats_reset_t stats_reset;
1376 eth_xstats_get_t xstats_get;
1377 eth_xstats_reset_t xstats_reset;
1378 eth_queue_stats_mapping_set_t queue_stats_mapping_set;
1380 eth_dev_infos_get_t dev_infos_get;
1382 vlan_filter_set_t vlan_filter_set;
1383 vlan_tpid_set_t vlan_tpid_set;
1384 vlan_strip_queue_set_t vlan_strip_queue_set;
1385 vlan_offload_set_t vlan_offload_set;
1386 vlan_pvid_set_t vlan_pvid_set;
1387 eth_queue_start_t rx_queue_start;
1388 eth_queue_stop_t rx_queue_stop;
1389 eth_queue_start_t tx_queue_start;
1390 eth_queue_stop_t tx_queue_stop;
1391 eth_rx_queue_setup_t rx_queue_setup;
1392 eth_queue_release_t rx_queue_release;
1393 eth_rx_queue_count_t rx_queue_count;
1394 eth_rx_descriptor_done_t rx_descriptor_done;
1397 eth_rx_enable_intr_t rx_queue_intr_enable;
1399 eth_rx_disable_intr_t rx_queue_intr_disable;
1401 eth_tx_queue_setup_t tx_queue_setup;
1402 eth_queue_release_t tx_queue_release;
1403 eth_dev_led_on_t dev_led_on;
1404 eth_dev_led_off_t dev_led_off;
1405 flow_ctrl_get_t flow_ctrl_get;
1406 flow_ctrl_set_t flow_ctrl_set;
1407 priority_flow_ctrl_set_t priority_flow_ctrl_set;
1408 eth_mac_addr_remove_t mac_addr_remove;
1409 eth_mac_addr_add_t mac_addr_add;
1410 eth_mac_addr_set_t mac_addr_set;
1411 eth_uc_hash_table_set_t uc_hash_table_set;
1412 eth_uc_all_hash_table_set_t uc_all_hash_table_set;
1413 eth_mirror_rule_set_t mirror_rule_set;
1414 eth_mirror_rule_reset_t mirror_rule_reset;
1415 eth_set_vf_rx_mode_t set_vf_rx_mode;
1416 eth_set_vf_rx_t set_vf_rx;
1417 eth_set_vf_tx_t set_vf_tx;
1418 eth_set_vf_vlan_filter_t set_vf_vlan_filter;
1419 eth_udp_tunnel_add_t udp_tunnel_add;
1420 eth_udp_tunnel_del_t udp_tunnel_del;
1421 eth_set_queue_rate_limit_t set_queue_rate_limit;
1422 eth_set_vf_rate_limit_t set_vf_rate_limit;
1425 fdir_add_signature_filter_t fdir_add_signature_filter;
1427 fdir_update_signature_filter_t fdir_update_signature_filter;
1429 fdir_remove_signature_filter_t fdir_remove_signature_filter;
1431 fdir_infos_get_t fdir_infos_get;
1433 fdir_add_perfect_filter_t fdir_add_perfect_filter;
1435 fdir_update_perfect_filter_t fdir_update_perfect_filter;
1437 fdir_remove_perfect_filter_t fdir_remove_perfect_filter;
1439 fdir_set_masks_t fdir_set_masks;
1441 reta_update_t reta_update;
1443 reta_query_t reta_query;
1445 eth_get_reg_length_t get_reg_length;
1447 eth_get_reg_t get_reg;
1449 eth_get_eeprom_length_t get_eeprom_length;
1451 eth_get_eeprom_t get_eeprom;
1453 eth_set_eeprom_t set_eeprom;
1456 #ifdef RTE_NIC_BYPASS
1457 bypass_init_t bypass_init;
1458 bypass_state_set_t bypass_state_set;
1459 bypass_state_show_t bypass_state_show;
1460 bypass_event_set_t bypass_event_set;
1461 bypass_event_show_t bypass_event_show;
1462 bypass_wd_timeout_set_t bypass_wd_timeout_set;
1463 bypass_wd_timeout_show_t bypass_wd_timeout_show;
1464 bypass_ver_show_t bypass_ver_show;
1465 bypass_wd_reset_t bypass_wd_reset;
1469 rss_hash_update_t rss_hash_update;
1471 rss_hash_conf_get_t rss_hash_conf_get;
1472 eth_filter_ctrl_t filter_ctrl;
1473 eth_set_mc_addr_list_t set_mc_addr_list;
1476 eth_timesync_enable_t timesync_enable;
1478 eth_timesync_disable_t timesync_disable;
1480 eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
1482 eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
1508 struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts,
1532 struct rte_mbuf *pkts[], uint16_t nb_pkts,
void *user_param);
1539 struct rte_eth_rxtx_callback {
1540 struct rte_eth_rxtx_callback *next;
1569 struct rte_eth_dev {
1570 eth_rx_burst_t rx_pkt_burst;
1571 eth_tx_burst_t tx_pkt_burst;
1572 struct rte_eth_dev_data *data;
1573 const struct eth_driver *driver;
1574 const struct eth_dev_ops *dev_ops;
1577 struct rte_eth_dev_cb_list link_intr_cbs;
1582 struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
1587 struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
1592 struct rte_eth_dev_sriov {
1594 uint8_t nb_q_per_pool;
1595 uint16_t def_vmdq_idx;
1596 uint16_t def_pool_q_idx;
1598 #define RTE_ETH_DEV_SRIOV(dev) ((dev)->data->sriov)
1600 #define RTE_ETH_NAME_MAX_LEN (32)
1609 struct rte_eth_dev_data {
1610 char name[RTE_ETH_NAME_MAX_LEN];
1614 uint16_t nb_rx_queues;
1615 uint16_t nb_tx_queues;
1617 struct rte_eth_dev_sriov sriov;
1627 uint32_t min_rx_buf_size;
1630 uint64_t rx_mbuf_alloc_failed;
1637 uint8_t promiscuous : 1,
1649 extern struct rte_eth_dev rte_eth_devices[];
1675 extern struct rte_eth_dev *rte_eth_dev_allocated(
const char *name);
1687 struct rte_eth_dev *rte_eth_dev_allocate(
const char *name,
1699 int rte_eth_dev_release_port(
struct rte_eth_dev *eth_dev);
1760 typedef int (*eth_dev_init_t)(
struct rte_eth_dev *eth_dev);
1777 typedef int (*eth_dev_uninit_t)(
struct rte_eth_dev *eth_dev);
1796 eth_dev_init_t eth_dev_init;
1797 eth_dev_uninit_t eth_dev_uninit;
1798 unsigned int dev_private_size;
1811 extern void rte_eth_driver_register(
struct eth_driver *eth_drv);
1843 uint16_t nb_rx_queue,
1844 uint16_t nb_tx_queue,
1887 uint16_t nb_rx_desc,
unsigned int socket_id,
1935 uint16_t nb_tx_desc,
unsigned int socket_id,
1948 extern int rte_eth_dev_socket_id(uint8_t port_id);
1959 extern int rte_eth_dev_is_valid_port(uint8_t port_id);
1977 extern int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id);
1993 extern int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id);
2010 extern int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id);
2026 extern int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id);
2252 uint16_t tx_queue_id,
2273 uint16_t rx_queue_id,
2297 struct rte_eth_dev_info *dev_info);
2367 uint16_t rx_queue_id,
int on);
2519 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
2521 struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
2523 static inline uint16_t
2525 struct rte_mbuf **rx_pkts,
const uint16_t nb_pkts)
2527 struct rte_eth_dev *dev;
2529 dev = &rte_eth_devices[port_id];
2531 int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
2534 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
2535 struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
2539 nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
2540 nb_pkts, cb->param);
2542 }
while (cb != NULL);
2560 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
2563 static inline uint32_t
2566 struct rte_eth_dev *dev;
2568 dev = &rte_eth_devices[port_id];
2569 return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
2587 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
2595 struct rte_eth_dev *dev;
2597 dev = &rte_eth_devices[port_id];
2598 return (*dev->dev_ops->rx_descriptor_done)( \
2599 dev->data->rx_queues[queue_id], offset);
2661 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
2663 struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
2665 static inline uint16_t
2667 struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
2669 struct rte_eth_dev *dev;
2671 dev = &rte_eth_devices[port_id];
2673 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
2674 struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
2678 nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
2681 }
while (cb != NULL);
2685 return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
2808 uint16_t soft_id, uint8_t rx_queue,
2842 uint16_t soft_id, uint8_t rx_queue,
2974 void _rte_eth_dev_callback_process(
struct rte_eth_dev *dev,
3061 int epfd,
int op,
void *data);
3210 uint16_t reta_size);
3229 uint16_t reta_size);
3436 uint16_t tx_rate, uint64_t q_msk);
3792 struct rte_eth_rxtx_callback *user_cb);
3825 struct rte_eth_rxtx_callback *user_cb);
3919 uint32_t nb_mc_addr);
3965 struct timespec *timestamp,
3983 struct timespec *timestamp);