DPDK  17.11.10
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 #include <rte_config.h>
185 #include <rte_ether.h>
186 
187 #include "rte_eth_ctrl.h"
188 #include "rte_dev_info.h"
189 
190 struct rte_mbuf;
191 
199  uint64_t ipackets;
200  uint64_t opackets;
201  uint64_t ibytes;
202  uint64_t obytes;
203  uint64_t imissed;
207  uint64_t ierrors;
208  uint64_t oerrors;
209  uint64_t rx_nombuf;
210  uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
212  uint64_t q_opackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
214  uint64_t q_ibytes[RTE_ETHDEV_QUEUE_STAT_CNTRS];
216  uint64_t q_obytes[RTE_ETHDEV_QUEUE_STAT_CNTRS];
218  uint64_t q_errors[RTE_ETHDEV_QUEUE_STAT_CNTRS];
220 };
221 
225 #define ETH_LINK_SPEED_AUTONEG (0 << 0)
226 #define ETH_LINK_SPEED_FIXED (1 << 0)
227 #define ETH_LINK_SPEED_10M_HD (1 << 1)
228 #define ETH_LINK_SPEED_10M (1 << 2)
229 #define ETH_LINK_SPEED_100M_HD (1 << 3)
230 #define ETH_LINK_SPEED_100M (1 << 4)
231 #define ETH_LINK_SPEED_1G (1 << 5)
232 #define ETH_LINK_SPEED_2_5G (1 << 6)
233 #define ETH_LINK_SPEED_5G (1 << 7)
234 #define ETH_LINK_SPEED_10G (1 << 8)
235 #define ETH_LINK_SPEED_20G (1 << 9)
236 #define ETH_LINK_SPEED_25G (1 << 10)
237 #define ETH_LINK_SPEED_40G (1 << 11)
238 #define ETH_LINK_SPEED_50G (1 << 12)
239 #define ETH_LINK_SPEED_56G (1 << 13)
240 #define ETH_LINK_SPEED_100G (1 << 14)
245 #define ETH_SPEED_NUM_NONE 0
246 #define ETH_SPEED_NUM_10M 10
247 #define ETH_SPEED_NUM_100M 100
248 #define ETH_SPEED_NUM_1G 1000
249 #define ETH_SPEED_NUM_2_5G 2500
250 #define ETH_SPEED_NUM_5G 5000
251 #define ETH_SPEED_NUM_10G 10000
252 #define ETH_SPEED_NUM_20G 20000
253 #define ETH_SPEED_NUM_25G 25000
254 #define ETH_SPEED_NUM_40G 40000
255 #define ETH_SPEED_NUM_50G 50000
256 #define ETH_SPEED_NUM_56G 56000
257 #define ETH_SPEED_NUM_100G 100000
262 __extension__
263 struct rte_eth_link {
264  uint32_t link_speed;
265  uint16_t link_duplex : 1;
266  uint16_t link_autoneg : 1;
267  uint16_t link_status : 1;
268 } __attribute__((aligned(8)));
270 /* Utility constants */
271 #define ETH_LINK_HALF_DUPLEX 0
272 #define ETH_LINK_FULL_DUPLEX 1
273 #define ETH_LINK_DOWN 0
274 #define ETH_LINK_UP 1
275 #define ETH_LINK_FIXED 0
276 #define ETH_LINK_AUTONEG 1
282 struct rte_eth_thresh {
283  uint8_t pthresh;
284  uint8_t hthresh;
285  uint8_t wthresh;
286 };
287 
291 #define ETH_MQ_RX_RSS_FLAG 0x1
292 #define ETH_MQ_RX_DCB_FLAG 0x2
293 #define ETH_MQ_RX_VMDQ_FLAG 0x4
294 
302 
306  ETH_MQ_RX_DCB = ETH_MQ_RX_DCB_FLAG,
308  ETH_MQ_RX_DCB_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_DCB_FLAG,
309 
311  ETH_MQ_RX_VMDQ_ONLY = ETH_MQ_RX_VMDQ_FLAG,
313  ETH_MQ_RX_VMDQ_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_VMDQ_FLAG,
315  ETH_MQ_RX_VMDQ_DCB = ETH_MQ_RX_VMDQ_FLAG | ETH_MQ_RX_DCB_FLAG,
318  ETH_MQ_RX_VMDQ_FLAG,
319 };
320 
324 #define ETH_RSS ETH_MQ_RX_RSS
325 #define VMDQ_DCB ETH_MQ_RX_VMDQ_DCB
326 #define ETH_DCB_RX ETH_MQ_RX_DCB
327 
337 };
338 
342 #define ETH_DCB_NONE ETH_MQ_TX_NONE
343 #define ETH_VMDQ_DCB_TX ETH_MQ_TX_VMDQ_DCB
344 #define ETH_DCB_TX ETH_MQ_TX_DCB
345 
352  uint32_t max_rx_pkt_len;
353  uint16_t split_hdr_size;
359  uint64_t offloads;
360  __extension__
366  uint16_t header_split : 1,
367  hw_ip_checksum : 1,
368  hw_vlan_filter : 1,
369  hw_vlan_strip : 1,
370  hw_vlan_extend : 1,
371  jumbo_frame : 1,
372  hw_strip_crc : 1,
373  enable_scatter : 1,
374  enable_lro : 1,
375  hw_timestamp : 1,
376  security : 1,
387 };
388 
394  ETH_VLAN_TYPE_UNKNOWN = 0,
397  ETH_VLAN_TYPE_MAX,
398 };
399 
405  uint64_t ids[64];
406 };
407 
426  uint8_t *rss_key;
427  uint8_t rss_key_len;
428  uint64_t rss_hf;
429 };
430 
431 /*
432  * The RSS offload types are defined based on flow types which are defined
433  * in rte_eth_ctrl.h. Different NIC hardwares may support different RSS offload
434  * types. The supported flow types or RSS offload types can be queried by
435  * rte_eth_dev_info_get().
436  */
437 #define ETH_RSS_IPV4 (1ULL << RTE_ETH_FLOW_IPV4)
438 #define ETH_RSS_FRAG_IPV4 (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
439 #define ETH_RSS_NONFRAG_IPV4_TCP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
440 #define ETH_RSS_NONFRAG_IPV4_UDP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
441 #define ETH_RSS_NONFRAG_IPV4_SCTP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
442 #define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
443 #define ETH_RSS_IPV6 (1ULL << RTE_ETH_FLOW_IPV6)
444 #define ETH_RSS_FRAG_IPV6 (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
445 #define ETH_RSS_NONFRAG_IPV6_TCP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
446 #define ETH_RSS_NONFRAG_IPV6_UDP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
447 #define ETH_RSS_NONFRAG_IPV6_SCTP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
448 #define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
449 #define ETH_RSS_L2_PAYLOAD (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
450 #define ETH_RSS_IPV6_EX (1ULL << RTE_ETH_FLOW_IPV6_EX)
451 #define ETH_RSS_IPV6_TCP_EX (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
452 #define ETH_RSS_IPV6_UDP_EX (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
453 #define ETH_RSS_PORT (1ULL << RTE_ETH_FLOW_PORT)
454 #define ETH_RSS_VXLAN (1ULL << RTE_ETH_FLOW_VXLAN)
455 #define ETH_RSS_GENEVE (1ULL << RTE_ETH_FLOW_GENEVE)
456 #define ETH_RSS_NVGRE (1ULL << RTE_ETH_FLOW_NVGRE)
457 
458 #define ETH_RSS_IP ( \
459  ETH_RSS_IPV4 | \
460  ETH_RSS_FRAG_IPV4 | \
461  ETH_RSS_NONFRAG_IPV4_OTHER | \
462  ETH_RSS_IPV6 | \
463  ETH_RSS_FRAG_IPV6 | \
464  ETH_RSS_NONFRAG_IPV6_OTHER | \
465  ETH_RSS_IPV6_EX)
466 
467 #define ETH_RSS_UDP ( \
468  ETH_RSS_NONFRAG_IPV4_UDP | \
469  ETH_RSS_NONFRAG_IPV6_UDP | \
470  ETH_RSS_IPV6_UDP_EX)
471 
472 #define ETH_RSS_TCP ( \
473  ETH_RSS_NONFRAG_IPV4_TCP | \
474  ETH_RSS_NONFRAG_IPV6_TCP | \
475  ETH_RSS_IPV6_TCP_EX)
476 
477 #define ETH_RSS_SCTP ( \
478  ETH_RSS_NONFRAG_IPV4_SCTP | \
479  ETH_RSS_NONFRAG_IPV6_SCTP)
480 
481 #define ETH_RSS_TUNNEL ( \
482  ETH_RSS_VXLAN | \
483  ETH_RSS_GENEVE | \
484  ETH_RSS_NVGRE)
485 
486 
488 #define ETH_RSS_PROTO_MASK ( \
489  ETH_RSS_IPV4 | \
490  ETH_RSS_FRAG_IPV4 | \
491  ETH_RSS_NONFRAG_IPV4_TCP | \
492  ETH_RSS_NONFRAG_IPV4_UDP | \
493  ETH_RSS_NONFRAG_IPV4_SCTP | \
494  ETH_RSS_NONFRAG_IPV4_OTHER | \
495  ETH_RSS_IPV6 | \
496  ETH_RSS_FRAG_IPV6 | \
497  ETH_RSS_NONFRAG_IPV6_TCP | \
498  ETH_RSS_NONFRAG_IPV6_UDP | \
499  ETH_RSS_NONFRAG_IPV6_SCTP | \
500  ETH_RSS_NONFRAG_IPV6_OTHER | \
501  ETH_RSS_L2_PAYLOAD | \
502  ETH_RSS_IPV6_EX | \
503  ETH_RSS_IPV6_TCP_EX | \
504  ETH_RSS_IPV6_UDP_EX | \
505  ETH_RSS_PORT | \
506  ETH_RSS_VXLAN | \
507  ETH_RSS_GENEVE | \
508  ETH_RSS_NVGRE)
509 
510 /*
511  * Definitions used for redirection table entry size.
512  * Some RSS RETA sizes may not be supported by some drivers, check the
513  * documentation or the description of relevant functions for more details.
514  */
515 #define ETH_RSS_RETA_SIZE_64 64
516 #define ETH_RSS_RETA_SIZE_128 128
517 #define ETH_RSS_RETA_SIZE_256 256
518 #define ETH_RSS_RETA_SIZE_512 512
519 #define RTE_RETA_GROUP_SIZE 64
520 
521 /* Definitions used for VMDQ and DCB functionality */
522 #define ETH_VMDQ_MAX_VLAN_FILTERS 64
523 #define ETH_DCB_NUM_USER_PRIORITIES 8
524 #define ETH_VMDQ_DCB_NUM_QUEUES 128
525 #define ETH_DCB_NUM_QUEUES 128
527 /* DCB capability defines */
528 #define ETH_DCB_PG_SUPPORT 0x00000001
529 #define ETH_DCB_PFC_SUPPORT 0x00000002
531 /* Definitions used for VLAN Offload functionality */
532 #define ETH_VLAN_STRIP_OFFLOAD 0x0001
533 #define ETH_VLAN_FILTER_OFFLOAD 0x0002
534 #define ETH_VLAN_EXTEND_OFFLOAD 0x0004
536 /* Definitions used for mask VLAN setting */
537 #define ETH_VLAN_STRIP_MASK 0x0001
538 #define ETH_VLAN_FILTER_MASK 0x0002
539 #define ETH_VLAN_EXTEND_MASK 0x0004
540 #define ETH_VLAN_ID_MAX 0x0FFF
542 /* Definitions used for receive MAC address */
543 #define ETH_NUM_RECEIVE_MAC_ADDR 128
545 /* Definitions used for unicast hash */
546 #define ETH_VMDQ_NUM_UC_HASH_ARRAY 128
548 /* Definitions used for VMDQ pool rx mode setting */
549 #define ETH_VMDQ_ACCEPT_UNTAG 0x0001
550 #define ETH_VMDQ_ACCEPT_HASH_MC 0x0002
551 #define ETH_VMDQ_ACCEPT_HASH_UC 0x0004
552 #define ETH_VMDQ_ACCEPT_BROADCAST 0x0008
553 #define ETH_VMDQ_ACCEPT_MULTICAST 0x0010
556 #define ETH_MIRROR_MAX_VLANS 64
557 
558 #define ETH_MIRROR_VIRTUAL_POOL_UP 0x01
559 #define ETH_MIRROR_UPLINK_PORT 0x02
560 #define ETH_MIRROR_DOWNLINK_PORT 0x04
561 #define ETH_MIRROR_VLAN 0x08
562 #define ETH_MIRROR_VIRTUAL_POOL_DOWN 0x10
567 struct rte_eth_vlan_mirror {
568  uint64_t vlan_mask;
570  uint16_t vlan_id[ETH_MIRROR_MAX_VLANS];
571 };
572 
577  uint8_t rule_type;
578  uint8_t dst_pool;
579  uint64_t pool_mask;
582 };
583 
591  uint64_t mask;
593  uint16_t reta[RTE_RETA_GROUP_SIZE];
595 };
596 
602  ETH_4_TCS = 4,
604 };
605 
615 };
616 
617 /* This structure may be extended in future. */
618 struct rte_eth_dcb_rx_conf {
619  enum rte_eth_nb_tcs nb_tcs;
621  uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
622 };
623 
624 struct rte_eth_vmdq_dcb_tx_conf {
625  enum rte_eth_nb_pools nb_queue_pools;
627  uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
628 };
629 
630 struct rte_eth_dcb_tx_conf {
631  enum rte_eth_nb_tcs nb_tcs;
633  uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
634 };
635 
636 struct rte_eth_vmdq_tx_conf {
637  enum rte_eth_nb_pools nb_queue_pools;
638 };
639 
654  uint8_t default_pool;
655  uint8_t nb_pool_maps;
656  struct {
657  uint16_t vlan_id;
658  uint64_t pools;
662 };
663 
685  uint8_t default_pool;
687  uint8_t nb_pool_maps;
688  uint32_t rx_mode;
689  struct {
690  uint16_t vlan_id;
691  uint64_t pools;
693 };
694 
705  uint64_t offloads;
706 
707  /* For i40e specifically */
708  uint16_t pvid;
709  __extension__
710  uint8_t hw_vlan_reject_tagged : 1,
716 };
717 
723  uint16_t rx_free_thresh;
724  uint8_t rx_drop_en;
731  uint64_t offloads;
732 };
733 
734 #define ETH_TXQ_FLAGS_NOMULTSEGS 0x0001
735 #define ETH_TXQ_FLAGS_NOREFCOUNT 0x0002
736 #define ETH_TXQ_FLAGS_NOMULTMEMP 0x0004
737 #define ETH_TXQ_FLAGS_NOVLANOFFL 0x0100
738 #define ETH_TXQ_FLAGS_NOXSUMSCTP 0x0200
739 #define ETH_TXQ_FLAGS_NOXSUMUDP 0x0400
740 #define ETH_TXQ_FLAGS_NOXSUMTCP 0x0800
741 #define ETH_TXQ_FLAGS_NOOFFLOADS \
742  (ETH_TXQ_FLAGS_NOVLANOFFL | ETH_TXQ_FLAGS_NOXSUMSCTP | \
743  ETH_TXQ_FLAGS_NOXSUMUDP | ETH_TXQ_FLAGS_NOXSUMTCP)
744 #define ETH_TXQ_FLAGS_NOXSUMS \
745  (ETH_TXQ_FLAGS_NOXSUMSCTP | ETH_TXQ_FLAGS_NOXSUMUDP | \
746  ETH_TXQ_FLAGS_NOXSUMTCP)
747 
754 #define ETH_TXQ_FLAGS_IGNORE 0x8000
755 
761  uint16_t tx_rs_thresh;
762  uint16_t tx_free_thresh;
765  uint32_t txq_flags;
772  uint64_t offloads;
773 };
774 
779  uint16_t nb_max;
780  uint16_t nb_min;
781  uint16_t nb_align;
791  uint16_t nb_seg_max;
792 
804  uint16_t nb_mtu_seg_max;
805 };
806 
815 };
816 
823  uint32_t high_water;
824  uint32_t low_water;
825  uint16_t pause_time;
826  uint16_t send_xon;
829  uint8_t autoneg;
830 };
831 
839  uint8_t priority;
840 };
841 
850 };
851 
859 };
860 
872  uint8_t drop_queue;
873  struct rte_eth_fdir_masks mask;
876 };
877 
886  uint16_t udp_port;
887  uint8_t prot_type;
888 };
889 
895  uint32_t lsc:1;
897  uint32_t rxq:1;
899  uint32_t rmv:1;
900 };
901 
907 struct rte_eth_conf {
908  uint32_t link_speeds;
917  uint32_t lpbk_mode;
922  struct {
926  struct rte_eth_dcb_rx_conf dcb_rx_conf;
930  } rx_adv_conf;
931  union {
932  struct rte_eth_vmdq_dcb_tx_conf vmdq_dcb_tx_conf;
934  struct rte_eth_dcb_tx_conf dcb_tx_conf;
936  struct rte_eth_vmdq_tx_conf vmdq_tx_conf;
938  } tx_adv_conf;
944 };
945 
949 #define DEV_RX_OFFLOAD_VLAN_STRIP 0x00000001
950 #define DEV_RX_OFFLOAD_IPV4_CKSUM 0x00000002
951 #define DEV_RX_OFFLOAD_UDP_CKSUM 0x00000004
952 #define DEV_RX_OFFLOAD_TCP_CKSUM 0x00000008
953 #define DEV_RX_OFFLOAD_TCP_LRO 0x00000010
954 #define DEV_RX_OFFLOAD_QINQ_STRIP 0x00000020
955 #define DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000040
956 #define DEV_RX_OFFLOAD_MACSEC_STRIP 0x00000080
957 #define DEV_RX_OFFLOAD_HEADER_SPLIT 0x00000100
958 #define DEV_RX_OFFLOAD_VLAN_FILTER 0x00000200
959 #define DEV_RX_OFFLOAD_VLAN_EXTEND 0x00000400
960 #define DEV_RX_OFFLOAD_JUMBO_FRAME 0x00000800
961 #define DEV_RX_OFFLOAD_CRC_STRIP 0x00001000
962 #define DEV_RX_OFFLOAD_SCATTER 0x00002000
963 #define DEV_RX_OFFLOAD_TIMESTAMP 0x00004000
964 #define DEV_RX_OFFLOAD_SECURITY 0x00008000
965 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
966  DEV_RX_OFFLOAD_UDP_CKSUM | \
967  DEV_RX_OFFLOAD_TCP_CKSUM)
968 #define DEV_RX_OFFLOAD_VLAN (DEV_RX_OFFLOAD_VLAN_STRIP | \
969  DEV_RX_OFFLOAD_VLAN_FILTER | \
970  DEV_RX_OFFLOAD_VLAN_EXTEND)
971 
975 #define DEV_TX_OFFLOAD_VLAN_INSERT 0x00000001
976 #define DEV_TX_OFFLOAD_IPV4_CKSUM 0x00000002
977 #define DEV_TX_OFFLOAD_UDP_CKSUM 0x00000004
978 #define DEV_TX_OFFLOAD_TCP_CKSUM 0x00000008
979 #define DEV_TX_OFFLOAD_SCTP_CKSUM 0x00000010
980 #define DEV_TX_OFFLOAD_TCP_TSO 0x00000020
981 #define DEV_TX_OFFLOAD_UDP_TSO 0x00000040
982 #define DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000080
983 #define DEV_TX_OFFLOAD_QINQ_INSERT 0x00000100
984 #define DEV_TX_OFFLOAD_VXLAN_TNL_TSO 0x00000200
985 #define DEV_TX_OFFLOAD_GRE_TNL_TSO 0x00000400
986 #define DEV_TX_OFFLOAD_IPIP_TNL_TSO 0x00000800
987 #define DEV_TX_OFFLOAD_GENEVE_TNL_TSO 0x00001000
988 #define DEV_TX_OFFLOAD_MACSEC_INSERT 0x00002000
989 #define DEV_TX_OFFLOAD_MT_LOCKFREE 0x00004000
990 
993 #define DEV_TX_OFFLOAD_MULTI_SEGS 0x00008000
994 
995 #define DEV_TX_OFFLOAD_MBUF_FAST_FREE 0x00010000
996 
1000 #define DEV_TX_OFFLOAD_SECURITY 0x00020000
1001 
1002 struct rte_pci_device;
1003 
1014  struct rte_pci_device *pci_dev;
1015  const char *driver_name;
1016  unsigned int if_index;
1018  uint32_t min_rx_bufsize;
1019  uint32_t max_rx_pktlen;
1020  uint16_t max_rx_queues;
1021  uint16_t max_tx_queues;
1022  uint32_t max_mac_addrs;
1023  uint32_t max_hash_mac_addrs;
1025  uint16_t max_vfs;
1026  uint16_t max_vmdq_pools;
1035  uint16_t reta_size;
1037  uint8_t hash_key_size;
1042  uint16_t vmdq_queue_base;
1043  uint16_t vmdq_queue_num;
1044  uint16_t vmdq_pool_base;
1047  uint32_t speed_capa;
1049  uint16_t nb_rx_queues;
1050  uint16_t nb_tx_queues;
1051 };
1052 
1058  struct rte_mempool *mp;
1060  uint8_t scattered_rx;
1061  uint16_t nb_desc;
1063 
1070  uint16_t nb_desc;
1072 
1074 #define RTE_ETH_XSTATS_NAME_SIZE 64
1075 
1086  uint64_t id;
1087  uint64_t value;
1088 };
1089 
1099 };
1100 
1101 #define ETH_DCB_NUM_TCS 8
1102 #define ETH_MAX_VMDQ_POOL 64
1103 
1110  struct {
1111  uint8_t base;
1112  uint8_t nb_queue;
1113  } tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
1115  struct {
1116  uint8_t base;
1117  uint8_t nb_queue;
1118  } tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
1119 };
1120 
1126  uint8_t nb_tcs;
1128  uint8_t tc_bws[ETH_DCB_NUM_TCS];
1131 };
1132 
1136 #define RTE_ETH_QUEUE_STATE_STOPPED 0
1137 #define RTE_ETH_QUEUE_STATE_STARTED 1
1138 
1139 struct rte_eth_dev;
1140 
1141 struct rte_eth_dev_callback;
1143 TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
1144 
1145 /* Macros to check for valid port */
1146 #define RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, retval) do { \
1147  if (!rte_eth_dev_is_valid_port(port_id)) { \
1148  RTE_PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); \
1149  return retval; \
1150  } \
1151 } while (0)
1152 
1153 #define RTE_ETH_VALID_PORTID_OR_RET(port_id) do { \
1154  if (!rte_eth_dev_is_valid_port(port_id)) { \
1155  RTE_PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); \
1156  return; \
1157  } \
1158 } while (0)
1159 
1165 #define ETH_L2_TUNNEL_ENABLE_MASK 0x00000001
1166 
1167 #define ETH_L2_TUNNEL_INSERTION_MASK 0x00000002
1168 
1169 #define ETH_L2_TUNNEL_STRIPPING_MASK 0x00000004
1170 
1171 #define ETH_L2_TUNNEL_FORWARDING_MASK 0x00000008
1172 
1173 /*
1174  * Definitions of all functions exported by an Ethernet driver through the
1175  * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
1176  * structure associated with an Ethernet device.
1177  */
1178 
1179 typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
1182 typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
1185 typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev);
1188 typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
1191 typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
1194 typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev);
1197 typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
1200 typedef void (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
1203 typedef void (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
1206 typedef void (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
1209 typedef void (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
1212 typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
1213  int wait_to_complete);
1216 typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
1217  struct rte_eth_stats *igb_stats);
1220 typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);
1223 typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
1224  struct rte_eth_xstat *stats, unsigned n);
1227 typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
1228  const uint64_t *ids,
1229  uint64_t *values,
1230  unsigned int n);
1233 typedef void (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
1236 typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
1237  struct rte_eth_xstat_name *xstats_names, unsigned size);
1240 typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
1241  struct rte_eth_xstat_name *xstats_names, const uint64_t *ids,
1242  unsigned int size);
1245 typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
1246  uint16_t queue_id,
1247  uint8_t stat_idx,
1248  uint8_t is_rx);
1251 typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
1252  struct rte_eth_dev_info *dev_info);
1255 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
1258 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
1259  uint16_t queue_id);
1262 typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
1263  uint16_t queue_id);
1266 typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
1267  uint16_t rx_queue_id,
1268  uint16_t nb_rx_desc,
1269  unsigned int socket_id,
1270  const struct rte_eth_rxconf *rx_conf,
1271  struct rte_mempool *mb_pool);
1274 typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
1275  uint16_t tx_queue_id,
1276  uint16_t nb_tx_desc,
1277  unsigned int socket_id,
1278  const struct rte_eth_txconf *tx_conf);
1281 typedef int (*eth_rx_enable_intr_t)(struct rte_eth_dev *dev,
1282  uint16_t rx_queue_id);
1285 typedef int (*eth_rx_disable_intr_t)(struct rte_eth_dev *dev,
1286  uint16_t rx_queue_id);
1289 typedef void (*eth_queue_release_t)(void *queue);
1292 typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
1293  uint16_t rx_queue_id);
1296 typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
1299 typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
1302 typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
1305 typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
1306  char *fw_version, size_t fw_size);
1309 typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
1312 typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
1313  uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo);
1314 
1315 typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,
1316  uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
1317 
1318 typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu);
1321 typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
1322  uint16_t vlan_id,
1323  int on);
1326 typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
1327  enum rte_vlan_type type, uint16_t tpid);
1330 typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
1333 typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
1334  uint16_t vlan_id,
1335  int on);
1338 typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
1339  uint16_t rx_queue_id,
1340  int on);
1343 typedef uint16_t (*eth_rx_burst_t)(void *rxq,
1344  struct rte_mbuf **rx_pkts,
1345  uint16_t nb_pkts);
1348 typedef uint16_t (*eth_tx_burst_t)(void *txq,
1349  struct rte_mbuf **tx_pkts,
1350  uint16_t nb_pkts);
1353 typedef uint16_t (*eth_tx_prep_t)(void *txq,
1354  struct rte_mbuf **tx_pkts,
1355  uint16_t nb_pkts);
1358 typedef int (*flow_ctrl_get_t)(struct rte_eth_dev *dev,
1359  struct rte_eth_fc_conf *fc_conf);
1362 typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
1363  struct rte_eth_fc_conf *fc_conf);
1366 typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
1367  struct rte_eth_pfc_conf *pfc_conf);
1370 typedef int (*reta_update_t)(struct rte_eth_dev *dev,
1371  struct rte_eth_rss_reta_entry64 *reta_conf,
1372  uint16_t reta_size);
1375 typedef int (*reta_query_t)(struct rte_eth_dev *dev,
1376  struct rte_eth_rss_reta_entry64 *reta_conf,
1377  uint16_t reta_size);
1380 typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
1381  struct rte_eth_rss_conf *rss_conf);
1384 typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
1385  struct rte_eth_rss_conf *rss_conf);
1388 typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
1391 typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
1394 typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
1397 typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
1398  struct ether_addr *mac_addr,
1399  uint32_t index,
1400  uint32_t vmdq);
1403 typedef void (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
1404  struct ether_addr *mac_addr);
1407 typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
1408  struct ether_addr *mac_addr,
1409  uint8_t on);
1412 typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
1413  uint8_t on);
1416 typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
1417  uint16_t queue_idx,
1418  uint16_t tx_rate);
1421 typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
1422  struct rte_eth_mirror_conf *mirror_conf,
1423  uint8_t rule_id,
1424  uint8_t on);
1427 typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
1428  uint8_t rule_id);
1431 typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
1432  struct rte_eth_udp_tunnel *tunnel_udp);
1435 typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
1436  struct rte_eth_udp_tunnel *tunnel_udp);
1439 typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
1440  struct ether_addr *mc_addr_set,
1441  uint32_t nb_mc_addr);
1444 typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
1447 typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
1450 typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
1451  struct timespec *timestamp,
1452  uint32_t flags);
1455 typedef int (*eth_timesync_read_tx_timestamp_t)(struct rte_eth_dev *dev,
1456  struct timespec *timestamp);
1459 typedef int (*eth_timesync_adjust_time)(struct rte_eth_dev *dev, int64_t);
1462 typedef int (*eth_timesync_read_time)(struct rte_eth_dev *dev,
1463  struct timespec *timestamp);
1466 typedef int (*eth_timesync_write_time)(struct rte_eth_dev *dev,
1467  const struct timespec *timestamp);
1470 typedef int (*eth_get_reg_t)(struct rte_eth_dev *dev,
1471  struct rte_dev_reg_info *info);
1474 typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
1477 typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
1478  struct rte_dev_eeprom_info *info);
1481 typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
1482  struct rte_dev_eeprom_info *info);
1485 typedef int (*eth_l2_tunnel_eth_type_conf_t)
1486  (struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
1489 typedef int (*eth_l2_tunnel_offload_set_t)
1490  (struct rte_eth_dev *dev,
1491  struct rte_eth_l2_tunnel_conf *l2_tunnel,
1492  uint32_t mask,
1493  uint8_t en);
1497 typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
1498  enum rte_filter_type filter_type,
1499  enum rte_filter_op filter_op,
1500  void *arg);
1503 typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
1506 typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
1509 typedef int (*eth_get_dcb_info)(struct rte_eth_dev *dev,
1510  struct rte_eth_dcb_info *dcb_info);
1513 typedef int (*eth_pool_ops_supported_t)(struct rte_eth_dev *dev,
1514  const char *pool);
1520 struct eth_dev_ops {
1521  eth_dev_configure_t dev_configure;
1522  eth_dev_start_t dev_start;
1523  eth_dev_stop_t dev_stop;
1524  eth_dev_set_link_up_t dev_set_link_up;
1525  eth_dev_set_link_down_t dev_set_link_down;
1526  eth_dev_close_t dev_close;
1527  eth_dev_reset_t dev_reset;
1528  eth_link_update_t link_update;
1530  eth_promiscuous_enable_t promiscuous_enable;
1531  eth_promiscuous_disable_t promiscuous_disable;
1532  eth_allmulticast_enable_t allmulticast_enable;
1533  eth_allmulticast_disable_t allmulticast_disable;
1534  eth_mac_addr_remove_t mac_addr_remove;
1535  eth_mac_addr_add_t mac_addr_add;
1536  eth_mac_addr_set_t mac_addr_set;
1537  eth_set_mc_addr_list_t set_mc_addr_list;
1538  mtu_set_t mtu_set;
1540  eth_stats_get_t stats_get;
1541  eth_stats_reset_t stats_reset;
1542  eth_xstats_get_t xstats_get;
1543  eth_xstats_reset_t xstats_reset;
1544  eth_xstats_get_names_t xstats_get_names;
1546  eth_queue_stats_mapping_set_t queue_stats_mapping_set;
1549  eth_dev_infos_get_t dev_infos_get;
1550  eth_rxq_info_get_t rxq_info_get;
1551  eth_txq_info_get_t txq_info_get;
1552  eth_fw_version_get_t fw_version_get;
1553  eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
1556  vlan_filter_set_t vlan_filter_set;
1557  vlan_tpid_set_t vlan_tpid_set;
1558  vlan_strip_queue_set_t vlan_strip_queue_set;
1559  vlan_offload_set_t vlan_offload_set;
1560  vlan_pvid_set_t vlan_pvid_set;
1562  eth_queue_start_t rx_queue_start;
1563  eth_queue_stop_t rx_queue_stop;
1564  eth_queue_start_t tx_queue_start;
1565  eth_queue_stop_t tx_queue_stop;
1566  eth_rx_queue_setup_t rx_queue_setup;
1567  eth_queue_release_t rx_queue_release;
1568  eth_rx_queue_count_t rx_queue_count;
1570  eth_rx_descriptor_done_t rx_descriptor_done;
1571  eth_rx_descriptor_status_t rx_descriptor_status;
1573  eth_tx_descriptor_status_t tx_descriptor_status;
1575  eth_rx_enable_intr_t rx_queue_intr_enable;
1576  eth_rx_disable_intr_t rx_queue_intr_disable;
1577  eth_tx_queue_setup_t tx_queue_setup;
1578  eth_queue_release_t tx_queue_release;
1579  eth_tx_done_cleanup_t tx_done_cleanup;
1581  eth_dev_led_on_t dev_led_on;
1582  eth_dev_led_off_t dev_led_off;
1584  flow_ctrl_get_t flow_ctrl_get;
1585  flow_ctrl_set_t flow_ctrl_set;
1586  priority_flow_ctrl_set_t priority_flow_ctrl_set;
1588  eth_uc_hash_table_set_t uc_hash_table_set;
1589  eth_uc_all_hash_table_set_t uc_all_hash_table_set;
1591  eth_mirror_rule_set_t mirror_rule_set;
1592  eth_mirror_rule_reset_t mirror_rule_reset;
1594  eth_udp_tunnel_port_add_t udp_tunnel_port_add;
1595  eth_udp_tunnel_port_del_t udp_tunnel_port_del;
1596  eth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf;
1598  eth_l2_tunnel_offload_set_t l2_tunnel_offload_set;
1601  eth_set_queue_rate_limit_t set_queue_rate_limit;
1603  rss_hash_update_t rss_hash_update;
1604  rss_hash_conf_get_t rss_hash_conf_get;
1605  reta_update_t reta_update;
1606  reta_query_t reta_query;
1608  eth_get_reg_t get_reg;
1609  eth_get_eeprom_length_t get_eeprom_length;
1610  eth_get_eeprom_t get_eeprom;
1611  eth_set_eeprom_t set_eeprom;
1614  eth_filter_ctrl_t filter_ctrl;
1616  eth_get_dcb_info get_dcb_info;
1618  eth_timesync_enable_t timesync_enable;
1620  eth_timesync_disable_t timesync_disable;
1622  eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
1624  eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
1626  eth_timesync_adjust_time timesync_adjust_time;
1627  eth_timesync_read_time timesync_read_time;
1628  eth_timesync_write_time timesync_write_time;
1630  eth_xstats_get_by_id_t xstats_get_by_id;
1632  eth_xstats_get_names_by_id_t xstats_get_names_by_id;
1635  eth_tm_ops_get_t tm_ops_get;
1638  eth_mtr_ops_get_t mtr_ops_get;
1641  eth_pool_ops_supported_t pool_ops_supported;
1643 };
1644 
1667 typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue,
1668  struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts,
1669  void *user_param);
1670 
1691 typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue,
1692  struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
1693 
1699 struct rte_eth_rxtx_callback {
1700  struct rte_eth_rxtx_callback *next;
1701  union{
1702  rte_rx_callback_fn rx;
1703  rte_tx_callback_fn tx;
1704  } fn;
1705  void *param;
1706 };
1707 
1712  RTE_ETH_DEV_UNUSED = 0,
1713  RTE_ETH_DEV_ATTACHED,
1714  RTE_ETH_DEV_DEFERRED,
1715 };
1716 
1727 struct rte_eth_dev {
1728  eth_rx_burst_t rx_pkt_burst;
1729  eth_tx_burst_t tx_pkt_burst;
1730  eth_tx_prep_t tx_pkt_prepare;
1731  struct rte_eth_dev_data *data;
1732  const struct eth_dev_ops *dev_ops;
1733  struct rte_device *device;
1734  struct rte_intr_handle *intr_handle;
1736  struct rte_eth_dev_cb_list link_intr_cbs;
1741  struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
1746  struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
1747  enum rte_eth_dev_state state;
1748  void *security_ctx;
1750 
1751 void *
1752 rte_eth_dev_get_sec_ctx(uint8_t port_id);
1753 
1754 struct rte_eth_dev_sriov {
1755  uint8_t active;
1756  uint8_t nb_q_per_pool;
1757  uint16_t def_vmdq_idx;
1758  uint16_t def_pool_q_idx;
1759 };
1760 #define RTE_ETH_DEV_SRIOV(dev) ((dev)->data->sriov)
1761 
1762 #define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
1763 
1771 struct rte_eth_dev_data {
1772  char name[RTE_ETH_NAME_MAX_LEN];
1774  void **rx_queues;
1775  void **tx_queues;
1776  uint16_t nb_rx_queues;
1777  uint16_t nb_tx_queues;
1779  struct rte_eth_dev_sriov sriov;
1781  void *dev_private;
1783  struct rte_eth_link dev_link;
1786  struct rte_eth_conf dev_conf;
1787  uint16_t mtu;
1789  uint32_t min_rx_buf_size;
1792  uint64_t rx_mbuf_alloc_failed;
1793  struct ether_addr* mac_addrs;
1794  uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
1796  struct ether_addr* hash_mac_addrs;
1798  uint16_t port_id;
1799  __extension__
1800  uint8_t promiscuous : 1,
1801  scattered_rx : 1,
1802  all_multicast : 1,
1803  dev_started : 1,
1804  lro : 1;
1805  uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
1807  uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
1809  uint32_t dev_flags;
1810  enum rte_kernel_driver kdrv;
1811  int numa_node;
1812  struct rte_vlan_filter_conf vlan_filter_conf;
1814 };
1815 
1817 #define RTE_ETH_DEV_INTR_LSC 0x0002
1818 
1819 #define RTE_ETH_DEV_BONDED_SLAVE 0x0004
1820 
1821 #define RTE_ETH_DEV_INTR_RMV 0x0008
1822 
1828 extern struct rte_eth_dev rte_eth_devices[];
1829 
1838 uint16_t rte_eth_find_next(uint16_t port_id);
1839 
1843 #define RTE_ETH_FOREACH_DEV(p) \
1844  for (p = rte_eth_find_next(0); \
1845  (unsigned int)p < (unsigned int)RTE_MAX_ETHPORTS; \
1846  p = rte_eth_find_next(p + 1))
1847 
1848 
1861 uint16_t rte_eth_dev_count(void);
1862 
1872 struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
1873 
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  uint16_t nb_rx;
2888 
2889 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
2890  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
2891  RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
2892 
2893  if (queue_id >= dev->data->nb_rx_queues) {
2894  RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
2895  return 0;
2896  }
2897 #endif
2898  nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
2899  rx_pkts, nb_pkts);
2900 
2901 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
2902  if (unlikely(dev->post_rx_burst_cbs[queue_id] != NULL)) {
2903  struct rte_eth_rxtx_callback *cb =
2904  dev->post_rx_burst_cbs[queue_id];
2905 
2906  do {
2907  nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
2908  nb_pkts, cb->param);
2909  cb = cb->next;
2910  } while (cb != NULL);
2911  }
2912 #endif
2913 
2914  return nb_rx;
2915 }
2916 
2929 static inline int
2930 rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)
2931 {
2932  struct rte_eth_dev *dev;
2933 
2934  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
2935  dev = &rte_eth_devices[port_id];
2936  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
2937  if (queue_id >= dev->data->nb_rx_queues)
2938  return -EINVAL;
2939 
2940  return (int)(*dev->dev_ops->rx_queue_count)(dev, queue_id);
2941 }
2942 
2958 static inline int
2959 rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
2960 {
2961  struct rte_eth_dev *dev = &rte_eth_devices[port_id];
2962  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
2963  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
2964  return (*dev->dev_ops->rx_descriptor_done)( \
2965  dev->data->rx_queues[queue_id], offset);
2966 }
2967 
2968 #define RTE_ETH_RX_DESC_AVAIL 0
2969 #define RTE_ETH_RX_DESC_DONE 1
2970 #define RTE_ETH_RX_DESC_UNAVAIL 2
3005 static inline int
3006 rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
3007  uint16_t offset)
3008 {
3009  struct rte_eth_dev *dev;
3010  void *rxq;
3011 
3012 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3013  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
3014 #endif
3015  dev = &rte_eth_devices[port_id];
3016 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3017  if (queue_id >= dev->data->nb_rx_queues)
3018  return -ENODEV;
3019 #endif
3020  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);
3021  rxq = dev->data->rx_queues[queue_id];
3022 
3023  return (*dev->dev_ops->rx_descriptor_status)(rxq, offset);
3024 }
3025 
3026 #define RTE_ETH_TX_DESC_FULL 0
3027 #define RTE_ETH_TX_DESC_DONE 1
3028 #define RTE_ETH_TX_DESC_UNAVAIL 2
3063 static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
3064  uint16_t queue_id, uint16_t offset)
3065 {
3066  struct rte_eth_dev *dev;
3067  void *txq;
3068 
3069 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3070  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
3071 #endif
3072  dev = &rte_eth_devices[port_id];
3073 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3074  if (queue_id >= dev->data->nb_tx_queues)
3075  return -ENODEV;
3076 #endif
3077  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);
3078  txq = dev->data->tx_queues[queue_id];
3079 
3080  return (*dev->dev_ops->tx_descriptor_status)(txq, offset);
3081 }
3082 
3149 static inline uint16_t
3150 rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
3151  struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
3152 {
3153  struct rte_eth_dev *dev = &rte_eth_devices[port_id];
3154 
3155 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3156  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
3157  RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
3158 
3159  if (queue_id >= dev->data->nb_tx_queues) {
3160  RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
3161  return 0;
3162  }
3163 #endif
3164 
3165 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
3166  struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
3167 
3168  if (unlikely(cb != NULL)) {
3169  do {
3170  nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
3171  cb->param);
3172  cb = cb->next;
3173  } while (cb != NULL);
3174  }
3175 #endif
3176 
3177  return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
3178 }
3179 
3236 #ifndef RTE_ETHDEV_TX_PREPARE_NOOP
3237 
3238 static inline uint16_t
3239 rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
3240  struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
3241 {
3242  struct rte_eth_dev *dev;
3243 
3244 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3245  if (!rte_eth_dev_is_valid_port(port_id)) {
3246  RTE_PMD_DEBUG_TRACE("Invalid TX port_id=%d\n", port_id);
3247  rte_errno = EINVAL;
3248  return 0;
3249  }
3250 #endif
3251 
3252  dev = &rte_eth_devices[port_id];
3253 
3254 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
3255  if (queue_id >= dev->data->nb_tx_queues) {
3256  RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
3257  rte_errno = EINVAL;
3258  return 0;
3259  }
3260 #endif
3261 
3262  if (!dev->tx_pkt_prepare)
3263  return nb_pkts;
3264 
3265  return (*dev->tx_pkt_prepare)(dev->data->tx_queues[queue_id],
3266  tx_pkts, nb_pkts);
3267 }
3268 
3269 #else
3270 
3271 /*
3272  * Native NOOP operation for compilation targets which doesn't require any
3273  * preparations steps, and functional NOOP may introduce unnecessary performance
3274  * drop.
3275  *
3276  * Generally this is not a good idea to turn it on globally and didn't should
3277  * be used if behavior of tx_preparation can change.
3278  */
3279 
3280 static inline uint16_t
3281 rte_eth_tx_prepare(__rte_unused uint16_t port_id,
3282  __rte_unused uint16_t queue_id,
3283  __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
3284 {
3285  return nb_pkts;
3286 }
3287 
3288 #endif
3289 
3290 typedef void (*buffer_tx_error_fn)(struct rte_mbuf **unsent, uint16_t count,
3291  void *userdata);
3292 
3298  buffer_tx_error_fn error_callback;
3299  void *error_userdata;
3300  uint16_t size;
3301  uint16_t length;
3302  struct rte_mbuf *pkts[];
3304 };
3305 
3312 #define RTE_ETH_TX_BUFFER_SIZE(sz) \
3313  (sizeof(struct rte_eth_dev_tx_buffer) + (sz) * sizeof(struct rte_mbuf *))
3314 
3325 int
3326 rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size);
3327 
3350 static inline uint16_t
3351 rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id,
3352  struct rte_eth_dev_tx_buffer *buffer)
3353 {
3354  uint16_t sent;
3355  uint16_t to_send = buffer->length;
3356 
3357  if (to_send == 0)
3358  return 0;
3359 
3360  sent = rte_eth_tx_burst(port_id, queue_id, buffer->pkts, to_send);
3361 
3362  buffer->length = 0;
3363 
3364  /* All packets sent, or to be dealt with by callback below */
3365  if (unlikely(sent != to_send))
3366  buffer->error_callback(&buffer->pkts[sent],
3367  (uint16_t)(to_send - sent),
3368  buffer->error_userdata);
3369 
3370  return sent;
3371 }
3372 
3403 static __rte_always_inline uint16_t
3404 rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
3405  struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt)
3406 {
3407  buffer->pkts[buffer->length++] = tx_pkt;
3408  if (buffer->length < buffer->size)
3409  return 0;
3410 
3411  return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
3412 }
3413 
3438 int
3440  buffer_tx_error_fn callback, void *userdata);
3441 
3464 void
3465 rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
3466  void *userdata);
3467 
3491 void
3492 rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
3493  void *userdata);
3494 
3519 int
3520 rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt);
3521 
3536 };
3537 
3538 typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id,
3539  enum rte_eth_event_type event, void *cb_arg, void *ret_param);
3560 int rte_eth_dev_callback_register(uint16_t port_id,
3561  enum rte_eth_event_type event,
3562  rte_eth_dev_cb_fn cb_fn, void *cb_arg);
3563 
3581 int rte_eth_dev_callback_unregister(uint16_t port_id,
3582  enum rte_eth_event_type event,
3583  rte_eth_dev_cb_fn cb_fn, void *cb_arg);
3584 
3604 int _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
3605  enum rte_eth_event_type event, void *cb_arg, void *ret_param);
3606 
3627 int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id);
3628 
3648 int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id);
3649 
3667 int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data);
3668 
3690 int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id,
3691  int epfd, int op, void *data);
3692 
3705 int rte_eth_led_on(uint16_t port_id);
3706 
3719 int rte_eth_led_off(uint16_t port_id);
3720 
3733 int rte_eth_dev_flow_ctrl_get(uint16_t port_id,
3734  struct rte_eth_fc_conf *fc_conf);
3735 
3750 int rte_eth_dev_flow_ctrl_set(uint16_t port_id,
3751  struct rte_eth_fc_conf *fc_conf);
3752 
3768 int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
3769  struct rte_eth_pfc_conf *pfc_conf);
3770 
3789 int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr,
3790  uint32_t pool);
3791 
3805 int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr);
3806 
3820 int rte_eth_dev_default_mac_addr_set(uint16_t port,
3821  struct ether_addr *mac_addr);
3822 
3838 int rte_eth_dev_rss_reta_update(uint16_t port,
3839  struct rte_eth_rss_reta_entry64 *reta_conf,
3840  uint16_t reta_size);
3841 
3857 int rte_eth_dev_rss_reta_query(uint16_t port,
3858  struct rte_eth_rss_reta_entry64 *reta_conf,
3859  uint16_t reta_size);
3860 
3879 int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr,
3880  uint8_t on);
3881 
3899 int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on);
3900 
3922 int rte_eth_mirror_rule_set(uint16_t port_id,
3923  struct rte_eth_mirror_conf *mirror_conf,
3924  uint8_t rule_id,
3925  uint8_t on);
3926 
3940 int rte_eth_mirror_rule_reset(uint16_t port_id,
3941  uint8_t rule_id);
3942 
3958 int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
3959  uint16_t tx_rate);
3960 
3974 int rte_eth_dev_rss_hash_update(uint16_t port_id,
3975  struct rte_eth_rss_conf *rss_conf);
3976 
3990 int
3991 rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
3992  struct rte_eth_rss_conf *rss_conf);
3993 
4011 int
4012 rte_eth_dev_udp_tunnel_port_add(uint16_t port_id,
4013  struct rte_eth_udp_tunnel *tunnel_udp);
4014 
4033 int
4034 rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id,
4035  struct rte_eth_udp_tunnel *tunnel_udp);
4036 
4050 int rte_eth_dev_filter_supported(uint16_t port_id,
4051  enum rte_filter_type filter_type);
4052 
4071 int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type,
4072  enum rte_filter_op filter_op, void *arg);
4073 
4086 int rte_eth_dev_get_dcb_info(uint16_t port_id,
4087  struct rte_eth_dcb_info *dcb_info);
4088 
4113 void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id,
4114  rte_rx_callback_fn fn, void *user_param);
4115 
4141 void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id,
4142  rte_rx_callback_fn fn, void *user_param);
4143 
4168 void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id,
4169  rte_tx_callback_fn fn, void *user_param);
4170 
4201 int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id,
4202  struct rte_eth_rxtx_callback *user_cb);
4203 
4234 int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id,
4235  struct rte_eth_rxtx_callback *user_cb);
4236 
4254 int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
4255  struct rte_eth_rxq_info *qinfo);
4256 
4274 int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
4275  struct rte_eth_txq_info *qinfo);
4276 
4293 int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info);
4294 
4306 int rte_eth_dev_get_eeprom_length(uint16_t port_id);
4307 
4322 int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
4323 
4338 int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
4339 
4357 int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
4358  struct ether_addr *mc_addr_set,
4359  uint32_t nb_mc_addr);
4360 
4372 int rte_eth_timesync_enable(uint16_t port_id);
4373 
4385 int rte_eth_timesync_disable(uint16_t port_id);
4386 
4404 int rte_eth_timesync_read_rx_timestamp(uint16_t port_id,
4405  struct timespec *timestamp, uint32_t flags);
4406 
4421 int rte_eth_timesync_read_tx_timestamp(uint16_t port_id,
4422  struct timespec *timestamp);
4423 
4440 int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta);
4441 
4456 int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time);
4457 
4475 int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time);
4476 
4496 const struct rte_memzone *
4497 rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name,
4498  uint16_t queue_id, size_t size,
4499  unsigned align, int socket_id);
4500 
4515 int
4516 rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id,
4517  struct rte_eth_l2_tunnel_conf *l2_tunnel);
4518 
4542 int
4543 rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id,
4544  struct rte_eth_l2_tunnel_conf *l2_tunnel,
4545  uint32_t mask,
4546  uint8_t en);
4547 
4560 int
4561 rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id);
4562 
4574 int
4575 rte_eth_dev_get_name_by_port(uint16_t port_id, char *name);
4576 
4593 int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id,
4594  uint16_t *nb_rx_desc,
4595  uint16_t *nb_tx_desc);
4596 
4597 
4612 int
4613 rte_eth_dev_pool_ops_supported(uint16_t port_id, const char *pool);
4614 
4615 #ifdef __cplusplus
4616 }
4617 #endif
4618 
4619 #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:1049
struct rte_eth_vmdq_dcb_tx_conf vmdq_dcb_tx_conf
Definition: rte_ethdev.h:932
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:765
uint8_t tc_bws[ETH_DCB_NUM_TCS]
Definition: rte_ethdev.h:1128
#define ETH_VMDQ_MAX_VLAN_FILTERS
Definition: rte_ethdev.h:522
struct rte_fdir_conf fdir_conf
Definition: rte_ethdev.h:942
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:899
#define __rte_always_inline
Definition: rte_common.h:139
uint16_t tx_rs_thresh
Definition: rte_ethdev.h:761
int rte_eth_timesync_write_time(uint16_t port_id, const 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:1667
uint16_t nb_desc
Definition: rte_ethdev.h:1070
uint64_t rx_offload_capa
Definition: rte_ethdev.h:1027
uint16_t reta[RTE_RETA_GROUP_SIZE]
Definition: rte_ethdev.h:593
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)
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:3239
int rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id)
rte_eth_nb_tcs
Definition: rte_ethdev.h:601
struct rte_eth_vmdq_tx_conf vmdq_tx_conf
Definition: rte_ethdev.h:936
uint64_t q_errors[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:218
struct rte_eth_thresh rx_thresh
Definition: rte_ethdev.h:722
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:846
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:3006
uint64_t imissed
Definition: rte_ethdev.h:203
static int rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset)
Definition: rte_ethdev.h:2959
uint32_t low_water
Definition: rte_ethdev.h:824
uint32_t max_rx_pkt_len
Definition: rte_ethdev.h:352
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:1691
uint8_t rss_key_len
Definition: rte_ethdev.h:427
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:284
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:1031
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:1035
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:544
uint32_t lpbk_mode
Definition: rte_ethdev.h:917
enum rte_fdir_status_mode status
Definition: rte_ethdev.h:870
enum rte_eth_tx_mq_mode mq_mode
Definition: rte_ethdev.h:699
#define rte_errno
Definition: rte_errno.h:58
uint32_t link_speeds
Definition: rte_ethdev.h:908
uint64_t tx_queue_offload_capa
Definition: rte_ethdev.h:1033
rte_eth_tx_mq_mode
Definition: rte_ethdev.h:332
rte_eth_fc_mode
Definition: rte_ethdev.h:810
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:653
uint16_t nb_mtu_seg_max
Definition: rte_ethdev.h:804
#define __rte_unused
Definition: rte_common.h:105
uint64_t q_obytes[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:216
int rte_eth_dev_get_eeprom_length(uint16_t port_id)
uint64_t opackets
Definition: rte_ethdev.h:200
rte_filter_op
Definition: rte_eth_ctrl.h:109
struct rte_eth_rss_conf rss_conf
Definition: rte_ethdev.h:923
uint8_t hash_key_size
Definition: rte_ethdev.h:1037
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:353
struct rte_mempool * mp
Definition: rte_ethdev.h:1058
uint32_t dcb_capability_en
Definition: rte_ethdev.h:941
__extension__ uint16_t hw_strip_crc
Definition: rte_ethdev.h:366
#define ETH_NUM_RECEIVE_MAC_ADDR
Definition: rte_ethdev.h:543
uint64_t q_ibytes[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:214
__extension__ uint16_t enable_scatter
Definition: rte_ethdev.h:366
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:366
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:897
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:760
struct rte_eth_desc_lim rx_desc_lim
Definition: rte_ethdev.h:1045
uint16_t rte_eth_dev_count(void)
uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES]
Definition: rte_ethdev.h:660
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:1043
uint8_t rx_deferred_start
Definition: rte_ethdev.h:725
void(* eth_promiscuous_enable_t)(struct rte_eth_dev *dev)
Definition: rte_ethdev.h:1200
struct rte_mbuf * pkts[]
Definition: rte_ethdev.h:3302
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:3538
struct rte_eth_rxmode rxmode
Definition: rte_ethdev.h:915
uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:210
uint32_t high_water
Definition: rte_ethdev.h:823
enum rte_eth_nb_pools nb_queue_pools
Definition: rte_ethdev.h:652
uint16_t port
Definition: rte_mbuf.h:460
struct rte_eth_txconf conf
Definition: rte_ethdev.h:1069
uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex)
struct rte_intr_conf intr_conf
Definition: rte_ethdev.h:943
#define RTE_ETH_XSTATS_NAME_SIZE
Definition: rte_ethdev.h:1074
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:1046
int rte_eth_timesync_disable(uint16_t port_id)
uint64_t offloads
Definition: rte_ethdev.h:731
struct rte_eth_conf::@65 rx_adv_conf
__extension__ uint16_t hw_vlan_strip
Definition: rte_ethdev.h:366
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:826
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:1014
int rte_eth_stats_reset(uint16_t port_id)
struct rte_eth_txconf default_txconf
Definition: rte_ethdev.h:1041
#define unlikely(x)
uint16_t nb_max
Definition: rte_ethdev.h:779
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:201
__extension__ uint16_t hw_vlan_filter
Definition: rte_ethdev.h:366
uint64_t offloads
Definition: rte_ethdev.h:772
uint64_t oerrors
Definition: rte_ethdev.h:208
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:926
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:928
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:1098
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:359
enum rte_eth_rx_mq_mode mq_mode
Definition: rte_ethdev.h:351
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:683
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:762
uint16_t nb_desc
Definition: rte_ethdev.h:1061
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:1026
int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr)
uint8_t scattered_rx
Definition: rte_ethdev.h:1060
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:934
uint64_t offloads
Definition: rte_ethdev.h:705
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:1044
uint64_t tx_offload_capa
Definition: rte_ethdev.h:1029
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:212
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:366
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:202
uint8_t enable_loop_back
Definition: rte_ethdev.h:686
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:123
struct rte_eth_rxconf conf
Definition: rte_ethdev.h:1059
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:366
#define ETH_DCB_NUM_USER_PRIORITIES
Definition: rte_ethdev.h:523
void rte_eth_promiscuous_disable(uint16_t port_id)
uint16_t max_tx_queues
Definition: rte_ethdev.h:1021
int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id)
rte_eth_dev_state
Definition: rte_ethdev.h:1711
uint16_t rx_free_thresh
Definition: rte_ethdev.h:723
struct rte_eth_vlan_mirror vlan
Definition: rte_ethdev.h:581
__extension__ uint16_t jumbo_frame
Definition: rte_ethdev.h:366
uint64_t ierrors
Definition: rte_ethdev.h:207
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:711
uint8_t priority
Definition: rte_ethdev.h:839
uint64_t flow_type_rss_offloads
Definition: rte_ethdev.h:1039
int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data)
rte_vlan_type
Definition: rte_ethdev.h:393
uint16_t nb_seg_max
Definition: rte_ethdev.h:791
uint8_t prio_tc[ETH_DCB_NUM_USER_PRIORITIES]
Definition: rte_ethdev.h:1127
uint64_t ipackets
Definition: rte_ethdev.h:199
uint16_t max_vfs
Definition: rte_ethdev.h:1025
uint16_t pause_time
Definition: rte_ethdev.h:825
struct rte_eth_dcb_tc_queue_mapping tc_queue
Definition: rte_ethdev.h:1130
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:209
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:3404
__extension__ uint8_t hw_vlan_reject_untagged
Definition: rte_ethdev.h:711
struct rte_mempool * pool
Definition: rte_mbuf.h:548
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:96
__extension__ uint16_t hw_ip_checksum
Definition: rte_ethdev.h:366
#define ETH_MQ_RX_RSS_FLAG
Definition: rte_ethdev.h:291
uint16_t vmdq_queue_base
Definition: rte_ethdev.h:1042
rte_eth_nb_pools
Definition: rte_ethdev.h:610
void rte_eth_xstats_reset(uint16_t port_id)
#define ETH_MIRROR_MAX_VLANS
Definition: rte_ethdev.h:556
uint16_t nb_align
Definition: rte_ethdev.h:781
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:366
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:299
const char * driver_name
Definition: rte_ethdev.h:1015
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:2930
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:684
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:1050
struct rte_eth_fdir_flex_conf flex_conf
Definition: rte_ethdev.h:874
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:1022
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:1087
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:869
int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp)
uint32_t max_rx_pktlen
Definition: rte_ethdev.h:1019
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:428
uint64_t id
Definition: rte_ethdev.h:1086
__extension__ uint8_t hw_vlan_reject_tagged
Definition: rte_ethdev.h:711
enum rte_fdir_mode mode
Definition: rte_ethdev.h:868
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:1016
void rte_eth_allmulticast_disable(uint16_t port_id)
uint8_t mac_ctrl_frame_fwd
Definition: rte_ethdev.h:828
__extension__ uint16_t ignore_offload_bitfield
Definition: rte_ethdev.h:366
enum rte_eth_fc_mode mode
Definition: rte_ethdev.h:827
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:924
uint8_t * rss_key
Definition: rte_ethdev.h:426
rte_fdir_status_mode
Definition: rte_ethdev.h:855
__extension__ uint16_t security
Definition: rte_ethdev.h:366
uint8_t tx_deferred_start
Definition: rte_ethdev.h:766
uint8_t wthresh
Definition: rte_ethdev.h:285
uint16_t max_rx_queues
Definition: rte_ethdev.h:1020
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:838
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:916
int rte_eth_allmulticast_get(uint16_t port_id)
uint8_t rx_drop_en
Definition: rte_ethdev.h:724
int rte_eth_dev_is_valid_port(uint16_t port_id)
uint16_t nb_min
Definition: rte_ethdev.h:780
int rte_eth_timesync_enable(uint16_t port_id)
uint8_t pthresh
Definition: rte_ethdev.h:283
void rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link)
struct rte_eth_rxconf default_rxconf
Definition: rte_ethdev.h:1040
uint32_t speed_capa
Definition: rte_ethdev.h:1047
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:3150
uint8_t drop_queue
Definition: rte_ethdev.h:872
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:829
uint32_t min_rx_bufsize
Definition: rte_ethdev.h:1018
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:895
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:3351
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:3525