147 #define RTE_ETHDEV_HAS_LRO_SUPPORT 149 #include <rte_compat.h> 156 #include <rte_config.h> 160 #include "rte_dev_info.h" 162 extern int rte_eth_dev_logtype;
164 #define RTE_ETHDEV_LOG(level, ...) \ 165 rte_log(RTE_LOG_ ## level, rte_eth_dev_logtype, "" __VA_ARGS__) 202 #define ETH_LINK_SPEED_AUTONEG (0 << 0) 203 #define ETH_LINK_SPEED_FIXED (1 << 0) 204 #define ETH_LINK_SPEED_10M_HD (1 << 1) 205 #define ETH_LINK_SPEED_10M (1 << 2) 206 #define ETH_LINK_SPEED_100M_HD (1 << 3) 207 #define ETH_LINK_SPEED_100M (1 << 4) 208 #define ETH_LINK_SPEED_1G (1 << 5) 209 #define ETH_LINK_SPEED_2_5G (1 << 6) 210 #define ETH_LINK_SPEED_5G (1 << 7) 211 #define ETH_LINK_SPEED_10G (1 << 8) 212 #define ETH_LINK_SPEED_20G (1 << 9) 213 #define ETH_LINK_SPEED_25G (1 << 10) 214 #define ETH_LINK_SPEED_40G (1 << 11) 215 #define ETH_LINK_SPEED_50G (1 << 12) 216 #define ETH_LINK_SPEED_56G (1 << 13) 217 #define ETH_LINK_SPEED_100G (1 << 14) 222 #define ETH_SPEED_NUM_NONE 0 223 #define ETH_SPEED_NUM_10M 10 224 #define ETH_SPEED_NUM_100M 100 225 #define ETH_SPEED_NUM_1G 1000 226 #define ETH_SPEED_NUM_2_5G 2500 227 #define ETH_SPEED_NUM_5G 5000 228 #define ETH_SPEED_NUM_10G 10000 229 #define ETH_SPEED_NUM_20G 20000 230 #define ETH_SPEED_NUM_25G 25000 231 #define ETH_SPEED_NUM_40G 40000 232 #define ETH_SPEED_NUM_50G 50000 233 #define ETH_SPEED_NUM_56G 56000 234 #define ETH_SPEED_NUM_100G 100000 245 } __attribute__((aligned(8)));
248 #define ETH_LINK_HALF_DUPLEX 0 249 #define ETH_LINK_FULL_DUPLEX 1 250 #define ETH_LINK_DOWN 0 251 #define ETH_LINK_UP 1 252 #define ETH_LINK_FIXED 0 253 #define ETH_LINK_AUTONEG 1 259 struct rte_eth_thresh { 268 #define ETH_MQ_RX_RSS_FLAG 0x1 269 #define ETH_MQ_RX_DCB_FLAG 0x2 270 #define ETH_MQ_RX_VMDQ_FLAG 0x4 301 #define ETH_RSS ETH_MQ_RX_RSS 302 #define VMDQ_DCB ETH_MQ_RX_VMDQ_DCB 303 #define ETH_DCB_RX ETH_MQ_RX_DCB 319 #define ETH_DCB_NONE ETH_MQ_TX_NONE 320 #define ETH_VMDQ_DCB_TX ETH_MQ_TX_VMDQ_DCB 321 #define ETH_DCB_TX ETH_MQ_TX_DCB 344 ETH_VLAN_TYPE_UNKNOWN = 0,
387 #define ETH_RSS_IPV4 (1ULL << RTE_ETH_FLOW_IPV4) 388 #define ETH_RSS_FRAG_IPV4 (1ULL << RTE_ETH_FLOW_FRAG_IPV4) 389 #define ETH_RSS_NONFRAG_IPV4_TCP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP) 390 #define ETH_RSS_NONFRAG_IPV4_UDP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP) 391 #define ETH_RSS_NONFRAG_IPV4_SCTP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP) 392 #define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER) 393 #define ETH_RSS_IPV6 (1ULL << RTE_ETH_FLOW_IPV6) 394 #define ETH_RSS_FRAG_IPV6 (1ULL << RTE_ETH_FLOW_FRAG_IPV6) 395 #define ETH_RSS_NONFRAG_IPV6_TCP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP) 396 #define ETH_RSS_NONFRAG_IPV6_UDP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP) 397 #define ETH_RSS_NONFRAG_IPV6_SCTP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP) 398 #define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER) 399 #define ETH_RSS_L2_PAYLOAD (1ULL << RTE_ETH_FLOW_L2_PAYLOAD) 400 #define ETH_RSS_IPV6_EX (1ULL << RTE_ETH_FLOW_IPV6_EX) 401 #define ETH_RSS_IPV6_TCP_EX (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX) 402 #define ETH_RSS_IPV6_UDP_EX (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX) 403 #define ETH_RSS_PORT (1ULL << RTE_ETH_FLOW_PORT) 404 #define ETH_RSS_VXLAN (1ULL << RTE_ETH_FLOW_VXLAN) 405 #define ETH_RSS_GENEVE (1ULL << RTE_ETH_FLOW_GENEVE) 406 #define ETH_RSS_NVGRE (1ULL << RTE_ETH_FLOW_NVGRE) 408 #define ETH_RSS_IP ( \ 410 ETH_RSS_FRAG_IPV4 | \ 411 ETH_RSS_NONFRAG_IPV4_OTHER | \ 413 ETH_RSS_FRAG_IPV6 | \ 414 ETH_RSS_NONFRAG_IPV6_OTHER | \ 417 #define ETH_RSS_UDP ( \ 418 ETH_RSS_NONFRAG_IPV4_UDP | \ 419 ETH_RSS_NONFRAG_IPV6_UDP | \ 422 #define ETH_RSS_TCP ( \ 423 ETH_RSS_NONFRAG_IPV4_TCP | \ 424 ETH_RSS_NONFRAG_IPV6_TCP | \ 427 #define ETH_RSS_SCTP ( \ 428 ETH_RSS_NONFRAG_IPV4_SCTP | \ 429 ETH_RSS_NONFRAG_IPV6_SCTP) 431 #define ETH_RSS_TUNNEL ( \ 437 #define ETH_RSS_PROTO_MASK ( \ 439 ETH_RSS_FRAG_IPV4 | \ 440 ETH_RSS_NONFRAG_IPV4_TCP | \ 441 ETH_RSS_NONFRAG_IPV4_UDP | \ 442 ETH_RSS_NONFRAG_IPV4_SCTP | \ 443 ETH_RSS_NONFRAG_IPV4_OTHER | \ 445 ETH_RSS_FRAG_IPV6 | \ 446 ETH_RSS_NONFRAG_IPV6_TCP | \ 447 ETH_RSS_NONFRAG_IPV6_UDP | \ 448 ETH_RSS_NONFRAG_IPV6_SCTP | \ 449 ETH_RSS_NONFRAG_IPV6_OTHER | \ 450 ETH_RSS_L2_PAYLOAD | \ 452 ETH_RSS_IPV6_TCP_EX | \ 453 ETH_RSS_IPV6_UDP_EX | \ 464 #define ETH_RSS_RETA_SIZE_64 64 465 #define ETH_RSS_RETA_SIZE_128 128 466 #define ETH_RSS_RETA_SIZE_256 256 467 #define ETH_RSS_RETA_SIZE_512 512 468 #define RTE_RETA_GROUP_SIZE 64 471 #define ETH_VMDQ_MAX_VLAN_FILTERS 64 472 #define ETH_DCB_NUM_USER_PRIORITIES 8 473 #define ETH_VMDQ_DCB_NUM_QUEUES 128 474 #define ETH_DCB_NUM_QUEUES 128 477 #define ETH_DCB_PG_SUPPORT 0x00000001 478 #define ETH_DCB_PFC_SUPPORT 0x00000002 481 #define ETH_VLAN_STRIP_OFFLOAD 0x0001 482 #define ETH_VLAN_FILTER_OFFLOAD 0x0002 483 #define ETH_VLAN_EXTEND_OFFLOAD 0x0004 486 #define ETH_VLAN_STRIP_MASK 0x0001 487 #define ETH_VLAN_FILTER_MASK 0x0002 488 #define ETH_VLAN_EXTEND_MASK 0x0004 489 #define ETH_VLAN_ID_MAX 0x0FFF 492 #define ETH_NUM_RECEIVE_MAC_ADDR 128 495 #define ETH_VMDQ_NUM_UC_HASH_ARRAY 128 498 #define ETH_VMDQ_ACCEPT_UNTAG 0x0001 499 #define ETH_VMDQ_ACCEPT_HASH_MC 0x0002 500 #define ETH_VMDQ_ACCEPT_HASH_UC 0x0004 501 #define ETH_VMDQ_ACCEPT_BROADCAST 0x0008 502 #define ETH_VMDQ_ACCEPT_MULTICAST 0x0010 505 #define ETH_MIRROR_MAX_VLANS 64 507 #define ETH_MIRROR_VIRTUAL_POOL_UP 0x01 508 #define ETH_MIRROR_UPLINK_PORT 0x02 509 #define ETH_MIRROR_DOWNLINK_PORT 0x04 510 #define ETH_MIRROR_VLAN 0x08 511 #define ETH_MIRROR_VIRTUAL_POOL_DOWN 0x10 516 struct rte_eth_vlan_mirror { 542 uint16_t
reta[RTE_RETA_GROUP_SIZE];
567 struct rte_eth_dcb_rx_conf {
573 struct rte_eth_vmdq_dcb_tx_conf {
579 struct rte_eth_dcb_tx_conf {
585 struct rte_eth_vmdq_tx_conf {
881 #define DEV_RX_OFFLOAD_VLAN_STRIP 0x00000001 882 #define DEV_RX_OFFLOAD_IPV4_CKSUM 0x00000002 883 #define DEV_RX_OFFLOAD_UDP_CKSUM 0x00000004 884 #define DEV_RX_OFFLOAD_TCP_CKSUM 0x00000008 885 #define DEV_RX_OFFLOAD_TCP_LRO 0x00000010 886 #define DEV_RX_OFFLOAD_QINQ_STRIP 0x00000020 887 #define DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000040 888 #define DEV_RX_OFFLOAD_MACSEC_STRIP 0x00000080 889 #define DEV_RX_OFFLOAD_HEADER_SPLIT 0x00000100 890 #define DEV_RX_OFFLOAD_VLAN_FILTER 0x00000200 891 #define DEV_RX_OFFLOAD_VLAN_EXTEND 0x00000400 892 #define DEV_RX_OFFLOAD_JUMBO_FRAME 0x00000800 893 #define DEV_RX_OFFLOAD_CRC_STRIP 0x00001000 894 #define DEV_RX_OFFLOAD_SCATTER 0x00002000 895 #define DEV_RX_OFFLOAD_TIMESTAMP 0x00004000 896 #define DEV_RX_OFFLOAD_SECURITY 0x00008000 902 #define DEV_RX_OFFLOAD_KEEP_CRC 0x00010000 903 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \ 904 DEV_RX_OFFLOAD_UDP_CKSUM | \ 905 DEV_RX_OFFLOAD_TCP_CKSUM) 906 #define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \ 907 DEV_RX_OFFLOAD_VLAN_FILTER | \ 908 DEV_RX_OFFLOAD_VLAN_EXTEND) 918 #define DEV_TX_OFFLOAD_VLAN_INSERT 0x00000001 919 #define DEV_TX_OFFLOAD_IPV4_CKSUM 0x00000002 920 #define DEV_TX_OFFLOAD_UDP_CKSUM 0x00000004 921 #define DEV_TX_OFFLOAD_TCP_CKSUM 0x00000008 922 #define DEV_TX_OFFLOAD_SCTP_CKSUM 0x00000010 923 #define DEV_TX_OFFLOAD_TCP_TSO 0x00000020 924 #define DEV_TX_OFFLOAD_UDP_TSO 0x00000040 925 #define DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000080 926 #define DEV_TX_OFFLOAD_QINQ_INSERT 0x00000100 927 #define DEV_TX_OFFLOAD_VXLAN_TNL_TSO 0x00000200 928 #define DEV_TX_OFFLOAD_GRE_TNL_TSO 0x00000400 929 #define DEV_TX_OFFLOAD_IPIP_TNL_TSO 0x00000800 930 #define DEV_TX_OFFLOAD_GENEVE_TNL_TSO 0x00001000 931 #define DEV_TX_OFFLOAD_MACSEC_INSERT 0x00002000 932 #define DEV_TX_OFFLOAD_MT_LOCKFREE 0x00004000 936 #define DEV_TX_OFFLOAD_MULTI_SEGS 0x00008000 938 #define DEV_TX_OFFLOAD_MBUF_FAST_FREE 0x00010000 943 #define DEV_TX_OFFLOAD_SECURITY 0x00020000 949 #define DEV_TX_OFFLOAD_UDP_TNL_TSO 0x00040000 955 #define DEV_TX_OFFLOAD_IP_TNL_TSO 0x00080000 957 #define RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP 0x00000001 959 #define RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP 0x00000002 972 #define RTE_ETH_DEV_FALLBACK_RX_RINGSIZE 512 973 #define RTE_ETH_DEV_FALLBACK_TX_RINGSIZE 512 974 #define RTE_ETH_DEV_FALLBACK_RX_NBQUEUES 1 975 #define RTE_ETH_DEV_FALLBACK_TX_NBQUEUES 1 992 #define RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID (0) 1024 uint32_t max_hash_mac_addrs;
1086 #define RTE_ETH_XSTATS_NAME_SIZE 64 1113 #define ETH_DCB_NUM_TCS 8 1114 #define ETH_MAX_VMDQ_POOL 64 1125 }
tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
1130 }
tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
1148 #define RTE_ETH_QUEUE_STATE_STOPPED 0 1149 #define RTE_ETH_QUEUE_STATE_STARTED 1 1151 #define RTE_ETH_ALL RTE_MAX_ETHPORTS 1154 #define RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, retval) do { \ 1155 if (!rte_eth_dev_is_valid_port(port_id)) { \ 1156 RTE_ETHDEV_LOG(ERR, "Invalid port_id=%u\n", port_id); \ 1161 #define RTE_ETH_VALID_PORTID_OR_RET(port_id) do { \ 1162 if (!rte_eth_dev_is_valid_port(port_id)) { \ 1163 RTE_ETHDEV_LOG(ERR, "Invalid port_id=%u\n", port_id); \ 1173 #define ETH_L2_TUNNEL_ENABLE_MASK 0x00000001 1175 #define ETH_L2_TUNNEL_INSERTION_MASK 0x00000002 1177 #define ETH_L2_TUNNEL_STRIPPING_MASK 0x00000004 1179 #define ETH_L2_TUNNEL_FORWARDING_MASK 0x00000008 1204 struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts,
1228 struct rte_mbuf *pkts[], uint16_t nb_pkts,
void *user_param);
1244 struct rte_eth_dev_sriov {
1246 uint8_t nb_q_per_pool;
1247 uint16_t def_vmdq_idx;
1248 uint16_t def_pool_q_idx;
1250 #define RTE_ETH_DEV_SRIOV(dev) ((dev)->data->sriov) 1252 #define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN 1254 #define RTE_ETH_DEV_NO_OWNER 0 1256 #define RTE_ETH_MAX_OWNER_NAME_LEN 64 1258 struct rte_eth_dev_owner {
1260 char name[RTE_ETH_MAX_OWNER_NAME_LEN];
1264 #define RTE_ETH_DEV_INTR_LSC 0x0002 1266 #define RTE_ETH_DEV_BONDED_SLAVE 0x0004 1268 #define RTE_ETH_DEV_INTR_RMV 0x0008 1270 #define RTE_ETH_DEV_REPRESENTOR 0x0010 1284 const uint64_t owner_id);
1289 #define RTE_ETH_FOREACH_DEV_OWNED_BY(p, o) \ 1290 for (p = rte_eth_find_next_owned_by(0, o); \ 1291 (unsigned int)p < (unsigned int)RTE_MAX_ETHPORTS; \ 1292 p = rte_eth_find_next_owned_by(p + 1, o)) 1307 #define RTE_ETH_FOREACH_DEV(p) \ 1308 RTE_ETH_FOREACH_DEV_OWNED_BY(p, RTE_ETH_DEV_NO_OWNER) 1340 const struct rte_eth_dev_owner *owner);
1356 const uint64_t owner_id);
1383 struct rte_eth_dev_owner *owner);
1532 uint16_t nb_tx_queue,
const struct rte_eth_conf *eth_conf);
1545 int __rte_experimental
1598 uint16_t nb_rx_desc,
unsigned int socket_id,
1651 uint16_t nb_tx_desc,
unsigned int socket_id,
2076 uint64_t *values,
unsigned int size);
2125 uint16_t tx_queue_id, uint8_t stat_idx);
2145 uint16_t rx_queue_id,
2190 char *fw_version,
size_t fw_size);
2231 uint32_t *ptypes,
int num);
2380 typedef void (*buffer_tx_error_fn)(
struct rte_mbuf **unsent, uint16_t count,
2388 buffer_tx_error_fn error_callback;
2389 void *error_userdata;
2402 #define RTE_ETH_TX_BUFFER_SIZE(sz) \ 2403 (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *)) 2444 buffer_tx_error_fn callback,
void *
userdata);
2719 int epfd,
int op,
void *data);
2873 uint16_t reta_size);
2893 uint16_t reta_size);
3135 struct rte_eth_rxtx_callback;
3161 const struct rte_eth_rxtx_callback *
3190 const struct rte_eth_rxtx_callback *
3218 const struct rte_eth_rxtx_callback *
3253 const struct rte_eth_rxtx_callback *user_cb);
3286 const struct rte_eth_rxtx_callback *user_cb);
3412 int __rte_experimental
3434 int __rte_experimental
3436 struct rte_dev_eeprom_info *info);
3458 uint32_t nb_mc_addr);
3507 struct timespec *timestamp, uint32_t flags);
3525 struct timespec *timestamp);
3683 uint16_t *nb_rx_desc,
3684 uint16_t *nb_tx_desc);
3800 static inline uint16_t
3802 struct rte_mbuf **rx_pkts,
const uint16_t nb_pkts)
3804 struct rte_eth_dev *dev = &rte_eth_devices[port_id];
3807 #ifdef RTE_LIBRTE_ETHDEV_DEBUG 3808 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
3809 RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
3811 if (queue_id >= dev->data->nb_rx_queues) {
3812 RTE_ETHDEV_LOG(ERR,
"Invalid RX queue_id=%u\n", queue_id);
3816 nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
3819 #ifdef RTE_ETHDEV_RXTX_CALLBACKS 3820 if (
unlikely(dev->post_rx_burst_cbs[queue_id] != NULL)) {
3821 struct rte_eth_rxtx_callback *cb =
3822 dev->post_rx_burst_cbs[queue_id];
3825 nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
3826 nb_pkts, cb->param);
3828 }
while (cb != NULL);
3850 struct rte_eth_dev *dev;
3852 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
3853 dev = &rte_eth_devices[port_id];
3854 RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
3855 if (queue_id >= dev->data->nb_rx_queues)
3858 return (
int)(*dev->dev_ops->rx_queue_count)(dev, queue_id);
3879 struct rte_eth_dev *dev = &rte_eth_devices[port_id];
3880 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
3881 RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
3882 return (*dev->dev_ops->rx_descriptor_done)( \
3883 dev->data->rx_queues[queue_id], offset);
3886 #define RTE_ETH_RX_DESC_AVAIL 0 3887 #define RTE_ETH_RX_DESC_DONE 1 3888 #define RTE_ETH_RX_DESC_UNAVAIL 2 3927 struct rte_eth_dev *dev;
3930 #ifdef RTE_LIBRTE_ETHDEV_DEBUG 3931 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
3933 dev = &rte_eth_devices[port_id];
3934 #ifdef RTE_LIBRTE_ETHDEV_DEBUG 3935 if (queue_id >= dev->data->nb_rx_queues)
3938 RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
3939 rxq = dev->data->rx_queues[queue_id];
3941 return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
3944 #define RTE_ETH_TX_DESC_FULL 0 3945 #define RTE_ETH_TX_DESC_DONE 1 3946 #define RTE_ETH_TX_DESC_UNAVAIL 2 3981 static inline int rte_eth_tx_descriptor_status(uint16_t port_id, 3982 uint16_t queue_id, uint16_t offset)
3984 struct rte_eth_dev *dev;
3987 #ifdef RTE_LIBRTE_ETHDEV_DEBUG 3988 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
3990 dev = &rte_eth_devices[port_id];
3991 #ifdef RTE_LIBRTE_ETHDEV_DEBUG 3992 if (queue_id >= dev->data->nb_tx_queues)
3995 RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
3996 txq = dev->data->tx_queues[queue_id];
3998 return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
4067 static inline uint16_t
4069 struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
4071 struct rte_eth_dev *dev = &rte_eth_devices[port_id];
4073 #ifdef RTE_LIBRTE_ETHDEV_DEBUG 4074 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
4075 RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
4077 if (queue_id >= dev->data->nb_tx_queues) {
4078 RTE_ETHDEV_LOG(ERR,
"Invalid TX queue_id=%u\n", queue_id);
4083 #ifdef RTE_ETHDEV_RXTX_CALLBACKS 4084 struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
4088 nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
4091 }
while (cb != NULL);
4095 return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
4154 #ifndef RTE_ETHDEV_TX_PREPARE_NOOP 4156 static inline uint16_t
4158 struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
4160 struct rte_eth_dev *dev;
4162 #ifdef RTE_LIBRTE_ETHDEV_DEBUG 4164 RTE_ETHDEV_LOG(ERR,
"Invalid TX port_id=%u\n", port_id);
4170 dev = &rte_eth_devices[port_id];
4172 #ifdef RTE_LIBRTE_ETHDEV_DEBUG 4173 if (queue_id >= dev->data->nb_tx_queues) {
4174 RTE_ETHDEV_LOG(ERR,
"Invalid TX queue_id=%u\n", queue_id);
4180 if (!dev->tx_pkt_prepare)
4183 return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
4198 static inline uint16_t
4230 static inline uint16_t
4235 uint16_t to_send = buffer->
length;
4246 buffer->error_callback(&buffer->
pkts[sent],
4247 (uint16_t)(to_send - sent),
4248 buffer->error_userdata);
struct rte_eth_vmdq_dcb_tx_conf vmdq_dcb_tx_conf
int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf)
uint8_t tc_bws[ETH_DCB_NUM_TCS]
#define ETH_VMDQ_MAX_VLAN_FILTERS
struct rte_eth_dev_portconf default_rxportconf
struct rte_fdir_conf fdir_conf
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)
__rte_deprecated int rte_eth_dev_detach(uint16_t port_id, char *devname)
struct rte_eth_conf::@115 rx_adv_conf
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)
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)
int rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id)
struct rte_eth_vmdq_tx_conf vmdq_tx_conf
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)
void __rte_experimental rte_eth_dev_owner_delete(const uint64_t owner_id)
uint64_t q_errors[RTE_ETHDEV_QUEUE_STAT_CNTRS]
enum rte_eth_event_ipsec_subtype subtype
struct rte_eth_thresh rx_thresh
uint16_t rte_eth_find_next(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)
static int rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
const char *__rte_experimental rte_eth_dev_tx_offload_name(uint64_t offload)
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)
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)
enum rte_fdir_status_mode status
enum rte_eth_tx_mq_mode mq_mode
struct rte_eth_dcb_tc_queue_mapping::@118 tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS]
int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on)
uint64_t tx_queue_offload_capa
int __rte_experimental rte_eth_dev_is_removed(uint16_t port_id)
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
uint64_t q_obytes[RTE_ETHDEV_QUEUE_STAT_CNTRS]
int rte_eth_dev_get_eeprom_length(uint16_t port_id)
struct rte_eth_rss_conf rss_conf
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)
uint32_t dcb_capability_en
uint64_t q_ibytes[RTE_ETHDEV_QUEUE_STAT_CNTRS]
struct rte_eth_switch_info switch_info
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)
void rte_eth_allmulticast_enable(uint16_t port_id)
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)
struct rte_eth_thresh tx_thresh
struct rte_eth_desc_lim rx_desc_lim
struct rte_eth_vmdq_dcb_conf::@113 pool_map[ETH_VMDQ_MAX_VLAN_FILTERS]
uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES]
int rte_eth_dev_get_vlan_offload(uint16_t port_id)
struct rte_eth_vmdq_rx_conf::@114 pool_map[ETH_VMDQ_MAX_VLAN_FILTERS]
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)
struct rte_eth_rxmode rxmode
uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS]
enum rte_eth_nb_pools nb_queue_pools
struct rte_eth_txconf conf
uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex)
struct rte_intr_conf intr_conf
#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)
struct rte_eth_desc_lim tx_desc_lim
int rte_eth_timesync_disable(uint16_t port_id)
int rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *mac_addr)
void * rte_eth_dev_get_sec_ctx(uint16_t port_id)
int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg)
int rte_eth_stats_reset(uint16_t port_id)
struct rte_eth_txconf default_txconf
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)
struct rte_eth_dcb_rx_conf dcb_rx_conf
int rte_eth_dev_set_mc_addr_list(uint16_t port_id, struct ether_addr *mc_addr_set, uint32_t nb_mc_addr)
struct rte_eth_vmdq_rx_conf vmdq_rx_conf
int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta)
char name[RTE_ETH_XSTATS_NAME_SIZE]
void rte_eth_promiscuous_enable(uint16_t port_id)
enum rte_eth_rx_mq_mode mq_mode
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)
enum rte_eth_nb_pools nb_queue_pools
int rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id)
void rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr)
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)
struct rte_eth_dcb_tc_queue_mapping::@117 tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS]
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)
struct rte_eth_dcb_tx_conf dcb_tx_conf
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_remove_tx_callback(uint16_t port_id, uint16_t queue_id, const struct rte_eth_rxtx_callback *user_cb)
int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr, uint8_t on)
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)
uint16_t __rte_experimental rte_eth_dev_count_total(void)
int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, uint16_t *nb_rx_desc, uint16_t *nb_tx_desc)
struct rte_eth_rxconf conf
void rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link)
#define ETH_DCB_NUM_USER_PRIORITIES
void rte_eth_promiscuous_disable(uint16_t port_id)
int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id)
struct rte_eth_vlan_mirror vlan
const char *__rte_experimental rte_eth_dev_rx_offload_name(uint64_t offload)
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)
__extension__ uint8_t hw_vlan_insert_pvid
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
int __rte_experimental rte_eth_dev_owner_set(const uint16_t port_id, const struct rte_eth_dev_owner *owner)
int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data)
struct rte_eth_dev_portconf default_txportconf
uint8_t prio_tc[ETH_DCB_NUM_USER_PRIORITIES]
struct rte_eth_dcb_tc_queue_mapping tc_queue
int __rte_experimental rte_eth_dev_get_module_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info)
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)
__extension__ uint8_t hw_vlan_reject_untagged
int rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info)
#define __rte_cache_min_aligned
int rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *mac_addr, uint32_t pool)
#define ETH_MQ_RX_RSS_FLAG
rte_eth_event_ipsec_subtype
void rte_eth_xstats_reset(uint16_t port_id)
#define ETH_MIRROR_MAX_VLANS
int rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct ether_addr *mac_addr)
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)
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)
struct rte_eth_fdir_flex_conf flex_conf
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_experimental rte_eth_dev_get_module_info(uint16_t port_id, struct rte_eth_dev_module_info *modinfo)
int rte_eth_dev_filter_supported(uint16_t port_id, enum rte_filter_type filter_type)
int __rte_experimental rte_eth_dev_owner_get(const uint16_t port_id, struct rte_eth_dev_owner *owner)
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)
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)
enum rte_fdir_pballoc_type pballoc
int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp)
int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num)
int __rte_experimental rte_eth_dev_owner_new(uint64_t *owner_id)
__rte_deprecated int rte_eth_dev_attach(const char *devargs, uint16_t *port_id)
__extension__ uint8_t hw_vlan_reject_tagged
int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats)
void rte_eth_allmulticast_disable(uint16_t port_id)
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)
enum rte_eth_fc_mode mode
int rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
struct rte_eth_vmdq_dcb_conf vmdq_dcb_conf
uint8_t tx_deferred_start
union rte_eth_conf::@116 tx_adv_conf
int rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size)
void rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
int rte_eth_xstats_get_names(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size)
struct rte_eth_fc_conf fc
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)
struct rte_eth_txmode txmode
int rte_eth_allmulticast_get(uint16_t port_id)
int rte_eth_dev_is_valid_port(uint16_t port_id)
int rte_eth_timesync_enable(uint16_t port_id)
void rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link)
int __rte_experimental rte_eth_dev_owner_unset(const uint16_t port_id, const uint64_t owner_id)
struct rte_eth_rxconf default_rxconf
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)
__rte_deprecated uint16_t rte_eth_dev_count(void)
int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info)
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)