149 #define RTE_ETHDEV_HAS_LRO_SUPPORT 151 #include <rte_compat.h> 158 #include <rte_config.h> 161 #include "rte_dev_info.h" 163 extern int rte_eth_dev_logtype;
165 #define RTE_ETHDEV_LOG(level, ...) \ 166 rte_log(RTE_LOG_ ## level, rte_eth_dev_logtype, "" __VA_ARGS__) 231 #define RTE_ETH_FOREACH_MATCHING_DEV(id, devargs, iter) \ 232 for (rte_eth_iterator_init(iter, devargs), \ 233 id = rte_eth_iterator_next(iter); \ 234 id != RTE_MAX_ETHPORTS; \ 235 id = rte_eth_iterator_next(iter)) 270 #define ETH_LINK_SPEED_AUTONEG (0 << 0) 271 #define ETH_LINK_SPEED_FIXED (1 << 0) 272 #define ETH_LINK_SPEED_10M_HD (1 << 1) 273 #define ETH_LINK_SPEED_10M (1 << 2) 274 #define ETH_LINK_SPEED_100M_HD (1 << 3) 275 #define ETH_LINK_SPEED_100M (1 << 4) 276 #define ETH_LINK_SPEED_1G (1 << 5) 277 #define ETH_LINK_SPEED_2_5G (1 << 6) 278 #define ETH_LINK_SPEED_5G (1 << 7) 279 #define ETH_LINK_SPEED_10G (1 << 8) 280 #define ETH_LINK_SPEED_20G (1 << 9) 281 #define ETH_LINK_SPEED_25G (1 << 10) 282 #define ETH_LINK_SPEED_40G (1 << 11) 283 #define ETH_LINK_SPEED_50G (1 << 12) 284 #define ETH_LINK_SPEED_56G (1 << 13) 285 #define ETH_LINK_SPEED_100G (1 << 14) 290 #define ETH_SPEED_NUM_NONE 0 291 #define ETH_SPEED_NUM_10M 10 292 #define ETH_SPEED_NUM_100M 100 293 #define ETH_SPEED_NUM_1G 1000 294 #define ETH_SPEED_NUM_2_5G 2500 295 #define ETH_SPEED_NUM_5G 5000 296 #define ETH_SPEED_NUM_10G 10000 297 #define ETH_SPEED_NUM_20G 20000 298 #define ETH_SPEED_NUM_25G 25000 299 #define ETH_SPEED_NUM_40G 40000 300 #define ETH_SPEED_NUM_50G 50000 301 #define ETH_SPEED_NUM_56G 56000 302 #define ETH_SPEED_NUM_100G 100000 313 } __attribute__((aligned(8)));
316 #define ETH_LINK_HALF_DUPLEX 0 317 #define ETH_LINK_FULL_DUPLEX 1 318 #define ETH_LINK_DOWN 0 319 #define ETH_LINK_UP 1 320 #define ETH_LINK_FIXED 0 321 #define ETH_LINK_AUTONEG 1 327 struct rte_eth_thresh { 336 #define ETH_MQ_RX_RSS_FLAG 0x1 337 #define ETH_MQ_RX_DCB_FLAG 0x2 338 #define ETH_MQ_RX_VMDQ_FLAG 0x4 369 #define ETH_RSS ETH_MQ_RX_RSS 370 #define VMDQ_DCB ETH_MQ_RX_VMDQ_DCB 371 #define ETH_DCB_RX ETH_MQ_RX_DCB 387 #define ETH_DCB_NONE ETH_MQ_TX_NONE 388 #define ETH_VMDQ_DCB_TX ETH_MQ_TX_VMDQ_DCB 389 #define ETH_DCB_TX ETH_MQ_TX_DCB 408 uint64_t reserved_64s[2];
409 void *reserved_ptrs[2];
417 ETH_VLAN_TYPE_UNKNOWN = 0,
462 #define RTE_ETH_FLOW_UNKNOWN 0 463 #define RTE_ETH_FLOW_RAW 1 464 #define RTE_ETH_FLOW_IPV4 2 465 #define RTE_ETH_FLOW_FRAG_IPV4 3 466 #define RTE_ETH_FLOW_NONFRAG_IPV4_TCP 4 467 #define RTE_ETH_FLOW_NONFRAG_IPV4_UDP 5 468 #define RTE_ETH_FLOW_NONFRAG_IPV4_SCTP 6 469 #define RTE_ETH_FLOW_NONFRAG_IPV4_OTHER 7 470 #define RTE_ETH_FLOW_IPV6 8 471 #define RTE_ETH_FLOW_FRAG_IPV6 9 472 #define RTE_ETH_FLOW_NONFRAG_IPV6_TCP 10 473 #define RTE_ETH_FLOW_NONFRAG_IPV6_UDP 11 474 #define RTE_ETH_FLOW_NONFRAG_IPV6_SCTP 12 475 #define RTE_ETH_FLOW_NONFRAG_IPV6_OTHER 13 476 #define RTE_ETH_FLOW_L2_PAYLOAD 14 477 #define RTE_ETH_FLOW_IPV6_EX 15 478 #define RTE_ETH_FLOW_IPV6_TCP_EX 16 479 #define RTE_ETH_FLOW_IPV6_UDP_EX 17 480 #define RTE_ETH_FLOW_PORT 18 482 #define RTE_ETH_FLOW_VXLAN 19 483 #define RTE_ETH_FLOW_GENEVE 20 484 #define RTE_ETH_FLOW_NVGRE 21 485 #define RTE_ETH_FLOW_VXLAN_GPE 22 486 #define RTE_ETH_FLOW_GTPU 23 487 #define RTE_ETH_FLOW_MAX 24 493 #define ETH_RSS_IPV4 (1ULL << 2) 494 #define ETH_RSS_FRAG_IPV4 (1ULL << 3) 495 #define ETH_RSS_NONFRAG_IPV4_TCP (1ULL << 4) 496 #define ETH_RSS_NONFRAG_IPV4_UDP (1ULL << 5) 497 #define ETH_RSS_NONFRAG_IPV4_SCTP (1ULL << 6) 498 #define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7) 499 #define ETH_RSS_IPV6 (1ULL << 8) 500 #define ETH_RSS_FRAG_IPV6 (1ULL << 9) 501 #define ETH_RSS_NONFRAG_IPV6_TCP (1ULL << 10) 502 #define ETH_RSS_NONFRAG_IPV6_UDP (1ULL << 11) 503 #define ETH_RSS_NONFRAG_IPV6_SCTP (1ULL << 12) 504 #define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13) 505 #define ETH_RSS_L2_PAYLOAD (1ULL << 14) 506 #define ETH_RSS_IPV6_EX (1ULL << 15) 507 #define ETH_RSS_IPV6_TCP_EX (1ULL << 16) 508 #define ETH_RSS_IPV6_UDP_EX (1ULL << 17) 509 #define ETH_RSS_PORT (1ULL << 18) 510 #define ETH_RSS_VXLAN (1ULL << 19) 511 #define ETH_RSS_GENEVE (1ULL << 20) 512 #define ETH_RSS_NVGRE (1ULL << 21) 513 #define ETH_RSS_GTPU (1ULL << 23) 524 #define ETH_RSS_L3_SRC_ONLY (1ULL << 63) 525 #define ETH_RSS_L3_DST_ONLY (1ULL << 62) 526 #define ETH_RSS_L4_SRC_ONLY (1ULL << 61) 527 #define ETH_RSS_L4_DST_ONLY (1ULL << 60) 539 static inline uint64_t
542 if ((rss_hf & ETH_RSS_L3_SRC_ONLY) && (rss_hf & ETH_RSS_L3_DST_ONLY))
543 rss_hf &= ~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
545 if ((rss_hf & ETH_RSS_L4_SRC_ONLY) && (rss_hf & ETH_RSS_L4_DST_ONLY))
546 rss_hf &= ~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
551 #define ETH_RSS_IP ( \ 553 ETH_RSS_FRAG_IPV4 | \ 554 ETH_RSS_NONFRAG_IPV4_OTHER | \ 556 ETH_RSS_FRAG_IPV6 | \ 557 ETH_RSS_NONFRAG_IPV6_OTHER | \ 560 #define ETH_RSS_UDP ( \ 561 ETH_RSS_NONFRAG_IPV4_UDP | \ 562 ETH_RSS_NONFRAG_IPV6_UDP | \ 565 #define ETH_RSS_TCP ( \ 566 ETH_RSS_NONFRAG_IPV4_TCP | \ 567 ETH_RSS_NONFRAG_IPV6_TCP | \ 570 #define ETH_RSS_SCTP ( \ 571 ETH_RSS_NONFRAG_IPV4_SCTP | \ 572 ETH_RSS_NONFRAG_IPV6_SCTP) 574 #define ETH_RSS_TUNNEL ( \ 580 #define ETH_RSS_PROTO_MASK ( \ 582 ETH_RSS_FRAG_IPV4 | \ 583 ETH_RSS_NONFRAG_IPV4_TCP | \ 584 ETH_RSS_NONFRAG_IPV4_UDP | \ 585 ETH_RSS_NONFRAG_IPV4_SCTP | \ 586 ETH_RSS_NONFRAG_IPV4_OTHER | \ 588 ETH_RSS_FRAG_IPV6 | \ 589 ETH_RSS_NONFRAG_IPV6_TCP | \ 590 ETH_RSS_NONFRAG_IPV6_UDP | \ 591 ETH_RSS_NONFRAG_IPV6_SCTP | \ 592 ETH_RSS_NONFRAG_IPV6_OTHER | \ 593 ETH_RSS_L2_PAYLOAD | \ 595 ETH_RSS_IPV6_TCP_EX | \ 596 ETH_RSS_IPV6_UDP_EX | \ 607 #define ETH_RSS_RETA_SIZE_64 64 608 #define ETH_RSS_RETA_SIZE_128 128 609 #define ETH_RSS_RETA_SIZE_256 256 610 #define ETH_RSS_RETA_SIZE_512 512 611 #define RTE_RETA_GROUP_SIZE 64 614 #define ETH_VMDQ_MAX_VLAN_FILTERS 64 615 #define ETH_DCB_NUM_USER_PRIORITIES 8 616 #define ETH_VMDQ_DCB_NUM_QUEUES 128 617 #define ETH_DCB_NUM_QUEUES 128 620 #define ETH_DCB_PG_SUPPORT 0x00000001 621 #define ETH_DCB_PFC_SUPPORT 0x00000002 624 #define ETH_VLAN_STRIP_OFFLOAD 0x0001 625 #define ETH_VLAN_FILTER_OFFLOAD 0x0002 626 #define ETH_VLAN_EXTEND_OFFLOAD 0x0004 627 #define ETH_QINQ_STRIP_OFFLOAD 0x0008 630 #define ETH_VLAN_STRIP_MASK 0x0001 631 #define ETH_VLAN_FILTER_MASK 0x0002 632 #define ETH_VLAN_EXTEND_MASK 0x0004 633 #define ETH_QINQ_STRIP_MASK 0x0008 634 #define ETH_VLAN_ID_MAX 0x0FFF 637 #define ETH_NUM_RECEIVE_MAC_ADDR 128 640 #define ETH_VMDQ_NUM_UC_HASH_ARRAY 128 643 #define ETH_VMDQ_ACCEPT_UNTAG 0x0001 644 #define ETH_VMDQ_ACCEPT_HASH_MC 0x0002 645 #define ETH_VMDQ_ACCEPT_HASH_UC 0x0004 646 #define ETH_VMDQ_ACCEPT_BROADCAST 0x0008 647 #define ETH_VMDQ_ACCEPT_MULTICAST 0x0010 650 #define ETH_MIRROR_MAX_VLANS 64 652 #define ETH_MIRROR_VIRTUAL_POOL_UP 0x01 653 #define ETH_MIRROR_UPLINK_PORT 0x02 654 #define ETH_MIRROR_DOWNLINK_PORT 0x04 655 #define ETH_MIRROR_VLAN 0x08 656 #define ETH_MIRROR_VIRTUAL_POOL_DOWN 0x10 661 struct rte_eth_vlan_mirror { 687 uint16_t reta[RTE_RETA_GROUP_SIZE];
712 struct rte_eth_dcb_rx_conf {
718 struct rte_eth_vmdq_dcb_tx_conf {
724 struct rte_eth_dcb_tx_conf {
730 struct rte_eth_vmdq_tx_conf {
804 uint8_t hw_vlan_reject_tagged : 1,
806 hw_vlan_reject_untagged : 1,
808 hw_vlan_insert_pvid : 1;
811 uint64_t reserved_64s[2];
812 void *reserved_ptrs[2];
830 uint64_t reserved_64s[2];
831 void *reserved_ptrs[2];
851 uint64_t reserved_64s[2];
852 void *reserved_ptrs[2];
871 #define RTE_ETH_MAX_HAIRPIN_PEERS 32 966 RTE_TUNNEL_TYPE_NONE = 0,
967 RTE_TUNNEL_TYPE_VXLAN,
968 RTE_TUNNEL_TYPE_GENEVE,
969 RTE_TUNNEL_TYPE_TEREDO,
970 RTE_TUNNEL_TYPE_NVGRE,
971 RTE_TUNNEL_TYPE_IP_IN_GRE,
972 RTE_L2_TUNNEL_TYPE_E_TAG,
973 RTE_TUNNEL_TYPE_VXLAN_GPE,
1064 struct rte_eth_dcb_rx_conf dcb_rx_conf;
1070 struct rte_eth_vmdq_dcb_tx_conf vmdq_dcb_tx_conf;
1072 struct rte_eth_dcb_tx_conf dcb_tx_conf;
1074 struct rte_eth_vmdq_tx_conf vmdq_tx_conf;
1087 #define DEV_RX_OFFLOAD_VLAN_STRIP 0x00000001 1088 #define DEV_RX_OFFLOAD_IPV4_CKSUM 0x00000002 1089 #define DEV_RX_OFFLOAD_UDP_CKSUM 0x00000004 1090 #define DEV_RX_OFFLOAD_TCP_CKSUM 0x00000008 1091 #define DEV_RX_OFFLOAD_TCP_LRO 0x00000010 1092 #define DEV_RX_OFFLOAD_QINQ_STRIP 0x00000020 1093 #define DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000040 1094 #define DEV_RX_OFFLOAD_MACSEC_STRIP 0x00000080 1095 #define DEV_RX_OFFLOAD_HEADER_SPLIT 0x00000100 1096 #define DEV_RX_OFFLOAD_VLAN_FILTER 0x00000200 1097 #define DEV_RX_OFFLOAD_VLAN_EXTEND 0x00000400 1098 #define DEV_RX_OFFLOAD_JUMBO_FRAME 0x00000800 1099 #define DEV_RX_OFFLOAD_SCATTER 0x00002000 1100 #define DEV_RX_OFFLOAD_TIMESTAMP 0x00004000 1101 #define DEV_RX_OFFLOAD_SECURITY 0x00008000 1102 #define DEV_RX_OFFLOAD_KEEP_CRC 0x00010000 1103 #define DEV_RX_OFFLOAD_SCTP_CKSUM 0x00020000 1104 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM 0x00040000 1105 #define DEV_RX_OFFLOAD_RSS_HASH 0x00080000 1107 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \ 1108 DEV_RX_OFFLOAD_UDP_CKSUM | \ 1109 DEV_RX_OFFLOAD_TCP_CKSUM) 1110 #define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \ 1111 DEV_RX_OFFLOAD_VLAN_FILTER | \ 1112 DEV_RX_OFFLOAD_VLAN_EXTEND | \ 1113 DEV_RX_OFFLOAD_QINQ_STRIP) 1123 #define DEV_TX_OFFLOAD_VLAN_INSERT 0x00000001 1124 #define DEV_TX_OFFLOAD_IPV4_CKSUM 0x00000002 1125 #define DEV_TX_OFFLOAD_UDP_CKSUM 0x00000004 1126 #define DEV_TX_OFFLOAD_TCP_CKSUM 0x00000008 1127 #define DEV_TX_OFFLOAD_SCTP_CKSUM 0x00000010 1128 #define DEV_TX_OFFLOAD_TCP_TSO 0x00000020 1129 #define DEV_TX_OFFLOAD_UDP_TSO 0x00000040 1130 #define DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000080 1131 #define DEV_TX_OFFLOAD_QINQ_INSERT 0x00000100 1132 #define DEV_TX_OFFLOAD_VXLAN_TNL_TSO 0x00000200 1133 #define DEV_TX_OFFLOAD_GRE_TNL_TSO 0x00000400 1134 #define DEV_TX_OFFLOAD_IPIP_TNL_TSO 0x00000800 1135 #define DEV_TX_OFFLOAD_GENEVE_TNL_TSO 0x00001000 1136 #define DEV_TX_OFFLOAD_MACSEC_INSERT 0x00002000 1137 #define DEV_TX_OFFLOAD_MT_LOCKFREE 0x00004000 1141 #define DEV_TX_OFFLOAD_MULTI_SEGS 0x00008000 1143 #define DEV_TX_OFFLOAD_MBUF_FAST_FREE 0x00010000 1148 #define DEV_TX_OFFLOAD_SECURITY 0x00020000 1154 #define DEV_TX_OFFLOAD_UDP_TNL_TSO 0x00040000 1160 #define DEV_TX_OFFLOAD_IP_TNL_TSO 0x00080000 1162 #define DEV_TX_OFFLOAD_OUTER_UDP_CKSUM 0x00100000 1172 #define RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP 0x00000001 1174 #define RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP 0x00000002 1182 #define RTE_ETH_DEV_FALLBACK_RX_RINGSIZE 512 1183 #define RTE_ETH_DEV_FALLBACK_TX_RINGSIZE 512 1184 #define RTE_ETH_DEV_FALLBACK_RX_NBQUEUES 1 1185 #define RTE_ETH_DEV_FALLBACK_TX_NBQUEUES 1 1202 #define RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID (UINT16_MAX) 1284 uint64_t reserved_64s[2];
1285 void *reserved_ptrs[2];
1315 #define RTE_ETH_BURST_FLAG_PER_QUEUE (1ULL << 0) 1324 #define RTE_ETH_BURST_MODE_INFO_SIZE 1024 1325 char info[RTE_ETH_BURST_MODE_INFO_SIZE]; 1329 #define RTE_ETH_XSTATS_NAME_SIZE 64 1356 #define ETH_DCB_NUM_TCS 8 1357 #define ETH_MAX_VMDQ_POOL 64 1368 } tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
1373 } tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
1383 uint8_t tc_bws[ETH_DCB_NUM_TCS];
1388 #define RTE_ETH_ALL RTE_MAX_ETHPORTS 1391 #define RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, retval) do { \ 1392 if (!rte_eth_dev_is_valid_port(port_id)) { \ 1393 RTE_ETHDEV_LOG(ERR, "Invalid port_id=%u\n", port_id); \ 1398 #define RTE_ETH_VALID_PORTID_OR_RET(port_id) do { \ 1399 if (!rte_eth_dev_is_valid_port(port_id)) { \ 1400 RTE_ETHDEV_LOG(ERR, "Invalid port_id=%u\n", port_id); \ 1410 #define ETH_L2_TUNNEL_ENABLE_MASK 0x00000001 1412 #define ETH_L2_TUNNEL_INSERTION_MASK 0x00000002 1414 #define ETH_L2_TUNNEL_STRIPPING_MASK 0x00000004 1416 #define ETH_L2_TUNNEL_FORWARDING_MASK 0x00000008 1441 struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts,
1465 struct rte_mbuf *pkts[], uint16_t nb_pkts,
void *user_param);
1479 struct rte_eth_dev_sriov {
1481 uint8_t nb_q_per_pool;
1482 uint16_t def_vmdq_idx;
1483 uint16_t def_pool_q_idx;
1485 #define RTE_ETH_DEV_SRIOV(dev) ((dev)->data->sriov) 1487 #define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN 1489 #define RTE_ETH_DEV_NO_OWNER 0 1491 #define RTE_ETH_MAX_OWNER_NAME_LEN 64 1493 struct rte_eth_dev_owner {
1495 char name[RTE_ETH_MAX_OWNER_NAME_LEN];
1502 #define RTE_ETH_DEV_CLOSE_REMOVE 0x0001 1504 #define RTE_ETH_DEV_INTR_LSC 0x0002 1506 #define RTE_ETH_DEV_BONDED_SLAVE 0x0004 1508 #define RTE_ETH_DEV_INTR_RMV 0x0008 1510 #define RTE_ETH_DEV_REPRESENTOR 0x0010 1512 #define RTE_ETH_DEV_NOLIVE_MAC_ADDR 0x0020 1526 const uint64_t owner_id);
1531 #define RTE_ETH_FOREACH_DEV_OWNED_BY(p, o) \ 1532 for (p = rte_eth_find_next_owned_by(0, o); \ 1533 (unsigned int)p < (unsigned int)RTE_MAX_ETHPORTS; \ 1534 p = rte_eth_find_next_owned_by(p + 1, o)) 1549 #define RTE_ETH_FOREACH_DEV(p) \ 1550 RTE_ETH_FOREACH_DEV_OWNED_BY(p, RTE_ETH_DEV_NO_OWNER) 1579 #define RTE_ETH_FOREACH_DEV_OF(port_id, parent) \ 1580 for (port_id = rte_eth_find_next_of(0, parent); \ 1581 port_id < RTE_MAX_ETHPORTS; \ 1582 port_id = rte_eth_find_next_of(port_id + 1, parent)) 1601 uint16_t ref_port_id);
1613 #define RTE_ETH_FOREACH_DEV_SIBLING(port_id, ref_port_id) \ 1614 for (port_id = rte_eth_find_next_sibling(0, ref_port_id); \ 1615 port_id < RTE_MAX_ETHPORTS; \ 1616 port_id = rte_eth_find_next_sibling(port_id + 1, ref_port_id)) 1649 const struct rte_eth_dev_owner *owner);
1666 const uint64_t owner_id);
1697 struct rte_eth_dev_owner *owner);
1794 uint16_t nb_tx_queue,
const struct rte_eth_conf *eth_conf);
1861 uint16_t nb_rx_desc,
unsigned int socket_id,
1893 (uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc,
1945 uint16_t nb_tx_desc,
unsigned int socket_id,
1974 (uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc,
2439 uint64_t *values,
unsigned int size);
2494 uint16_t tx_queue_id, uint8_t stat_idx);
2514 uint16_t rx_queue_id,
2595 char *fw_version,
size_t fw_size);
2636 uint32_t *ptypes,
int num);
2672 uint32_t *set_ptypes,
unsigned int num);
2825 typedef void (*buffer_tx_error_fn)(
struct rte_mbuf **unsent, uint16_t count,
2833 buffer_tx_error_fn error_callback;
2834 void *error_userdata;
2847 #define RTE_ETH_TX_BUFFER_SIZE(sz) \ 2848 (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *)) 2889 buffer_tx_error_fn callback,
void *
userdata);
3164 int epfd,
int op,
void *data);
3340 uint16_t reta_size);
3361 uint16_t reta_size);
3605 struct rte_eth_rxtx_callback;
3632 const struct rte_eth_rxtx_callback *
3662 const struct rte_eth_rxtx_callback *
3691 const struct rte_eth_rxtx_callback *
3728 const struct rte_eth_rxtx_callback *user_cb);
3763 const struct rte_eth_rxtx_callback *user_cb);
3964 struct rte_dev_eeprom_info *info);
3986 uint32_t nb_mc_addr);
4035 struct timespec *timestamp, uint32_t flags);
4053 struct timespec *timestamp);
4259 uint16_t *nb_rx_desc,
4260 uint16_t *nb_tx_desc);
4393 static inline uint16_t
4395 struct rte_mbuf **rx_pkts,
const uint16_t nb_pkts)
4397 struct rte_eth_dev *dev = &rte_eth_devices[port_id];
4400 #ifdef RTE_LIBRTE_ETHDEV_DEBUG 4401 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
4402 RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
4404 if (queue_id >= dev->data->nb_rx_queues) {
4405 RTE_ETHDEV_LOG(ERR,
"Invalid RX queue_id=%u\n", queue_id);
4409 nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
4412 #ifdef RTE_ETHDEV_RXTX_CALLBACKS 4413 struct rte_eth_rxtx_callback *cb;
4421 cb = __atomic_load_n(&dev->post_rx_burst_cbs[queue_id],
4426 nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
4427 nb_pkts, cb->param);
4429 }
while (cb != NULL);
4451 struct rte_eth_dev *dev;
4453 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
4454 dev = &rte_eth_devices[port_id];
4455 RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
4456 if (queue_id >= dev->data->nb_rx_queues)
4459 return (
int)(*dev->dev_ops->rx_queue_count)(dev, queue_id);
4480 struct rte_eth_dev *dev = &rte_eth_devices[port_id];
4481 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
4482 RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
4483 return (*dev->dev_ops->rx_descriptor_done)( \
4484 dev->data->rx_queues[queue_id], offset);
4487 #define RTE_ETH_RX_DESC_AVAIL 0 4488 #define RTE_ETH_RX_DESC_DONE 1 4489 #define RTE_ETH_RX_DESC_UNAVAIL 2 4528 struct rte_eth_dev *dev;
4531 #ifdef RTE_LIBRTE_ETHDEV_DEBUG 4532 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
4534 dev = &rte_eth_devices[port_id];
4535 #ifdef RTE_LIBRTE_ETHDEV_DEBUG 4536 if (queue_id >= dev->data->nb_rx_queues)
4539 RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
4540 rxq = dev->data->rx_queues[queue_id];
4542 return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
4545 #define RTE_ETH_TX_DESC_FULL 0 4546 #define RTE_ETH_TX_DESC_DONE 1 4547 #define RTE_ETH_TX_DESC_UNAVAIL 2 4582 static inline int rte_eth_tx_descriptor_status(uint16_t port_id, 4583 uint16_t queue_id, uint16_t offset)
4585 struct rte_eth_dev *dev;
4588 #ifdef RTE_LIBRTE_ETHDEV_DEBUG 4589 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
4591 dev = &rte_eth_devices[port_id];
4592 #ifdef RTE_LIBRTE_ETHDEV_DEBUG 4593 if (queue_id >= dev->data->nb_tx_queues)
4596 RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
4597 txq = dev->data->tx_queues[queue_id];
4599 return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
4668 static inline uint16_t
4670 struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
4672 struct rte_eth_dev *dev = &rte_eth_devices[port_id];
4674 #ifdef RTE_LIBRTE_ETHDEV_DEBUG 4675 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
4676 RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
4678 if (queue_id >= dev->data->nb_tx_queues) {
4679 RTE_ETHDEV_LOG(ERR,
"Invalid TX queue_id=%u\n", queue_id);
4684 #ifdef RTE_ETHDEV_RXTX_CALLBACKS 4685 struct rte_eth_rxtx_callback *cb;
4693 cb = __atomic_load_n(&dev->pre_tx_burst_cbs[queue_id],
4698 nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
4701 }
while (cb != NULL);
4705 return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
4761 #ifndef RTE_ETHDEV_TX_PREPARE_NOOP 4763 static inline uint16_t
4765 struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
4767 struct rte_eth_dev *dev;
4769 #ifdef RTE_LIBRTE_ETHDEV_DEBUG 4771 RTE_ETHDEV_LOG(ERR,
"Invalid TX port_id=%u\n", port_id);
4777 dev = &rte_eth_devices[port_id];
4779 #ifdef RTE_LIBRTE_ETHDEV_DEBUG 4780 if (queue_id >= dev->data->nb_tx_queues) {
4781 RTE_ETHDEV_LOG(ERR,
"Invalid TX queue_id=%u\n", queue_id);
4787 if (!dev->tx_pkt_prepare)
4790 return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
4805 static inline uint16_t
4837 static inline uint16_t
4842 uint16_t to_send = buffer->
length;
4853 buffer->error_callback(&buffer->
pkts[sent],
4854 (uint16_t)(to_send - sent),
4855 buffer->error_userdata);
int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf)
int rte_eth_promiscuous_disable(uint16_t port_id)
#define ETH_VMDQ_MAX_VLAN_FILTERS
int rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel)
#define __rte_always_inline
uint16_t rte_eth_dev_count_avail(void)
int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time)
const uint32_t * dev_flags
int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info)
int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time)
uint64_t rte_eth_find_next_owned_by(uint16_t port_id, const uint64_t owner_id)
void rte_eth_dev_stop(uint16_t port_id)
__rte_experimental int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode)
#define __rte_cache_min_aligned
int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue, uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf)
int rte_eth_dev_get_name_by_port(uint16_t port_id, char *name)
static uint16_t rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
struct rte_device * device
int rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id)
const struct rte_eth_rxtx_callback * rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param)
uint64_t q_errors[RTE_ETHDEV_QUEUE_STAT_CNTRS]
__rte_experimental int rte_eth_dev_owner_new(uint64_t *owner_id)
__rte_experimental int rte_eth_dev_owner_unset(const uint16_t port_id, const uint64_t owner_id)
uint16_t rte_eth_find_next(uint16_t port_id)
__rte_experimental int rte_eth_dev_is_removed(uint16_t port_id)
int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on)
int rte_eth_led_off(uint16_t port_id)
int rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp)
static int rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id, uint16_t offset)
__rte_experimental uint16_t rte_eth_find_next_of(uint16_t port_id_start, const struct rte_device *parent)
static int rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
__rte_experimental int rte_eth_dev_hairpin_capability_get(uint16_t port_id, struct rte_eth_hairpin_cap *cap)
void rte_eth_dev_close(uint16_t port_id)
int rte_eth_dev_rss_reta_update(uint16_t port_id, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size)
int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, uint16_t tx_rate)
int rte_eth_dev_rss_hash_update(uint16_t port_id, struct rte_eth_rss_conf *rss_conf)
uint64_t rx_queue_offload_capa
int rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, unsigned int n)
__rte_experimental int rte_eth_read_clock(uint16_t port_id, uint64_t *clock)
int rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs)
int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, int epfd, int op, void *data)
int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, const struct rte_eth_rxtx_callback *user_cb)
int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on)
uint64_t tx_queue_offload_capa
int rte_eth_mirror_rule_set(uint16_t port_id, struct rte_eth_mirror_conf *mirror_conf, uint8_t rule_id, uint8_t on)
uint8_t enable_default_pool
uint32_t max_hash_mac_addrs
uint64_t q_obytes[RTE_ETHDEV_QUEUE_STAT_CNTRS]
int rte_eth_dev_get_eeprom_length(uint16_t port_id)
int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id)
int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx)
int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_txq_info *qinfo)
__rte_experimental int rte_eth_dev_get_module_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info)
uint32_t dcb_capability_en
uint64_t q_ibytes[RTE_ETHDEV_QUEUE_STAT_CNTRS]
int rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf)
int rte_eth_dev_callback_unregister(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg)
int rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id)
int rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool)
int rte_eth_dev_set_link_up(uint16_t port_id)
int rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags)
int rte_eth_dev_get_vlan_offload(uint16_t port_id)
__rte_experimental int rte_eth_dev_owner_set(const uint16_t port_id, const struct rte_eth_dev_owner *owner)
__rte_experimental int rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id)
int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf)
uint8_t rx_deferred_start
int(* rte_eth_dev_cb_fn)(uint16_t port_id, enum rte_eth_event_type event, void *cb_arg, void *ret_param)
uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS]
uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex)
#define RTE_ETH_XSTATS_NAME_SIZE
int rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf)
int rte_eth_timesync_disable(uint16_t port_id)
int rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *mac_addr)
void rte_eth_iterator_cleanup(struct rte_dev_iterator *iter)
void * rte_eth_dev_get_sec_ctx(uint16_t port_id)
int rte_eth_stats_reset(uint16_t port_id)
int rte_eth_allmulticast_enable(uint16_t port_id)
void rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent, void *userdata)
int rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp)
int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta)
int rte_eth_dev_callback_register(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg)
int rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id)
__rte_experimental uint16_t rte_eth_find_next_sibling(uint16_t port_id_start, uint16_t ref_port_id)
static uint16_t rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
int rte_eth_allmulticast_disable(uint16_t port_id)
__rte_experimental int rte_eth_dev_get_module_info(uint16_t port_id, struct rte_eth_dev_module_info *modinfo)
int rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, int on)
int rte_eth_dev_start(uint16_t port_id)
int rte_eth_dev_reset(uint16_t port_id)
int rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids, uint64_t *values, unsigned int size)
int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id)
int rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer, buffer_tx_error_fn callback, void *userdata)
void rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent, void *userdata)
uint64_t q_opackets[RTE_ETHDEV_QUEUE_STAT_CNTRS]
int rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, const struct rte_eth_rxtx_callback *user_cb)
uint16_t(* rte_tx_callback_fn)(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param)
int rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size)
int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, uint16_t *nb_rx_desc, uint16_t *nb_tx_desc)
int rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *mac_addr)
#define ETH_DCB_NUM_USER_PRIORITIES
int rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *mac_addr, uint32_t pool)
int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id)
int rte_eth_xstats_reset(uint16_t port_id)
int rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, uint64_t *id)
int rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id)
const struct rte_eth_rxtx_callback * rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, rte_tx_callback_fn fn, void *user_param)
uint64_t flow_type_rss_offloads
uint16_t rte_eth_dev_count_total(void)
int rte_eth_promiscuous_enable(uint16_t port_id)
int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data)
const char * rte_eth_dev_tx_offload_name(uint64_t offload)
int rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link)
int rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel, uint32_t mask, uint8_t en)
static __rte_always_inline uint16_t rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
int rte_eth_dev_set_mc_addr_list(uint16_t port_id, struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr)
int rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info)
#define ETH_MQ_RX_RSS_FLAG
rte_eth_event_ipsec_subtype
#define ETH_MIRROR_MAX_VLANS
int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx)
int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info)
__rte_experimental int rte_eth_dev_owner_get(const uint16_t port_id, struct rte_eth_dev_owner *owner)
static int rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxq_info *qinfo)
int rte_eth_dev_socket_id(uint16_t port_id)
uint8_t enable_default_pool
int rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on)
int rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link)
int rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu)
int rte_eth_dev_set_vlan_ether_type(uint16_t port_id, enum rte_vlan_type vlan_type, uint16_t tag_type)
int rte_eth_xstats_get_names_by_id(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size, uint64_t *ids)
__rte_experimental int rte_eth_rx_hairpin_queue_setup(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, const struct rte_eth_hairpin_conf *conf)
static uint64_t rte_eth_rss_hf_refine(uint64_t rss_hf)
int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr, uint8_t on)
int rte_eth_dev_rss_reta_query(uint16_t port_id, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size)
int rte_eth_promiscuous_get(uint16_t port_id)
int rte_eth_led_on(uint16_t port_id)
int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp)
__rte_experimental int rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *set_ptypes, unsigned int num)
__rte_experimental int rte_eth_dev_owner_delete(const uint64_t owner_id)
int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num)
int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats)
__rte_deprecated int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg)
__rte_experimental int rte_eth_tx_hairpin_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, const struct rte_eth_hairpin_conf *conf)
uint8_t mac_ctrl_frame_fwd
uint16_t(* rte_rx_callback_fn)(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param)
int rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
__rte_deprecated int rte_eth_dev_filter_supported(uint16_t port_id, enum rte_filter_type filter_type)
uint8_t tx_deferred_start
int rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size)
uint32_t max_lro_pkt_size
int rte_eth_xstats_get_names(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size)
const struct rte_eth_rxtx_callback * rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param)
int rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt)
int rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask)
int rte_eth_allmulticast_get(uint16_t port_id)
int rte_eth_dev_is_valid_port(uint16_t port_id)
int rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
uint32_t max_lro_pkt_size
int rte_eth_timesync_enable(uint16_t port_id)
static uint16_t rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
int rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id)
int rte_eth_dev_set_link_down(uint16_t port_id)
int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf)
uint16_t rte_eth_iterator_next(struct rte_dev_iterator *iter)
int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info)
__rte_experimental int rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode)
const char * rte_eth_dev_rx_offload_name(uint64_t offload)
static uint16_t rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer)
int rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mb_pool)