DPDK  19.11.10
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 
142 #ifdef __cplusplus
143 extern "C" {
144 #endif
145 
146 #include <stdint.h>
147 
148 /* Use this macro to check if LRO API is supported */
149 #define RTE_ETHDEV_HAS_LRO_SUPPORT
150 
151 #include <rte_compat.h>
152 #include <rte_log.h>
153 #include <rte_interrupts.h>
154 #include <rte_dev.h>
155 #include <rte_devargs.h>
156 #include <rte_errno.h>
157 #include <rte_common.h>
158 #include <rte_config.h>
159 #include <rte_ether.h>
160 
161 #include "rte_dev_info.h"
162 
163 extern int rte_eth_dev_logtype;
164 
165 #define RTE_ETHDEV_LOG(level, ...) \
166  rte_log(RTE_LOG_ ## level, rte_eth_dev_logtype, "" __VA_ARGS__)
167 
168 struct rte_mbuf;
169 
186 int rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs);
187 
202 uint16_t rte_eth_iterator_next(struct rte_dev_iterator *iter);
203 
216 void rte_eth_iterator_cleanup(struct rte_dev_iterator *iter);
217 
231 #define RTE_ETH_FOREACH_MATCHING_DEV(id, devargs, iter) \
232  for (rte_eth_iterator_init(iter, devargs), \
233  id = rte_eth_iterator_next(iter); \
234  id != RTE_MAX_ETHPORTS; \
235  id = rte_eth_iterator_next(iter))
236 
244  uint64_t ipackets;
245  uint64_t opackets;
246  uint64_t ibytes;
247  uint64_t obytes;
248  uint64_t imissed;
252  uint64_t ierrors;
253  uint64_t oerrors;
254  uint64_t rx_nombuf;
255  uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
257  uint64_t q_opackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
259  uint64_t q_ibytes[RTE_ETHDEV_QUEUE_STAT_CNTRS];
261  uint64_t q_obytes[RTE_ETHDEV_QUEUE_STAT_CNTRS];
263  uint64_t q_errors[RTE_ETHDEV_QUEUE_STAT_CNTRS];
265 };
266 
270 #define ETH_LINK_SPEED_AUTONEG (0 << 0)
271 #define ETH_LINK_SPEED_FIXED (1 << 0)
272 #define ETH_LINK_SPEED_10M_HD (1 << 1)
273 #define ETH_LINK_SPEED_10M (1 << 2)
274 #define ETH_LINK_SPEED_100M_HD (1 << 3)
275 #define ETH_LINK_SPEED_100M (1 << 4)
276 #define ETH_LINK_SPEED_1G (1 << 5)
277 #define ETH_LINK_SPEED_2_5G (1 << 6)
278 #define ETH_LINK_SPEED_5G (1 << 7)
279 #define ETH_LINK_SPEED_10G (1 << 8)
280 #define ETH_LINK_SPEED_20G (1 << 9)
281 #define ETH_LINK_SPEED_25G (1 << 10)
282 #define ETH_LINK_SPEED_40G (1 << 11)
283 #define ETH_LINK_SPEED_50G (1 << 12)
284 #define ETH_LINK_SPEED_56G (1 << 13)
285 #define ETH_LINK_SPEED_100G (1 << 14)
290 #define ETH_SPEED_NUM_NONE 0
291 #define ETH_SPEED_NUM_10M 10
292 #define ETH_SPEED_NUM_100M 100
293 #define ETH_SPEED_NUM_1G 1000
294 #define ETH_SPEED_NUM_2_5G 2500
295 #define ETH_SPEED_NUM_5G 5000
296 #define ETH_SPEED_NUM_10G 10000
297 #define ETH_SPEED_NUM_20G 20000
298 #define ETH_SPEED_NUM_25G 25000
299 #define ETH_SPEED_NUM_40G 40000
300 #define ETH_SPEED_NUM_50G 50000
301 #define ETH_SPEED_NUM_56G 56000
302 #define ETH_SPEED_NUM_100G 100000
307 __extension__
308 struct rte_eth_link {
309  uint32_t link_speed;
310  uint16_t link_duplex : 1;
311  uint16_t link_autoneg : 1;
312  uint16_t link_status : 1;
313 } __attribute__((aligned(8)));
315 /* Utility constants */
316 #define ETH_LINK_HALF_DUPLEX 0
317 #define ETH_LINK_FULL_DUPLEX 1
318 #define ETH_LINK_DOWN 0
319 #define ETH_LINK_UP 1
320 #define ETH_LINK_FIXED 0
321 #define ETH_LINK_AUTONEG 1
327 struct rte_eth_thresh {
328  uint8_t pthresh;
329  uint8_t hthresh;
330  uint8_t wthresh;
331 };
332 
336 #define ETH_MQ_RX_RSS_FLAG 0x1
337 #define ETH_MQ_RX_DCB_FLAG 0x2
338 #define ETH_MQ_RX_VMDQ_FLAG 0x4
339 
347 
351  ETH_MQ_RX_DCB = ETH_MQ_RX_DCB_FLAG,
353  ETH_MQ_RX_DCB_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_DCB_FLAG,
354 
356  ETH_MQ_RX_VMDQ_ONLY = ETH_MQ_RX_VMDQ_FLAG,
358  ETH_MQ_RX_VMDQ_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_VMDQ_FLAG,
360  ETH_MQ_RX_VMDQ_DCB = ETH_MQ_RX_VMDQ_FLAG | ETH_MQ_RX_DCB_FLAG,
363  ETH_MQ_RX_VMDQ_FLAG,
364 };
365 
369 #define ETH_RSS ETH_MQ_RX_RSS
370 #define VMDQ_DCB ETH_MQ_RX_VMDQ_DCB
371 #define ETH_DCB_RX ETH_MQ_RX_DCB
372 
382 };
383 
387 #define ETH_DCB_NONE ETH_MQ_TX_NONE
388 #define ETH_VMDQ_DCB_TX ETH_MQ_TX_VMDQ_DCB
389 #define ETH_DCB_TX ETH_MQ_TX_DCB
390 
396  enum rte_eth_rx_mq_mode mq_mode;
397  uint32_t max_rx_pkt_len;
400  uint16_t split_hdr_size;
406  uint64_t offloads;
407 
408  uint64_t reserved_64s[2];
409  void *reserved_ptrs[2];
410 };
411 
417  ETH_VLAN_TYPE_UNKNOWN = 0,
420  ETH_VLAN_TYPE_MAX,
421 };
422 
428  uint64_t ids[64];
429 };
430 
449  uint8_t *rss_key;
450  uint8_t rss_key_len;
451  uint64_t rss_hf;
452 };
453 
454 /*
455  * A packet can be identified by hardware as different flow types. Different
456  * NIC hardware may support different flow types.
457  * Basically, the NIC hardware identifies the flow type as deep protocol as
458  * possible, and exclusively. For example, if a packet is identified as
459  * 'RTE_ETH_FLOW_NONFRAG_IPV4_TCP', it will not be any of other flow types,
460  * though it is an actual IPV4 packet.
461  */
462 #define RTE_ETH_FLOW_UNKNOWN 0
463 #define RTE_ETH_FLOW_RAW 1
464 #define RTE_ETH_FLOW_IPV4 2
465 #define RTE_ETH_FLOW_FRAG_IPV4 3
466 #define RTE_ETH_FLOW_NONFRAG_IPV4_TCP 4
467 #define RTE_ETH_FLOW_NONFRAG_IPV4_UDP 5
468 #define RTE_ETH_FLOW_NONFRAG_IPV4_SCTP 6
469 #define RTE_ETH_FLOW_NONFRAG_IPV4_OTHER 7
470 #define RTE_ETH_FLOW_IPV6 8
471 #define RTE_ETH_FLOW_FRAG_IPV6 9
472 #define RTE_ETH_FLOW_NONFRAG_IPV6_TCP 10
473 #define RTE_ETH_FLOW_NONFRAG_IPV6_UDP 11
474 #define RTE_ETH_FLOW_NONFRAG_IPV6_SCTP 12
475 #define RTE_ETH_FLOW_NONFRAG_IPV6_OTHER 13
476 #define RTE_ETH_FLOW_L2_PAYLOAD 14
477 #define RTE_ETH_FLOW_IPV6_EX 15
478 #define RTE_ETH_FLOW_IPV6_TCP_EX 16
479 #define RTE_ETH_FLOW_IPV6_UDP_EX 17
480 #define RTE_ETH_FLOW_PORT 18
481 
482 #define RTE_ETH_FLOW_VXLAN 19
483 #define RTE_ETH_FLOW_GENEVE 20
484 #define RTE_ETH_FLOW_NVGRE 21
485 #define RTE_ETH_FLOW_VXLAN_GPE 22
486 #define RTE_ETH_FLOW_GTPU 23
487 #define RTE_ETH_FLOW_MAX 24
488 
489 /*
490  * Below macros are defined for RSS offload types, they can be used to
491  * fill rte_eth_rss_conf.rss_hf or rte_flow_action_rss.types.
492  */
493 #define ETH_RSS_IPV4 (1ULL << 2)
494 #define ETH_RSS_FRAG_IPV4 (1ULL << 3)
495 #define ETH_RSS_NONFRAG_IPV4_TCP (1ULL << 4)
496 #define ETH_RSS_NONFRAG_IPV4_UDP (1ULL << 5)
497 #define ETH_RSS_NONFRAG_IPV4_SCTP (1ULL << 6)
498 #define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << 7)
499 #define ETH_RSS_IPV6 (1ULL << 8)
500 #define ETH_RSS_FRAG_IPV6 (1ULL << 9)
501 #define ETH_RSS_NONFRAG_IPV6_TCP (1ULL << 10)
502 #define ETH_RSS_NONFRAG_IPV6_UDP (1ULL << 11)
503 #define ETH_RSS_NONFRAG_IPV6_SCTP (1ULL << 12)
504 #define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << 13)
505 #define ETH_RSS_L2_PAYLOAD (1ULL << 14)
506 #define ETH_RSS_IPV6_EX (1ULL << 15)
507 #define ETH_RSS_IPV6_TCP_EX (1ULL << 16)
508 #define ETH_RSS_IPV6_UDP_EX (1ULL << 17)
509 #define ETH_RSS_PORT (1ULL << 18)
510 #define ETH_RSS_VXLAN (1ULL << 19)
511 #define ETH_RSS_GENEVE (1ULL << 20)
512 #define ETH_RSS_NVGRE (1ULL << 21)
513 #define ETH_RSS_GTPU (1ULL << 23)
514 
515 /*
516  * We use the following macros to combine with above ETH_RSS_* for
517  * more specific input set selection. These bits are defined starting
518  * from the high end of the 64 bits.
519  * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents
520  * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY of
521  * the same level are used simultaneously, it is the same case as none of
522  * them are added.
523  */
524 #define ETH_RSS_L3_SRC_ONLY (1ULL << 63)
525 #define ETH_RSS_L3_DST_ONLY (1ULL << 62)
526 #define ETH_RSS_L4_SRC_ONLY (1ULL << 61)
527 #define ETH_RSS_L4_DST_ONLY (1ULL << 60)
528 
539 static inline uint64_t
540 rte_eth_rss_hf_refine(uint64_t rss_hf)
541 {
542  if ((rss_hf & ETH_RSS_L3_SRC_ONLY) && (rss_hf & ETH_RSS_L3_DST_ONLY))
543  rss_hf &= ~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY);
544 
545  if ((rss_hf & ETH_RSS_L4_SRC_ONLY) && (rss_hf & ETH_RSS_L4_DST_ONLY))
546  rss_hf &= ~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY);
547 
548  return rss_hf;
549 }
550 
551 #define ETH_RSS_IP ( \
552  ETH_RSS_IPV4 | \
553  ETH_RSS_FRAG_IPV4 | \
554  ETH_RSS_NONFRAG_IPV4_OTHER | \
555  ETH_RSS_IPV6 | \
556  ETH_RSS_FRAG_IPV6 | \
557  ETH_RSS_NONFRAG_IPV6_OTHER | \
558  ETH_RSS_IPV6_EX)
559 
560 #define ETH_RSS_UDP ( \
561  ETH_RSS_NONFRAG_IPV4_UDP | \
562  ETH_RSS_NONFRAG_IPV6_UDP | \
563  ETH_RSS_IPV6_UDP_EX)
564 
565 #define ETH_RSS_TCP ( \
566  ETH_RSS_NONFRAG_IPV4_TCP | \
567  ETH_RSS_NONFRAG_IPV6_TCP | \
568  ETH_RSS_IPV6_TCP_EX)
569 
570 #define ETH_RSS_SCTP ( \
571  ETH_RSS_NONFRAG_IPV4_SCTP | \
572  ETH_RSS_NONFRAG_IPV6_SCTP)
573 
574 #define ETH_RSS_TUNNEL ( \
575  ETH_RSS_VXLAN | \
576  ETH_RSS_GENEVE | \
577  ETH_RSS_NVGRE)
578 
580 #define ETH_RSS_PROTO_MASK ( \
581  ETH_RSS_IPV4 | \
582  ETH_RSS_FRAG_IPV4 | \
583  ETH_RSS_NONFRAG_IPV4_TCP | \
584  ETH_RSS_NONFRAG_IPV4_UDP | \
585  ETH_RSS_NONFRAG_IPV4_SCTP | \
586  ETH_RSS_NONFRAG_IPV4_OTHER | \
587  ETH_RSS_IPV6 | \
588  ETH_RSS_FRAG_IPV6 | \
589  ETH_RSS_NONFRAG_IPV6_TCP | \
590  ETH_RSS_NONFRAG_IPV6_UDP | \
591  ETH_RSS_NONFRAG_IPV6_SCTP | \
592  ETH_RSS_NONFRAG_IPV6_OTHER | \
593  ETH_RSS_L2_PAYLOAD | \
594  ETH_RSS_IPV6_EX | \
595  ETH_RSS_IPV6_TCP_EX | \
596  ETH_RSS_IPV6_UDP_EX | \
597  ETH_RSS_PORT | \
598  ETH_RSS_VXLAN | \
599  ETH_RSS_GENEVE | \
600  ETH_RSS_NVGRE)
601 
602 /*
603  * Definitions used for redirection table entry size.
604  * Some RSS RETA sizes may not be supported by some drivers, check the
605  * documentation or the description of relevant functions for more details.
606  */
607 #define ETH_RSS_RETA_SIZE_64 64
608 #define ETH_RSS_RETA_SIZE_128 128
609 #define ETH_RSS_RETA_SIZE_256 256
610 #define ETH_RSS_RETA_SIZE_512 512
611 #define RTE_RETA_GROUP_SIZE 64
612 
613 /* Definitions used for VMDQ and DCB functionality */
614 #define ETH_VMDQ_MAX_VLAN_FILTERS 64
615 #define ETH_DCB_NUM_USER_PRIORITIES 8
616 #define ETH_VMDQ_DCB_NUM_QUEUES 128
617 #define ETH_DCB_NUM_QUEUES 128
619 /* DCB capability defines */
620 #define ETH_DCB_PG_SUPPORT 0x00000001
621 #define ETH_DCB_PFC_SUPPORT 0x00000002
623 /* Definitions used for VLAN Offload functionality */
624 #define ETH_VLAN_STRIP_OFFLOAD 0x0001
625 #define ETH_VLAN_FILTER_OFFLOAD 0x0002
626 #define ETH_VLAN_EXTEND_OFFLOAD 0x0004
627 #define ETH_QINQ_STRIP_OFFLOAD 0x0008
629 /* Definitions used for mask VLAN setting */
630 #define ETH_VLAN_STRIP_MASK 0x0001
631 #define ETH_VLAN_FILTER_MASK 0x0002
632 #define ETH_VLAN_EXTEND_MASK 0x0004
633 #define ETH_QINQ_STRIP_MASK 0x0008
634 #define ETH_VLAN_ID_MAX 0x0FFF
636 /* Definitions used for receive MAC address */
637 #define ETH_NUM_RECEIVE_MAC_ADDR 128
639 /* Definitions used for unicast hash */
640 #define ETH_VMDQ_NUM_UC_HASH_ARRAY 128
642 /* Definitions used for VMDQ pool rx mode setting */
643 #define ETH_VMDQ_ACCEPT_UNTAG 0x0001
644 #define ETH_VMDQ_ACCEPT_HASH_MC 0x0002
645 #define ETH_VMDQ_ACCEPT_HASH_UC 0x0004
646 #define ETH_VMDQ_ACCEPT_BROADCAST 0x0008
647 #define ETH_VMDQ_ACCEPT_MULTICAST 0x0010
650 #define ETH_MIRROR_MAX_VLANS 64
651 
652 #define ETH_MIRROR_VIRTUAL_POOL_UP 0x01
653 #define ETH_MIRROR_UPLINK_PORT 0x02
654 #define ETH_MIRROR_DOWNLINK_PORT 0x04
655 #define ETH_MIRROR_VLAN 0x08
656 #define ETH_MIRROR_VIRTUAL_POOL_DOWN 0x10
661 struct rte_eth_vlan_mirror {
662  uint64_t vlan_mask;
664  uint16_t vlan_id[ETH_MIRROR_MAX_VLANS];
665 };
666 
671  uint8_t rule_type;
672  uint8_t dst_pool;
673  uint64_t pool_mask;
675  struct rte_eth_vlan_mirror vlan;
676 };
677 
685  uint64_t mask;
687  uint16_t reta[RTE_RETA_GROUP_SIZE];
689 };
690 
696  ETH_4_TCS = 4,
698 };
699 
709 };
710 
711 /* This structure may be extended in future. */
712 struct rte_eth_dcb_rx_conf {
713  enum rte_eth_nb_tcs nb_tcs;
715  uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
716 };
717 
718 struct rte_eth_vmdq_dcb_tx_conf {
719  enum rte_eth_nb_pools nb_queue_pools;
721  uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
722 };
723 
724 struct rte_eth_dcb_tx_conf {
725  enum rte_eth_nb_tcs nb_tcs;
727  uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
728 };
729 
730 struct rte_eth_vmdq_tx_conf {
731  enum rte_eth_nb_pools nb_queue_pools;
732 };
733 
746  enum rte_eth_nb_pools nb_queue_pools;
748  uint8_t default_pool;
749  uint8_t nb_pool_maps;
750  struct {
751  uint16_t vlan_id;
752  uint64_t pools;
753  } pool_map[ETH_VMDQ_MAX_VLAN_FILTERS];
756 };
757 
777  enum rte_eth_nb_pools nb_queue_pools;
779  uint8_t default_pool;
781  uint8_t nb_pool_maps;
782  uint32_t rx_mode;
783  struct {
784  uint16_t vlan_id;
785  uint64_t pools;
786  } pool_map[ETH_VMDQ_MAX_VLAN_FILTERS];
787 };
788 
793  enum rte_eth_tx_mq_mode mq_mode;
799  uint64_t offloads;
800 
801  /* For i40e specifically */
802  uint16_t pvid;
803  __extension__
804  uint8_t hw_vlan_reject_tagged : 1,
806  hw_vlan_reject_untagged : 1,
808  hw_vlan_insert_pvid : 1;
811  uint64_t reserved_64s[2];
812  void *reserved_ptrs[2];
813 };
814 
819  struct rte_eth_thresh rx_thresh;
820  uint16_t rx_free_thresh;
821  uint8_t rx_drop_en;
828  uint64_t offloads;
829 
830  uint64_t reserved_64s[2];
831  void *reserved_ptrs[2];
832 };
833 
838  struct rte_eth_thresh tx_thresh;
839  uint16_t tx_rs_thresh;
840  uint16_t tx_free_thresh;
849  uint64_t offloads;
850 
851  uint64_t reserved_64s[2];
852  void *reserved_ptrs[2];
853 };
854 
863  uint16_t max_nb_queues;
865  uint16_t max_rx_2_tx;
867  uint16_t max_tx_2_rx;
868  uint16_t max_nb_desc;
869 };
870 
871 #define RTE_ETH_MAX_HAIRPIN_PEERS 32
872 
880  uint16_t port;
881  uint16_t queue;
882 };
883 
891  uint16_t peer_count;
892  struct rte_eth_hairpin_peer peers[RTE_ETH_MAX_HAIRPIN_PEERS];
893 };
894 
899  uint16_t nb_max;
900  uint16_t nb_min;
901  uint16_t nb_align;
911  uint16_t nb_seg_max;
912 
924  uint16_t nb_mtu_seg_max;
925 };
926 
935 };
936 
943  uint32_t high_water;
944  uint32_t low_water;
945  uint16_t pause_time;
946  uint16_t send_xon;
947  enum rte_eth_fc_mode mode;
949  uint8_t autoneg;
950 };
951 
958  struct rte_eth_fc_conf fc;
959  uint8_t priority;
960 };
961 
966  RTE_TUNNEL_TYPE_NONE = 0,
967  RTE_TUNNEL_TYPE_VXLAN,
968  RTE_TUNNEL_TYPE_GENEVE,
969  RTE_TUNNEL_TYPE_TEREDO,
970  RTE_TUNNEL_TYPE_NVGRE,
971  RTE_TUNNEL_TYPE_IP_IN_GRE,
972  RTE_L2_TUNNEL_TYPE_E_TAG,
973  RTE_TUNNEL_TYPE_VXLAN_GPE,
974  RTE_TUNNEL_TYPE_MAX,
975 };
976 
977 /* Deprecated API file for rte_eth_dev_filter_* functions */
978 #include "rte_eth_ctrl.h"
979 
988 };
989 
997 };
998 
1006  enum rte_fdir_mode mode;
1007  enum rte_fdir_pballoc_type pballoc;
1008  enum rte_fdir_status_mode status;
1010  uint8_t drop_queue;
1011  struct rte_eth_fdir_masks mask;
1012  struct rte_eth_fdir_flex_conf flex_conf;
1014 };
1015 
1024  uint16_t udp_port;
1025  uint8_t prot_type;
1026 };
1027 
1033  uint32_t lsc:1;
1035  uint32_t rxq:1;
1037  uint32_t rmv:1;
1038 };
1039 
1046  uint32_t link_speeds;
1053  struct rte_eth_rxmode rxmode;
1054  struct rte_eth_txmode txmode;
1055  uint32_t lpbk_mode;
1060  struct {
1061  struct rte_eth_rss_conf rss_conf;
1062  struct rte_eth_vmdq_dcb_conf vmdq_dcb_conf;
1064  struct rte_eth_dcb_rx_conf dcb_rx_conf;
1066  struct rte_eth_vmdq_rx_conf vmdq_rx_conf;
1068  } rx_adv_conf;
1069  union {
1070  struct rte_eth_vmdq_dcb_tx_conf vmdq_dcb_tx_conf;
1072  struct rte_eth_dcb_tx_conf dcb_tx_conf;
1074  struct rte_eth_vmdq_tx_conf vmdq_tx_conf;
1076  } tx_adv_conf;
1080  struct rte_fdir_conf fdir_conf;
1081  struct rte_intr_conf intr_conf;
1082 };
1083 
1087 #define DEV_RX_OFFLOAD_VLAN_STRIP 0x00000001
1088 #define DEV_RX_OFFLOAD_IPV4_CKSUM 0x00000002
1089 #define DEV_RX_OFFLOAD_UDP_CKSUM 0x00000004
1090 #define DEV_RX_OFFLOAD_TCP_CKSUM 0x00000008
1091 #define DEV_RX_OFFLOAD_TCP_LRO 0x00000010
1092 #define DEV_RX_OFFLOAD_QINQ_STRIP 0x00000020
1093 #define DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000040
1094 #define DEV_RX_OFFLOAD_MACSEC_STRIP 0x00000080
1095 #define DEV_RX_OFFLOAD_HEADER_SPLIT 0x00000100
1096 #define DEV_RX_OFFLOAD_VLAN_FILTER 0x00000200
1097 #define DEV_RX_OFFLOAD_VLAN_EXTEND 0x00000400
1098 #define DEV_RX_OFFLOAD_JUMBO_FRAME 0x00000800
1099 #define DEV_RX_OFFLOAD_SCATTER 0x00002000
1100 #define DEV_RX_OFFLOAD_TIMESTAMP 0x00004000
1101 #define DEV_RX_OFFLOAD_SECURITY 0x00008000
1102 #define DEV_RX_OFFLOAD_KEEP_CRC 0x00010000
1103 #define DEV_RX_OFFLOAD_SCTP_CKSUM 0x00020000
1104 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM 0x00040000
1105 #define DEV_RX_OFFLOAD_RSS_HASH 0x00080000
1106 
1107 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
1108  DEV_RX_OFFLOAD_UDP_CKSUM | \
1109  DEV_RX_OFFLOAD_TCP_CKSUM)
1110 #define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \
1111  DEV_RX_OFFLOAD_VLAN_FILTER | \
1112  DEV_RX_OFFLOAD_VLAN_EXTEND | \
1113  DEV_RX_OFFLOAD_QINQ_STRIP)
1114 
1115 /*
1116  * If new Rx offload capabilities are defined, they also must be
1117  * mentioned in rte_rx_offload_names in rte_ethdev.c file.
1118  */
1119 
1123 #define DEV_TX_OFFLOAD_VLAN_INSERT 0x00000001
1124 #define DEV_TX_OFFLOAD_IPV4_CKSUM 0x00000002
1125 #define DEV_TX_OFFLOAD_UDP_CKSUM 0x00000004
1126 #define DEV_TX_OFFLOAD_TCP_CKSUM 0x00000008
1127 #define DEV_TX_OFFLOAD_SCTP_CKSUM 0x00000010
1128 #define DEV_TX_OFFLOAD_TCP_TSO 0x00000020
1129 #define DEV_TX_OFFLOAD_UDP_TSO 0x00000040
1130 #define DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000080
1131 #define DEV_TX_OFFLOAD_QINQ_INSERT 0x00000100
1132 #define DEV_TX_OFFLOAD_VXLAN_TNL_TSO 0x00000200
1133 #define DEV_TX_OFFLOAD_GRE_TNL_TSO 0x00000400
1134 #define DEV_TX_OFFLOAD_IPIP_TNL_TSO 0x00000800
1135 #define DEV_TX_OFFLOAD_GENEVE_TNL_TSO 0x00001000
1136 #define DEV_TX_OFFLOAD_MACSEC_INSERT 0x00002000
1137 #define DEV_TX_OFFLOAD_MT_LOCKFREE 0x00004000
1138 
1141 #define DEV_TX_OFFLOAD_MULTI_SEGS 0x00008000
1142 
1143 #define DEV_TX_OFFLOAD_MBUF_FAST_FREE 0x00010000
1144 
1148 #define DEV_TX_OFFLOAD_SECURITY 0x00020000
1149 
1154 #define DEV_TX_OFFLOAD_UDP_TNL_TSO 0x00040000
1155 
1160 #define DEV_TX_OFFLOAD_IP_TNL_TSO 0x00080000
1161 
1162 #define DEV_TX_OFFLOAD_OUTER_UDP_CKSUM 0x00100000
1163 /*
1164  * If new Tx offload capabilities are defined, they also must be
1165  * mentioned in rte_tx_offload_names in rte_ethdev.c file.
1166  */
1167 
1172 #define RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP 0x00000001
1173 
1174 #define RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP 0x00000002
1175 
1177 /*
1178  * Fallback default preferred Rx/Tx port parameters.
1179  * These are used if an application requests default parameters
1180  * but the PMD does not provide preferred values.
1181  */
1182 #define RTE_ETH_DEV_FALLBACK_RX_RINGSIZE 512
1183 #define RTE_ETH_DEV_FALLBACK_TX_RINGSIZE 512
1184 #define RTE_ETH_DEV_FALLBACK_RX_NBQUEUES 1
1185 #define RTE_ETH_DEV_FALLBACK_TX_NBQUEUES 1
1186 
1193  uint16_t burst_size;
1194  uint16_t ring_size;
1195  uint16_t nb_queues;
1196 };
1197 
1202 #define RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID (UINT16_MAX)
1203 
1208  const char *name;
1209  uint16_t domain_id;
1210  uint16_t port_id;
1218 };
1219 
1230  struct rte_device *device;
1231  const char *driver_name;
1232  unsigned int if_index;
1234  uint16_t min_mtu;
1235  uint16_t max_mtu;
1236  const uint32_t *dev_flags;
1237  uint32_t min_rx_bufsize;
1238  uint32_t max_rx_pktlen;
1241  uint16_t max_rx_queues;
1242  uint16_t max_tx_queues;
1243  uint32_t max_mac_addrs;
1244  uint32_t max_hash_mac_addrs;
1246  uint16_t max_vfs;
1247  uint16_t max_vmdq_pools;
1256  uint16_t reta_size;
1258  uint8_t hash_key_size;
1261  struct rte_eth_rxconf default_rxconf;
1262  struct rte_eth_txconf default_txconf;
1263  uint16_t vmdq_queue_base;
1264  uint16_t vmdq_queue_num;
1265  uint16_t vmdq_pool_base;
1266  struct rte_eth_desc_lim rx_desc_lim;
1267  struct rte_eth_desc_lim tx_desc_lim;
1268  uint32_t speed_capa;
1270  uint16_t nb_rx_queues;
1271  uint16_t nb_tx_queues;
1273  struct rte_eth_dev_portconf default_rxportconf;
1275  struct rte_eth_dev_portconf default_txportconf;
1277  uint64_t dev_capa;
1282  struct rte_eth_switch_info switch_info;
1283 
1284  uint64_t reserved_64s[2];
1285  void *reserved_ptrs[2];
1286 };
1287 
1293  struct rte_mempool *mp;
1294  struct rte_eth_rxconf conf;
1295  uint8_t scattered_rx;
1296  uint16_t nb_desc;
1298 
1304  struct rte_eth_txconf conf;
1305  uint16_t nb_desc;
1307 
1308 /* Generic Burst mode flag definition, values can be ORed. */
1309 
1315 #define RTE_ETH_BURST_FLAG_PER_QUEUE (1ULL << 0)
1316 
1322  uint64_t flags;
1324 #define RTE_ETH_BURST_MODE_INFO_SIZE 1024
1325  char info[RTE_ETH_BURST_MODE_INFO_SIZE];
1326 };
1327 
1329 #define RTE_ETH_XSTATS_NAME_SIZE 64
1330 
1341  uint64_t id;
1342  uint64_t value;
1343 };
1344 
1354 };
1355 
1356 #define ETH_DCB_NUM_TCS 8
1357 #define ETH_MAX_VMDQ_POOL 64
1358 
1365  struct {
1366  uint8_t base;
1367  uint8_t nb_queue;
1368  } tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
1370  struct {
1371  uint8_t base;
1372  uint8_t nb_queue;
1373  } tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
1374 };
1375 
1381  uint8_t nb_tcs;
1382  uint8_t prio_tc[ETH_DCB_NUM_USER_PRIORITIES];
1383  uint8_t tc_bws[ETH_DCB_NUM_TCS];
1386 };
1387 
1388 #define RTE_ETH_ALL RTE_MAX_ETHPORTS
1389 
1390 /* Macros to check for valid port */
1391 #define RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, retval) do { \
1392  if (!rte_eth_dev_is_valid_port(port_id)) { \
1393  RTE_ETHDEV_LOG(ERR, "Invalid port_id=%u\n", port_id); \
1394  return retval; \
1395  } \
1396 } while (0)
1397 
1398 #define RTE_ETH_VALID_PORTID_OR_RET(port_id) do { \
1399  if (!rte_eth_dev_is_valid_port(port_id)) { \
1400  RTE_ETHDEV_LOG(ERR, "Invalid port_id=%u\n", port_id); \
1401  return; \
1402  } \
1403 } while (0)
1404 
1410 #define ETH_L2_TUNNEL_ENABLE_MASK 0x00000001
1411 
1412 #define ETH_L2_TUNNEL_INSERTION_MASK 0x00000002
1413 
1414 #define ETH_L2_TUNNEL_STRIPPING_MASK 0x00000004
1415 
1416 #define ETH_L2_TUNNEL_FORWARDING_MASK 0x00000008
1417 
1440 typedef uint16_t (*rte_rx_callback_fn)(uint16_t port_id, uint16_t queue,
1441  struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts,
1442  void *user_param);
1443 
1464 typedef uint16_t (*rte_tx_callback_fn)(uint16_t port_id, uint16_t queue,
1465  struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
1466 
1477 };
1478 
1479 struct rte_eth_dev_sriov {
1480  uint8_t active;
1481  uint8_t nb_q_per_pool;
1482  uint16_t def_vmdq_idx;
1483  uint16_t def_pool_q_idx;
1484 };
1485 #define RTE_ETH_DEV_SRIOV(dev) ((dev)->data->sriov)
1486 
1487 #define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
1488 
1489 #define RTE_ETH_DEV_NO_OWNER 0
1490 
1491 #define RTE_ETH_MAX_OWNER_NAME_LEN 64
1492 
1493 struct rte_eth_dev_owner {
1494  uint64_t id;
1495  char name[RTE_ETH_MAX_OWNER_NAME_LEN];
1496 };
1497 
1502 #define RTE_ETH_DEV_CLOSE_REMOVE 0x0001
1503 
1504 #define RTE_ETH_DEV_INTR_LSC 0x0002
1505 
1506 #define RTE_ETH_DEV_BONDED_SLAVE 0x0004
1507 
1508 #define RTE_ETH_DEV_INTR_RMV 0x0008
1509 
1510 #define RTE_ETH_DEV_REPRESENTOR 0x0010
1511 
1512 #define RTE_ETH_DEV_NOLIVE_MAC_ADDR 0x0020
1513 
1525 uint64_t rte_eth_find_next_owned_by(uint16_t port_id,
1526  const uint64_t owner_id);
1527 
1531 #define RTE_ETH_FOREACH_DEV_OWNED_BY(p, o) \
1532  for (p = rte_eth_find_next_owned_by(0, o); \
1533  (unsigned int)p < (unsigned int)RTE_MAX_ETHPORTS; \
1534  p = rte_eth_find_next_owned_by(p + 1, o))
1535 
1544 uint16_t rte_eth_find_next(uint16_t port_id);
1545 
1549 #define RTE_ETH_FOREACH_DEV(p) \
1550  RTE_ETH_FOREACH_DEV_OWNED_BY(p, RTE_ETH_DEV_NO_OWNER)
1551 
1566 __rte_experimental
1567 uint16_t
1568 rte_eth_find_next_of(uint16_t port_id_start,
1569  const struct rte_device *parent);
1570 
1579 #define RTE_ETH_FOREACH_DEV_OF(port_id, parent) \
1580  for (port_id = rte_eth_find_next_of(0, parent); \
1581  port_id < RTE_MAX_ETHPORTS; \
1582  port_id = rte_eth_find_next_of(port_id + 1, parent))
1583 
1598 __rte_experimental
1599 uint16_t
1600 rte_eth_find_next_sibling(uint16_t port_id_start,
1601  uint16_t ref_port_id);
1602 
1613 #define RTE_ETH_FOREACH_DEV_SIBLING(port_id, ref_port_id) \
1614  for (port_id = rte_eth_find_next_sibling(0, ref_port_id); \
1615  port_id < RTE_MAX_ETHPORTS; \
1616  port_id = rte_eth_find_next_sibling(port_id + 1, ref_port_id))
1617 
1631 __rte_experimental
1632 int rte_eth_dev_owner_new(uint64_t *owner_id);
1633 
1647 __rte_experimental
1648 int rte_eth_dev_owner_set(const uint16_t port_id,
1649  const struct rte_eth_dev_owner *owner);
1650 
1664 __rte_experimental
1665 int rte_eth_dev_owner_unset(const uint16_t port_id,
1666  const uint64_t owner_id);
1667 
1679 __rte_experimental
1680 int rte_eth_dev_owner_delete(const uint64_t owner_id);
1681 
1695 __rte_experimental
1696 int rte_eth_dev_owner_get(const uint16_t port_id,
1697  struct rte_eth_dev_owner *owner);
1698 
1709 uint16_t rte_eth_dev_count_avail(void);
1710 
1719 uint16_t rte_eth_dev_count_total(void);
1720 
1732 uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex);
1733 
1742 const char *rte_eth_dev_rx_offload_name(uint64_t offload);
1743 
1752 const char *rte_eth_dev_tx_offload_name(uint64_t offload);
1753 
1793 int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue,
1794  uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf);
1795 
1807 __rte_experimental
1808 int
1809 rte_eth_dev_is_removed(uint16_t port_id);
1810 
1860 int rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
1861  uint16_t nb_rx_desc, unsigned int socket_id,
1862  const struct rte_eth_rxconf *rx_conf,
1863  struct rte_mempool *mb_pool);
1864 
1891 __rte_experimental
1893  (uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc,
1894  const struct rte_eth_hairpin_conf *conf);
1895 
1944 int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,
1945  uint16_t nb_tx_desc, unsigned int socket_id,
1946  const struct rte_eth_txconf *tx_conf);
1947 
1972 __rte_experimental
1974  (uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc,
1975  const struct rte_eth_hairpin_conf *conf);
1976 
1987 int rte_eth_dev_socket_id(uint16_t port_id);
1988 
1998 int rte_eth_dev_is_valid_port(uint16_t port_id);
1999 
2016 int rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id);
2017 
2033 int rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id);
2034 
2051 int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id);
2052 
2068 int rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id);
2069 
2089 int rte_eth_dev_start(uint16_t port_id);
2090 
2098 void rte_eth_dev_stop(uint16_t port_id);
2099 
2112 int rte_eth_dev_set_link_up(uint16_t port_id);
2113 
2123 int rte_eth_dev_set_link_down(uint16_t port_id);
2124 
2133 void rte_eth_dev_close(uint16_t port_id);
2134 
2172 int rte_eth_dev_reset(uint16_t port_id);
2173 
2185 int rte_eth_promiscuous_enable(uint16_t port_id);
2186 
2198 int rte_eth_promiscuous_disable(uint16_t port_id);
2199 
2210 int rte_eth_promiscuous_get(uint16_t port_id);
2211 
2223 int rte_eth_allmulticast_enable(uint16_t port_id);
2224 
2236 int rte_eth_allmulticast_disable(uint16_t port_id);
2237 
2248 int rte_eth_allmulticast_get(uint16_t port_id);
2249 
2265 int rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link);
2266 
2282 int rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link);
2283 
2301 int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats);
2302 
2314 int rte_eth_stats_reset(uint16_t port_id);
2315 
2345 int rte_eth_xstats_get_names(uint16_t port_id,
2346  struct rte_eth_xstat_name *xstats_names,
2347  unsigned int size);
2348 
2378 int rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats,
2379  unsigned int n);
2380 
2403 int
2404 rte_eth_xstats_get_names_by_id(uint16_t port_id,
2405  struct rte_eth_xstat_name *xstats_names, unsigned int size,
2406  uint64_t *ids);
2407 
2431 int rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids,
2432  uint64_t *values, unsigned int size);
2433 
2452 int rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name,
2453  uint64_t *id);
2454 
2467 int rte_eth_xstats_reset(uint16_t port_id);
2468 
2486 int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id,
2487  uint16_t tx_queue_id, uint8_t stat_idx);
2488 
2506 int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id,
2507  uint16_t rx_queue_id,
2508  uint8_t stat_idx);
2509 
2522 int rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr);
2523 
2566 int rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info);
2567 
2587 int rte_eth_dev_fw_version_get(uint16_t port_id,
2588  char *fw_version, size_t fw_size);
2589 
2628 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
2629  uint32_t *ptypes, int num);
2663 __rte_experimental
2664 int rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask,
2665  uint32_t *set_ptypes, unsigned int num);
2666 
2678 int rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu);
2679 
2697 int rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu);
2698 
2718 int rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on);
2719 
2739 int rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id,
2740  int on);
2741 
2759 int rte_eth_dev_set_vlan_ether_type(uint16_t port_id,
2760  enum rte_vlan_type vlan_type,
2761  uint16_t tag_type);
2762 
2785 int rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask);
2786 
2800 int rte_eth_dev_get_vlan_offload(uint16_t port_id);
2801 
2816 int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on);
2817 
2818 typedef void (*buffer_tx_error_fn)(struct rte_mbuf **unsent, uint16_t count,
2819  void *userdata);
2820 
2826  buffer_tx_error_fn error_callback;
2827  void *error_userdata;
2828  uint16_t size;
2829  uint16_t length;
2830  struct rte_mbuf *pkts[];
2832 };
2833 
2840 #define RTE_ETH_TX_BUFFER_SIZE(sz) \
2841  (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
2842 
2853 int
2854 rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);
2855 
2880 int
2882  buffer_tx_error_fn callback, void *userdata);
2883 
2906 void
2907 rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
2908  void *userdata);
2909 
2933 void
2934 rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
2935  void *userdata);
2936 
2962 int
2963 rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
2964 
2980 };
2981 
2989  uint64_t metadata;
3003 };
3004 
3022 };
3023 
3024 typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id,
3025  enum rte_eth_event_type event, void *cb_arg, void *ret_param);
3045 int rte_eth_dev_callback_register(uint16_t port_id,
3046  enum rte_eth_event_type event,
3047  rte_eth_dev_cb_fn cb_fn, void *cb_arg);
3048 
3067 int rte_eth_dev_callback_unregister(uint16_t port_id,
3068  enum rte_eth_event_type event,
3069  rte_eth_dev_cb_fn cb_fn, void *cb_arg);
3070 
3092 int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id);
3093 
3114 int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id);
3115 
3133 int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data);
3134 
3156 int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id,
3157  int epfd, int op, void *data);
3158 
3176 __rte_experimental
3177 int
3178 rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id);
3179 
3193 int rte_eth_led_on(uint16_t port_id);
3194 
3208 int rte_eth_led_off(uint16_t port_id);
3209 
3223 int rte_eth_dev_flow_ctrl_get(uint16_t port_id,
3224  struct rte_eth_fc_conf *fc_conf);
3225 
3240 int rte_eth_dev_flow_ctrl_set(uint16_t port_id,
3241  struct rte_eth_fc_conf *fc_conf);
3242 
3258 int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
3259  struct rte_eth_pfc_conf *pfc_conf);
3260 
3280 int rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *mac_addr,
3281  uint32_t pool);
3282 
3296 int rte_eth_dev_mac_addr_remove(uint16_t port_id,
3297  struct rte_ether_addr *mac_addr);
3298 
3312 int rte_eth_dev_default_mac_addr_set(uint16_t port_id,
3313  struct rte_ether_addr *mac_addr);
3314 
3331 int rte_eth_dev_rss_reta_update(uint16_t port_id,
3332  struct rte_eth_rss_reta_entry64 *reta_conf,
3333  uint16_t reta_size);
3334 
3352 int rte_eth_dev_rss_reta_query(uint16_t port_id,
3353  struct rte_eth_rss_reta_entry64 *reta_conf,
3354  uint16_t reta_size);
3355 
3375 int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr,
3376  uint8_t on);
3377 
3396 int rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on);
3397 
3420 int rte_eth_mirror_rule_set(uint16_t port_id,
3421  struct rte_eth_mirror_conf *mirror_conf,
3422  uint8_t rule_id,
3423  uint8_t on);
3424 
3439 int rte_eth_mirror_rule_reset(uint16_t port_id,
3440  uint8_t rule_id);
3441 
3458 int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
3459  uint16_t tx_rate);
3460 
3475 int rte_eth_dev_rss_hash_update(uint16_t port_id,
3476  struct rte_eth_rss_conf *rss_conf);
3477 
3492 int
3493 rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
3494  struct rte_eth_rss_conf *rss_conf);
3495 
3514 int
3515 rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
3516  struct rte_eth_udp_tunnel *tunnel_udp);
3517 
3537 int
3538 rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
3539  struct rte_eth_udp_tunnel *tunnel_udp);
3540 
3555 __rte_deprecated
3556 int rte_eth_dev_filter_supported(uint16_t port_id,
3557  enum rte_filter_type filter_type);
3558 
3578 __rte_deprecated
3579 int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
3580  enum rte_filter_op filter_op, void *arg);
3581 
3595 int rte_eth_dev_get_dcb_info(uint16_t port_id,
3596  struct rte_eth_dcb_info *dcb_info);
3597 
3598 struct rte_eth_rxtx_callback;
3599 
3625 const struct rte_eth_rxtx_callback *
3626 rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
3627  rte_rx_callback_fn fn, void *user_param);
3628 
3655 const struct rte_eth_rxtx_callback *
3656 rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
3657  rte_rx_callback_fn fn, void *user_param);
3658 
3684 const struct rte_eth_rxtx_callback *
3685 rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
3686  rte_tx_callback_fn fn, void *user_param);
3687 
3720 int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
3721  const struct rte_eth_rxtx_callback *user_cb);
3722 
3755 int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
3756  const struct rte_eth_rxtx_callback *user_cb);
3757 
3776 int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
3777  struct rte_eth_rxq_info *qinfo);
3778 
3797 int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
3798  struct rte_eth_txq_info *qinfo);
3799 
3817 __rte_experimental
3818 int rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
3819  struct rte_eth_burst_mode *mode);
3820 
3838 __rte_experimental
3839 int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
3840  struct rte_eth_burst_mode *mode);
3841 
3860 int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info);
3861 
3874 int rte_eth_dev_get_eeprom_length(uint16_t port_id);
3875 
3892 int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
3893 
3910 int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
3911 
3930 __rte_experimental
3931 int
3932 rte_eth_dev_get_module_info(uint16_t port_id,
3933  struct rte_eth_dev_module_info *modinfo);
3934 
3954 __rte_experimental
3955 int
3956 rte_eth_dev_get_module_eeprom(uint16_t port_id,
3957  struct rte_dev_eeprom_info *info);
3958 
3977 int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
3978  struct rte_ether_addr *mc_addr_set,
3979  uint32_t nb_mc_addr);
3980 
3993 int rte_eth_timesync_enable(uint16_t port_id);
3994 
4007 int rte_eth_timesync_disable(uint16_t port_id);
4008 
4027 int rte_eth_timesync_read_rx_timestamp(uint16_t port_id,
4028  struct timespec *timestamp, uint32_t flags);
4029 
4045 int rte_eth_timesync_read_tx_timestamp(uint16_t port_id,
4046  struct timespec *timestamp);
4047 
4065 int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);
4066 
4081 int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
4082 
4101 int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
4102 
4147 __rte_experimental
4148 int
4149 rte_eth_read_clock(uint16_t port_id, uint64_t *clock);
4150 
4166 int
4167 rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
4168  struct rte_eth_l2_tunnel_conf *l2_tunnel);
4169 
4194 int
4195 rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
4196  struct rte_eth_l2_tunnel_conf *l2_tunnel,
4197  uint32_t mask,
4198  uint8_t en);
4199 
4215 int
4216 rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
4217 
4232 int
4233 rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
4234 
4251 int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
4252  uint16_t *nb_rx_desc,
4253  uint16_t *nb_tx_desc);
4254 
4269 int
4270 rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
4271 
4281 void *
4282 rte_eth_dev_get_sec_ctx(uint16_t port_id);
4283 
4298 __rte_experimental
4299 int rte_eth_dev_hairpin_capability_get(uint16_t port_id,
4300  struct rte_eth_hairpin_cap *cap);
4301 
4302 #include <rte_ethdev_core.h>
4303 
4386 static inline uint16_t
4387 rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
4388  struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
4389 {
4390  struct rte_eth_dev *dev = &rte_eth_devices[port_id];
4391  uint16_t nb_rx;
4392 
4393 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
4394  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
4395  RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
4396 
4397  if (queue_id >= dev->data->nb_rx_queues) {
4398  RTE_ETHDEV_LOG(ERR, "Invalid RX queue_id=%u\n", queue_id);
4399  return 0;
4400  }
4401 #endif
4402  nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
4403  rx_pkts, nb_pkts);
4404 
4405 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
4406  struct rte_eth_rxtx_callback *cb;
4407 
4408  /* __ATOMIC_RELEASE memory order was used when the
4409  * call back was inserted into the list.
4410  * Since there is a clear dependency between loading
4411  * cb and cb->fn/cb->next, __ATOMIC_ACQUIRE memory order is
4412  * not required.
4413  */
4414  cb = __atomic_load_n(&dev->post_rx_burst_cbs[queue_id],
4415  __ATOMIC_RELAXED);
4416 
4417  if (unlikely(cb != NULL)) {
4418  do {
4419  nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
4420  nb_pkts, cb->param);
4421  cb = cb->next;
4422  } while (cb != NULL);
4423  }
4424 #endif
4425 
4426  return nb_rx;
4427 }
4428 
4441 static inline int
4442 rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
4443 {
4444  struct rte_eth_dev *dev;
4445 
4446  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
4447  dev = &rte_eth_devices[port_id];
4448  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
4449  if (queue_id >= dev->data->nb_rx_queues)
4450  return -EINVAL;
4451 
4452  return (int)(*dev->dev_ops->rx_queue_count)(dev, queue_id);
4453 }
4454 
4470 static inline int
4471 rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
4472 {
4473  struct rte_eth_dev *dev = &rte_eth_devices[port_id];
4474  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
4475  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
4476  return (*dev->dev_ops->rx_descriptor_done)( \
4477  dev->data->rx_queues[queue_id], offset);
4478 }
4479 
4480 #define RTE_ETH_RX_DESC_AVAIL 0
4481 #define RTE_ETH_RX_DESC_DONE 1
4482 #define RTE_ETH_RX_DESC_UNAVAIL 2
4517 static inline int
4518 rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
4519  uint16_t offset)
4520 {
4521  struct rte_eth_dev *dev;
4522  void *rxq;
4523 
4524 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
4525  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
4526 #endif
4527  dev = &rte_eth_devices[port_id];
4528 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
4529  if (queue_id >= dev->data->nb_rx_queues)
4530  return -ENODEV;
4531 #endif
4532  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
4533  rxq = dev->data->rx_queues[queue_id];
4534 
4535  return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
4536 }
4537 
4538 #define RTE_ETH_TX_DESC_FULL 0
4539 #define RTE_ETH_TX_DESC_DONE 1
4540 #define RTE_ETH_TX_DESC_UNAVAIL 2
4575 static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
4576  uint16_t queue_id, uint16_t offset)
4577 {
4578  struct rte_eth_dev *dev;
4579  void *txq;
4580 
4581 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
4582  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
4583 #endif
4584  dev = &rte_eth_devices[port_id];
4585 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
4586  if (queue_id >= dev->data->nb_tx_queues)
4587  return -ENODEV;
4588 #endif
4589  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
4590  txq = dev->data->tx_queues[queue_id];
4591 
4592  return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
4593 }
4594 
4661 static inline uint16_t
4662 rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
4663  struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
4664 {
4665  struct rte_eth_dev *dev = &rte_eth_devices[port_id];
4666 
4667 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
4668  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
4669  RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
4670 
4671  if (queue_id >= dev->data->nb_tx_queues) {
4672  RTE_ETHDEV_LOG(ERR, "Invalid TX queue_id=%u\n", queue_id);
4673  return 0;
4674  }
4675 #endif
4676 
4677 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
4678  struct rte_eth_rxtx_callback *cb;
4679 
4680  /* __ATOMIC_RELEASE memory order was used when the
4681  * call back was inserted into the list.
4682  * Since there is a clear dependency between loading
4683  * cb and cb->fn/cb->next, __ATOMIC_ACQUIRE memory order is
4684  * not required.
4685  */
4686  cb = __atomic_load_n(&dev->pre_tx_burst_cbs[queue_id],
4687  __ATOMIC_RELAXED);
4688 
4689  if (unlikely(cb != NULL)) {
4690  do {
4691  nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
4692  cb->param);
4693  cb = cb->next;
4694  } while (cb != NULL);
4695  }
4696 #endif
4697 
4698  return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
4699 }
4700 
4754 #ifndef RTE_ETHDEV_TX_PREPARE_NOOP
4755 
4756 static inline uint16_t
4757 rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
4758  struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
4759 {
4760  struct rte_eth_dev *dev;
4761 
4762 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
4763  if (!rte_eth_dev_is_valid_port(port_id)) {
4764  RTE_ETHDEV_LOG(ERR, "Invalid TX port_id=%u\n", port_id);
4765  rte_errno = EINVAL;
4766  return 0;
4767  }
4768 #endif
4769 
4770  dev = &rte_eth_devices[port_id];
4771 
4772 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
4773  if (queue_id >= dev->data->nb_tx_queues) {
4774  RTE_ETHDEV_LOG(ERR, "Invalid TX queue_id=%u\n", queue_id);
4775  rte_errno = EINVAL;
4776  return 0;
4777  }
4778 #endif
4779 
4780  if (!dev->tx_pkt_prepare)
4781  return nb_pkts;
4782 
4783  return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
4784  tx_pkts, nb_pkts);
4785 }
4786 
4787 #else
4788 
4789 /*
4790  * Native NOOP operation for compilation targets which doesn't require any
4791  * preparations steps, and functional NOOP may introduce unnecessary performance
4792  * drop.
4793  *
4794  * Generally this is not a good idea to turn it on globally and didn't should
4795  * be used if behavior of tx_preparation can change.
4796  */
4797 
4798 static inline uint16_t
4799 rte_eth_tx_prepare(__rte_unused uint16_t port_id,
4800  __rte_unused uint16_t queue_id,
4801  __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
4802 {
4803  return nb_pkts;
4804 }
4805 
4806 #endif
4807 
4830 static inline uint16_t
4831 rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
4832  struct rte_eth_dev_tx_buffer *buffer)
4833 {
4834  uint16_t sent;
4835  uint16_t to_send = buffer->length;
4836 
4837  if (to_send == 0)
4838  return 0;
4839 
4840  sent = rte_eth_tx_burst(port_id, queue_id, buffer->pkts, to_send);
4841 
4842  buffer->length = 0;
4843 
4844  /* All packets sent, or to be dealt with by callback below */
4845  if (unlikely(sent != to_send))
4846  buffer->error_callback(&buffer->pkts[sent],
4847  (uint16_t)(to_send - sent),
4848  buffer->error_userdata);
4849 
4850  return sent;
4851 }
4852 
4883 static __rte_always_inline uint16_t
4884 rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
4885  struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
4886 {
4887  buffer->pkts[buffer->length++] = tx_pkt;
4888  if (buffer->length < buffer->size)
4889  return 0;
4890 
4891  return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
4892 }
4893 
4894 #ifdef __cplusplus
4895 }
4896 #endif
4897 
4898 #endif /* _RTE_ETHDEV_H_ */
uint16_t nb_rx_queues
Definition: rte_ethdev.h:1270
int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf)
int rte_eth_promiscuous_disable(uint16_t port_id)
#define ETH_VMDQ_MAX_VLAN_FILTERS
Definition: rte_ethdev.h:614
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:1037
#define __rte_always_inline
Definition: rte_common.h:153
uint16_t tx_rs_thresh
Definition: rte_ethdev.h:839
uint16_t rte_eth_dev_count_avail(void)
int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time)
uint16_t nb_desc
Definition: rte_ethdev.h:1305
uint64_t rx_offload_capa
Definition: rte_ethdev.h:1248
const uint32_t * dev_flags
Definition: rte_ethdev.h:1236
int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info)
int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time)
uint64_t rte_eth_find_next_owned_by(uint16_t port_id, const uint64_t owner_id)
void rte_eth_dev_stop(uint16_t port_id)
__rte_experimental int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode)
#define __rte_cache_min_aligned
Definition: rte_common.h:320
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:4757
int rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id)
rte_eth_nb_tcs
Definition: rte_ethdev.h:695
const struct rte_eth_rxtx_callback * rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param)
uint64_t q_errors[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:263
__rte_experimental int rte_eth_dev_owner_new(uint64_t *owner_id)
__rte_experimental int rte_eth_dev_owner_unset(const uint16_t port_id, const uint64_t owner_id)
uint16_t rte_eth_find_next(uint16_t port_id)
__rte_experimental int rte_eth_dev_is_removed(uint16_t port_id)
int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on)
int rte_eth_led_off(uint16_t port_id)
rte_fdir_pballoc_type
Definition: rte_ethdev.h:984
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:4518
__rte_experimental uint16_t rte_eth_find_next_of(uint16_t port_id_start, const struct rte_device *parent)
uint64_t imissed
Definition: rte_ethdev.h:248
static int rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
Definition: rte_ethdev.h:4471
uint32_t low_water
Definition: rte_ethdev.h:944
__rte_experimental int rte_eth_dev_hairpin_capability_get(uint16_t port_id, struct rte_eth_hairpin_cap *cap)
uint32_t max_rx_pkt_len
Definition: rte_ethdev.h:397
uint8_t rss_key_len
Definition: rte_ethdev.h:450
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:329
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:1252
int rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, unsigned int n)
__rte_experimental int rte_eth_read_clock(uint16_t port_id, uint64_t *clock)
int rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs)
uint16_t reta_size
Definition: rte_ethdev.h:1256
int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, int epfd, int op, void *data)
void * userdata
int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, const struct rte_eth_rxtx_callback *user_cb)
uint32_t lpbk_mode
Definition: rte_ethdev.h:1055
#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:1046
uint64_t tx_queue_offload_capa
Definition: rte_ethdev.h:1254
rte_eth_tx_mq_mode
Definition: rte_ethdev.h:377
rte_eth_fc_mode
Definition: rte_ethdev.h:930
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:747
uint16_t nb_mtu_seg_max
Definition: rte_ethdev.h:924
#define __rte_unused
Definition: rte_common.h:84
uint64_t q_obytes[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:261
uint16_t max_rx_2_tx
Definition: rte_ethdev.h:865
int rte_eth_dev_get_eeprom_length(uint16_t port_id)
uint64_t opackets
Definition: rte_ethdev.h:245
rte_filter_op
Definition: rte_eth_ctrl.h:47
uint8_t hash_key_size
Definition: rte_ethdev.h:1258
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:400
__rte_experimental int rte_eth_dev_get_module_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info)
struct rte_mempool * mp
Definition: rte_ethdev.h:1293
uint32_t dcb_capability_en
Definition: rte_ethdev.h:1079
uint64_t q_ibytes[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:259
const char * name
Definition: rte_ethdev.h:1208
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)
uint32_t rxq
Definition: rte_ethdev.h:1035
int rte_eth_dev_set_link_up(uint16_t port_id)
int rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags)
int rte_eth_dev_get_vlan_offload(uint16_t port_id)
__rte_experimental int rte_eth_dev_owner_set(const uint16_t port_id, const struct rte_eth_dev_owner *owner)
__rte_experimental int rte_eth_dev_rx_intr_ctl_q_get_fd(uint16_t port_id, uint16_t queue_id)
int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf)
uint16_t vmdq_queue_num
Definition: rte_ethdev.h:1264
uint8_t rx_deferred_start
Definition: rte_ethdev.h:822
struct rte_mbuf * pkts[]
Definition: rte_ethdev.h:2830
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:3024
uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:255
uint32_t high_water
Definition: rte_ethdev.h:943
uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex)
#define RTE_ETH_XSTATS_NAME_SIZE
Definition: rte_ethdev.h:1329
int rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf)
int rte_eth_timesync_disable(uint16_t port_id)
int rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *mac_addr)
uint64_t offloads
Definition: rte_ethdev.h:828
void rte_eth_iterator_cleanup(struct rte_dev_iterator *iter)
void * rte_eth_dev_get_sec_ctx(uint16_t port_id)
uint16_t send_xon
Definition: rte_ethdev.h:946
int rte_eth_stats_reset(uint16_t port_id)
int rte_eth_allmulticast_enable(uint16_t port_id)
#define unlikely(x)
uint16_t nb_max
Definition: rte_ethdev.h:899
uint64_t ibytes
Definition: rte_ethdev.h:246
uint64_t offloads
Definition: rte_ethdev.h:849
uint16_t max_nb_queues
Definition: rte_ethdev.h:863
uint64_t oerrors
Definition: rte_ethdev.h:253
void rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent, void *userdata)
int rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp)
int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta)
uint16_t max_mtu
Definition: rte_ethdev.h:1235
uint64_t offloads
Definition: rte_ethdev.h:406
int rte_eth_dev_callback_register(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg)
int rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id)
uint16_t tx_free_thresh
Definition: rte_ethdev.h:840
uint16_t nb_desc
Definition: rte_ethdev.h:1296
__rte_experimental uint16_t rte_eth_find_next_sibling(uint16_t port_id_start, uint16_t ref_port_id)
static uint16_t rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
Definition: rte_ethdev.h:4387
int rte_eth_allmulticast_disable(uint16_t port_id)
__rte_experimental int rte_eth_dev_get_module_info(uint16_t port_id, struct rte_eth_dev_module_info *modinfo)
int rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, int on)
int rte_eth_dev_start(uint16_t port_id)
uint16_t max_vmdq_pools
Definition: rte_ethdev.h:1247
uint8_t scattered_rx
Definition: rte_ethdev.h:1295
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)
uint64_t offloads
Definition: rte_ethdev.h:799
uint16_t vmdq_pool_base
Definition: rte_ethdev.h:1265
uint64_t tx_offload_capa
Definition: rte_ethdev.h:1250
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:257
int rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
uint16_t min_mtu
Definition: rte_ethdev.h:1234
int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, const struct rte_eth_rxtx_callback *user_cb)
uint16_t(* rte_tx_callback_fn)(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param)
Definition: rte_ethdev.h:1464
int rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size)
uint64_t obytes
Definition: rte_ethdev.h:247
uint8_t enable_loop_back
Definition: rte_ethdev.h:780
int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, uint16_t *nb_rx_desc, uint16_t *nb_tx_desc)
int rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *mac_addr)
#define ETH_DCB_NUM_USER_PRIORITIES
Definition: rte_ethdev.h:615
int rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *mac_addr, uint32_t pool)
uint16_t max_tx_queues
Definition: rte_ethdev.h:1242
int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id)
int rte_eth_xstats_reset(uint16_t port_id)
rte_eth_dev_state
Definition: rte_ethdev.h:1470
uint16_t rx_free_thresh
Definition: rte_ethdev.h:820
uint64_t dev_capa
Definition: rte_ethdev.h:1277
uint16_t max_tx_2_rx
Definition: rte_ethdev.h:867
uint64_t ierrors
Definition: rte_ethdev.h:252
uint16_t max_nb_desc
Definition: rte_ethdev.h:868
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)
uint8_t priority
Definition: rte_ethdev.h:959
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
Definition: rte_ethdev.h:1260
uint16_t rte_eth_dev_count_total(void)
int rte_eth_promiscuous_enable(uint16_t port_id)
int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data)
rte_vlan_type
Definition: rte_ethdev.h:416
const char * rte_eth_dev_tx_offload_name(uint64_t offload)
uint16_t nb_seg_max
Definition: rte_ethdev.h:911
uint64_t ipackets
Definition: rte_ethdev.h:244
uint16_t max_vfs
Definition: rte_ethdev.h:1246
uint16_t pause_time
Definition: rte_ethdev.h:945
int rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link)
rte_filter_type
Definition: rte_eth_ctrl.h:29
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:254
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:4884
int rte_eth_dev_set_mc_addr_list(uint16_t port_id, struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr)
int rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info)
#define ETH_MQ_RX_RSS_FLAG
Definition: rte_ethdev.h:336
uint16_t vmdq_queue_base
Definition: rte_ethdev.h:1263
rte_eth_event_ipsec_subtype
Definition: rte_ethdev.h:2969
rte_eth_nb_pools
Definition: rte_ethdev.h:704
#define ETH_MIRROR_MAX_VLANS
Definition: rte_ethdev.h:650
uint16_t nb_align
Definition: rte_ethdev.h:901
int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx)
int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info)
rte_eth_rx_mq_mode
Definition: rte_ethdev.h:344
__rte_experimental int rte_eth_dev_owner_get(const uint16_t port_id, struct rte_eth_dev_owner *owner)
const char * driver_name
Definition: rte_ethdev.h:1231
static int rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
Definition: rte_ethdev.h:4442
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:778
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:1271
int rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link)
int rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu)
int rte_eth_dev_set_vlan_ether_type(uint16_t port_id, enum rte_vlan_type vlan_type, uint16_t tag_type)
uint32_t max_mac_addrs
Definition: rte_ethdev.h:1243
int rte_eth_xstats_get_names_by_id(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size, uint64_t *ids)
rte_eth_tunnel_type
Definition: rte_ethdev.h:965
__rte_experimental int rte_eth_rx_hairpin_queue_setup(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, const struct rte_eth_hairpin_conf *conf)
uint64_t value
Definition: rte_ethdev.h:1342
static uint64_t rte_eth_rss_hf_refine(uint64_t rss_hf)
Definition: rte_ethdev.h:540
int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr, uint8_t on)
int rte_eth_dev_rss_reta_query(uint16_t port_id, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size)
int rte_eth_promiscuous_get(uint16_t port_id)
int rte_eth_led_on(uint16_t port_id)
int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp)
__rte_experimental int rte_eth_dev_set_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *set_ptypes, unsigned int num)
uint32_t max_rx_pktlen
Definition: rte_ethdev.h:1238
__rte_experimental int rte_eth_dev_owner_delete(const uint64_t owner_id)
int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num)
uint64_t rss_hf
Definition: rte_ethdev.h:451
uint64_t id
Definition: rte_ethdev.h:1341
int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats)
unsigned int if_index
Definition: rte_ethdev.h:1232
__rte_deprecated int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg)
__rte_experimental int rte_eth_tx_hairpin_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, const struct rte_eth_hairpin_conf *conf)
uint8_t mac_ctrl_frame_fwd
Definition: rte_ethdev.h:948
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:1440
int rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
rte_fdir_mode
Definition: rte_eth_ctrl.h:604
uint8_t * rss_key
Definition: rte_ethdev.h:449
rte_fdir_status_mode
Definition: rte_ethdev.h:993
__rte_deprecated int rte_eth_dev_filter_supported(uint16_t port_id, enum rte_filter_type filter_type)
uint8_t tx_deferred_start
Definition: rte_ethdev.h:843
uint8_t wthresh
Definition: rte_ethdev.h:330
uint16_t max_rx_queues
Definition: rte_ethdev.h:1241
int rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size)
uint32_t max_lro_pkt_size
Definition: rte_ethdev.h:399
int rte_eth_xstats_get_names(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size)
const struct rte_eth_rxtx_callback * rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param)
int rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt)
int rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask)
int rte_eth_allmulticast_get(uint16_t port_id)
uint8_t rx_drop_en
Definition: rte_ethdev.h:821
int rte_eth_dev_is_valid_port(uint16_t port_id)
int rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)
uint32_t max_lro_pkt_size
Definition: rte_ethdev.h:1240
uint16_t nb_min
Definition: rte_ethdev.h:900
int rte_eth_timesync_enable(uint16_t port_id)
uint8_t pthresh
Definition: rte_ethdev.h:328
uint32_t speed_capa
Definition: rte_ethdev.h:1268
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:4662
uint8_t drop_queue
Definition: rte_ethdev.h:1010
int rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id)
int rte_eth_dev_set_link_down(uint16_t port_id)
int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf)
uint16_t rte_eth_iterator_next(struct rte_dev_iterator *iter)
uint8_t autoneg
Definition: rte_ethdev.h:949
uint32_t min_rx_bufsize
Definition: rte_ethdev.h:1237
int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info)
__rte_experimental int rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_burst_mode *mode)
const char * rte_eth_dev_rx_offload_name(uint64_t offload)
uint32_t lsc
Definition: rte_ethdev.h:1033
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:4831
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:3008