DPDK  17.11.0
rte_ethdev.h
Go to the documentation of this file.
1 /*-
2  * BSD LICENSE
3  *
4  * Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in
15  * the documentation and/or other materials provided with the
16  * distribution.
17  * * Neither the name of Intel Corporation nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #ifndef _RTE_ETHDEV_H_
35 #define _RTE_ETHDEV_H_
36 
169 #ifdef __cplusplus
170 extern "C" {
171 #endif
172 
173 #include <stdint.h>
174 
175 /* Use this macro to check if LRO API is supported */
176 #define RTE_ETHDEV_HAS_LRO_SUPPORT
177 
178 #include <rte_log.h>
179 #include <rte_interrupts.h>
180 #include <rte_dev.h>
181 #include <rte_devargs.h>
182 #include <rte_errno.h>
183 #include <rte_common.h>
184 
185 #include "rte_ether.h"
186 #include "rte_eth_ctrl.h"
187 #include "rte_dev_info.h"
188 
189 struct rte_mbuf;
190 
198  uint64_t ipackets;
199  uint64_t opackets;
200  uint64_t ibytes;
201  uint64_t obytes;
202  uint64_t imissed;
206  uint64_t ierrors;
207  uint64_t oerrors;
208  uint64_t rx_nombuf;
209  uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
211  uint64_t q_opackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
213  uint64_t q_ibytes[RTE_ETHDEV_QUEUE_STAT_CNTRS];
215  uint64_t q_obytes[RTE_ETHDEV_QUEUE_STAT_CNTRS];
217  uint64_t q_errors[RTE_ETHDEV_QUEUE_STAT_CNTRS];
219 };
220 
224 #define ETH_LINK_SPEED_AUTONEG (0 << 0)
225 #define ETH_LINK_SPEED_FIXED (1 << 0)
226 #define ETH_LINK_SPEED_10M_HD (1 << 1)
227 #define ETH_LINK_SPEED_10M (1 << 2)
228 #define ETH_LINK_SPEED_100M_HD (1 << 3)
229 #define ETH_LINK_SPEED_100M (1 << 4)
230 #define ETH_LINK_SPEED_1G (1 << 5)
231 #define ETH_LINK_SPEED_2_5G (1 << 6)
232 #define ETH_LINK_SPEED_5G (1 << 7)
233 #define ETH_LINK_SPEED_10G (1 << 8)
234 #define ETH_LINK_SPEED_20G (1 << 9)
235 #define ETH_LINK_SPEED_25G (1 << 10)
236 #define ETH_LINK_SPEED_40G (1 << 11)
237 #define ETH_LINK_SPEED_50G (1 << 12)
238 #define ETH_LINK_SPEED_56G (1 << 13)
239 #define ETH_LINK_SPEED_100G (1 << 14)
244 #define ETH_SPEED_NUM_NONE 0
245 #define ETH_SPEED_NUM_10M 10
246 #define ETH_SPEED_NUM_100M 100
247 #define ETH_SPEED_NUM_1G 1000
248 #define ETH_SPEED_NUM_2_5G 2500
249 #define ETH_SPEED_NUM_5G 5000
250 #define ETH_SPEED_NUM_10G 10000
251 #define ETH_SPEED_NUM_20G 20000
252 #define ETH_SPEED_NUM_25G 25000
253 #define ETH_SPEED_NUM_40G 40000
254 #define ETH_SPEED_NUM_50G 50000
255 #define ETH_SPEED_NUM_56G 56000
256 #define ETH_SPEED_NUM_100G 100000
261 __extension__
262 struct rte_eth_link {
263  uint32_t link_speed;
264  uint16_t link_duplex : 1;
265  uint16_t link_autoneg : 1;
266  uint16_t link_status : 1;
267 } __attribute__((aligned(8)));
269 /* Utility constants */
270 #define ETH_LINK_HALF_DUPLEX 0
271 #define ETH_LINK_FULL_DUPLEX 1
272 #define ETH_LINK_DOWN 0
273 #define ETH_LINK_UP 1
274 #define ETH_LINK_FIXED 0
275 #define ETH_LINK_AUTONEG 1
281 struct rte_eth_thresh {
282  uint8_t pthresh;
283  uint8_t hthresh;
284  uint8_t wthresh;
285 };
286 
290 #define ETH_MQ_RX_RSS_FLAG 0x1
291 #define ETH_MQ_RX_DCB_FLAG 0x2
292 #define ETH_MQ_RX_VMDQ_FLAG 0x4
293 
301 
305  ETH_MQ_RX_DCB = ETH_MQ_RX_DCB_FLAG,
307  ETH_MQ_RX_DCB_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_DCB_FLAG,
308 
310  ETH_MQ_RX_VMDQ_ONLY = ETH_MQ_RX_VMDQ_FLAG,
312  ETH_MQ_RX_VMDQ_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_VMDQ_FLAG,
314  ETH_MQ_RX_VMDQ_DCB = ETH_MQ_RX_VMDQ_FLAG | ETH_MQ_RX_DCB_FLAG,
317  ETH_MQ_RX_VMDQ_FLAG,
318 };
319 
323 #define ETH_RSS ETH_MQ_RX_RSS
324 #define VMDQ_DCB ETH_MQ_RX_VMDQ_DCB
325 #define ETH_DCB_RX ETH_MQ_RX_DCB
326 
336 };
337 
341 #define ETH_DCB_NONE ETH_MQ_TX_NONE
342 #define ETH_VMDQ_DCB_TX ETH_MQ_TX_VMDQ_DCB
343 #define ETH_DCB_TX ETH_MQ_TX_DCB
344 
351  uint32_t max_rx_pkt_len;
352  uint16_t split_hdr_size;
358  uint64_t offloads;
359  __extension__
365  uint16_t header_split : 1,
366  hw_ip_checksum : 1,
367  hw_vlan_filter : 1,
368  hw_vlan_strip : 1,
369  hw_vlan_extend : 1,
370  jumbo_frame : 1,
371  hw_strip_crc : 1,
372  enable_scatter : 1,
373  enable_lro : 1,
374  hw_timestamp : 1,
375  security : 1,
386 };
387 
393  ETH_VLAN_TYPE_UNKNOWN = 0,
396  ETH_VLAN_TYPE_MAX,
397 };
398 
404  uint64_t ids[64];
405 };
406 
425  uint8_t *rss_key;
426  uint8_t rss_key_len;
427  uint64_t rss_hf;
428 };
429 
430 /*
431  * The RSS offload types are defined based on flow types which are defined
432  * in rte_eth_ctrl.h. Different NIC hardwares may support different RSS offload
433  * types. The supported flow types or RSS offload types can be queried by
434  * rte_eth_dev_info_get().
435  */
436 #define ETH_RSS_IPV4 (1ULL << RTE_ETH_FLOW_IPV4)
437 #define ETH_RSS_FRAG_IPV4 (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
438 #define ETH_RSS_NONFRAG_IPV4_TCP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
439 #define ETH_RSS_NONFRAG_IPV4_UDP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
440 #define ETH_RSS_NONFRAG_IPV4_SCTP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
441 #define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
442 #define ETH_RSS_IPV6 (1ULL << RTE_ETH_FLOW_IPV6)
443 #define ETH_RSS_FRAG_IPV6 (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
444 #define ETH_RSS_NONFRAG_IPV6_TCP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
445 #define ETH_RSS_NONFRAG_IPV6_UDP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
446 #define ETH_RSS_NONFRAG_IPV6_SCTP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
447 #define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
448 #define ETH_RSS_L2_PAYLOAD (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
449 #define ETH_RSS_IPV6_EX (1ULL << RTE_ETH_FLOW_IPV6_EX)
450 #define ETH_RSS_IPV6_TCP_EX (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
451 #define ETH_RSS_IPV6_UDP_EX (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
452 #define ETH_RSS_PORT (1ULL << RTE_ETH_FLOW_PORT)
453 #define ETH_RSS_VXLAN (1ULL << RTE_ETH_FLOW_VXLAN)
454 #define ETH_RSS_GENEVE (1ULL << RTE_ETH_FLOW_GENEVE)
455 #define ETH_RSS_NVGRE (1ULL << RTE_ETH_FLOW_NVGRE)
456 
457 #define ETH_RSS_IP ( \
458  ETH_RSS_IPV4 | \
459  ETH_RSS_FRAG_IPV4 | \
460  ETH_RSS_NONFRAG_IPV4_OTHER | \
461  ETH_RSS_IPV6 | \
462  ETH_RSS_FRAG_IPV6 | \
463  ETH_RSS_NONFRAG_IPV6_OTHER | \
464  ETH_RSS_IPV6_EX)
465 
466 #define ETH_RSS_UDP ( \
467  ETH_RSS_NONFRAG_IPV4_UDP | \
468  ETH_RSS_NONFRAG_IPV6_UDP | \
469  ETH_RSS_IPV6_UDP_EX)
470 
471 #define ETH_RSS_TCP ( \
472  ETH_RSS_NONFRAG_IPV4_TCP | \
473  ETH_RSS_NONFRAG_IPV6_TCP | \
474  ETH_RSS_IPV6_TCP_EX)
475 
476 #define ETH_RSS_SCTP ( \
477  ETH_RSS_NONFRAG_IPV4_SCTP | \
478  ETH_RSS_NONFRAG_IPV6_SCTP)
479 
480 #define ETH_RSS_TUNNEL ( \
481  ETH_RSS_VXLAN | \
482  ETH_RSS_GENEVE | \
483  ETH_RSS_NVGRE)
484 
485 
487 #define ETH_RSS_PROTO_MASK ( \
488  ETH_RSS_IPV4 | \
489  ETH_RSS_FRAG_IPV4 | \
490  ETH_RSS_NONFRAG_IPV4_TCP | \
491  ETH_RSS_NONFRAG_IPV4_UDP | \
492  ETH_RSS_NONFRAG_IPV4_SCTP | \
493  ETH_RSS_NONFRAG_IPV4_OTHER | \
494  ETH_RSS_IPV6 | \
495  ETH_RSS_FRAG_IPV6 | \
496  ETH_RSS_NONFRAG_IPV6_TCP | \
497  ETH_RSS_NONFRAG_IPV6_UDP | \
498  ETH_RSS_NONFRAG_IPV6_SCTP | \
499  ETH_RSS_NONFRAG_IPV6_OTHER | \
500  ETH_RSS_L2_PAYLOAD | \
501  ETH_RSS_IPV6_EX | \
502  ETH_RSS_IPV6_TCP_EX | \
503  ETH_RSS_IPV6_UDP_EX | \
504  ETH_RSS_PORT | \
505  ETH_RSS_VXLAN | \
506  ETH_RSS_GENEVE | \
507  ETH_RSS_NVGRE)
508 
509 /*
510  * Definitions used for redirection table entry size.
511  * Some RSS RETA sizes may not be supported by some drivers, check the
512  * documentation or the description of relevant functions for more details.
513  */
514 #define ETH_RSS_RETA_SIZE_64 64
515 #define ETH_RSS_RETA_SIZE_128 128
516 #define ETH_RSS_RETA_SIZE_256 256
517 #define ETH_RSS_RETA_SIZE_512 512
518 #define RTE_RETA_GROUP_SIZE 64
519 
520 /* Definitions used for VMDQ and DCB functionality */
521 #define ETH_VMDQ_MAX_VLAN_FILTERS 64
522 #define ETH_DCB_NUM_USER_PRIORITIES 8
523 #define ETH_VMDQ_DCB_NUM_QUEUES 128
524 #define ETH_DCB_NUM_QUEUES 128
526 /* DCB capability defines */
527 #define ETH_DCB_PG_SUPPORT 0x00000001
528 #define ETH_DCB_PFC_SUPPORT 0x00000002
530 /* Definitions used for VLAN Offload functionality */
531 #define ETH_VLAN_STRIP_OFFLOAD 0x0001
532 #define ETH_VLAN_FILTER_OFFLOAD 0x0002
533 #define ETH_VLAN_EXTEND_OFFLOAD 0x0004
535 /* Definitions used for mask VLAN setting */
536 #define ETH_VLAN_STRIP_MASK 0x0001
537 #define ETH_VLAN_FILTER_MASK 0x0002
538 #define ETH_VLAN_EXTEND_MASK 0x0004
539 #define ETH_VLAN_ID_MAX 0x0FFF
541 /* Definitions used for receive MAC address */
542 #define ETH_NUM_RECEIVE_MAC_ADDR 128
544 /* Definitions used for unicast hash */
545 #define ETH_VMDQ_NUM_UC_HASH_ARRAY 128
547 /* Definitions used for VMDQ pool rx mode setting */
548 #define ETH_VMDQ_ACCEPT_UNTAG 0x0001
549 #define ETH_VMDQ_ACCEPT_HASH_MC 0x0002
550 #define ETH_VMDQ_ACCEPT_HASH_UC 0x0004
551 #define ETH_VMDQ_ACCEPT_BROADCAST 0x0008
552 #define ETH_VMDQ_ACCEPT_MULTICAST 0x0010
555 #define ETH_MIRROR_MAX_VLANS 64
556 
557 #define ETH_MIRROR_VIRTUAL_POOL_UP 0x01
558 #define ETH_MIRROR_UPLINK_PORT 0x02
559 #define ETH_MIRROR_DOWNLINK_PORT 0x04
560 #define ETH_MIRROR_VLAN 0x08
561 #define ETH_MIRROR_VIRTUAL_POOL_DOWN 0x10
566 struct rte_eth_vlan_mirror {
567  uint64_t vlan_mask;
569  uint16_t vlan_id[ETH_MIRROR_MAX_VLANS];
570 };
571 
576  uint8_t rule_type;
577  uint8_t dst_pool;
578  uint64_t pool_mask;
581 };
582 
590  uint64_t mask;
592  uint16_t reta[RTE_RETA_GROUP_SIZE];
594 };
595 
601  ETH_4_TCS = 4,
603 };
604 
614 };
615 
616 /* This structure may be extended in future. */
617 struct rte_eth_dcb_rx_conf {
618  enum rte_eth_nb_tcs nb_tcs;
620  uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
621 };
622 
623 struct rte_eth_vmdq_dcb_tx_conf {
624  enum rte_eth_nb_pools nb_queue_pools;
626  uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
627 };
628 
629 struct rte_eth_dcb_tx_conf {
630  enum rte_eth_nb_tcs nb_tcs;
632  uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
633 };
634 
635 struct rte_eth_vmdq_tx_conf {
636  enum rte_eth_nb_pools nb_queue_pools;
637 };
638 
653  uint8_t default_pool;
654  uint8_t nb_pool_maps;
655  struct {
656  uint16_t vlan_id;
657  uint64_t pools;
661 };
662 
684  uint8_t default_pool;
686  uint8_t nb_pool_maps;
687  uint32_t rx_mode;
688  struct {
689  uint16_t vlan_id;
690  uint64_t pools;
692 };
693 
704  uint64_t offloads;
705 
706  /* For i40e specifically */
707  uint16_t pvid;
708  __extension__
709  uint8_t hw_vlan_reject_tagged : 1,
715 };
716 
722  uint16_t rx_free_thresh;
723  uint8_t rx_drop_en;
730  uint64_t offloads;
731 };
732 
733 #define ETH_TXQ_FLAGS_NOMULTSEGS 0x0001
734 #define ETH_TXQ_FLAGS_NOREFCOUNT 0x0002
735 #define ETH_TXQ_FLAGS_NOMULTMEMP 0x0004
736 #define ETH_TXQ_FLAGS_NOVLANOFFL 0x0100
737 #define ETH_TXQ_FLAGS_NOXSUMSCTP 0x0200
738 #define ETH_TXQ_FLAGS_NOXSUMUDP 0x0400
739 #define ETH_TXQ_FLAGS_NOXSUMTCP 0x0800
740 #define ETH_TXQ_FLAGS_NOOFFLOADS \
741  (ETH_TXQ_FLAGS_NOVLANOFFL | ETH_TXQ_FLAGS_NOXSUMSCTP | \
742  ETH_TXQ_FLAGS_NOXSUMUDP | ETH_TXQ_FLAGS_NOXSUMTCP)
743 #define ETH_TXQ_FLAGS_NOXSUMS \
744  (ETH_TXQ_FLAGS_NOXSUMSCTP | ETH_TXQ_FLAGS_NOXSUMUDP | \
745  ETH_TXQ_FLAGS_NOXSUMTCP)
746 
753 #define ETH_TXQ_FLAGS_IGNORE 0x8000
754 
760  uint16_t tx_rs_thresh;
761  uint16_t tx_free_thresh;
764  uint32_t txq_flags;
771  uint64_t offloads;
772 };
773 
778  uint16_t nb_max;
779  uint16_t nb_min;
780  uint16_t nb_align;
790  uint16_t nb_seg_max;
791 
803  uint16_t nb_mtu_seg_max;
804 };
805 
814 };
815 
822  uint32_t high_water;
823  uint32_t low_water;
824  uint16_t pause_time;
825  uint16_t send_xon;
828  uint8_t autoneg;
829 };
830 
838  uint8_t priority;
839 };
840 
849 };
850 
858 };
859 
871  uint8_t drop_queue;
872  struct rte_eth_fdir_masks mask;
875 };
876 
885  uint16_t udp_port;
886  uint8_t prot_type;
887 };
888 
894  uint32_t lsc:1;
896  uint32_t rxq:1;
898  uint32_t rmv:1;
899 };
900 
906 struct rte_eth_conf {
907  uint32_t link_speeds;
916  uint32_t lpbk_mode;
921  struct {
925  struct rte_eth_dcb_rx_conf dcb_rx_conf;
929  } rx_adv_conf;
930  union {
931  struct rte_eth_vmdq_dcb_tx_conf vmdq_dcb_tx_conf;
933  struct rte_eth_dcb_tx_conf dcb_tx_conf;
935  struct rte_eth_vmdq_tx_conf vmdq_tx_conf;
937  } tx_adv_conf;
943 };
944 
954 #define DEV_RX_OFFLOAD_VLAN_STRIP 0x00000001
955 #define DEV_RX_OFFLOAD_IPV4_CKSUM 0x00000002
956 #define DEV_RX_OFFLOAD_UDP_CKSUM 0x00000004
957 #define DEV_RX_OFFLOAD_TCP_CKSUM 0x00000008
958 #define DEV_RX_OFFLOAD_TCP_LRO 0x00000010
959 #define DEV_RX_OFFLOAD_QINQ_STRIP 0x00000020
960 #define DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000040
961 #define DEV_RX_OFFLOAD_MACSEC_STRIP 0x00000080
962 #define DEV_RX_OFFLOAD_HEADER_SPLIT 0x00000100
963 #define DEV_RX_OFFLOAD_VLAN_FILTER 0x00000200
964 #define DEV_RX_OFFLOAD_VLAN_EXTEND 0x00000400
965 #define DEV_RX_OFFLOAD_JUMBO_FRAME 0x00000800
966 #define DEV_RX_OFFLOAD_CRC_STRIP 0x00001000
967 #define DEV_RX_OFFLOAD_SCATTER 0x00002000
968 #define DEV_RX_OFFLOAD_TIMESTAMP 0x00004000
969 #define DEV_RX_OFFLOAD_SECURITY 0x00008000
970 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
971  DEV_RX_OFFLOAD_UDP_CKSUM | \
972  DEV_RX_OFFLOAD_TCP_CKSUM)
973 #define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \
974  DEV_RX_OFFLOAD_VLAN_FILTER | \
975  DEV_RX_OFFLOAD_VLAN_EXTEND)
976 
980 #define DEV_TX_OFFLOAD_VLAN_INSERT 0x00000001
981 #define DEV_TX_OFFLOAD_IPV4_CKSUM 0x00000002
982 #define DEV_TX_OFFLOAD_UDP_CKSUM 0x00000004
983 #define DEV_TX_OFFLOAD_TCP_CKSUM 0x00000008
984 #define DEV_TX_OFFLOAD_SCTP_CKSUM 0x00000010
985 #define DEV_TX_OFFLOAD_TCP_TSO 0x00000020
986 #define DEV_TX_OFFLOAD_UDP_TSO 0x00000040
987 #define DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000080
988 #define DEV_TX_OFFLOAD_QINQ_INSERT 0x00000100
989 #define DEV_TX_OFFLOAD_VXLAN_TNL_TSO 0x00000200
990 #define DEV_TX_OFFLOAD_GRE_TNL_TSO 0x00000400
991 #define DEV_TX_OFFLOAD_IPIP_TNL_TSO 0x00000800
992 #define DEV_TX_OFFLOAD_GENEVE_TNL_TSO 0x00001000
993 #define DEV_TX_OFFLOAD_MACSEC_INSERT 0x00002000
994 #define DEV_TX_OFFLOAD_MT_LOCKFREE 0x00004000
995 
998 #define DEV_TX_OFFLOAD_MULTI_SEGS 0x00008000
999 
1000 #define DEV_TX_OFFLOAD_MBUF_FAST_FREE 0x00010000
1001 
1005 #define DEV_TX_OFFLOAD_SECURITY 0x00020000
1006 
1007 struct rte_pci_device;
1008 
1013  struct rte_pci_device *pci_dev;
1014  const char *driver_name;
1015  unsigned int if_index;
1017  uint32_t min_rx_bufsize;
1018  uint32_t max_rx_pktlen;
1019  uint16_t max_rx_queues;
1020  uint16_t max_tx_queues;
1021  uint32_t max_mac_addrs;
1022  uint32_t max_hash_mac_addrs;
1024  uint16_t max_vfs;
1025  uint16_t max_vmdq_pools;
1034  uint16_t reta_size;
1036  uint8_t hash_key_size;
1041  uint16_t vmdq_queue_base;
1042  uint16_t vmdq_queue_num;
1043  uint16_t vmdq_pool_base;
1046  uint32_t speed_capa;
1048  uint16_t nb_rx_queues;
1049  uint16_t nb_tx_queues;
1050 };
1051 
1057  struct rte_mempool *mp;
1059  uint8_t scattered_rx;
1060  uint16_t nb_desc;
1062 
1069  uint16_t nb_desc;
1071 
1073 #define RTE_ETH_XSTATS_NAME_SIZE 64
1074 
1085  uint64_t id;
1086  uint64_t value;
1087 };
1088 
1098 };
1099 
1100 #define ETH_DCB_NUM_TCS 8
1101 #define ETH_MAX_VMDQ_POOL 64
1102 
1109  struct {
1110  uint8_t base;
1111  uint8_t nb_queue;
1112  } tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
1114  struct {
1115  uint8_t base;
1116  uint8_t nb_queue;
1117  } tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
1118 };
1119 
1125  uint8_t nb_tcs;
1127  uint8_t tc_bws[ETH_DCB_NUM_TCS];
1130 };
1131 
1135 #define RTE_ETH_QUEUE_STATE_STOPPED 0
1136 #define RTE_ETH_QUEUE_STATE_STARTED 1
1137 
1138 struct rte_eth_dev;
1139 
1140 struct rte_eth_dev_callback;
1142 TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
1143 
1144 /* Macros to check for valid port */
1145 #define RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, retval) do { \
1146  if (!rte_eth_dev_is_valid_port(port_id)) { \
1147  RTE_PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); \
1148  return retval; \
1149  } \
1150 } while (0)
1151 
1152 #define RTE_ETH_VALID_PORTID_OR_RET(port_id) do { \
1153  if (!rte_eth_dev_is_valid_port(port_id)) { \
1154  RTE_PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); \
1155  return; \
1156  } \
1157 } while (0)
1158 
1164 #define ETH_L2_TUNNEL_ENABLE_MASK 0x00000001
1165 
1166 #define ETH_L2_TUNNEL_INSERTION_MASK 0x00000002
1167 
1168 #define ETH_L2_TUNNEL_STRIPPING_MASK 0x00000004
1169 
1170 #define ETH_L2_TUNNEL_FORWARDING_MASK 0x00000008
1171 
1172 /*
1173  * Definitions of all functions exported by an Ethernet driver through the
1174  * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
1175  * structure associated with an Ethernet device.
1176  */
1177 
1178 typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
1181 typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
1184 typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev);
1187 typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
1190 typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
1193 typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev);
1196 typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
1199 typedef void (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
1202 typedef void (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
1205 typedef void (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
1208 typedef void (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
1211 typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
1212  int wait_to_complete);
1215 typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
1216  struct rte_eth_stats *igb_stats);
1219 typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);
1222 typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
1223  struct rte_eth_xstat *stats, unsigned n);
1226 typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
1227  const uint64_t *ids,
1228  uint64_t *values,
1229  unsigned int n);
1232 typedef void (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
1235 typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
1236  struct rte_eth_xstat_name *xstats_names, unsigned size);
1239 typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
1240  struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
1241  unsigned int size);
1244 typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
1245  uint16_t queue_id,
1246  uint8_t stat_idx,
1247  uint8_t is_rx);
1250 typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
1251  struct rte_eth_dev_info *dev_info);
1254 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
1257 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
1258  uint16_t queue_id);
1261 typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
1262  uint16_t queue_id);
1265 typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
1266  uint16_t rx_queue_id,
1267  uint16_t nb_rx_desc,
1268  unsigned int socket_id,
1269  const struct rte_eth_rxconf *rx_conf,
1270  struct rte_mempool *mb_pool);
1273 typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
1274  uint16_t tx_queue_id,
1275  uint16_t nb_tx_desc,
1276  unsigned int socket_id,
1277  const struct rte_eth_txconf *tx_conf);
1280 typedef int (*eth_rx_enable_intr_t)(struct rte_eth_dev *dev,
1281  uint16_t rx_queue_id);
1284 typedef int (*eth_rx_disable_intr_t)(struct rte_eth_dev *dev,
1285  uint16_t rx_queue_id);
1288 typedef void (*eth_queue_release_t)(void *queue);
1291 typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
1292  uint16_t rx_queue_id);
1295 typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
1298 typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
1301 typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
1304 typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
1305  char *fw_version, size_t fw_size);
1308 typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
1311 typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
1312  uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo);
1313 
1314 typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,
1315  uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
1316 
1317 typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu);
1320 typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
1321  uint16_t vlan_id,
1322  int on);
1325 typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
1326  enum rte_vlan_type type, uint16_t tpid);
1329 typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
1332 typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
1333  uint16_t vlan_id,
1334  int on);
1337 typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
1338  uint16_t rx_queue_id,
1339  int on);
1342 typedef uint16_t (*eth_rx_burst_t)(void *rxq,
1343  struct rte_mbuf **rx_pkts,
1344  uint16_t nb_pkts);
1347 typedef uint16_t (*eth_tx_burst_t)(void *txq,
1348  struct rte_mbuf **tx_pkts,
1349  uint16_t nb_pkts);
1352 typedef uint16_t (*eth_tx_prep_t)(void *txq,
1353  struct rte_mbuf **tx_pkts,
1354  uint16_t nb_pkts);
1357 typedef int (*flow_ctrl_get_t)(struct rte_eth_dev *dev,
1358  struct rte_eth_fc_conf *fc_conf);
1361 typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
1362  struct rte_eth_fc_conf *fc_conf);
1365 typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
1366  struct rte_eth_pfc_conf *pfc_conf);
1369 typedef int (*reta_update_t)(struct rte_eth_dev *dev,
1370  struct rte_eth_rss_reta_entry64 *reta_conf,
1371  uint16_t reta_size);
1374 typedef int (*reta_query_t)(struct rte_eth_dev *dev,
1375  struct rte_eth_rss_reta_entry64 *reta_conf,
1376  uint16_t reta_size);
1379 typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
1380  struct rte_eth_rss_conf *rss_conf);
1383 typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
1384  struct rte_eth_rss_conf *rss_conf);
1387 typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
1390 typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
1393 typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
1396 typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
1397  struct ether_addr *mac_addr,
1398  uint32_t index,
1399  uint32_t vmdq);
1402 typedef void (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
1403  struct ether_addr *mac_addr);
1406 typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
1407  struct ether_addr *mac_addr,
1408  uint8_t on);
1411 typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
1412  uint8_t on);
1415 typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
1416  uint16_t queue_idx,
1417  uint16_t tx_rate);
1420 typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
1421  struct rte_eth_mirror_conf *mirror_conf,
1422  uint8_t rule_id,
1423  uint8_t on);
1426 typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
1427  uint8_t rule_id);
1430 typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
1431  struct rte_eth_udp_tunnel *tunnel_udp);
1434 typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
1435  struct rte_eth_udp_tunnel *tunnel_udp);
1438 typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
1439  struct ether_addr *mc_addr_set,
1440  uint32_t nb_mc_addr);
1443 typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
1446 typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
1449 typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
1450  struct timespec *timestamp,
1451  uint32_t flags);
1454 typedef int (*eth_timesync_read_tx_timestamp_t)(struct rte_eth_dev *dev,
1455  struct timespec *timestamp);
1458 typedef int (*eth_timesync_adjust_time)(struct rte_eth_dev *dev, int64_t);
1461 typedef int (*eth_timesync_read_time)(struct rte_eth_dev *dev,
1462  struct timespec *timestamp);
1465 typedef int (*eth_timesync_write_time)(struct rte_eth_dev *dev,
1466  const struct timespec *timestamp);
1469 typedef int (*eth_get_reg_t)(struct rte_eth_dev *dev,
1470  struct rte_dev_reg_info *info);
1473 typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
1476 typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
1477  struct rte_dev_eeprom_info *info);
1480 typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
1481  struct rte_dev_eeprom_info *info);
1484 typedef int (*eth_l2_tunnel_eth_type_conf_t)
1485  (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
1488 typedef int (*eth_l2_tunnel_offload_set_t)
1489  (struct rte_eth_dev *dev,
1490  struct rte_eth_l2_tunnel_conf *l2_tunnel,
1491  uint32_t mask,
1492  uint8_t en);
1496 typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
1497  enum rte_filter_type filter_type,
1498  enum rte_filter_op filter_op,
1499  void *arg);
1502 typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
1505 typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
1508 typedef int (*eth_get_dcb_info)(struct rte_eth_dev *dev,
1509  struct rte_eth_dcb_info *dcb_info);
1512 typedef int (*eth_pool_ops_supported_t)(struct rte_eth_dev *dev,
1513  const char *pool);
1519 struct eth_dev_ops {
1520  eth_dev_configure_t dev_configure;
1521  eth_dev_start_t dev_start;
1522  eth_dev_stop_t dev_stop;
1523  eth_dev_set_link_up_t dev_set_link_up;
1524  eth_dev_set_link_down_t dev_set_link_down;
1525  eth_dev_close_t dev_close;
1526  eth_dev_reset_t dev_reset;
1527  eth_link_update_t link_update;
1529  eth_promiscuous_enable_t promiscuous_enable;
1530  eth_promiscuous_disable_t promiscuous_disable;
1531  eth_allmulticast_enable_t allmulticast_enable;
1532  eth_allmulticast_disable_t allmulticast_disable;
1533  eth_mac_addr_remove_t mac_addr_remove;
1534  eth_mac_addr_add_t mac_addr_add;
1535  eth_mac_addr_set_t mac_addr_set;
1536  eth_set_mc_addr_list_t set_mc_addr_list;
1537  mtu_set_t mtu_set;
1539  eth_stats_get_t stats_get;
1540  eth_stats_reset_t stats_reset;
1541  eth_xstats_get_t xstats_get;
1542  eth_xstats_reset_t xstats_reset;
1543  eth_xstats_get_names_t xstats_get_names;
1545  eth_queue_stats_mapping_set_t queue_stats_mapping_set;
1548  eth_dev_infos_get_t dev_infos_get;
1549  eth_rxq_info_get_t rxq_info_get;
1550  eth_txq_info_get_t txq_info_get;
1551  eth_fw_version_get_t fw_version_get;
1552  eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
1555  vlan_filter_set_t vlan_filter_set;
1556  vlan_tpid_set_t vlan_tpid_set;
1557  vlan_strip_queue_set_t vlan_strip_queue_set;
1558  vlan_offload_set_t vlan_offload_set;
1559  vlan_pvid_set_t vlan_pvid_set;
1561  eth_queue_start_t rx_queue_start;
1562  eth_queue_stop_t rx_queue_stop;
1563  eth_queue_start_t tx_queue_start;
1564  eth_queue_stop_t tx_queue_stop;
1565  eth_rx_queue_setup_t rx_queue_setup;
1566  eth_queue_release_t rx_queue_release;
1567  eth_rx_queue_count_t rx_queue_count;
1569  eth_rx_descriptor_done_t rx_descriptor_done;
1570  eth_rx_descriptor_status_t rx_descriptor_status;
1572  eth_tx_descriptor_status_t tx_descriptor_status;
1574  eth_rx_enable_intr_t rx_queue_intr_enable;
1575  eth_rx_disable_intr_t rx_queue_intr_disable;
1576  eth_tx_queue_setup_t tx_queue_setup;
1577  eth_queue_release_t tx_queue_release;
1578  eth_tx_done_cleanup_t tx_done_cleanup;
1580  eth_dev_led_on_t dev_led_on;
1581  eth_dev_led_off_t dev_led_off;
1583  flow_ctrl_get_t flow_ctrl_get;
1584  flow_ctrl_set_t flow_ctrl_set;
1585  priority_flow_ctrl_set_t priority_flow_ctrl_set;
1587  eth_uc_hash_table_set_t uc_hash_table_set;
1588  eth_uc_all_hash_table_set_t uc_all_hash_table_set;
1590  eth_mirror_rule_set_t mirror_rule_set;
1591  eth_mirror_rule_reset_t mirror_rule_reset;
1593  eth_udp_tunnel_port_add_t udp_tunnel_port_add;
1594  eth_udp_tunnel_port_del_t udp_tunnel_port_del;
1595  eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf;
1597  eth_l2_tunnel_offload_set_t l2_tunnel_offload_set;
1600  eth_set_queue_rate_limit_t set_queue_rate_limit;
1602  rss_hash_update_t rss_hash_update;
1603  rss_hash_conf_get_t rss_hash_conf_get;
1604  reta_update_t reta_update;
1605  reta_query_t reta_query;
1607  eth_get_reg_t get_reg;
1608  eth_get_eeprom_length_t get_eeprom_length;
1609  eth_get_eeprom_t get_eeprom;
1610  eth_set_eeprom_t set_eeprom;
1613  eth_filter_ctrl_t filter_ctrl;
1615  eth_get_dcb_info get_dcb_info;
1617  eth_timesync_enable_t timesync_enable;
1619  eth_timesync_disable_t timesync_disable;
1621  eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
1623  eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
1625  eth_timesync_adjust_time timesync_adjust_time;
1626  eth_timesync_read_time timesync_read_time;
1627  eth_timesync_write_time timesync_write_time;
1629  eth_xstats_get_by_id_t xstats_get_by_id;
1631  eth_xstats_get_names_by_id_t xstats_get_names_by_id;
1634  eth_tm_ops_get_t tm_ops_get;
1637  eth_mtr_ops_get_t mtr_ops_get;
1640  eth_pool_ops_supported_t pool_ops_supported;
1642 };
1643 
1666 typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
1667  struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts,
1668  void *user_param);
1669 
1690 typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
1691  struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
1692 
1698 struct rte_eth_rxtx_callback {
1699  struct rte_eth_rxtx_callback *next;
1700  union{
1701  rte_rx_callback_fn rx;
1702  rte_tx_callback_fn tx;
1703  } fn;
1704  void *param;
1705 };
1706 
1711  RTE_ETH_DEV_UNUSED = 0,
1712  RTE_ETH_DEV_ATTACHED,
1713  RTE_ETH_DEV_DEFERRED,
1714 };
1715 
1726 struct rte_eth_dev {
1727  eth_rx_burst_t rx_pkt_burst;
1728  eth_tx_burst_t tx_pkt_burst;
1729  eth_tx_prep_t tx_pkt_prepare;
1730  struct rte_eth_dev_data *data;
1731  const struct eth_dev_ops *dev_ops;
1732  struct rte_device *device;
1733  struct rte_intr_handle *intr_handle;
1735  struct rte_eth_dev_cb_list link_intr_cbs;
1740  struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
1745  struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
1746  enum rte_eth_dev_state state;
1747  void *security_ctx;
1749 
1750 void *
1751 rte_eth_dev_get_sec_ctx(uint8_t port_id);
1752 
1753 struct rte_eth_dev_sriov {
1754  uint8_t active;
1755  uint8_t nb_q_per_pool;
1756  uint16_t def_vmdq_idx;
1757  uint16_t def_pool_q_idx;
1758 };
1759 #define RTE_ETH_DEV_SRIOV(dev) ((dev)->data->sriov)
1760 
1761 #define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
1762 
1770 struct rte_eth_dev_data {
1771  char name[RTE_ETH_NAME_MAX_LEN];
1773  void **rx_queues;
1774  void **tx_queues;
1775  uint16_t nb_rx_queues;
1776  uint16_t nb_tx_queues;
1778  struct rte_eth_dev_sriov sriov;
1780  void *dev_private;
1782  struct rte_eth_link dev_link;
1785  struct rte_eth_conf dev_conf;
1786  uint16_t mtu;
1788  uint32_t min_rx_buf_size;
1791  uint64_t rx_mbuf_alloc_failed;
1792  struct ether_addr* mac_addrs;
1793  uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
1795  struct ether_addr* hash_mac_addrs;
1797  uint16_t port_id;
1798  __extension__
1799  uint8_t promiscuous : 1,
1800  scattered_rx : 1,
1801  all_multicast : 1,
1802  dev_started : 1,
1803  lro : 1;
1804  uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
1806  uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
1808  uint32_t dev_flags;
1809  enum rte_kernel_driver kdrv;
1810  int numa_node;
1811  struct rte_vlan_filter_conf vlan_filter_conf;
1813 };
1814 
1816 #define RTE_ETH_DEV_INTR_LSC 0x0002
1817 
1818 #define RTE_ETH_DEV_BONDED_SLAVE 0x0004
1819 
1820 #define RTE_ETH_DEV_INTR_RMV 0x0008
1821 
1827 extern struct rte_eth_dev rte_eth_devices[];
1828 
1837 uint16_t rte_eth_find_next(uint16_t port_id);
1838 
1842 #define RTE_ETH_FOREACH_DEV(p) \
1843  for (p = rte_eth_find_next(0); \
1844  (unsigned int)p < (unsigned int)RTE_MAX_ETHPORTS; \
1845  p = rte_eth_find_next(p + 1))
1846 
1847 
1860 uint16_t rte_eth_dev_count(void);
1861 
1871 struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
1872 
1883 struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
1884 
1896 struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
1897 
1907 int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
1908 
1921 int rte_eth_dev_attach(const char *devargs, uint16_t *port_id);
1922 
1936 int rte_eth_dev_detach(uint16_t port_id, char *devname);
1937 
1949 uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex);
1950 
1983 int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue,
1984  uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf);
1985 
1997 void _rte_eth_dev_reset(struct rte_eth_dev *dev);
1998 
2040 int rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
2041  uint16_t nb_rx_desc, unsigned int socket_id,
2042  const struct rte_eth_rxconf *rx_conf,
2043  struct rte_mempool *mb_pool);
2044 
2093 int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,
2094  uint16_t nb_tx_desc, unsigned int socket_id,
2095  const struct rte_eth_txconf *tx_conf);
2096 
2107 int rte_eth_dev_socket_id(uint16_t port_id);
2108 
2118 int rte_eth_dev_is_valid_port(uint16_t port_id);
2119 
2135 int rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id);
2136 
2151 int rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id);
2152 
2168 int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id);
2169 
2184 int rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id);
2185 
2186 
2187 
2203 int rte_eth_dev_start(uint16_t port_id);
2204 
2212 void rte_eth_dev_stop(uint16_t port_id);
2213 
2214 
2227 int rte_eth_dev_set_link_up(uint16_t port_id);
2228 
2238 int rte_eth_dev_set_link_down(uint16_t port_id);
2239 
2248 void rte_eth_dev_close(uint16_t port_id);
2249 
2287 int rte_eth_dev_reset(uint16_t port_id);
2288 
2295 void rte_eth_promiscuous_enable(uint16_t port_id);
2296 
2303 void rte_eth_promiscuous_disable(uint16_t port_id);
2304 
2315 int rte_eth_promiscuous_get(uint16_t port_id);
2316 
2323 void rte_eth_allmulticast_enable(uint16_t port_id);
2324 
2331 void rte_eth_allmulticast_disable(uint16_t port_id);
2332 
2343 int rte_eth_allmulticast_get(uint16_t port_id);
2344 
2356 void rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link);
2357 
2369 void rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link);
2370 
2388 int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats);
2389 
2400 int rte_eth_stats_reset(uint16_t port_id);
2401 
2422 int rte_eth_xstats_get_names(uint16_t port_id,
2423  struct rte_eth_xstat_name *xstats_names,
2424  unsigned int size);
2425 
2448 int rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats,
2449  unsigned int n);
2450 
2473 int
2474 rte_eth_xstats_get_names_by_id(uint16_t port_id,
2475  struct rte_eth_xstat_name *xstats_names, unsigned int size,
2476  uint64_t *ids);
2477 
2501 int rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids,
2502  uint64_t *values, unsigned int size);
2503 
2521 int rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name,
2522  uint64_t *id);
2523 
2530 void rte_eth_xstats_reset(uint16_t port_id);
2531 
2549 int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id,
2550  uint16_t tx_queue_id, uint8_t stat_idx);
2551 
2569 int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id,
2570  uint16_t rx_queue_id,
2571  uint8_t stat_idx);
2572 
2582 void rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr);
2583 
2593 void rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info);
2594 
2613 int rte_eth_dev_fw_version_get(uint16_t port_id,
2614  char *fw_version, size_t fw_size);
2615 
2654 int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,
2655  uint32_t *ptypes, int num);
2656 
2668 int rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu);
2669 
2684 int rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu);
2685 
2704 int rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on);
2705 
2725 int rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id,
2726  int on);
2727 
2744 int rte_eth_dev_set_vlan_ether_type(uint16_t port_id,
2745  enum rte_vlan_type vlan_type,
2746  uint16_t tag_type);
2747 
2768 int rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask);
2769 
2782 int rte_eth_dev_get_vlan_offload(uint16_t port_id);
2783 
2798 int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on);
2799 
2882 static inline uint16_t
2883 rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
2884  struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
2885 {
2886  struct rte_eth_dev *dev = &rte_eth_devices[port_id];
2887 
2888 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
2889  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
2890  RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
2891 
2892  if (queue_id >= dev->data->nb_rx_queues) {
2893  RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
2894  return 0;
2895  }
2896 #endif
2897  int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
2898  rx_pkts, nb_pkts);
2899 
2900 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
2901  struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
2902 
2903  if (unlikely(cb != NULL)) {
2904  do {
2905  nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
2906  nb_pkts, cb->param);
2907  cb = cb->next;
2908  } while (cb != NULL);
2909  }
2910 #endif
2911 
2912  return nb_rx;
2913 }
2914 
2927 static inline int
2928 rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
2929 {
2930  struct rte_eth_dev *dev;
2931 
2932  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
2933  dev = &rte_eth_devices[port_id];
2934  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
2935  if (queue_id >= dev->data->nb_rx_queues)
2936  return -EINVAL;
2937 
2938  return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
2939 }
2940 
2956 static inline int
2957 rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
2958 {
2959  struct rte_eth_dev *dev = &rte_eth_devices[port_id];
2960  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
2961  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
2962  return (*dev->dev_ops->rx_descriptor_done)( \
2963  dev->data->rx_queues[queue_id], offset);
2964 }
2965 
2966 #define RTE_ETH_RX_DESC_AVAIL 0
2967 #define RTE_ETH_RX_DESC_DONE 1
2968 #define RTE_ETH_RX_DESC_UNAVAIL 2
3003 static inline int
3004 rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
3005  uint16_t offset)
3006 {
3007  struct rte_eth_dev *dev;
3008  void *rxq;
3009 
3010 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3011  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
3012 #endif
3013  dev = &rte_eth_devices[port_id];
3014 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3015  if (queue_id >= dev->data->nb_rx_queues)
3016  return -ENODEV;
3017 #endif
3018  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
3019  rxq = dev->data->rx_queues[queue_id];
3020 
3021  return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
3022 }
3023 
3024 #define RTE_ETH_TX_DESC_FULL 0
3025 #define RTE_ETH_TX_DESC_DONE 1
3026 #define RTE_ETH_TX_DESC_UNAVAIL 2
3061 static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
3062  uint16_t queue_id, uint16_t offset)
3063 {
3064  struct rte_eth_dev *dev;
3065  void *txq;
3066 
3067 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3068  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
3069 #endif
3070  dev = &rte_eth_devices[port_id];
3071 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3072  if (queue_id >= dev->data->nb_tx_queues)
3073  return -ENODEV;
3074 #endif
3075  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
3076  txq = dev->data->tx_queues[queue_id];
3077 
3078  return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
3079 }
3080 
3144 static inline uint16_t
3145 rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
3146  struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
3147 {
3148  struct rte_eth_dev *dev = &rte_eth_devices[port_id];
3149 
3150 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3151  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
3152  RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
3153 
3154  if (queue_id >= dev->data->nb_tx_queues) {
3155  RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
3156  return 0;
3157  }
3158 #endif
3159 
3160 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
3161  struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
3162 
3163  if (unlikely(cb != NULL)) {
3164  do {
3165  nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
3166  cb->param);
3167  cb = cb->next;
3168  } while (cb != NULL);
3169  }
3170 #endif
3171 
3172  return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
3173 }
3174 
3231 #ifndef RTE_ETHDEV_TX_PREPARE_NOOP
3232 
3233 static inline uint16_t
3234 rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
3235  struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
3236 {
3237  struct rte_eth_dev *dev;
3238 
3239 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3240  if (!rte_eth_dev_is_valid_port(port_id)) {
3241  RTE_PMD_DEBUG_TRACE("Invalid TX port_id=%d\n", port_id);
3242  rte_errno = -EINVAL;
3243  return 0;
3244  }
3245 #endif
3246 
3247  dev = &rte_eth_devices[port_id];
3248 
3249 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3250  if (queue_id >= dev->data->nb_tx_queues) {
3251  RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
3252  rte_errno = -EINVAL;
3253  return 0;
3254  }
3255 #endif
3256 
3257  if (!dev->tx_pkt_prepare)
3258  return nb_pkts;
3259 
3260  return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
3261  tx_pkts, nb_pkts);
3262 }
3263 
3264 #else
3265 
3266 /*
3267  * Native NOOP operation for compilation targets which doesn't require any
3268  * preparations steps, and functional NOOP may introduce unnecessary performance
3269  * drop.
3270  *
3271  * Generally this is not a good idea to turn it on globally and didn't should
3272  * be used if behavior of tx_preparation can change.
3273  */
3274 
3275 static inline uint16_t
3276 rte_eth_tx_prepare(__rte_unused uint16_t port_id,
3277  __rte_unused uint16_t queue_id,
3278  __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
3279 {
3280  return nb_pkts;
3281 }
3282 
3283 #endif
3284 
3285 typedef void (*buffer_tx_error_fn)(struct rte_mbuf **unsent, uint16_t count,
3286  void *userdata);
3287 
3293  buffer_tx_error_fn error_callback;
3294  void *error_userdata;
3295  uint16_t size;
3296  uint16_t length;
3297  struct rte_mbuf *pkts[];
3299 };
3300 
3307 #define RTE_ETH_TX_BUFFER_SIZE(sz) \
3308  (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
3309 
3320 int
3321 rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);
3322 
3345 static inline uint16_t
3346 rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
3347  struct rte_eth_dev_tx_buffer *buffer)
3348 {
3349  uint16_t sent;
3350  uint16_t to_send = buffer->length;
3351 
3352  if (to_send == 0)
3353  return 0;
3354 
3355  sent = rte_eth_tx_burst(port_id, queue_id, buffer->pkts, to_send);
3356 
3357  buffer->length = 0;
3358 
3359  /* All packets sent, or to be dealt with by callback below */
3360  if (unlikely(sent != to_send))
3361  buffer->error_callback(&buffer->pkts[sent], to_send - sent,
3362  buffer->error_userdata);
3363 
3364  return sent;
3365 }
3366 
3397 static __rte_always_inline uint16_t
3398 rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
3399  struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
3400 {
3401  buffer->pkts[buffer->length++] = tx_pkt;
3402  if (buffer->length < buffer->size)
3403  return 0;
3404 
3405  return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
3406 }
3407 
3432 int
3434  buffer_tx_error_fn callback, void *userdata);
3435 
3458 void
3459 rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
3460  void *userdata);
3461 
3485 void
3486 rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
3487  void *userdata);
3488 
3513 int
3514 rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
3515 
3530 };
3531 
3532 typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id,
3533  enum rte_eth_event_type event, void *cb_arg, void *ret_param);
3554 int rte_eth_dev_callback_register(uint16_t port_id,
3555  enum rte_eth_event_type event,
3556  rte_eth_dev_cb_fn cb_fn, void *cb_arg);
3557 
3575 int rte_eth_dev_callback_unregister(uint16_t port_id,
3576  enum rte_eth_event_type event,
3577  rte_eth_dev_cb_fn cb_fn, void *cb_arg);
3578 
3598 int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
3599  enum rte_eth_event_type event, void *cb_arg, void *ret_param);
3600 
3621 int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id);
3622 
3642 int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id);
3643 
3661 int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data);
3662 
3684 int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id,
3685  int epfd, int op, void *data);
3686 
3699 int rte_eth_led_on(uint16_t port_id);
3700 
3713 int rte_eth_led_off(uint16_t port_id);
3714 
3727 int rte_eth_dev_flow_ctrl_get(uint16_t port_id,
3728  struct rte_eth_fc_conf *fc_conf);
3729 
3744 int rte_eth_dev_flow_ctrl_set(uint16_t port_id,
3745  struct rte_eth_fc_conf *fc_conf);
3746 
3762 int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
3763  struct rte_eth_pfc_conf *pfc_conf);
3764 
3783 int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
3784  uint32_t pool);
3785 
3799 int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
3800 
3814 int rte_eth_dev_default_mac_addr_set(uint16_t port,
3815  struct ether_addr *mac_addr);
3816 
3832 int rte_eth_dev_rss_reta_update(uint16_t port,
3833  struct rte_eth_rss_reta_entry64 *reta_conf,
3834  uint16_t reta_size);
3835 
3851 int rte_eth_dev_rss_reta_query(uint16_t port,
3852  struct rte_eth_rss_reta_entry64 *reta_conf,
3853  uint16_t reta_size);
3854 
3873 int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
3874  uint8_t on);
3875 
3893 int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
3894 
3916 int rte_eth_mirror_rule_set(uint16_t port_id,
3917  struct rte_eth_mirror_conf *mirror_conf,
3918  uint8_t rule_id,
3919  uint8_t on);
3920 
3934 int rte_eth_mirror_rule_reset(uint16_t port_id,
3935  uint8_t rule_id);
3936 
3952 int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
3953  uint16_t tx_rate);
3954 
3968 int rte_eth_dev_rss_hash_update(uint16_t port_id,
3969  struct rte_eth_rss_conf *rss_conf);
3970 
3984 int
3985 rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
3986  struct rte_eth_rss_conf *rss_conf);
3987 
4005 int
4006 rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
4007  struct rte_eth_udp_tunnel *tunnel_udp);
4008 
4027 int
4028 rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
4029  struct rte_eth_udp_tunnel *tunnel_udp);
4030 
4044 int rte_eth_dev_filter_supported(uint16_t port_id,
4045  enum rte_filter_type filter_type);
4046 
4065 int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
4066  enum rte_filter_op filter_op, void *arg);
4067 
4080 int rte_eth_dev_get_dcb_info(uint16_t port_id,
4081  struct rte_eth_dcb_info *dcb_info);
4082 
4107 void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
4108  rte_rx_callback_fn fn, void *user_param);
4109 
4135 void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
4136  rte_rx_callback_fn fn, void *user_param);
4137 
4162 void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
4163  rte_tx_callback_fn fn, void *user_param);
4164 
4195 int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
4196  struct rte_eth_rxtx_callback *user_cb);
4197 
4228 int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
4229  struct rte_eth_rxtx_callback *user_cb);
4230 
4248 int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
4249  struct rte_eth_rxq_info *qinfo);
4250 
4268 int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
4269  struct rte_eth_txq_info *qinfo);
4270 
4287 int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info);
4288 
4300 int rte_eth_dev_get_eeprom_length(uint16_t port_id);
4301 
4316 int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
4317 
4332 int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
4333 
4351 int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
4352  struct ether_addr *mc_addr_set,
4353  uint32_t nb_mc_addr);
4354 
4366 int rte_eth_timesync_enable(uint16_t port_id);
4367 
4379 int rte_eth_timesync_disable(uint16_t port_id);
4380 
4398 int rte_eth_timesync_read_rx_timestamp(uint16_t port_id,
4399  struct timespec *timestamp, uint32_t flags);
4400 
4415 int rte_eth_timesync_read_tx_timestamp(uint16_t port_id,
4416  struct timespec *timestamp);
4417 
4434 int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);
4435 
4450 int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
4451 
4469 int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
4470 
4490 const struct rte_memzone *
4491 rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name,
4492  uint16_t queue_id, size_t size,
4493  unsigned align, int socket_id);
4494 
4509 int
4510 rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
4511  struct rte_eth_l2_tunnel_conf *l2_tunnel);
4512 
4536 int
4537 rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
4538  struct rte_eth_l2_tunnel_conf *l2_tunnel,
4539  uint32_t mask,
4540  uint8_t en);
4541 
4554 int
4555 rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
4556 
4568 int
4569 rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
4570 
4587 int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
4588  uint16_t *nb_rx_desc,
4589  uint16_t *nb_tx_desc);
4590 
4591 
4606 int
4607 rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
4608 
4609 #ifdef __cplusplus
4610 }
4611 #endif
4612 
4613 #endif /* _RTE_ETHDEV_H_ */
int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on)
uint16_t nb_rx_queues
Definition: rte_ethdev.h:1048
struct rte_eth_vmdq_dcb_tx_conf vmdq_dcb_tx_conf
Definition: rte_ethdev.h:931
int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf)
int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr, uint32_t pool)
uint32_t txq_flags
Definition: rte_ethdev.h:764
uint8_t tc_bws[ETH_DCB_NUM_TCS]
Definition: rte_ethdev.h:1127
#define ETH_VMDQ_MAX_VLAN_FILTERS
Definition: rte_ethdev.h:521
struct rte_fdir_conf fdir_conf
Definition: rte_ethdev.h:941
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:898
#define __rte_always_inline
Definition: rte_common.h:137
uint16_t tx_rs_thresh
Definition: rte_ethdev.h:760
int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time)
uint16_t nb_desc
Definition: rte_ethdev.h:1069
uint64_t rx_offload_capa
Definition: rte_ethdev.h:1026
uint16_t reta[RTE_RETA_GROUP_SIZE]
Definition: rte_ethdev.h:592
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)
uint16_t(* rte_rx_callback_fn)(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param)
Definition: rte_ethdev.h:1666
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:3234
int rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id)
rte_eth_nb_tcs
Definition: rte_ethdev.h:600
struct rte_eth_vmdq_tx_conf vmdq_tx_conf
Definition: rte_ethdev.h:935
uint64_t q_errors[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:217
struct rte_eth_thresh rx_thresh
Definition: rte_ethdev.h:721
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:845
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:3004
uint16_t(* rte_tx_callback_fn)(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param)
Definition: rte_ethdev.h:1690
uint64_t imissed
Definition: rte_ethdev.h:202
static int rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
Definition: rte_ethdev.h:2957
uint32_t low_water
Definition: rte_ethdev.h:823
uint32_t max_rx_pkt_len
Definition: rte_ethdev.h:351
uint8_t rss_key_len
Definition: rte_ethdev.h:426
void rte_eth_dev_close(uint16_t port_id)
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:283
union rte_eth_conf::@66 tx_adv_conf
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:1030
int rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, unsigned int n)
const struct rte_memzone * rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name, uint16_t queue_id, size_t size, unsigned align, int socket_id)
uint16_t reta_size
Definition: rte_ethdev.h:1034
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:546
uint32_t lpbk_mode
Definition: rte_ethdev.h:916
enum rte_fdir_status_mode status
Definition: rte_ethdev.h:869
enum rte_eth_tx_mq_mode mq_mode
Definition: rte_ethdev.h:698
#define rte_errno
Definition: rte_errno.h:58
uint32_t link_speeds
Definition: rte_ethdev.h:907
uint64_t tx_queue_offload_capa
Definition: rte_ethdev.h:1032
rte_eth_tx_mq_mode
Definition: rte_ethdev.h:331
rte_eth_fc_mode
Definition: rte_ethdev.h:809
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:652
uint16_t nb_mtu_seg_max
Definition: rte_ethdev.h:803
#define __rte_unused
Definition: rte_common.h:103
uint64_t q_obytes[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:215
int rte_eth_dev_get_eeprom_length(uint16_t port_id)
uint64_t opackets
Definition: rte_ethdev.h:199
rte_filter_op
Definition: rte_eth_ctrl.h:109
struct rte_eth_rss_conf rss_conf
Definition: rte_ethdev.h:922
uint8_t hash_key_size
Definition: rte_ethdev.h:1036
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:352
struct rte_mempool * mp
Definition: rte_ethdev.h:1057
uint32_t dcb_capability_en
Definition: rte_ethdev.h:940
__extension__ uint16_t hw_strip_crc
Definition: rte_ethdev.h:365
#define ETH_NUM_RECEIVE_MAC_ADDR
Definition: rte_ethdev.h:542
uint64_t q_ibytes[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:213
__extension__ uint16_t enable_scatter
Definition: rte_ethdev.h:365
struct rte_mbuf __rte_cache_aligned
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:365
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:896
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:759
struct rte_eth_desc_lim rx_desc_lim
Definition: rte_ethdev.h:1044
uint16_t rte_eth_dev_count(void)
uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES]
Definition: rte_ethdev.h:659
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:1042
uint8_t rx_deferred_start
Definition: rte_ethdev.h:724
struct rte_mbuf * pkts[]
Definition: rte_ethdev.h:3297
struct rte_eth_rxmode rxmode
Definition: rte_ethdev.h:914
uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:209
uint32_t high_water
Definition: rte_ethdev.h:822
enum rte_eth_nb_pools nb_queue_pools
Definition: rte_ethdev.h:651
uint16_t port
Definition: rte_mbuf.h:462
struct rte_eth_txconf conf
Definition: rte_ethdev.h:1068
uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex)
struct rte_intr_conf intr_conf
Definition: rte_ethdev.h:942
#define RTE_ETH_XSTATS_NAME_SIZE
Definition: rte_ethdev.h:1073
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:1045
int rte_eth_timesync_disable(uint16_t port_id)
uint64_t offloads
Definition: rte_ethdev.h:730
struct rte_eth_conf::@65 rx_adv_conf
__extension__ uint16_t hw_vlan_strip
Definition: rte_ethdev.h:365
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:825
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:1013
int rte_eth_stats_reset(uint16_t port_id)
struct rte_eth_txconf default_txconf
Definition: rte_ethdev.h:1040
#define unlikely(x)
uint16_t nb_max
Definition: rte_ethdev.h:778
int rte_eth_dev_rss_reta_query(uint16_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size)
uint64_t ibytes
Definition: rte_ethdev.h:200
__extension__ uint16_t hw_vlan_filter
Definition: rte_ethdev.h:365
uint64_t offloads
Definition: rte_ethdev.h:771
uint64_t oerrors
Definition: rte_ethdev.h:207
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:925
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:927
int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta)
struct rte_eth_vmdq_rx_conf::@64 pool_map[ETH_VMDQ_MAX_VLAN_FILTERS]
char name[RTE_ETH_XSTATS_NAME_SIZE]
Definition: rte_ethdev.h:1097
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:358
enum rte_eth_rx_mq_mode mq_mode
Definition: rte_ethdev.h:350
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:682
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:761
uint16_t nb_desc
Definition: rte_ethdev.h:1060
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:2883
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:1025
int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr)
uint8_t scattered_rx
Definition: rte_ethdev.h:1059
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:933
uint64_t offloads
Definition: rte_ethdev.h:704
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:1043
uint64_t tx_offload_capa
Definition: rte_ethdev.h:1028
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:211
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:365
struct rte_eth_dcb_tc_queue_mapping::@68 tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS]
int rte_eth_dev_attach(const char *devargs, uint16_t *port_id)
uint64_t obytes
Definition: rte_ethdev.h:201
uint8_t enable_loop_back
Definition: rte_ethdev.h:685
int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, uint16_t *nb_rx_desc, uint16_t *nb_tx_desc)
rte_kernel_driver
Definition: rte_dev.h:119
struct rte_eth_rxconf conf
Definition: rte_ethdev.h:1058
void rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link)
int rte_eth_dev_default_mac_addr_set(uint16_t port, struct ether_addr *mac_addr)
__extension__ uint16_t enable_lro
Definition: rte_ethdev.h:365
#define ETH_DCB_NUM_USER_PRIORITIES
Definition: rte_ethdev.h:522
void rte_eth_promiscuous_disable(uint16_t port_id)
uint16_t max_tx_queues
Definition: rte_ethdev.h:1020
int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id)
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:3532
rte_eth_dev_state
Definition: rte_ethdev.h:1710
uint16_t rx_free_thresh
Definition: rte_ethdev.h:722
struct rte_eth_vlan_mirror vlan
Definition: rte_ethdev.h:580
__extension__ uint16_t jumbo_frame
Definition: rte_ethdev.h:365
uint64_t ierrors
Definition: rte_ethdev.h:206
struct rte_eth_vmdq_dcb_conf::@63 pool_map[ETH_VMDQ_MAX_VLAN_FILTERS]
struct rte_eth_dcb_tc_queue_mapping::@67 tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS]
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:710
uint8_t priority
Definition: rte_ethdev.h:838
uint64_t flow_type_rss_offloads
Definition: rte_ethdev.h:1038
int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data)
rte_vlan_type
Definition: rte_ethdev.h:392
uint16_t nb_seg_max
Definition: rte_ethdev.h:790
uint8_t prio_tc[ETH_DCB_NUM_USER_PRIORITIES]
Definition: rte_ethdev.h:1126
uint64_t ipackets
Definition: rte_ethdev.h:198
uint16_t max_vfs
Definition: rte_ethdev.h:1024
uint16_t pause_time
Definition: rte_ethdev.h:824
struct rte_eth_dcb_tc_queue_mapping tc_queue
Definition: rte_ethdev.h:1129
rte_filter_type
Definition: rte_eth_ctrl.h:91
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:208
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:3398
__extension__ uint8_t hw_vlan_reject_untagged
Definition: rte_ethdev.h:710
struct rte_mempool * pool
Definition: rte_mbuf.h:550
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:95
__extension__ uint16_t hw_ip_checksum
Definition: rte_ethdev.h:365
#define ETH_MQ_RX_RSS_FLAG
Definition: rte_ethdev.h:290
uint16_t vmdq_queue_base
Definition: rte_ethdev.h:1041
rte_eth_nb_pools
Definition: rte_ethdev.h:609
void rte_eth_xstats_reset(uint16_t port_id)
#define ETH_MIRROR_MAX_VLANS
Definition: rte_ethdev.h:555
uint16_t nb_align
Definition: rte_ethdev.h:780
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:365
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:298
const char * driver_name
Definition: rte_ethdev.h:1014
int rte_eth_dev_rss_reta_update(uint16_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size)
static int rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
Definition: rte_ethdev.h:2928
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:683
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:1049
struct rte_eth_fdir_flex_conf flex_conf
Definition: rte_ethdev.h:873
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)
uint32_t max_mac_addrs
Definition: rte_ethdev.h:1021
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:1086
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:868
int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp)
uint32_t max_rx_pktlen
Definition: rte_ethdev.h:1018
int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num)
char name[RTE_MEMZONE_NAMESIZE]
Definition: rte_memzone.h:79
uint64_t rss_hf
Definition: rte_ethdev.h:427
uint64_t id
Definition: rte_ethdev.h:1085
__extension__ uint8_t hw_vlan_reject_tagged
Definition: rte_ethdev.h:710
enum rte_fdir_mode mode
Definition: rte_ethdev.h:867
int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr, uint8_t on)
int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats)
unsigned int if_index
Definition: rte_ethdev.h:1015
void rte_eth_allmulticast_disable(uint16_t port_id)
uint8_t mac_ctrl_frame_fwd
Definition: rte_ethdev.h:827
__extension__ uint16_t ignore_offload_bitfield
Definition: rte_ethdev.h:365
enum rte_eth_fc_mode mode
Definition: rte_ethdev.h:826
int rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu)
rte_fdir_mode
Definition: rte_eth_ctrl.h:686
struct rte_eth_vmdq_dcb_conf vmdq_dcb_conf
Definition: rte_ethdev.h:923
uint8_t * rss_key
Definition: rte_ethdev.h:425
rte_fdir_status_mode
Definition: rte_ethdev.h:854
__extension__ uint16_t security
Definition: rte_ethdev.h:365
uint8_t tx_deferred_start
Definition: rte_ethdev.h:765
uint8_t wthresh
Definition: rte_ethdev.h:284
uint16_t max_rx_queues
Definition: rte_ethdev.h:1019
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:837
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:915
int rte_eth_allmulticast_get(uint16_t port_id)
uint8_t rx_drop_en
Definition: rte_ethdev.h:723
int rte_eth_dev_is_valid_port(uint16_t port_id)
uint16_t nb_min
Definition: rte_ethdev.h:779
int rte_eth_timesync_enable(uint16_t port_id)
uint8_t pthresh
Definition: rte_ethdev.h:282
void rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link)
void(* eth_promiscuous_enable_t)(struct rte_eth_dev *dev)
Definition: rte_ethdev.h:1199
struct rte_eth_rxconf default_rxconf
Definition: rte_ethdev.h:1039
uint32_t speed_capa
Definition: rte_ethdev.h:1046
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:3145
uint8_t drop_queue
Definition: rte_ethdev.h:871
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:828
uint32_t min_rx_bufsize
Definition: rte_ethdev.h:1017
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:894
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:3346
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:3519