DPDK  18.02.0
rte_ethdev.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2017 Intel Corporation
3  */
4 
5 #ifndef _RTE_ETHDEV_H_
6 #define _RTE_ETHDEV_H_
7 
140 #ifdef __cplusplus
141 extern "C" {
142 #endif
143 
144 #include <stdint.h>
145 
146 /* Use this macro to check if LRO API is supported */
147 #define RTE_ETHDEV_HAS_LRO_SUPPORT
148 
149 #include <rte_compat.h>
150 #include <rte_log.h>
151 #include <rte_interrupts.h>
152 #include <rte_dev.h>
153 #include <rte_devargs.h>
154 #include <rte_errno.h>
155 #include <rte_common.h>
156 #include <rte_config.h>
157 
158 #include "rte_ether.h"
159 #include "rte_eth_ctrl.h"
160 #include "rte_dev_info.h"
161 
162 struct rte_mbuf;
163 
171  uint64_t ipackets;
172  uint64_t opackets;
173  uint64_t ibytes;
174  uint64_t obytes;
175  uint64_t imissed;
179  uint64_t ierrors;
180  uint64_t oerrors;
181  uint64_t rx_nombuf;
182  uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
184  uint64_t q_opackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
186  uint64_t q_ibytes[RTE_ETHDEV_QUEUE_STAT_CNTRS];
188  uint64_t q_obytes[RTE_ETHDEV_QUEUE_STAT_CNTRS];
190  uint64_t q_errors[RTE_ETHDEV_QUEUE_STAT_CNTRS];
192 };
193 
197 #define ETH_LINK_SPEED_AUTONEG (0 << 0)
198 #define ETH_LINK_SPEED_FIXED (1 << 0)
199 #define ETH_LINK_SPEED_10M_HD (1 << 1)
200 #define ETH_LINK_SPEED_10M (1 << 2)
201 #define ETH_LINK_SPEED_100M_HD (1 << 3)
202 #define ETH_LINK_SPEED_100M (1 << 4)
203 #define ETH_LINK_SPEED_1G (1 << 5)
204 #define ETH_LINK_SPEED_2_5G (1 << 6)
205 #define ETH_LINK_SPEED_5G (1 << 7)
206 #define ETH_LINK_SPEED_10G (1 << 8)
207 #define ETH_LINK_SPEED_20G (1 << 9)
208 #define ETH_LINK_SPEED_25G (1 << 10)
209 #define ETH_LINK_SPEED_40G (1 << 11)
210 #define ETH_LINK_SPEED_50G (1 << 12)
211 #define ETH_LINK_SPEED_56G (1 << 13)
212 #define ETH_LINK_SPEED_100G (1 << 14)
217 #define ETH_SPEED_NUM_NONE 0
218 #define ETH_SPEED_NUM_10M 10
219 #define ETH_SPEED_NUM_100M 100
220 #define ETH_SPEED_NUM_1G 1000
221 #define ETH_SPEED_NUM_2_5G 2500
222 #define ETH_SPEED_NUM_5G 5000
223 #define ETH_SPEED_NUM_10G 10000
224 #define ETH_SPEED_NUM_20G 20000
225 #define ETH_SPEED_NUM_25G 25000
226 #define ETH_SPEED_NUM_40G 40000
227 #define ETH_SPEED_NUM_50G 50000
228 #define ETH_SPEED_NUM_56G 56000
229 #define ETH_SPEED_NUM_100G 100000
234 __extension__
235 struct rte_eth_link {
236  uint32_t link_speed;
237  uint16_t link_duplex : 1;
238  uint16_t link_autoneg : 1;
239  uint16_t link_status : 1;
240 } __attribute__((aligned(8)));
242 /* Utility constants */
243 #define ETH_LINK_HALF_DUPLEX 0
244 #define ETH_LINK_FULL_DUPLEX 1
245 #define ETH_LINK_DOWN 0
246 #define ETH_LINK_UP 1
247 #define ETH_LINK_FIXED 0
248 #define ETH_LINK_AUTONEG 1
254 struct rte_eth_thresh {
255  uint8_t pthresh;
256  uint8_t hthresh;
257  uint8_t wthresh;
258 };
259 
263 #define ETH_MQ_RX_RSS_FLAG 0x1
264 #define ETH_MQ_RX_DCB_FLAG 0x2
265 #define ETH_MQ_RX_VMDQ_FLAG 0x4
266 
274 
278  ETH_MQ_RX_DCB = ETH_MQ_RX_DCB_FLAG,
280  ETH_MQ_RX_DCB_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_DCB_FLAG,
281 
283  ETH_MQ_RX_VMDQ_ONLY = ETH_MQ_RX_VMDQ_FLAG,
285  ETH_MQ_RX_VMDQ_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_VMDQ_FLAG,
287  ETH_MQ_RX_VMDQ_DCB = ETH_MQ_RX_VMDQ_FLAG | ETH_MQ_RX_DCB_FLAG,
290  ETH_MQ_RX_VMDQ_FLAG,
291 };
292 
296 #define ETH_RSS ETH_MQ_RX_RSS
297 #define VMDQ_DCB ETH_MQ_RX_VMDQ_DCB
298 #define ETH_DCB_RX ETH_MQ_RX_DCB
299 
309 };
310 
314 #define ETH_DCB_NONE ETH_MQ_TX_NONE
315 #define ETH_VMDQ_DCB_TX ETH_MQ_TX_VMDQ_DCB
316 #define ETH_DCB_TX ETH_MQ_TX_DCB
317 
324  uint32_t max_rx_pkt_len;
325  uint16_t split_hdr_size;
331  uint64_t offloads;
332  __extension__
338  uint16_t header_split : 1,
339  hw_ip_checksum : 1,
340  hw_vlan_filter : 1,
341  hw_vlan_strip : 1,
342  hw_vlan_extend : 1,
343  jumbo_frame : 1,
344  hw_strip_crc : 1,
345  enable_scatter : 1,
346  enable_lro : 1,
347  hw_timestamp : 1,
348  security : 1,
359 };
360 
366  ETH_VLAN_TYPE_UNKNOWN = 0,
369  ETH_VLAN_TYPE_MAX,
370 };
371 
377  uint64_t ids[64];
378 };
379 
398  uint8_t *rss_key;
399  uint8_t rss_key_len;
400  uint64_t rss_hf;
401 };
402 
403 /*
404  * The RSS offload types are defined based on flow types which are defined
405  * in rte_eth_ctrl.h. Different NIC hardwares may support different RSS offload
406  * types. The supported flow types or RSS offload types can be queried by
407  * rte_eth_dev_info_get().
408  */
409 #define ETH_RSS_IPV4 (1ULL << RTE_ETH_FLOW_IPV4)
410 #define ETH_RSS_FRAG_IPV4 (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
411 #define ETH_RSS_NONFRAG_IPV4_TCP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
412 #define ETH_RSS_NONFRAG_IPV4_UDP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
413 #define ETH_RSS_NONFRAG_IPV4_SCTP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
414 #define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
415 #define ETH_RSS_IPV6 (1ULL << RTE_ETH_FLOW_IPV6)
416 #define ETH_RSS_FRAG_IPV6 (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
417 #define ETH_RSS_NONFRAG_IPV6_TCP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
418 #define ETH_RSS_NONFRAG_IPV6_UDP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
419 #define ETH_RSS_NONFRAG_IPV6_SCTP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
420 #define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
421 #define ETH_RSS_L2_PAYLOAD (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
422 #define ETH_RSS_IPV6_EX (1ULL << RTE_ETH_FLOW_IPV6_EX)
423 #define ETH_RSS_IPV6_TCP_EX (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
424 #define ETH_RSS_IPV6_UDP_EX (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
425 #define ETH_RSS_PORT (1ULL << RTE_ETH_FLOW_PORT)
426 #define ETH_RSS_VXLAN (1ULL << RTE_ETH_FLOW_VXLAN)
427 #define ETH_RSS_GENEVE (1ULL << RTE_ETH_FLOW_GENEVE)
428 #define ETH_RSS_NVGRE (1ULL << RTE_ETH_FLOW_NVGRE)
429 
430 #define ETH_RSS_IP ( \
431  ETH_RSS_IPV4 | \
432  ETH_RSS_FRAG_IPV4 | \
433  ETH_RSS_NONFRAG_IPV4_OTHER | \
434  ETH_RSS_IPV6 | \
435  ETH_RSS_FRAG_IPV6 | \
436  ETH_RSS_NONFRAG_IPV6_OTHER | \
437  ETH_RSS_IPV6_EX)
438 
439 #define ETH_RSS_UDP ( \
440  ETH_RSS_NONFRAG_IPV4_UDP | \
441  ETH_RSS_NONFRAG_IPV6_UDP | \
442  ETH_RSS_IPV6_UDP_EX)
443 
444 #define ETH_RSS_TCP ( \
445  ETH_RSS_NONFRAG_IPV4_TCP | \
446  ETH_RSS_NONFRAG_IPV6_TCP | \
447  ETH_RSS_IPV6_TCP_EX)
448 
449 #define ETH_RSS_SCTP ( \
450  ETH_RSS_NONFRAG_IPV4_SCTP | \
451  ETH_RSS_NONFRAG_IPV6_SCTP)
452 
453 #define ETH_RSS_TUNNEL ( \
454  ETH_RSS_VXLAN | \
455  ETH_RSS_GENEVE | \
456  ETH_RSS_NVGRE)
457 
459 #define ETH_RSS_PROTO_MASK ( \
460  ETH_RSS_IPV4 | \
461  ETH_RSS_FRAG_IPV4 | \
462  ETH_RSS_NONFRAG_IPV4_TCP | \
463  ETH_RSS_NONFRAG_IPV4_UDP | \
464  ETH_RSS_NONFRAG_IPV4_SCTP | \
465  ETH_RSS_NONFRAG_IPV4_OTHER | \
466  ETH_RSS_IPV6 | \
467  ETH_RSS_FRAG_IPV6 | \
468  ETH_RSS_NONFRAG_IPV6_TCP | \
469  ETH_RSS_NONFRAG_IPV6_UDP | \
470  ETH_RSS_NONFRAG_IPV6_SCTP | \
471  ETH_RSS_NONFRAG_IPV6_OTHER | \
472  ETH_RSS_L2_PAYLOAD | \
473  ETH_RSS_IPV6_EX | \
474  ETH_RSS_IPV6_TCP_EX | \
475  ETH_RSS_IPV6_UDP_EX | \
476  ETH_RSS_PORT | \
477  ETH_RSS_VXLAN | \
478  ETH_RSS_GENEVE | \
479  ETH_RSS_NVGRE)
480 
481 /*
482  * Definitions used for redirection table entry size.
483  * Some RSS RETA sizes may not be supported by some drivers, check the
484  * documentation or the description of relevant functions for more details.
485  */
486 #define ETH_RSS_RETA_SIZE_64 64
487 #define ETH_RSS_RETA_SIZE_128 128
488 #define ETH_RSS_RETA_SIZE_256 256
489 #define ETH_RSS_RETA_SIZE_512 512
490 #define RTE_RETA_GROUP_SIZE 64
491 
492 /* Definitions used for VMDQ and DCB functionality */
493 #define ETH_VMDQ_MAX_VLAN_FILTERS 64
494 #define ETH_DCB_NUM_USER_PRIORITIES 8
495 #define ETH_VMDQ_DCB_NUM_QUEUES 128
496 #define ETH_DCB_NUM_QUEUES 128
498 /* DCB capability defines */
499 #define ETH_DCB_PG_SUPPORT 0x00000001
500 #define ETH_DCB_PFC_SUPPORT 0x00000002
502 /* Definitions used for VLAN Offload functionality */
503 #define ETH_VLAN_STRIP_OFFLOAD 0x0001
504 #define ETH_VLAN_FILTER_OFFLOAD 0x0002
505 #define ETH_VLAN_EXTEND_OFFLOAD 0x0004
507 /* Definitions used for mask VLAN setting */
508 #define ETH_VLAN_STRIP_MASK 0x0001
509 #define ETH_VLAN_FILTER_MASK 0x0002
510 #define ETH_VLAN_EXTEND_MASK 0x0004
511 #define ETH_VLAN_ID_MAX 0x0FFF
513 /* Definitions used for receive MAC address */
514 #define ETH_NUM_RECEIVE_MAC_ADDR 128
516 /* Definitions used for unicast hash */
517 #define ETH_VMDQ_NUM_UC_HASH_ARRAY 128
519 /* Definitions used for VMDQ pool rx mode setting */
520 #define ETH_VMDQ_ACCEPT_UNTAG 0x0001
521 #define ETH_VMDQ_ACCEPT_HASH_MC 0x0002
522 #define ETH_VMDQ_ACCEPT_HASH_UC 0x0004
523 #define ETH_VMDQ_ACCEPT_BROADCAST 0x0008
524 #define ETH_VMDQ_ACCEPT_MULTICAST 0x0010
527 #define ETH_MIRROR_MAX_VLANS 64
528 
529 #define ETH_MIRROR_VIRTUAL_POOL_UP 0x01
530 #define ETH_MIRROR_UPLINK_PORT 0x02
531 #define ETH_MIRROR_DOWNLINK_PORT 0x04
532 #define ETH_MIRROR_VLAN 0x08
533 #define ETH_MIRROR_VIRTUAL_POOL_DOWN 0x10
538 struct rte_eth_vlan_mirror {
539  uint64_t vlan_mask;
541  uint16_t vlan_id[ETH_MIRROR_MAX_VLANS];
542 };
543 
548  uint8_t rule_type;
549  uint8_t dst_pool;
550  uint64_t pool_mask;
553 };
554 
562  uint64_t mask;
564  uint16_t reta[RTE_RETA_GROUP_SIZE];
566 };
567 
573  ETH_4_TCS = 4,
575 };
576 
586 };
587 
588 /* This structure may be extended in future. */
589 struct rte_eth_dcb_rx_conf {
590  enum rte_eth_nb_tcs nb_tcs;
592  uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
593 };
594 
595 struct rte_eth_vmdq_dcb_tx_conf {
596  enum rte_eth_nb_pools nb_queue_pools;
598  uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
599 };
600 
601 struct rte_eth_dcb_tx_conf {
602  enum rte_eth_nb_tcs nb_tcs;
604  uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
605 };
606 
607 struct rte_eth_vmdq_tx_conf {
608  enum rte_eth_nb_pools nb_queue_pools;
609 };
610 
625  uint8_t default_pool;
626  uint8_t nb_pool_maps;
627  struct {
628  uint16_t vlan_id;
629  uint64_t pools;
633 };
634 
656  uint8_t default_pool;
658  uint8_t nb_pool_maps;
659  uint32_t rx_mode;
660  struct {
661  uint16_t vlan_id;
662  uint64_t pools;
664 };
665 
676  uint64_t offloads;
677 
678  /* For i40e specifically */
679  uint16_t pvid;
680  __extension__
681  uint8_t hw_vlan_reject_tagged : 1,
687 };
688 
694  uint16_t rx_free_thresh;
695  uint8_t rx_drop_en;
702  uint64_t offloads;
703 };
704 
705 #define ETH_TXQ_FLAGS_NOMULTSEGS 0x0001
706 #define ETH_TXQ_FLAGS_NOREFCOUNT 0x0002
707 #define ETH_TXQ_FLAGS_NOMULTMEMP 0x0004
708 #define ETH_TXQ_FLAGS_NOVLANOFFL 0x0100
709 #define ETH_TXQ_FLAGS_NOXSUMSCTP 0x0200
710 #define ETH_TXQ_FLAGS_NOXSUMUDP 0x0400
711 #define ETH_TXQ_FLAGS_NOXSUMTCP 0x0800
712 #define ETH_TXQ_FLAGS_NOOFFLOADS \
713  (ETH_TXQ_FLAGS_NOVLANOFFL | ETH_TXQ_FLAGS_NOXSUMSCTP | \
714  ETH_TXQ_FLAGS_NOXSUMUDP | ETH_TXQ_FLAGS_NOXSUMTCP)
715 #define ETH_TXQ_FLAGS_NOXSUMS \
716  (ETH_TXQ_FLAGS_NOXSUMSCTP | ETH_TXQ_FLAGS_NOXSUMUDP | \
717  ETH_TXQ_FLAGS_NOXSUMTCP)
718 
725 #define ETH_TXQ_FLAGS_IGNORE 0x8000
726 
732  uint16_t tx_rs_thresh;
733  uint16_t tx_free_thresh;
736  uint32_t txq_flags;
743  uint64_t offloads;
744 };
745 
750  uint16_t nb_max;
751  uint16_t nb_min;
752  uint16_t nb_align;
762  uint16_t nb_seg_max;
763 
775  uint16_t nb_mtu_seg_max;
776 };
777 
786 };
787 
794  uint32_t high_water;
795  uint32_t low_water;
796  uint16_t pause_time;
797  uint16_t send_xon;
800  uint8_t autoneg;
801 };
802 
810  uint8_t priority;
811 };
812 
821 };
822 
830 };
831 
843  uint8_t drop_queue;
844  struct rte_eth_fdir_masks mask;
847 };
848 
857  uint16_t udp_port;
858  uint8_t prot_type;
859 };
860 
866  uint32_t lsc:1;
868  uint32_t rxq:1;
870  uint32_t rmv:1;
871 };
872 
878 struct rte_eth_conf {
879  uint32_t link_speeds;
888  uint32_t lpbk_mode;
893  struct {
897  struct rte_eth_dcb_rx_conf dcb_rx_conf;
901  } rx_adv_conf;
902  union {
903  struct rte_eth_vmdq_dcb_tx_conf vmdq_dcb_tx_conf;
905  struct rte_eth_dcb_tx_conf dcb_tx_conf;
907  struct rte_eth_vmdq_tx_conf vmdq_tx_conf;
909  } tx_adv_conf;
915 };
916 
926 #define DEV_RX_OFFLOAD_VLAN_STRIP 0x00000001
927 #define DEV_RX_OFFLOAD_IPV4_CKSUM 0x00000002
928 #define DEV_RX_OFFLOAD_UDP_CKSUM 0x00000004
929 #define DEV_RX_OFFLOAD_TCP_CKSUM 0x00000008
930 #define DEV_RX_OFFLOAD_TCP_LRO 0x00000010
931 #define DEV_RX_OFFLOAD_QINQ_STRIP 0x00000020
932 #define DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000040
933 #define DEV_RX_OFFLOAD_MACSEC_STRIP 0x00000080
934 #define DEV_RX_OFFLOAD_HEADER_SPLIT 0x00000100
935 #define DEV_RX_OFFLOAD_VLAN_FILTER 0x00000200
936 #define DEV_RX_OFFLOAD_VLAN_EXTEND 0x00000400
937 #define DEV_RX_OFFLOAD_JUMBO_FRAME 0x00000800
938 #define DEV_RX_OFFLOAD_CRC_STRIP 0x00001000
939 #define DEV_RX_OFFLOAD_SCATTER 0x00002000
940 #define DEV_RX_OFFLOAD_TIMESTAMP 0x00004000
941 #define DEV_RX_OFFLOAD_SECURITY 0x00008000
942 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
943  DEV_RX_OFFLOAD_UDP_CKSUM | \
944  DEV_RX_OFFLOAD_TCP_CKSUM)
945 #define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \
946  DEV_RX_OFFLOAD_VLAN_FILTER | \
947  DEV_RX_OFFLOAD_VLAN_EXTEND)
948 
949 /*
950  * If new Rx offload capabilities are defined, they also must be
951  * mentioned in rte_rx_offload_names in rte_ethdev.c file.
952  */
953 
957 #define DEV_TX_OFFLOAD_VLAN_INSERT 0x00000001
958 #define DEV_TX_OFFLOAD_IPV4_CKSUM 0x00000002
959 #define DEV_TX_OFFLOAD_UDP_CKSUM 0x00000004
960 #define DEV_TX_OFFLOAD_TCP_CKSUM 0x00000008
961 #define DEV_TX_OFFLOAD_SCTP_CKSUM 0x00000010
962 #define DEV_TX_OFFLOAD_TCP_TSO 0x00000020
963 #define DEV_TX_OFFLOAD_UDP_TSO 0x00000040
964 #define DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000080
965 #define DEV_TX_OFFLOAD_QINQ_INSERT 0x00000100
966 #define DEV_TX_OFFLOAD_VXLAN_TNL_TSO 0x00000200
967 #define DEV_TX_OFFLOAD_GRE_TNL_TSO 0x00000400
968 #define DEV_TX_OFFLOAD_IPIP_TNL_TSO 0x00000800
969 #define DEV_TX_OFFLOAD_GENEVE_TNL_TSO 0x00001000
970 #define DEV_TX_OFFLOAD_MACSEC_INSERT 0x00002000
971 #define DEV_TX_OFFLOAD_MT_LOCKFREE 0x00004000
972 
975 #define DEV_TX_OFFLOAD_MULTI_SEGS 0x00008000
976 
977 #define DEV_TX_OFFLOAD_MBUF_FAST_FREE 0x00010000
978 
982 #define DEV_TX_OFFLOAD_SECURITY 0x00020000
983 
984 /*
985  * If new Tx offload capabilities are defined, they also must be
986  * mentioned in rte_tx_offload_names in rte_ethdev.c file.
987  */
988 
989 struct rte_pci_device;
990 
995  struct rte_pci_device *pci_dev;
996  const char *driver_name;
997  unsigned int if_index;
999  uint32_t min_rx_bufsize;
1000  uint32_t max_rx_pktlen;
1001  uint16_t max_rx_queues;
1002  uint16_t max_tx_queues;
1003  uint32_t max_mac_addrs;
1004  uint32_t max_hash_mac_addrs;
1006  uint16_t max_vfs;
1007  uint16_t max_vmdq_pools;
1016  uint16_t reta_size;
1018  uint8_t hash_key_size;
1023  uint16_t vmdq_queue_base;
1024  uint16_t vmdq_queue_num;
1025  uint16_t vmdq_pool_base;
1028  uint32_t speed_capa;
1030  uint16_t nb_rx_queues;
1031  uint16_t nb_tx_queues;
1032 };
1033 
1039  struct rte_mempool *mp;
1041  uint8_t scattered_rx;
1042  uint16_t nb_desc;
1044 
1051  uint16_t nb_desc;
1053 
1055 #define RTE_ETH_XSTATS_NAME_SIZE 64
1056 
1067  uint64_t id;
1068  uint64_t value;
1069 };
1070 
1080 };
1081 
1082 #define ETH_DCB_NUM_TCS 8
1083 #define ETH_MAX_VMDQ_POOL 64
1084 
1091  struct {
1092  uint8_t base;
1093  uint8_t nb_queue;
1094  } tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
1096  struct {
1097  uint8_t base;
1098  uint8_t nb_queue;
1099  } tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
1100 };
1101 
1107  uint8_t nb_tcs;
1109  uint8_t tc_bws[ETH_DCB_NUM_TCS];
1112 };
1113 
1117 #define RTE_ETH_QUEUE_STATE_STOPPED 0
1118 #define RTE_ETH_QUEUE_STATE_STARTED 1
1119 
1120 struct rte_eth_dev;
1121 
1122 #define RTE_ETH_ALL RTE_MAX_ETHPORTS
1123 
1124 /* Macros to check for valid port */
1125 #define RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, retval) do { \
1126  if (!rte_eth_dev_is_valid_port(port_id)) { \
1127  RTE_PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); \
1128  return retval; \
1129  } \
1130 } while (0)
1131 
1132 #define RTE_ETH_VALID_PORTID_OR_RET(port_id) do { \
1133  if (!rte_eth_dev_is_valid_port(port_id)) { \
1134  RTE_PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); \
1135  return; \
1136  } \
1137 } while (0)
1138 
1144 #define ETH_L2_TUNNEL_ENABLE_MASK 0x00000001
1145 
1146 #define ETH_L2_TUNNEL_INSERTION_MASK 0x00000002
1147 
1148 #define ETH_L2_TUNNEL_STRIPPING_MASK 0x00000004
1149 
1150 #define ETH_L2_TUNNEL_FORWARDING_MASK 0x00000008
1151 
1174 typedef uint16_t (*rte_rx_callback_fn)(uint16_t port_id, uint16_t queue,
1175  struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts,
1176  void *user_param);
1177 
1198 typedef uint16_t (*rte_tx_callback_fn)(uint16_t port_id, uint16_t queue,
1199  struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
1200 
1205  RTE_ETH_DEV_UNUSED = 0,
1206  RTE_ETH_DEV_ATTACHED,
1207  RTE_ETH_DEV_DEFERRED,
1208  RTE_ETH_DEV_REMOVED,
1209 };
1210 
1211 struct rte_eth_dev_sriov {
1212  uint8_t active;
1213  uint8_t nb_q_per_pool;
1214  uint16_t def_vmdq_idx;
1215  uint16_t def_pool_q_idx;
1216 };
1217 #define RTE_ETH_DEV_SRIOV(dev) ((dev)->data->sriov)
1218 
1219 #define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
1220 
1221 #define RTE_ETH_DEV_NO_OWNER 0
1222 
1223 #define RTE_ETH_MAX_OWNER_NAME_LEN 64
1224 
1225 struct rte_eth_dev_owner {
1226  uint64_t id;
1227  char name[RTE_ETH_MAX_OWNER_NAME_LEN];
1228 };
1229 
1231 #define RTE_ETH_DEV_INTR_LSC 0x0002
1232 
1233 #define RTE_ETH_DEV_BONDED_SLAVE 0x0004
1234 
1235 #define RTE_ETH_DEV_INTR_RMV 0x0008
1236 
1251 uint64_t __rte_experimental rte_eth_find_next_owned_by(uint16_t port_id,
1252  const uint64_t owner_id);
1253 
1257 #define RTE_ETH_FOREACH_DEV_OWNED_BY(p, o) \
1258  for (p = rte_eth_find_next_owned_by(0, o); \
1259  (unsigned int)p < (unsigned int)RTE_MAX_ETHPORTS; \
1260  p = rte_eth_find_next_owned_by(p + 1, o))
1261 
1270 uint16_t rte_eth_find_next(uint16_t port_id);
1271 
1275 #define RTE_ETH_FOREACH_DEV(p) \
1276  RTE_ETH_FOREACH_DEV_OWNED_BY(p, RTE_ETH_DEV_NO_OWNER)
1277 
1278 
1292 int __rte_experimental rte_eth_dev_owner_new(uint64_t *owner_id);
1293 
1307 int __rte_experimental rte_eth_dev_owner_set(const uint16_t port_id,
1308  const struct rte_eth_dev_owner *owner);
1309 
1323 int __rte_experimental rte_eth_dev_owner_unset(const uint16_t port_id,
1324  const uint64_t owner_id);
1325 
1335 void __rte_experimental rte_eth_dev_owner_delete(const uint64_t owner_id);
1336 
1350 int __rte_experimental rte_eth_dev_owner_get(const uint16_t port_id,
1351  struct rte_eth_dev_owner *owner);
1352 
1365 uint16_t rte_eth_dev_count(void);
1366 
1379 int rte_eth_dev_attach(const char *devargs, uint16_t *port_id);
1380 
1394 int rte_eth_dev_detach(uint16_t port_id, char *devname);
1395 
1407 uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex);
1408 
1420 const char * __rte_experimental rte_eth_dev_rx_offload_name(uint64_t offload);
1421 
1433 const char * __rte_experimental rte_eth_dev_tx_offload_name(uint64_t offload);
1434 
1467 int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue,
1468  uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf);
1469 
1481 int __rte_experimental
1482 rte_eth_dev_is_removed(uint16_t port_id);
1483 
1526 int rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
1527  uint16_t nb_rx_desc, unsigned int socket_id,
1528  const struct rte_eth_rxconf *rx_conf,
1529  struct rte_mempool *mb_pool);
1530 
1579 int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,
1580  uint16_t nb_tx_desc, unsigned int socket_id,
1581  const struct rte_eth_txconf *tx_conf);
1582 
1593 int rte_eth_dev_socket_id(uint16_t port_id);
1594 
1604 int rte_eth_dev_is_valid_port(uint16_t port_id);
1605 
1622 int rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id);
1623 
1639 int rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id);
1640 
1657 int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id);
1658 
1674 int rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id);
1675 
1691 int rte_eth_dev_start(uint16_t port_id);
1692 
1700 void rte_eth_dev_stop(uint16_t port_id);
1701 
1714 int rte_eth_dev_set_link_up(uint16_t port_id);
1715 
1725 int rte_eth_dev_set_link_down(uint16_t port_id);
1726 
1735 void rte_eth_dev_close(uint16_t port_id);
1736 
1774 int rte_eth_dev_reset(uint16_t port_id);
1775 
1782 void rte_eth_promiscuous_enable(uint16_t port_id);
1783 
1790 void rte_eth_promiscuous_disable(uint16_t port_id);
1791 
1802 int rte_eth_promiscuous_get(uint16_t port_id);
1803 
1810 void rte_eth_allmulticast_enable(uint16_t port_id);
1811 
1818 void rte_eth_allmulticast_disable(uint16_t port_id);
1819 
1830 int rte_eth_allmulticast_get(uint16_t port_id);
1831 
1843 void rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link);
1844 
1856 void rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link);
1857 
1875 int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats);
1876 
1887 int rte_eth_stats_reset(uint16_t port_id);
1888 
1909 int rte_eth_xstats_get_names(uint16_t port_id,
1910  struct rte_eth_xstat_name *xstats_names,
1911  unsigned int size);
1912 
1935 int rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats,
1936  unsigned int n);
1937 
1960 int
1961 rte_eth_xstats_get_names_by_id(uint16_t port_id,
1962  struct rte_eth_xstat_name *xstats_names, unsigned int size,
1963  uint64_t *ids);
1964 
1988 int rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids,
1989  uint64_t *values, unsigned int size);
1990 
2009 int rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name,
2010  uint64_t *id);
2011 
2018 void rte_eth_xstats_reset(uint16_t port_id);
2019 
2037 int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id,
2038  uint16_t tx_queue_id, uint8_t stat_idx);
2039 
2057 int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id,
2058  uint16_t rx_queue_id,
2059  uint8_t stat_idx);
2060 
2070 void rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr);
2071 
2081 void rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info);
2082 
2102 int rte_eth_dev_fw_version_get(uint16_t port_id,
2103  char *fw_version, size_t fw_size);
2104 
2143 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
2144  uint32_t *ptypes, int num);
2145 
2157 int rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu);
2158 
2174 int rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu);
2175 
2195 int rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on);
2196 
2216 int rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id,
2217  int on);
2218 
2236 int rte_eth_dev_set_vlan_ether_type(uint16_t port_id,
2237  enum rte_vlan_type vlan_type,
2238  uint16_t tag_type);
2239 
2261 int rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask);
2262 
2275 int rte_eth_dev_get_vlan_offload(uint16_t port_id);
2276 
2291 int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on);
2292 
2293 typedef void (*buffer_tx_error_fn)(struct rte_mbuf **unsent, uint16_t count,
2294  void *userdata);
2295 
2301  buffer_tx_error_fn error_callback;
2302  void *error_userdata;
2303  uint16_t size;
2304  uint16_t length;
2305  struct rte_mbuf *pkts[];
2307 };
2308 
2315 #define RTE_ETH_TX_BUFFER_SIZE(sz) \
2316  (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
2317 
2328 int
2329 rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);
2330 
2355 int
2357  buffer_tx_error_fn callback, void *userdata);
2358 
2381 void
2382 rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
2383  void *userdata);
2384 
2408 void
2409 rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
2410  void *userdata);
2411 
2437 int
2438 rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
2439 
2456 };
2457 
2458 typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id,
2459  enum rte_eth_event_type event, void *cb_arg, void *ret_param);
2479 int rte_eth_dev_callback_register(uint16_t port_id,
2480  enum rte_eth_event_type event,
2481  rte_eth_dev_cb_fn cb_fn, void *cb_arg);
2482 
2501 int rte_eth_dev_callback_unregister(uint16_t port_id,
2502  enum rte_eth_event_type event,
2503  rte_eth_dev_cb_fn cb_fn, void *cb_arg);
2504 
2526 int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id);
2527 
2548 int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id);
2549 
2567 int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data);
2568 
2590 int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id,
2591  int epfd, int op, void *data);
2592 
2606 int rte_eth_led_on(uint16_t port_id);
2607 
2621 int rte_eth_led_off(uint16_t port_id);
2622 
2636 int rte_eth_dev_flow_ctrl_get(uint16_t port_id,
2637  struct rte_eth_fc_conf *fc_conf);
2638 
2653 int rte_eth_dev_flow_ctrl_set(uint16_t port_id,
2654  struct rte_eth_fc_conf *fc_conf);
2655 
2671 int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
2672  struct rte_eth_pfc_conf *pfc_conf);
2673 
2693 int rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *mac_addr,
2694  uint32_t pool);
2695 
2709 int rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *mac_addr);
2710 
2724 int rte_eth_dev_default_mac_addr_set(uint16_t port_id,
2725  struct ether_addr *mac_addr);
2726 
2743 int rte_eth_dev_rss_reta_update(uint16_t port_id,
2744  struct rte_eth_rss_reta_entry64 *reta_conf,
2745  uint16_t reta_size);
2746 
2763 int rte_eth_dev_rss_reta_query(uint16_t port_id,
2764  struct rte_eth_rss_reta_entry64 *reta_conf,
2765  uint16_t reta_size);
2766 
2786 int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr,
2787  uint8_t on);
2788 
2807 int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on);
2808 
2831 int rte_eth_mirror_rule_set(uint16_t port_id,
2832  struct rte_eth_mirror_conf *mirror_conf,
2833  uint8_t rule_id,
2834  uint8_t on);
2835 
2850 int rte_eth_mirror_rule_reset(uint16_t port_id,
2851  uint8_t rule_id);
2852 
2869 int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
2870  uint16_t tx_rate);
2871 
2886 int rte_eth_dev_rss_hash_update(uint16_t port_id,
2887  struct rte_eth_rss_conf *rss_conf);
2888 
2903 int
2904 rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
2905  struct rte_eth_rss_conf *rss_conf);
2906 
2925 int
2926 rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
2927  struct rte_eth_udp_tunnel *tunnel_udp);
2928 
2948 int
2949 rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
2950  struct rte_eth_udp_tunnel *tunnel_udp);
2951 
2966 int rte_eth_dev_filter_supported(uint16_t port_id,
2967  enum rte_filter_type filter_type);
2968 
2988 int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
2989  enum rte_filter_op filter_op, void *arg);
2990 
3004 int rte_eth_dev_get_dcb_info(uint16_t port_id,
3005  struct rte_eth_dcb_info *dcb_info);
3006 
3031 void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
3032  rte_rx_callback_fn fn, void *user_param);
3033 
3059 void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
3060  rte_rx_callback_fn fn, void *user_param);
3061 
3086 void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
3087  rte_tx_callback_fn fn, void *user_param);
3088 
3089 struct rte_eth_rxtx_callback;
3090 
3121 int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
3122  struct rte_eth_rxtx_callback *user_cb);
3123 
3154 int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
3155  struct rte_eth_rxtx_callback *user_cb);
3156 
3174 int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
3175  struct rte_eth_rxq_info *qinfo);
3176 
3194 int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
3195  struct rte_eth_txq_info *qinfo);
3196 
3214 int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info);
3215 
3228 int rte_eth_dev_get_eeprom_length(uint16_t port_id);
3229 
3245 int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
3246 
3262 int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
3263 
3282 int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
3283  struct ether_addr *mc_addr_set,
3284  uint32_t nb_mc_addr);
3285 
3298 int rte_eth_timesync_enable(uint16_t port_id);
3299 
3312 int rte_eth_timesync_disable(uint16_t port_id);
3313 
3332 int rte_eth_timesync_read_rx_timestamp(uint16_t port_id,
3333  struct timespec *timestamp, uint32_t flags);
3334 
3350 int rte_eth_timesync_read_tx_timestamp(uint16_t port_id,
3351  struct timespec *timestamp);
3352 
3370 int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);
3371 
3386 int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
3387 
3406 int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
3407 
3423 int
3424 rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
3425  struct rte_eth_l2_tunnel_conf *l2_tunnel);
3426 
3451 int
3452 rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
3453  struct rte_eth_l2_tunnel_conf *l2_tunnel,
3454  uint32_t mask,
3455  uint8_t en);
3456 
3469 int
3470 rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
3471 
3483 int
3484 rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
3485 
3502 int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
3503  uint16_t *nb_rx_desc,
3504  uint16_t *nb_tx_desc);
3505 
3520 int
3521 rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
3522 
3532 void *
3533 rte_eth_dev_get_sec_ctx(uint8_t port_id);
3534 
3535 
3536 #include <rte_ethdev_core.h>
3537 
3620 static inline uint16_t
3621 rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
3622  struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
3623 {
3624  struct rte_eth_dev *dev = &rte_eth_devices[port_id];
3625 
3626 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3627  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
3628  RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
3629 
3630  if (queue_id >= dev->data->nb_rx_queues) {
3631  RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
3632  return 0;
3633  }
3634 #endif
3635  int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
3636  rx_pkts, nb_pkts);
3637 
3638 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
3639  struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
3640 
3641  if (unlikely(cb != NULL)) {
3642  do {
3643  nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
3644  nb_pkts, cb->param);
3645  cb = cb->next;
3646  } while (cb != NULL);
3647  }
3648 #endif
3649 
3650  return nb_rx;
3651 }
3652 
3665 static inline int
3666 rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
3667 {
3668  struct rte_eth_dev *dev;
3669 
3670  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
3671  dev = &rte_eth_devices[port_id];
3672  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
3673  if (queue_id >= dev->data->nb_rx_queues)
3674  return -EINVAL;
3675 
3676  return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
3677 }
3678 
3694 static inline int
3695 rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
3696 {
3697  struct rte_eth_dev *dev = &rte_eth_devices[port_id];
3698  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
3699  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
3700  return (*dev->dev_ops->rx_descriptor_done)( \
3701  dev->data->rx_queues[queue_id], offset);
3702 }
3703 
3704 #define RTE_ETH_RX_DESC_AVAIL 0
3705 #define RTE_ETH_RX_DESC_DONE 1
3706 #define RTE_ETH_RX_DESC_UNAVAIL 2
3741 static inline int
3742 rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
3743  uint16_t offset)
3744 {
3745  struct rte_eth_dev *dev;
3746  void *rxq;
3747 
3748 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3749  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
3750 #endif
3751  dev = &rte_eth_devices[port_id];
3752 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3753  if (queue_id >= dev->data->nb_rx_queues)
3754  return -ENODEV;
3755 #endif
3756  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
3757  rxq = dev->data->rx_queues[queue_id];
3758 
3759  return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
3760 }
3761 
3762 #define RTE_ETH_TX_DESC_FULL 0
3763 #define RTE_ETH_TX_DESC_DONE 1
3764 #define RTE_ETH_TX_DESC_UNAVAIL 2
3799 static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
3800  uint16_t queue_id, uint16_t offset)
3801 {
3802  struct rte_eth_dev *dev;
3803  void *txq;
3804 
3805 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3806  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
3807 #endif
3808  dev = &rte_eth_devices[port_id];
3809 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3810  if (queue_id >= dev->data->nb_tx_queues)
3811  return -ENODEV;
3812 #endif
3813  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
3814  txq = dev->data->tx_queues[queue_id];
3815 
3816  return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
3817 }
3818 
3882 static inline uint16_t
3883 rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
3884  struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
3885 {
3886  struct rte_eth_dev *dev = &rte_eth_devices[port_id];
3887 
3888 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3889  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
3890  RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
3891 
3892  if (queue_id >= dev->data->nb_tx_queues) {
3893  RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
3894  return 0;
3895  }
3896 #endif
3897 
3898 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
3899  struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
3900 
3901  if (unlikely(cb != NULL)) {
3902  do {
3903  nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
3904  cb->param);
3905  cb = cb->next;
3906  } while (cb != NULL);
3907  }
3908 #endif
3909 
3910  return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
3911 }
3912 
3969 #ifndef RTE_ETHDEV_TX_PREPARE_NOOP
3970 
3971 static inline uint16_t
3972 rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
3973  struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
3974 {
3975  struct rte_eth_dev *dev;
3976 
3977 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3978  if (!rte_eth_dev_is_valid_port(port_id)) {
3979  RTE_PMD_DEBUG_TRACE("Invalid TX port_id=%d\n", port_id);
3980  rte_errno = -EINVAL;
3981  return 0;
3982  }
3983 #endif
3984 
3985  dev = &rte_eth_devices[port_id];
3986 
3987 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3988  if (queue_id >= dev->data->nb_tx_queues) {
3989  RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
3990  rte_errno = -EINVAL;
3991  return 0;
3992  }
3993 #endif
3994 
3995  if (!dev->tx_pkt_prepare)
3996  return nb_pkts;
3997 
3998  return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
3999  tx_pkts, nb_pkts);
4000 }
4001 
4002 #else
4003 
4004 /*
4005  * Native NOOP operation for compilation targets which doesn't require any
4006  * preparations steps, and functional NOOP may introduce unnecessary performance
4007  * drop.
4008  *
4009  * Generally this is not a good idea to turn it on globally and didn't should
4010  * be used if behavior of tx_preparation can change.
4011  */
4012 
4013 static inline uint16_t
4014 rte_eth_tx_prepare(__rte_unused uint16_t port_id,
4015  __rte_unused uint16_t queue_id,
4016  __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
4017 {
4018  return nb_pkts;
4019 }
4020 
4021 #endif
4022 
4045 static inline uint16_t
4046 rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
4047  struct rte_eth_dev_tx_buffer *buffer)
4048 {
4049  uint16_t sent;
4050  uint16_t to_send = buffer->length;
4051 
4052  if (to_send == 0)
4053  return 0;
4054 
4055  sent = rte_eth_tx_burst(port_id, queue_id, buffer->pkts, to_send);
4056 
4057  buffer->length = 0;
4058 
4059  /* All packets sent, or to be dealt with by callback below */
4060  if (unlikely(sent != to_send))
4061  buffer->error_callback(&buffer->pkts[sent], to_send - sent,
4062  buffer->error_userdata);
4063 
4064  return sent;
4065 }
4066 
4097 static __rte_always_inline uint16_t
4098 rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
4099  struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
4100 {
4101  buffer->pkts[buffer->length++] = tx_pkt;
4102  if (buffer->length < buffer->size)
4103  return 0;
4104 
4105  return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
4106 }
4107 
4108 #ifdef __cplusplus
4109 }
4110 #endif
4111 
4112 #endif /* _RTE_ETHDEV_H_ */
uint16_t nb_rx_queues
Definition: rte_ethdev.h:1030
struct rte_eth_vmdq_dcb_tx_conf vmdq_dcb_tx_conf
Definition: rte_ethdev.h:903
int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf)
uint32_t txq_flags
Definition: rte_ethdev.h:736
uint8_t tc_bws[ETH_DCB_NUM_TCS]
Definition: rte_ethdev.h:1109
#define ETH_VMDQ_MAX_VLAN_FILTERS
Definition: rte_ethdev.h:493
struct rte_fdir_conf fdir_conf
Definition: rte_ethdev.h:913
int rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel)
uint32_t rmv
Definition: rte_ethdev.h:870
#define __rte_always_inline
Definition: rte_common.h:110
uint16_t tx_rs_thresh
Definition: rte_ethdev.h:732
int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time)
uint16_t nb_desc
Definition: rte_ethdev.h:1051
uint64_t rx_offload_capa
Definition: rte_ethdev.h:1008
uint16_t reta[RTE_RETA_GROUP_SIZE]
Definition: rte_ethdev.h:564
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)
struct rte_eth_conf::@71 rx_adv_conf
uint64_t __rte_experimental 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)
Definition: rte_ethdev.h:3972
int rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id)
rte_eth_nb_tcs
Definition: rte_ethdev.h:572
struct rte_eth_vmdq_tx_conf vmdq_tx_conf
Definition: rte_ethdev.h:907
void __rte_experimental rte_eth_dev_owner_delete(const uint64_t owner_id)
uint64_t q_errors[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:190
struct rte_eth_thresh rx_thresh
Definition: rte_ethdev.h:693
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)
rte_fdir_pballoc_type
Definition: rte_ethdev.h:817
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)
Definition: rte_ethdev.h:3742
uint64_t imissed
Definition: rte_ethdev.h:175
static int rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
Definition: rte_ethdev.h:3695
uint32_t low_water
Definition: rte_ethdev.h:795
const char *__rte_experimental rte_eth_dev_tx_offload_name(uint64_t offload)
uint32_t max_rx_pkt_len
Definition: rte_ethdev.h:324
uint8_t rss_key_len
Definition: rte_ethdev.h:399
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)
uint8_t hthresh
Definition: rte_ethdev.h:256
int rte_eth_dev_rss_hash_update(uint16_t port_id, struct rte_eth_rss_conf *rss_conf)
uint64_t rx_queue_offload_capa
Definition: rte_ethdev.h:1012
int rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, unsigned int n)
uint16_t reta_size
Definition: rte_ethdev.h:1016
int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, int epfd, int op, void *data)
void * userdata
Definition: rte_mbuf.h:533
uint32_t lpbk_mode
Definition: rte_ethdev.h:888
enum rte_fdir_status_mode status
Definition: rte_ethdev.h:841
enum rte_eth_tx_mq_mode mq_mode
Definition: rte_ethdev.h:670
#define rte_errno
Definition: rte_errno.h:29
int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on)
uint32_t link_speeds
Definition: rte_ethdev.h:879
uint64_t tx_queue_offload_capa
Definition: rte_ethdev.h:1014
rte_eth_tx_mq_mode
Definition: rte_ethdev.h:304
rte_eth_fc_mode
Definition: rte_ethdev.h:781
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
Definition: rte_ethdev.h:624
uint16_t nb_mtu_seg_max
Definition: rte_ethdev.h:775
#define __rte_unused
Definition: rte_common.h:76
uint64_t q_obytes[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:188
int rte_eth_dev_get_eeprom_length(uint16_t port_id)
uint64_t opackets
Definition: rte_ethdev.h:172
rte_filter_op
Definition: rte_eth_ctrl.h:80
struct rte_eth_rss_conf rss_conf
Definition: rte_ethdev.h:894
uint8_t hash_key_size
Definition: rte_ethdev.h:1018
void * 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_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)
uint16_t split_hdr_size
Definition: rte_ethdev.h:325
struct rte_mempool * mp
Definition: rte_ethdev.h:1039
uint32_t dcb_capability_en
Definition: rte_ethdev.h:912
__extension__ uint16_t hw_strip_crc
Definition: rte_ethdev.h:338
uint64_t q_ibytes[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:186
__extension__ uint16_t enable_scatter
Definition: rte_ethdev.h:338
struct rte_eth_vmdq_dcb_conf::@69 pool_map[ETH_VMDQ_MAX_VLAN_FILTERS]
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)
__extension__ uint16_t header_split
Definition: rte_ethdev.h:338
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)
uint32_t rxq
Definition: rte_ethdev.h:868
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
Definition: rte_ethdev.h:731
struct rte_eth_desc_lim rx_desc_lim
Definition: rte_ethdev.h:1026
uint16_t rte_eth_dev_count(void)
uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES]
Definition: rte_ethdev.h:631
int rte_eth_dev_get_vlan_offload(uint16_t port_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)
uint16_t vmdq_queue_num
Definition: rte_ethdev.h:1024
uint8_t rx_deferred_start
Definition: rte_ethdev.h:696
struct rte_mbuf * pkts[]
Definition: rte_ethdev.h:2305
int(* rte_eth_dev_cb_fn)(uint16_t port_id, enum rte_eth_event_type event, void *cb_arg, void *ret_param)
Definition: rte_ethdev.h:2458
struct rte_eth_rxmode rxmode
Definition: rte_ethdev.h:886
uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:182
uint32_t high_water
Definition: rte_ethdev.h:794
enum rte_eth_nb_pools nb_queue_pools
Definition: rte_ethdev.h:623
struct rte_eth_txconf conf
Definition: rte_ethdev.h:1050
uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex)
struct rte_intr_conf intr_conf
Definition: rte_ethdev.h:914
#define RTE_ETH_XSTATS_NAME_SIZE
Definition: rte_ethdev.h:1055
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
Definition: rte_ethdev.h:1027
int rte_eth_timesync_disable(uint16_t port_id)
uint64_t offloads
Definition: rte_ethdev.h:702
union rte_eth_conf::@72 tx_adv_conf
int rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *mac_addr)
__extension__ uint16_t hw_vlan_strip
Definition: rte_ethdev.h:338
int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg)
uint16_t send_xon
Definition: rte_ethdev.h:797
int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb)
struct rte_pci_device * pci_dev
Definition: rte_ethdev.h:995
int rte_eth_stats_reset(uint16_t port_id)
struct rte_eth_txconf default_txconf
Definition: rte_ethdev.h:1022
#define unlikely(x)
uint16_t nb_max
Definition: rte_ethdev.h:750
uint64_t ibytes
Definition: rte_ethdev.h:173
__extension__ uint16_t hw_vlan_filter
Definition: rte_ethdev.h:338
uint64_t offloads
Definition: rte_ethdev.h:743
uint64_t oerrors
Definition: rte_ethdev.h:180
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
Definition: rte_ethdev.h:897
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
Definition: rte_ethdev.h:899
int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta)
char name[RTE_ETH_XSTATS_NAME_SIZE]
Definition: rte_ethdev.h:1079
void rte_eth_promiscuous_enable(uint16_t port_id)
int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb)
uint64_t offloads
Definition: rte_ethdev.h:331
enum rte_eth_rx_mq_mode mq_mode
Definition: rte_ethdev.h:323
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
Definition: rte_ethdev.h:654
int rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id)
uint16_t tx_free_thresh
Definition: rte_ethdev.h:733
uint16_t nb_desc
Definition: rte_ethdev.h:1042
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)
Definition: rte_ethdev.h:3621
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)
uint16_t max_vmdq_pools
Definition: rte_ethdev.h:1007
uint8_t scattered_rx
Definition: rte_ethdev.h:1041
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
Definition: rte_ethdev.h:905
uint64_t offloads
Definition: rte_ethdev.h:676
void * rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, rte_tx_callback_fn fn, void *user_param)
uint16_t vmdq_pool_base
Definition: rte_ethdev.h:1025
uint64_t tx_offload_capa
Definition: rte_ethdev.h:1010
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]
Definition: rte_ethdev.h:184
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)
Definition: rte_ethdev.h:1198
int rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size)
__extension__ uint16_t hw_timestamp
Definition: rte_ethdev.h:338
int rte_eth_dev_attach(const char *devargs, uint16_t *port_id)
uint64_t obytes
Definition: rte_ethdev.h:174
uint8_t enable_loop_back
Definition: rte_ethdev.h:657
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
Definition: rte_ethdev.h:1040
void rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link)
__extension__ uint16_t enable_lro
Definition: rte_ethdev.h:338
#define ETH_DCB_NUM_USER_PRIORITIES
Definition: rte_ethdev.h:494
void rte_eth_promiscuous_disable(uint16_t port_id)
uint16_t max_tx_queues
Definition: rte_ethdev.h:1002
int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id)
rte_eth_dev_state
Definition: rte_ethdev.h:1204
uint16_t rx_free_thresh
Definition: rte_ethdev.h:694
struct rte_eth_vlan_mirror vlan
Definition: rte_ethdev.h:552
const char *__rte_experimental rte_eth_dev_rx_offload_name(uint64_t offload)
void * rte_eth_dev_get_sec_ctx(uint8_t port_id)
__extension__ uint16_t jumbo_frame
Definition: rte_ethdev.h:338
uint64_t ierrors
Definition: rte_ethdev.h:179
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
Definition: rte_ethdev.h:682
uint8_t priority
Definition: rte_ethdev.h:810
uint64_t flow_type_rss_offloads
Definition: rte_ethdev.h:1020
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)
rte_vlan_type
Definition: rte_ethdev.h:365
uint16_t nb_seg_max
Definition: rte_ethdev.h:762
uint8_t prio_tc[ETH_DCB_NUM_USER_PRIORITIES]
Definition: rte_ethdev.h:1108
uint64_t ipackets
Definition: rte_ethdev.h:171
struct rte_eth_dcb_tc_queue_mapping::@73 tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS]
uint16_t max_vfs
Definition: rte_ethdev.h:1006
uint16_t pause_time
Definition: rte_ethdev.h:796
struct rte_eth_dcb_tc_queue_mapping tc_queue
Definition: rte_ethdev.h:1111
rte_filter_type
Definition: rte_eth_ctrl.h:62
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)
uint64_t rx_nombuf
Definition: rte_ethdev.h:181
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)
Definition: rte_ethdev.h:4098
__extension__ uint8_t hw_vlan_reject_untagged
Definition: rte_ethdev.h:682
struct rte_mempool * pool
Definition: rte_mbuf.h:537
int rte_eth_dev_detach(uint16_t port_id, char *devname)
int rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info)
#define __rte_cache_min_aligned
Definition: rte_memory.h:67
int rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *mac_addr, uint32_t pool)
__extension__ uint16_t hw_ip_checksum
Definition: rte_ethdev.h:338
#define ETH_MQ_RX_RSS_FLAG
Definition: rte_ethdev.h:263
uint16_t vmdq_queue_base
Definition: rte_ethdev.h:1023
rte_eth_nb_pools
Definition: rte_ethdev.h:581
void rte_eth_xstats_reset(uint16_t port_id)
#define ETH_MIRROR_MAX_VLANS
Definition: rte_ethdev.h:527
uint16_t nb_align
Definition: rte_ethdev.h:752
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)
__extension__ uint16_t hw_vlan_extend
Definition: rte_ethdev.h:338
int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info)
rte_eth_rx_mq_mode
Definition: rte_ethdev.h:271
const char * driver_name
Definition: rte_ethdev.h:996
static int rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
Definition: rte_ethdev.h:3666
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
Definition: rte_ethdev.h:655
int rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on)
uint16_t nb_tx_queues
Definition: rte_ethdev.h:1031
struct rte_eth_fdir_flex_conf flex_conf
Definition: rte_ethdev.h:845
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_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)
uint32_t max_mac_addrs
Definition: rte_ethdev.h:1003
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)
uint64_t value
Definition: rte_ethdev.h:1068
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
Definition: rte_ethdev.h:840
int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp)
uint32_t max_rx_pktlen
Definition: rte_ethdev.h:1000
int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num)
uint64_t rss_hf
Definition: rte_ethdev.h:400
int __rte_experimental rte_eth_dev_owner_new(uint64_t *owner_id)
uint64_t id
Definition: rte_ethdev.h:1067
__extension__ uint8_t hw_vlan_reject_tagged
Definition: rte_ethdev.h:682
enum rte_fdir_mode mode
Definition: rte_ethdev.h:839
int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats)
unsigned int if_index
Definition: rte_ethdev.h:997
void rte_eth_allmulticast_disable(uint16_t port_id)
uint8_t mac_ctrl_frame_fwd
Definition: rte_ethdev.h:799
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)
Definition: rte_ethdev.h:1174
__extension__ uint16_t ignore_offload_bitfield
Definition: rte_ethdev.h:338
enum rte_eth_fc_mode mode
Definition: rte_ethdev.h:798
int rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
rte_fdir_mode
Definition: rte_eth_ctrl.h:657
struct rte_eth_vmdq_dcb_conf vmdq_dcb_conf
Definition: rte_ethdev.h:895
uint8_t * rss_key
Definition: rte_ethdev.h:398
rte_fdir_status_mode
Definition: rte_ethdev.h:826
__extension__ uint16_t security
Definition: rte_ethdev.h:338
uint8_t tx_deferred_start
Definition: rte_ethdev.h:737
uint8_t wthresh
Definition: rte_ethdev.h:257
uint16_t max_rx_queues
Definition: rte_ethdev.h:1001
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
Definition: rte_ethdev.h:809
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
Definition: rte_ethdev.h:887
int rte_eth_allmulticast_get(uint16_t port_id)
uint8_t rx_drop_en
Definition: rte_ethdev.h:695
struct rte_eth_vmdq_rx_conf::@70 pool_map[ETH_VMDQ_MAX_VLAN_FILTERS]
int rte_eth_dev_is_valid_port(uint16_t port_id)
struct rte_eth_dcb_tc_queue_mapping::@74 tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS]
uint16_t nb_min
Definition: rte_ethdev.h:751
int rte_eth_timesync_enable(uint16_t port_id)
uint8_t pthresh
Definition: rte_ethdev.h:255
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
Definition: rte_ethdev.h:1021
uint32_t speed_capa
Definition: rte_ethdev.h:1028
static uint16_t rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
Definition: rte_ethdev.h:3883
uint8_t drop_queue
Definition: rte_ethdev.h:843
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)
uint8_t autoneg
Definition: rte_ethdev.h:800
uint32_t min_rx_bufsize
Definition: rte_ethdev.h:999
int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info)
void * rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param)
uint32_t lsc
Definition: rte_ethdev.h:866
static uint16_t rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer)
Definition: rte_ethdev.h:4046
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)
rte_eth_event_type
Definition: rte_ethdev.h:2443