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__)
230 #define RTE_ETH_FOREACH_MATCHING_DEV(id, devargs, iter) \
231 for (rte_eth_iterator_init(iter, devargs), \
232 id = rte_eth_iterator_next(iter); \
233 id != RTE_MAX_ETHPORTS; \
234 id = rte_eth_iterator_next(iter))
254 uint64_t
q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
256 uint64_t
q_opackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
258 uint64_t
q_ibytes[RTE_ETHDEV_QUEUE_STAT_CNTRS];
260 uint64_t
q_obytes[RTE_ETHDEV_QUEUE_STAT_CNTRS];
262 uint64_t
q_errors[RTE_ETHDEV_QUEUE_STAT_CNTRS];
269 #define ETH_LINK_SPEED_AUTONEG (0 << 0)
270 #define ETH_LINK_SPEED_FIXED (1 << 0)
271 #define ETH_LINK_SPEED_10M_HD (1 << 1)
272 #define ETH_LINK_SPEED_10M (1 << 2)
273 #define ETH_LINK_SPEED_100M_HD (1 << 3)
274 #define ETH_LINK_SPEED_100M (1 << 4)
275 #define ETH_LINK_SPEED_1G (1 << 5)
276 #define ETH_LINK_SPEED_2_5G (1 << 6)
277 #define ETH_LINK_SPEED_5G (1 << 7)
278 #define ETH_LINK_SPEED_10G (1 << 8)
279 #define ETH_LINK_SPEED_20G (1 << 9)
280 #define ETH_LINK_SPEED_25G (1 << 10)
281 #define ETH_LINK_SPEED_40G (1 << 11)
282 #define ETH_LINK_SPEED_50G (1 << 12)
283 #define ETH_LINK_SPEED_56G (1 << 13)
284 #define ETH_LINK_SPEED_100G (1 << 14)
289 #define ETH_SPEED_NUM_NONE 0
290 #define ETH_SPEED_NUM_10M 10
291 #define ETH_SPEED_NUM_100M 100
292 #define ETH_SPEED_NUM_1G 1000
293 #define ETH_SPEED_NUM_2_5G 2500
294 #define ETH_SPEED_NUM_5G 5000
295 #define ETH_SPEED_NUM_10G 10000
296 #define ETH_SPEED_NUM_20G 20000
297 #define ETH_SPEED_NUM_25G 25000
298 #define ETH_SPEED_NUM_40G 40000
299 #define ETH_SPEED_NUM_50G 50000
300 #define ETH_SPEED_NUM_56G 56000
301 #define ETH_SPEED_NUM_100G 100000
312 } __attribute__((aligned(8)));
315 #define ETH_LINK_HALF_DUPLEX 0
316 #define ETH_LINK_FULL_DUPLEX 1
317 #define ETH_LINK_DOWN 0
318 #define ETH_LINK_UP 1
319 #define ETH_LINK_FIXED 0
320 #define ETH_LINK_AUTONEG 1
326 struct rte_eth_thresh {
335 #define ETH_MQ_RX_RSS_FLAG 0x1
336 #define ETH_MQ_RX_DCB_FLAG 0x2
337 #define ETH_MQ_RX_VMDQ_FLAG 0x4
368 #define ETH_RSS ETH_MQ_RX_RSS
369 #define VMDQ_DCB ETH_MQ_RX_VMDQ_DCB
370 #define ETH_DCB_RX ETH_MQ_RX_DCB
386 #define ETH_DCB_NONE ETH_MQ_TX_NONE
387 #define ETH_VMDQ_DCB_TX ETH_MQ_TX_VMDQ_DCB
388 #define ETH_DCB_TX ETH_MQ_TX_DCB
411 ETH_VLAN_TYPE_UNKNOWN = 0,
454 #define ETH_RSS_IPV4 (1ULL << RTE_ETH_FLOW_IPV4)
455 #define ETH_RSS_FRAG_IPV4 (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
456 #define ETH_RSS_NONFRAG_IPV4_TCP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
457 #define ETH_RSS_NONFRAG_IPV4_UDP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
458 #define ETH_RSS_NONFRAG_IPV4_SCTP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
459 #define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
460 #define ETH_RSS_IPV6 (1ULL << RTE_ETH_FLOW_IPV6)
461 #define ETH_RSS_FRAG_IPV6 (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
462 #define ETH_RSS_NONFRAG_IPV6_TCP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
463 #define ETH_RSS_NONFRAG_IPV6_UDP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
464 #define ETH_RSS_NONFRAG_IPV6_SCTP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
465 #define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
466 #define ETH_RSS_L2_PAYLOAD (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
467 #define ETH_RSS_IPV6_EX (1ULL << RTE_ETH_FLOW_IPV6_EX)
468 #define ETH_RSS_IPV6_TCP_EX (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
469 #define ETH_RSS_IPV6_UDP_EX (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
470 #define ETH_RSS_PORT (1ULL << RTE_ETH_FLOW_PORT)
471 #define ETH_RSS_VXLAN (1ULL << RTE_ETH_FLOW_VXLAN)
472 #define ETH_RSS_GENEVE (1ULL << RTE_ETH_FLOW_GENEVE)
473 #define ETH_RSS_NVGRE (1ULL << RTE_ETH_FLOW_NVGRE)
475 #define ETH_RSS_IP ( \
477 ETH_RSS_FRAG_IPV4 | \
478 ETH_RSS_NONFRAG_IPV4_OTHER | \
480 ETH_RSS_FRAG_IPV6 | \
481 ETH_RSS_NONFRAG_IPV6_OTHER | \
484 #define ETH_RSS_UDP ( \
485 ETH_RSS_NONFRAG_IPV4_UDP | \
486 ETH_RSS_NONFRAG_IPV6_UDP | \
489 #define ETH_RSS_TCP ( \
490 ETH_RSS_NONFRAG_IPV4_TCP | \
491 ETH_RSS_NONFRAG_IPV6_TCP | \
494 #define ETH_RSS_SCTP ( \
495 ETH_RSS_NONFRAG_IPV4_SCTP | \
496 ETH_RSS_NONFRAG_IPV6_SCTP)
498 #define ETH_RSS_TUNNEL ( \
504 #define ETH_RSS_PROTO_MASK ( \
506 ETH_RSS_FRAG_IPV4 | \
507 ETH_RSS_NONFRAG_IPV4_TCP | \
508 ETH_RSS_NONFRAG_IPV4_UDP | \
509 ETH_RSS_NONFRAG_IPV4_SCTP | \
510 ETH_RSS_NONFRAG_IPV4_OTHER | \
512 ETH_RSS_FRAG_IPV6 | \
513 ETH_RSS_NONFRAG_IPV6_TCP | \
514 ETH_RSS_NONFRAG_IPV6_UDP | \
515 ETH_RSS_NONFRAG_IPV6_SCTP | \
516 ETH_RSS_NONFRAG_IPV6_OTHER | \
517 ETH_RSS_L2_PAYLOAD | \
519 ETH_RSS_IPV6_TCP_EX | \
520 ETH_RSS_IPV6_UDP_EX | \
531 #define ETH_RSS_RETA_SIZE_64 64
532 #define ETH_RSS_RETA_SIZE_128 128
533 #define ETH_RSS_RETA_SIZE_256 256
534 #define ETH_RSS_RETA_SIZE_512 512
535 #define RTE_RETA_GROUP_SIZE 64
538 #define ETH_VMDQ_MAX_VLAN_FILTERS 64
539 #define ETH_DCB_NUM_USER_PRIORITIES 8
540 #define ETH_VMDQ_DCB_NUM_QUEUES 128
541 #define ETH_DCB_NUM_QUEUES 128
544 #define ETH_DCB_PG_SUPPORT 0x00000001
545 #define ETH_DCB_PFC_SUPPORT 0x00000002
548 #define ETH_VLAN_STRIP_OFFLOAD 0x0001
549 #define ETH_VLAN_FILTER_OFFLOAD 0x0002
550 #define ETH_VLAN_EXTEND_OFFLOAD 0x0004
553 #define ETH_VLAN_STRIP_MASK 0x0001
554 #define ETH_VLAN_FILTER_MASK 0x0002
555 #define ETH_VLAN_EXTEND_MASK 0x0004
556 #define ETH_VLAN_ID_MAX 0x0FFF
559 #define ETH_NUM_RECEIVE_MAC_ADDR 128
562 #define ETH_VMDQ_NUM_UC_HASH_ARRAY 128
565 #define ETH_VMDQ_ACCEPT_UNTAG 0x0001
566 #define ETH_VMDQ_ACCEPT_HASH_MC 0x0002
567 #define ETH_VMDQ_ACCEPT_HASH_UC 0x0004
568 #define ETH_VMDQ_ACCEPT_BROADCAST 0x0008
569 #define ETH_VMDQ_ACCEPT_MULTICAST 0x0010
572 #define ETH_MIRROR_MAX_VLANS 64
574 #define ETH_MIRROR_VIRTUAL_POOL_UP 0x01
575 #define ETH_MIRROR_UPLINK_PORT 0x02
576 #define ETH_MIRROR_DOWNLINK_PORT 0x04
577 #define ETH_MIRROR_VLAN 0x08
578 #define ETH_MIRROR_VIRTUAL_POOL_DOWN 0x10
583 struct rte_eth_vlan_mirror {
609 uint16_t
reta[RTE_RETA_GROUP_SIZE];
634 struct rte_eth_dcb_rx_conf {
640 struct rte_eth_vmdq_dcb_tx_conf {
646 struct rte_eth_dcb_tx_conf {
652 struct rte_eth_vmdq_tx_conf {
942 #define DEV_RX_OFFLOAD_VLAN_STRIP 0x00000001
943 #define DEV_RX_OFFLOAD_IPV4_CKSUM 0x00000002
944 #define DEV_RX_OFFLOAD_UDP_CKSUM 0x00000004
945 #define DEV_RX_OFFLOAD_TCP_CKSUM 0x00000008
946 #define DEV_RX_OFFLOAD_TCP_LRO 0x00000010
947 #define DEV_RX_OFFLOAD_QINQ_STRIP 0x00000020
948 #define DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000040
949 #define DEV_RX_OFFLOAD_MACSEC_STRIP 0x00000080
950 #define DEV_RX_OFFLOAD_HEADER_SPLIT 0x00000100
951 #define DEV_RX_OFFLOAD_VLAN_FILTER 0x00000200
952 #define DEV_RX_OFFLOAD_VLAN_EXTEND 0x00000400
953 #define DEV_RX_OFFLOAD_JUMBO_FRAME 0x00000800
954 #define DEV_RX_OFFLOAD_SCATTER 0x00002000
955 #define DEV_RX_OFFLOAD_TIMESTAMP 0x00004000
956 #define DEV_RX_OFFLOAD_SECURITY 0x00008000
957 #define DEV_RX_OFFLOAD_KEEP_CRC 0x00010000
958 #define DEV_RX_OFFLOAD_SCTP_CKSUM 0x00020000
959 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM 0x00040000
961 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
962 DEV_RX_OFFLOAD_UDP_CKSUM | \
963 DEV_RX_OFFLOAD_TCP_CKSUM)
964 #define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \
965 DEV_RX_OFFLOAD_VLAN_FILTER | \
966 DEV_RX_OFFLOAD_VLAN_EXTEND)
976 #define DEV_TX_OFFLOAD_VLAN_INSERT 0x00000001
977 #define DEV_TX_OFFLOAD_IPV4_CKSUM 0x00000002
978 #define DEV_TX_OFFLOAD_UDP_CKSUM 0x00000004
979 #define DEV_TX_OFFLOAD_TCP_CKSUM 0x00000008
980 #define DEV_TX_OFFLOAD_SCTP_CKSUM 0x00000010
981 #define DEV_TX_OFFLOAD_TCP_TSO 0x00000020
982 #define DEV_TX_OFFLOAD_UDP_TSO 0x00000040
983 #define DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000080
984 #define DEV_TX_OFFLOAD_QINQ_INSERT 0x00000100
985 #define DEV_TX_OFFLOAD_VXLAN_TNL_TSO 0x00000200
986 #define DEV_TX_OFFLOAD_GRE_TNL_TSO 0x00000400
987 #define DEV_TX_OFFLOAD_IPIP_TNL_TSO 0x00000800
988 #define DEV_TX_OFFLOAD_GENEVE_TNL_TSO 0x00001000
989 #define DEV_TX_OFFLOAD_MACSEC_INSERT 0x00002000
990 #define DEV_TX_OFFLOAD_MT_LOCKFREE 0x00004000
994 #define DEV_TX_OFFLOAD_MULTI_SEGS 0x00008000
996 #define DEV_TX_OFFLOAD_MBUF_FAST_FREE 0x00010000
1001 #define DEV_TX_OFFLOAD_SECURITY 0x00020000
1007 #define DEV_TX_OFFLOAD_UDP_TNL_TSO 0x00040000
1013 #define DEV_TX_OFFLOAD_IP_TNL_TSO 0x00080000
1015 #define DEV_TX_OFFLOAD_OUTER_UDP_CKSUM 0x00100000
1020 #define DEV_TX_OFFLOAD_MATCH_METADATA 0x00200000
1022 #define RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP 0x00000001
1024 #define RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP 0x00000002
1037 #define RTE_ETH_DEV_FALLBACK_RX_RINGSIZE 512
1038 #define RTE_ETH_DEV_FALLBACK_TX_RINGSIZE 512
1039 #define RTE_ETH_DEV_FALLBACK_RX_NBQUEUES 1
1040 #define RTE_ETH_DEV_FALLBACK_TX_NBQUEUES 1
1057 #define RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID (0)
1095 uint32_t max_hash_mac_addrs;
1157 #define RTE_ETH_XSTATS_NAME_SIZE 64
1184 #define ETH_DCB_NUM_TCS 8
1185 #define ETH_MAX_VMDQ_POOL 64
1196 }
tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
1201 }
tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
1219 #define RTE_ETH_QUEUE_STATE_STOPPED 0
1220 #define RTE_ETH_QUEUE_STATE_STARTED 1
1222 #define RTE_ETH_ALL RTE_MAX_ETHPORTS
1225 #define RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, retval) do { \
1226 if (!rte_eth_dev_is_valid_port(port_id)) { \
1227 RTE_ETHDEV_LOG(ERR, "Invalid port_id=%u\n", port_id); \
1232 #define RTE_ETH_VALID_PORTID_OR_RET(port_id) do { \
1233 if (!rte_eth_dev_is_valid_port(port_id)) { \
1234 RTE_ETHDEV_LOG(ERR, "Invalid port_id=%u\n", port_id); \
1244 #define ETH_L2_TUNNEL_ENABLE_MASK 0x00000001
1246 #define ETH_L2_TUNNEL_INSERTION_MASK 0x00000002
1248 #define ETH_L2_TUNNEL_STRIPPING_MASK 0x00000004
1250 #define ETH_L2_TUNNEL_FORWARDING_MASK 0x00000008
1275 struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts,
1299 struct rte_mbuf *pkts[], uint16_t nb_pkts,
void *user_param);
1313 struct rte_eth_dev_sriov {
1315 uint8_t nb_q_per_pool;
1316 uint16_t def_vmdq_idx;
1317 uint16_t def_pool_q_idx;
1319 #define RTE_ETH_DEV_SRIOV(dev) ((dev)->data->sriov)
1321 #define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
1323 #define RTE_ETH_DEV_NO_OWNER 0
1325 #define RTE_ETH_MAX_OWNER_NAME_LEN 64
1327 struct rte_eth_dev_owner {
1329 char name[RTE_ETH_MAX_OWNER_NAME_LEN];
1336 #define RTE_ETH_DEV_CLOSE_REMOVE 0x0001
1338 #define RTE_ETH_DEV_INTR_LSC 0x0002
1340 #define RTE_ETH_DEV_BONDED_SLAVE 0x0004
1342 #define RTE_ETH_DEV_INTR_RMV 0x0008
1344 #define RTE_ETH_DEV_REPRESENTOR 0x0010
1346 #define RTE_ETH_DEV_NOLIVE_MAC_ADDR 0x0020
1360 const uint64_t owner_id);
1365 #define RTE_ETH_FOREACH_DEV_OWNED_BY(p, o) \
1366 for (p = rte_eth_find_next_owned_by(0, o); \
1367 (unsigned int)p < (unsigned int)RTE_MAX_ETHPORTS; \
1368 p = rte_eth_find_next_owned_by(p + 1, o))
1383 #define RTE_ETH_FOREACH_DEV(p) \
1384 RTE_ETH_FOREACH_DEV_OWNED_BY(p, RTE_ETH_DEV_NO_OWNER)
1416 const struct rte_eth_dev_owner *owner);
1432 const uint64_t owner_id);
1459 struct rte_eth_dev_owner *owner);
1571 uint16_t nb_tx_queue,
const struct rte_eth_conf *eth_conf);
1584 int __rte_experimental
1637 uint16_t nb_rx_desc,
unsigned int socket_id,
1690 uint16_t nb_tx_desc,
unsigned int socket_id,
2119 uint64_t *values,
unsigned int size);
2168 uint16_t tx_queue_id, uint8_t stat_idx);
2188 uint16_t rx_queue_id,
2233 char *fw_version,
size_t fw_size);
2274 uint32_t *ptypes,
int num);
2423 typedef void (*buffer_tx_error_fn)(
struct rte_mbuf **unsent, uint16_t count,
2431 buffer_tx_error_fn error_callback;
2432 void *error_userdata;
2445 #define RTE_ETH_TX_BUFFER_SIZE(sz) \
2446 (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
2487 buffer_tx_error_fn callback,
void *
userdata);
2762 int epfd,
int op,
void *data);
2781 int __rte_experimental
2936 uint16_t reta_size);
2956 uint16_t reta_size);
3198 struct rte_eth_rxtx_callback;
3224 const struct rte_eth_rxtx_callback *
3253 const struct rte_eth_rxtx_callback *
3281 const struct rte_eth_rxtx_callback *
3316 const struct rte_eth_rxtx_callback *user_cb);
3349 const struct rte_eth_rxtx_callback *user_cb);
3475 int __rte_experimental
3497 int __rte_experimental
3499 struct rte_dev_eeprom_info *info);
3521 uint32_t nb_mc_addr);
3570 struct timespec *timestamp, uint32_t flags);
3588 struct timespec *timestamp);
3746 uint16_t *nb_rx_desc,
3747 uint16_t *nb_tx_desc);
3863 static inline uint16_t
3865 struct rte_mbuf **rx_pkts,
const uint16_t nb_pkts)
3867 struct rte_eth_dev *dev = &rte_eth_devices[port_id];
3870 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3871 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
3872 RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
3874 if (queue_id >= dev->data->nb_rx_queues) {
3875 RTE_ETHDEV_LOG(ERR,
"Invalid RX queue_id=%u\n", queue_id);
3879 nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
3882 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
3883 if (
unlikely(dev->post_rx_burst_cbs[queue_id] != NULL)) {
3884 struct rte_eth_rxtx_callback *cb =
3885 dev->post_rx_burst_cbs[queue_id];
3888 nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
3889 nb_pkts, cb->param);
3891 }
while (cb != NULL);
3913 struct rte_eth_dev *dev;
3915 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
3916 dev = &rte_eth_devices[port_id];
3917 RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
3918 if (queue_id >= dev->data->nb_rx_queues)
3921 return (
int)(*dev->dev_ops->rx_queue_count)(dev, queue_id);
3942 struct rte_eth_dev *dev = &rte_eth_devices[port_id];
3943 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
3944 RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
3945 return (*dev->dev_ops->rx_descriptor_done)( \
3946 dev->data->rx_queues[queue_id], offset);
3949 #define RTE_ETH_RX_DESC_AVAIL 0
3950 #define RTE_ETH_RX_DESC_DONE 1
3951 #define RTE_ETH_RX_DESC_UNAVAIL 2
3990 struct rte_eth_dev *dev;
3993 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3994 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
3996 dev = &rte_eth_devices[port_id];
3997 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3998 if (queue_id >= dev->data->nb_rx_queues)
4001 RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
4002 rxq = dev->data->rx_queues[queue_id];
4004 return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
4007 #define RTE_ETH_TX_DESC_FULL 0
4008 #define RTE_ETH_TX_DESC_DONE 1
4009 #define RTE_ETH_TX_DESC_UNAVAIL 2
4044 static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
4045 uint16_t queue_id, uint16_t offset)
4047 struct rte_eth_dev *dev;
4050 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
4051 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
4053 dev = &rte_eth_devices[port_id];
4054 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
4055 if (queue_id >= dev->data->nb_tx_queues)
4058 RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
4059 txq = dev->data->tx_queues[queue_id];
4061 return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
4130 static inline uint16_t
4132 struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
4134 struct rte_eth_dev *dev = &rte_eth_devices[port_id];
4136 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
4137 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
4138 RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
4140 if (queue_id >= dev->data->nb_tx_queues) {
4141 RTE_ETHDEV_LOG(ERR,
"Invalid TX queue_id=%u\n", queue_id);
4146 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
4147 struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
4151 nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
4154 }
while (cb != NULL);
4158 return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
4214 #ifndef RTE_ETHDEV_TX_PREPARE_NOOP
4216 static inline uint16_t
4218 struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
4220 struct rte_eth_dev *dev;
4222 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
4224 RTE_ETHDEV_LOG(ERR,
"Invalid TX port_id=%u\n", port_id);
4230 dev = &rte_eth_devices[port_id];
4232 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
4233 if (queue_id >= dev->data->nb_tx_queues) {
4234 RTE_ETHDEV_LOG(ERR,
"Invalid TX queue_id=%u\n", queue_id);
4240 if (!dev->tx_pkt_prepare)
4243 return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
4258 static inline uint16_t
4290 static inline uint16_t
4295 uint16_t to_send = buffer->
length;
4306 buffer->error_callback(&buffer->
pkts[sent],
4307 (uint16_t)(to_send - sent),
4308 buffer->error_userdata);