DPDK  make-f/home/abuild/rpmbuild/BUILD/dpdk-2.2.0/mk/rte.sdkconfig.mkshowversion
rte_ethdev.h
Go to the documentation of this file.
1 /*-
2  * BSD LICENSE
3  *
4  * Copyright(c) 2010-2015 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 #include <rte_dev.h>
176 
177 /* Use this macro to check if LRO API is supported */
178 #define RTE_ETHDEV_HAS_LRO_SUPPORT
179 
180 #include <rte_log.h>
181 #include <rte_interrupts.h>
182 #include <rte_pci.h>
183 #include <rte_dev.h>
184 #include <rte_devargs.h>
185 #include "rte_ether.h"
186 #include "rte_eth_ctrl.h"
187 #include "rte_dev_info.h"
188 
189 struct rte_mbuf;
190 
195  uint64_t ipackets;
196  uint64_t opackets;
197  uint64_t ibytes;
198  uint64_t obytes;
199  uint64_t imissed;
203  uint64_t ibadcrc __rte_deprecated;
205  uint64_t ibadlen __rte_deprecated;
207  uint64_t ierrors;
208  uint64_t oerrors;
209  uint64_t imcasts;
211  uint64_t rx_nombuf;
212  uint64_t fdirmatch __rte_deprecated;
214  uint64_t fdirmiss __rte_deprecated;
216  uint64_t tx_pause_xon __rte_deprecated;
218  uint64_t rx_pause_xon __rte_deprecated;
220  uint64_t tx_pause_xoff __rte_deprecated;
222  uint64_t rx_pause_xoff __rte_deprecated;
224  uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
226  uint64_t q_opackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
228  uint64_t q_ibytes[RTE_ETHDEV_QUEUE_STAT_CNTRS];
230  uint64_t q_obytes[RTE_ETHDEV_QUEUE_STAT_CNTRS];
232  uint64_t q_errors[RTE_ETHDEV_QUEUE_STAT_CNTRS];
234  uint64_t ilbpackets;
236  uint64_t olbpackets;
238  uint64_t ilbbytes;
240  uint64_t olbbytes;
242 };
243 
247 struct rte_eth_link {
248  uint16_t link_speed;
249  uint16_t link_duplex;
250  uint8_t link_status : 1;
251 }__attribute__((aligned(8)));
253 #define ETH_LINK_SPEED_AUTONEG 0
254 #define ETH_LINK_SPEED_10 10
255 #define ETH_LINK_SPEED_100 100
256 #define ETH_LINK_SPEED_1000 1000
257 #define ETH_LINK_SPEED_10000 10000
258 #define ETH_LINK_SPEED_10G 10000
259 #define ETH_LINK_SPEED_20G 20000
260 #define ETH_LINK_SPEED_40G 40000
262 #define ETH_LINK_AUTONEG_DUPLEX 0
263 #define ETH_LINK_HALF_DUPLEX 1
264 #define ETH_LINK_FULL_DUPLEX 2
270 struct rte_eth_thresh {
271  uint8_t pthresh;
272  uint8_t hthresh;
273  uint8_t wthresh;
274 };
275 
279 #define ETH_MQ_RX_RSS_FLAG 0x1
280 #define ETH_MQ_RX_DCB_FLAG 0x2
281 #define ETH_MQ_RX_VMDQ_FLAG 0x4
282 
290 
294  ETH_MQ_RX_DCB = ETH_MQ_RX_DCB_FLAG,
296  ETH_MQ_RX_DCB_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_DCB_FLAG,
297 
299  ETH_MQ_RX_VMDQ_ONLY = ETH_MQ_RX_VMDQ_FLAG,
301  ETH_MQ_RX_VMDQ_RSS = ETH_MQ_RX_RSS_FLAG | ETH_MQ_RX_VMDQ_FLAG,
303  ETH_MQ_RX_VMDQ_DCB = ETH_MQ_RX_VMDQ_FLAG | ETH_MQ_RX_DCB_FLAG,
306  ETH_MQ_RX_VMDQ_FLAG,
307 };
308 
312 #define ETH_RSS ETH_MQ_RX_RSS
313 #define VMDQ_DCB ETH_MQ_RX_VMDQ_DCB
314 #define ETH_DCB_RX ETH_MQ_RX_DCB
315 
325 };
326 
330 #define ETH_DCB_NONE ETH_MQ_TX_NONE
331 #define ETH_VMDQ_DCB_TX ETH_MQ_TX_VMDQ_DCB
332 #define ETH_DCB_TX ETH_MQ_TX_DCB
333 
339  enum rte_eth_rx_mq_mode mq_mode;
340  uint32_t max_rx_pkt_len;
341  uint16_t split_hdr_size;
342  uint16_t header_split : 1,
343  hw_ip_checksum : 1,
344  hw_vlan_filter : 1,
345  hw_vlan_strip : 1,
346  hw_vlan_extend : 1,
347  jumbo_frame : 1,
348  hw_strip_crc : 1,
349  enable_scatter : 1,
350  enable_lro : 1;
351 };
352 
371  uint8_t *rss_key;
372  uint8_t rss_key_len;
373  uint64_t rss_hf;
374 };
375 
376 /*
377  * The RSS offload types are defined based on flow types which are defined
378  * in rte_eth_ctrl.h. Different NIC hardwares may support different RSS offload
379  * types. The supported flow types or RSS offload types can be queried by
380  * rte_eth_dev_info_get().
381  */
382 #define ETH_RSS_IPV4 (1ULL << RTE_ETH_FLOW_IPV4)
383 #define ETH_RSS_FRAG_IPV4 (1ULL << RTE_ETH_FLOW_FRAG_IPV4)
384 #define ETH_RSS_NONFRAG_IPV4_TCP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP)
385 #define ETH_RSS_NONFRAG_IPV4_UDP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP)
386 #define ETH_RSS_NONFRAG_IPV4_SCTP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP)
387 #define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER)
388 #define ETH_RSS_IPV6 (1ULL << RTE_ETH_FLOW_IPV6)
389 #define ETH_RSS_FRAG_IPV6 (1ULL << RTE_ETH_FLOW_FRAG_IPV6)
390 #define ETH_RSS_NONFRAG_IPV6_TCP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP)
391 #define ETH_RSS_NONFRAG_IPV6_UDP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP)
392 #define ETH_RSS_NONFRAG_IPV6_SCTP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP)
393 #define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER)
394 #define ETH_RSS_L2_PAYLOAD (1ULL << RTE_ETH_FLOW_L2_PAYLOAD)
395 #define ETH_RSS_IPV6_EX (1ULL << RTE_ETH_FLOW_IPV6_EX)
396 #define ETH_RSS_IPV6_TCP_EX (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX)
397 #define ETH_RSS_IPV6_UDP_EX (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX)
398 
399 #define ETH_RSS_IP ( \
400  ETH_RSS_IPV4 | \
401  ETH_RSS_FRAG_IPV4 | \
402  ETH_RSS_NONFRAG_IPV4_OTHER | \
403  ETH_RSS_IPV6 | \
404  ETH_RSS_FRAG_IPV6 | \
405  ETH_RSS_NONFRAG_IPV6_OTHER | \
406  ETH_RSS_IPV6_EX)
407 
408 #define ETH_RSS_UDP ( \
409  ETH_RSS_NONFRAG_IPV4_UDP | \
410  ETH_RSS_NONFRAG_IPV6_UDP | \
411  ETH_RSS_IPV6_UDP_EX)
412 
413 #define ETH_RSS_TCP ( \
414  ETH_RSS_NONFRAG_IPV4_TCP | \
415  ETH_RSS_NONFRAG_IPV6_TCP | \
416  ETH_RSS_IPV6_TCP_EX)
417 
418 #define ETH_RSS_SCTP ( \
419  ETH_RSS_NONFRAG_IPV4_SCTP | \
420  ETH_RSS_NONFRAG_IPV6_SCTP)
421 
423 #define ETH_RSS_PROTO_MASK ( \
424  ETH_RSS_IPV4 | \
425  ETH_RSS_FRAG_IPV4 | \
426  ETH_RSS_NONFRAG_IPV4_TCP | \
427  ETH_RSS_NONFRAG_IPV4_UDP | \
428  ETH_RSS_NONFRAG_IPV4_SCTP | \
429  ETH_RSS_NONFRAG_IPV4_OTHER | \
430  ETH_RSS_IPV6 | \
431  ETH_RSS_FRAG_IPV6 | \
432  ETH_RSS_NONFRAG_IPV6_TCP | \
433  ETH_RSS_NONFRAG_IPV6_UDP | \
434  ETH_RSS_NONFRAG_IPV6_SCTP | \
435  ETH_RSS_NONFRAG_IPV6_OTHER | \
436  ETH_RSS_L2_PAYLOAD | \
437  ETH_RSS_IPV6_EX | \
438  ETH_RSS_IPV6_TCP_EX | \
439  ETH_RSS_IPV6_UDP_EX)
440 
441 /*
442  * Definitions used for redirection table entry size.
443  * Some RSS RETA sizes may not be supported by some drivers, check the
444  * documentation or the description of relevant functions for more details.
445  */
446 #define ETH_RSS_RETA_SIZE_64 64
447 #define ETH_RSS_RETA_SIZE_128 128
448 #define ETH_RSS_RETA_SIZE_512 512
449 #define RTE_RETA_GROUP_SIZE 64
450 
451 /* Definitions used for VMDQ and DCB functionality */
452 #define ETH_VMDQ_MAX_VLAN_FILTERS 64
453 #define ETH_DCB_NUM_USER_PRIORITIES 8
454 #define ETH_VMDQ_DCB_NUM_QUEUES 128
455 #define ETH_DCB_NUM_QUEUES 128
457 /* DCB capability defines */
458 #define ETH_DCB_PG_SUPPORT 0x00000001
459 #define ETH_DCB_PFC_SUPPORT 0x00000002
461 /* Definitions used for VLAN Offload functionality */
462 #define ETH_VLAN_STRIP_OFFLOAD 0x0001
463 #define ETH_VLAN_FILTER_OFFLOAD 0x0002
464 #define ETH_VLAN_EXTEND_OFFLOAD 0x0004
466 /* Definitions used for mask VLAN setting */
467 #define ETH_VLAN_STRIP_MASK 0x0001
468 #define ETH_VLAN_FILTER_MASK 0x0002
469 #define ETH_VLAN_EXTEND_MASK 0x0004
470 #define ETH_VLAN_ID_MAX 0x0FFF
472 /* Definitions used for receive MAC address */
473 #define ETH_NUM_RECEIVE_MAC_ADDR 128
475 /* Definitions used for unicast hash */
476 #define ETH_VMDQ_NUM_UC_HASH_ARRAY 128
478 /* Definitions used for VMDQ pool rx mode setting */
479 #define ETH_VMDQ_ACCEPT_UNTAG 0x0001
480 #define ETH_VMDQ_ACCEPT_HASH_MC 0x0002
481 #define ETH_VMDQ_ACCEPT_HASH_UC 0x0004
482 #define ETH_VMDQ_ACCEPT_BROADCAST 0x0008
483 #define ETH_VMDQ_ACCEPT_MULTICAST 0x0010
486 #define ETH_MIRROR_MAX_VLANS 64
487 
488 #define ETH_MIRROR_VIRTUAL_POOL_UP 0x01
489 #define ETH_MIRROR_UPLINK_PORT 0x02
490 #define ETH_MIRROR_DOWNLINK_PORT 0x04
491 #define ETH_MIRROR_VLAN 0x08
492 #define ETH_MIRROR_VIRTUAL_POOL_DOWN 0x10
497 struct rte_eth_vlan_mirror {
498  uint64_t vlan_mask;
500  uint16_t vlan_id[ETH_MIRROR_MAX_VLANS];
501 };
502 
507  uint8_t rule_type;
508  uint8_t dst_pool;
509  uint64_t pool_mask;
511  struct rte_eth_vlan_mirror vlan;
512 };
513 
521  uint64_t mask;
523  uint8_t reta[RTE_RETA_GROUP_SIZE];
525 };
526 
532  ETH_4_TCS = 4,
534 };
535 
545 };
546 
547 /* This structure may be extended in future. */
548 struct rte_eth_dcb_rx_conf {
549  enum rte_eth_nb_tcs nb_tcs;
551  uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
552 };
553 
554 struct rte_eth_vmdq_dcb_tx_conf {
555  enum rte_eth_nb_pools nb_queue_pools;
557  uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
558 };
559 
560 struct rte_eth_dcb_tx_conf {
561  enum rte_eth_nb_tcs nb_tcs;
563  uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES];
564 };
565 
566 struct rte_eth_vmdq_tx_conf {
567  enum rte_eth_nb_pools nb_queue_pools;
568 };
569 
582  enum rte_eth_nb_pools nb_queue_pools;
584  uint8_t default_pool;
585  uint8_t nb_pool_maps;
586  struct {
587  uint16_t vlan_id;
588  uint64_t pools;
589  } pool_map[ETH_VMDQ_MAX_VLAN_FILTERS];
592 };
593 
594 struct rte_eth_vmdq_rx_conf {
595  enum rte_eth_nb_pools nb_queue_pools;
596  uint8_t enable_default_pool;
597  uint8_t default_pool;
598  uint8_t enable_loop_back;
599  uint8_t nb_pool_maps;
600  uint32_t rx_mode;
601  struct {
602  uint16_t vlan_id;
603  uint64_t pools;
604  } pool_map[ETH_VMDQ_MAX_VLAN_FILTERS];
605 };
606 
611  enum rte_eth_tx_mq_mode mq_mode;
613  /* For i40e specifically */
614  uint16_t pvid;
615  uint8_t hw_vlan_reject_tagged : 1,
617  hw_vlan_reject_untagged : 1,
619  hw_vlan_insert_pvid : 1;
621 };
622 
627  struct rte_eth_thresh rx_thresh;
628  uint16_t rx_free_thresh;
629  uint8_t rx_drop_en;
631 };
632 
633 #define ETH_TXQ_FLAGS_NOMULTSEGS 0x0001
634 #define ETH_TXQ_FLAGS_NOREFCOUNT 0x0002
635 #define ETH_TXQ_FLAGS_NOMULTMEMP 0x0004
636 #define ETH_TXQ_FLAGS_NOVLANOFFL 0x0100
637 #define ETH_TXQ_FLAGS_NOXSUMSCTP 0x0200
638 #define ETH_TXQ_FLAGS_NOXSUMUDP 0x0400
639 #define ETH_TXQ_FLAGS_NOXSUMTCP 0x0800
640 #define ETH_TXQ_FLAGS_NOOFFLOADS \
641  (ETH_TXQ_FLAGS_NOVLANOFFL | ETH_TXQ_FLAGS_NOXSUMSCTP | \
642  ETH_TXQ_FLAGS_NOXSUMUDP | ETH_TXQ_FLAGS_NOXSUMTCP)
643 #define ETH_TXQ_FLAGS_NOXSUMS \
644  (ETH_TXQ_FLAGS_NOXSUMSCTP | ETH_TXQ_FLAGS_NOXSUMUDP | \
645  ETH_TXQ_FLAGS_NOXSUMTCP)
646 
650  struct rte_eth_thresh tx_thresh;
651  uint16_t tx_rs_thresh;
652  uint16_t tx_free_thresh;
655  uint32_t txq_flags;
657 };
658 
663  uint16_t nb_max;
664  uint16_t nb_min;
665  uint16_t nb_align;
666 };
667 
676 };
677 
684  uint32_t high_water;
685  uint32_t low_water;
686  uint16_t pause_time;
687  uint16_t send_xon;
688  enum rte_eth_fc_mode mode;
690  uint8_t autoneg;
691 };
692 
699  struct rte_eth_fc_conf fc;
700  uint8_t priority;
701 };
702 
711 };
712 
720 };
721 
729  enum rte_fdir_mode mode;
730  enum rte_fdir_pballoc_type pballoc;
731  enum rte_fdir_status_mode status;
733  uint8_t drop_queue;
734  struct rte_eth_fdir_masks mask;
735  struct rte_eth_fdir_flex_conf flex_conf;
737 };
738 
743  uint16_t udp_port;
744  uint8_t prot_type;
745 };
746 
752  uint16_t lsc;
754  uint16_t rxq;
755 };
756 
762 struct rte_eth_conf {
763  uint16_t link_speed;
765  uint16_t link_duplex;
767  struct rte_eth_rxmode rxmode;
768  struct rte_eth_txmode txmode;
769  uint32_t lpbk_mode;
774  struct {
775  struct rte_eth_rss_conf rss_conf;
776  struct rte_eth_vmdq_dcb_conf vmdq_dcb_conf;
778  struct rte_eth_dcb_rx_conf dcb_rx_conf;
780  struct rte_eth_vmdq_rx_conf vmdq_rx_conf;
782  } rx_adv_conf;
783  union {
784  struct rte_eth_vmdq_dcb_tx_conf vmdq_dcb_tx_conf;
786  struct rte_eth_dcb_tx_conf dcb_tx_conf;
788  struct rte_eth_vmdq_tx_conf vmdq_tx_conf;
790  } tx_adv_conf;
794  struct rte_fdir_conf fdir_conf;
795  struct rte_intr_conf intr_conf;
796 };
797 
807 #define DEV_RX_OFFLOAD_VLAN_STRIP 0x00000001
808 #define DEV_RX_OFFLOAD_IPV4_CKSUM 0x00000002
809 #define DEV_RX_OFFLOAD_UDP_CKSUM 0x00000004
810 #define DEV_RX_OFFLOAD_TCP_CKSUM 0x00000008
811 #define DEV_RX_OFFLOAD_TCP_LRO 0x00000010
812 #define DEV_RX_OFFLOAD_QINQ_STRIP 0x00000020
813 
817 #define DEV_TX_OFFLOAD_VLAN_INSERT 0x00000001
818 #define DEV_TX_OFFLOAD_IPV4_CKSUM 0x00000002
819 #define DEV_TX_OFFLOAD_UDP_CKSUM 0x00000004
820 #define DEV_TX_OFFLOAD_TCP_CKSUM 0x00000008
821 #define DEV_TX_OFFLOAD_SCTP_CKSUM 0x00000010
822 #define DEV_TX_OFFLOAD_TCP_TSO 0x00000020
823 #define DEV_TX_OFFLOAD_UDP_TSO 0x00000040
824 #define DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000080
825 #define DEV_TX_OFFLOAD_QINQ_INSERT 0x00000100
826 
827 struct rte_eth_dev_info {
828  struct rte_pci_device *pci_dev;
829  const char *driver_name;
830  unsigned int if_index;
832  uint32_t min_rx_bufsize;
833  uint32_t max_rx_pktlen;
834  uint16_t max_rx_queues;
835  uint16_t max_tx_queues;
836  uint32_t max_mac_addrs;
837  uint32_t max_hash_mac_addrs;
839  uint16_t max_vfs;
840  uint16_t max_vmdq_pools;
841  uint32_t rx_offload_capa;
842  uint32_t tx_offload_capa;
843  uint16_t reta_size;
845  uint8_t hash_key_size;
847  uint64_t flow_type_rss_offloads;
848  struct rte_eth_rxconf default_rxconf;
849  struct rte_eth_txconf default_txconf;
850  uint16_t vmdq_queue_base;
851  uint16_t vmdq_queue_num;
852  uint16_t vmdq_pool_base;
853  struct rte_eth_desc_lim rx_desc_lim;
854  struct rte_eth_desc_lim tx_desc_lim;
855 };
856 
862  struct rte_mempool *mp;
863  struct rte_eth_rxconf conf;
864  uint8_t scattered_rx;
865  uint16_t nb_desc;
867 
873  struct rte_eth_txconf conf;
874  uint16_t nb_desc;
876 
878 #define RTE_ETH_XSTATS_NAME_SIZE 64
879 
888  char name[RTE_ETH_XSTATS_NAME_SIZE];
889  uint64_t value;
890 };
891 
892 #define ETH_DCB_NUM_TCS 8
893 #define ETH_MAX_VMDQ_POOL 64
894 
901  struct {
902  uint8_t base;
903  uint8_t nb_queue;
904  } tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
906  struct {
907  uint8_t base;
908  uint8_t nb_queue;
909  } tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
910 };
911 
917  uint8_t nb_tcs;
918  uint8_t prio_tc[ETH_DCB_NUM_USER_PRIORITIES];
919  uint8_t tc_bws[ETH_DCB_NUM_TCS];
922 };
923 
927 #define RTE_ETH_QUEUE_STATE_STOPPED 0
928 #define RTE_ETH_QUEUE_STATE_STARTED 1
929 
930 struct rte_eth_dev;
931 
932 struct rte_eth_dev_callback;
934 TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
935 
936 
937 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
938 #define RTE_PMD_DEBUG_TRACE(...) \
939  rte_pmd_debug_trace(__func__, __VA_ARGS__)
940 #else
941 #define RTE_PMD_DEBUG_TRACE(...)
942 #endif
943 
944 
945 /* Macros to check for valid port */
946 #define RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, retval) do { \
947  if (!rte_eth_dev_is_valid_port(port_id)) { \
948  RTE_PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); \
949  return retval; \
950  } \
951 } while (0)
952 
953 #define RTE_ETH_VALID_PORTID_OR_RET(port_id) do { \
954  if (!rte_eth_dev_is_valid_port(port_id)) { \
955  RTE_PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id); \
956  return; \
957  } \
958 } while (0)
959 
960 /*
961  * Definitions of all functions exported by an Ethernet driver through the
962  * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
963  * structure associated with an Ethernet device.
964  */
965 
966 typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
969 typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
972 typedef void (*eth_dev_stop_t)(struct rte_eth_dev *dev);
975 typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
978 typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
981 typedef void (*eth_dev_close_t)(struct rte_eth_dev *dev);
984 typedef void (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
987 typedef void (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
990 typedef void (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
993 typedef void (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
996 typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
997  int wait_to_complete);
1000 typedef void (*eth_stats_get_t)(struct rte_eth_dev *dev,
1001  struct rte_eth_stats *igb_stats);
1004 typedef void (*eth_stats_reset_t)(struct rte_eth_dev *dev);
1007 typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
1008  struct rte_eth_xstats *stats, unsigned n);
1011 typedef void (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
1014 typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
1015  uint16_t queue_id,
1016  uint8_t stat_idx,
1017  uint8_t is_rx);
1020 typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
1021  struct rte_eth_dev_info *dev_info);
1024 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
1025  uint16_t queue_id);
1028 typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
1029  uint16_t queue_id);
1032 typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
1033  uint16_t rx_queue_id,
1034  uint16_t nb_rx_desc,
1035  unsigned int socket_id,
1036  const struct rte_eth_rxconf *rx_conf,
1037  struct rte_mempool *mb_pool);
1040 typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
1041  uint16_t tx_queue_id,
1042  uint16_t nb_tx_desc,
1043  unsigned int socket_id,
1044  const struct rte_eth_txconf *tx_conf);
1047 typedef int (*eth_rx_enable_intr_t)(struct rte_eth_dev *dev,
1048  uint16_t rx_queue_id);
1051 typedef int (*eth_rx_disable_intr_t)(struct rte_eth_dev *dev,
1052  uint16_t rx_queue_id);
1055 typedef void (*eth_queue_release_t)(void *queue);
1058 typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
1059  uint16_t rx_queue_id);
1062 typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
1065 typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
1066  uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo);
1067 
1068 typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,
1069  uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
1070 
1071 typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu);
1074 typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
1075  uint16_t vlan_id,
1076  int on);
1079 typedef void (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
1080  uint16_t tpid);
1083 typedef void (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
1086 typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
1087  uint16_t vlan_id,
1088  int on);
1091 typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
1092  uint16_t rx_queue_id,
1093  int on);
1096 typedef uint16_t (*eth_rx_burst_t)(void *rxq,
1097  struct rte_mbuf **rx_pkts,
1098  uint16_t nb_pkts);
1101 typedef uint16_t (*eth_tx_burst_t)(void *txq,
1102  struct rte_mbuf **tx_pkts,
1103  uint16_t nb_pkts);
1106 typedef int (*flow_ctrl_get_t)(struct rte_eth_dev *dev,
1107  struct rte_eth_fc_conf *fc_conf);
1110 typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
1111  struct rte_eth_fc_conf *fc_conf);
1114 typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
1115  struct rte_eth_pfc_conf *pfc_conf);
1118 typedef int (*reta_update_t)(struct rte_eth_dev *dev,
1119  struct rte_eth_rss_reta_entry64 *reta_conf,
1120  uint16_t reta_size);
1123 typedef int (*reta_query_t)(struct rte_eth_dev *dev,
1124  struct rte_eth_rss_reta_entry64 *reta_conf,
1125  uint16_t reta_size);
1128 typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
1129  struct rte_eth_rss_conf *rss_conf);
1132 typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
1133  struct rte_eth_rss_conf *rss_conf);
1136 typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
1139 typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
1142 typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
1145 typedef void (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
1146  struct ether_addr *mac_addr,
1147  uint32_t index,
1148  uint32_t vmdq);
1151 typedef void (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
1152  struct ether_addr *mac_addr);
1155 typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
1156  struct ether_addr *mac_addr,
1157  uint8_t on);
1160 typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
1161  uint8_t on);
1164 typedef int (*eth_set_vf_rx_mode_t)(struct rte_eth_dev *dev,
1165  uint16_t vf,
1166  uint16_t rx_mode,
1167  uint8_t on);
1170 typedef int (*eth_set_vf_rx_t)(struct rte_eth_dev *dev,
1171  uint16_t vf,
1172  uint8_t on);
1175 typedef int (*eth_set_vf_tx_t)(struct rte_eth_dev *dev,
1176  uint16_t vf,
1177  uint8_t on);
1180 typedef int (*eth_set_vf_vlan_filter_t)(struct rte_eth_dev *dev,
1181  uint16_t vlan,
1182  uint64_t vf_mask,
1183  uint8_t vlan_on);
1186 typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
1187  uint16_t queue_idx,
1188  uint16_t tx_rate);
1191 typedef int (*eth_set_vf_rate_limit_t)(struct rte_eth_dev *dev,
1192  uint16_t vf,
1193  uint16_t tx_rate,
1194  uint64_t q_msk);
1197 typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
1198  struct rte_eth_mirror_conf *mirror_conf,
1199  uint8_t rule_id,
1200  uint8_t on);
1203 typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,
1204  uint8_t rule_id);
1207 typedef int (*eth_udp_tunnel_add_t)(struct rte_eth_dev *dev,
1208  struct rte_eth_udp_tunnel *tunnel_udp);
1211 typedef int (*eth_udp_tunnel_del_t)(struct rte_eth_dev *dev,
1212  struct rte_eth_udp_tunnel *tunnel_udp);
1215 typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
1216  struct ether_addr *mc_addr_set,
1217  uint32_t nb_mc_addr);
1220 typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
1223 typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
1226 typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
1227  struct timespec *timestamp,
1228  uint32_t flags);
1231 typedef int (*eth_timesync_read_tx_timestamp_t)(struct rte_eth_dev *dev,
1232  struct timespec *timestamp);
1235 typedef int (*eth_timesync_adjust_time)(struct rte_eth_dev *dev, int64_t);
1238 typedef int (*eth_timesync_read_time)(struct rte_eth_dev *dev,
1239  struct timespec *timestamp);
1242 typedef int (*eth_timesync_write_time)(struct rte_eth_dev *dev,
1243  const struct timespec *timestamp);
1246 typedef int (*eth_get_reg_length_t)(struct rte_eth_dev *dev);
1249 typedef int (*eth_get_reg_t)(struct rte_eth_dev *dev,
1250  struct rte_dev_reg_info *info);
1253 typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
1256 typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
1257  struct rte_dev_eeprom_info *info);
1260 typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
1261  struct rte_dev_eeprom_info *info);
1264 #ifdef RTE_NIC_BYPASS
1265 
1266 enum {
1267  RTE_BYPASS_MODE_NONE,
1268  RTE_BYPASS_MODE_NORMAL,
1269  RTE_BYPASS_MODE_BYPASS,
1270  RTE_BYPASS_MODE_ISOLATE,
1271  RTE_BYPASS_MODE_NUM,
1272 };
1273 
1274 #define RTE_BYPASS_MODE_VALID(x) \
1275  ((x) > RTE_BYPASS_MODE_NONE && (x) < RTE_BYPASS_MODE_NUM)
1276 
1277 enum {
1278  RTE_BYPASS_EVENT_NONE,
1279  RTE_BYPASS_EVENT_START,
1280  RTE_BYPASS_EVENT_OS_ON = RTE_BYPASS_EVENT_START,
1281  RTE_BYPASS_EVENT_POWER_ON,
1282  RTE_BYPASS_EVENT_OS_OFF,
1283  RTE_BYPASS_EVENT_POWER_OFF,
1284  RTE_BYPASS_EVENT_TIMEOUT,
1285  RTE_BYPASS_EVENT_NUM
1286 };
1287 
1288 #define RTE_BYPASS_EVENT_VALID(x) \
1289  ((x) > RTE_BYPASS_EVENT_NONE && (x) < RTE_BYPASS_MODE_NUM)
1290 
1291 enum {
1292  RTE_BYPASS_TMT_OFF, /* timeout disabled. */
1293  RTE_BYPASS_TMT_1_5_SEC, /* timeout for 1.5 seconds */
1294  RTE_BYPASS_TMT_2_SEC, /* timeout for 2 seconds */
1295  RTE_BYPASS_TMT_3_SEC, /* timeout for 3 seconds */
1296  RTE_BYPASS_TMT_4_SEC, /* timeout for 4 seconds */
1297  RTE_BYPASS_TMT_8_SEC, /* timeout for 8 seconds */
1298  RTE_BYPASS_TMT_16_SEC, /* timeout for 16 seconds */
1299  RTE_BYPASS_TMT_32_SEC, /* timeout for 32 seconds */
1300  RTE_BYPASS_TMT_NUM
1301 };
1302 
1303 #define RTE_BYPASS_TMT_VALID(x) \
1304  ((x) == RTE_BYPASS_TMT_OFF || \
1305  ((x) > RTE_BYPASS_TMT_OFF && (x) < RTE_BYPASS_TMT_NUM))
1306 
1307 typedef void (*bypass_init_t)(struct rte_eth_dev *dev);
1308 typedef int32_t (*bypass_state_set_t)(struct rte_eth_dev *dev, uint32_t *new_state);
1309 typedef int32_t (*bypass_state_show_t)(struct rte_eth_dev *dev, uint32_t *state);
1310 typedef int32_t (*bypass_event_set_t)(struct rte_eth_dev *dev, uint32_t state, uint32_t event);
1311 typedef int32_t (*bypass_event_show_t)(struct rte_eth_dev *dev, uint32_t event_shift, uint32_t *event);
1312 typedef int32_t (*bypass_wd_timeout_set_t)(struct rte_eth_dev *dev, uint32_t timeout);
1313 typedef int32_t (*bypass_wd_timeout_show_t)(struct rte_eth_dev *dev, uint32_t *wd_timeout);
1314 typedef int32_t (*bypass_ver_show_t)(struct rte_eth_dev *dev, uint32_t *ver);
1315 typedef int32_t (*bypass_wd_reset_t)(struct rte_eth_dev *dev);
1316 #endif
1317 
1318 typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
1319  enum rte_filter_type filter_type,
1320  enum rte_filter_op filter_op,
1321  void *arg);
1324 typedef int (*eth_get_dcb_info)(struct rte_eth_dev *dev,
1325  struct rte_eth_dcb_info *dcb_info);
1331 struct eth_dev_ops {
1332  eth_dev_configure_t dev_configure;
1333  eth_dev_start_t dev_start;
1334  eth_dev_stop_t dev_stop;
1335  eth_dev_set_link_up_t dev_set_link_up;
1336  eth_dev_set_link_down_t dev_set_link_down;
1337  eth_dev_close_t dev_close;
1338  eth_promiscuous_enable_t promiscuous_enable;
1339  eth_promiscuous_disable_t promiscuous_disable;
1340  eth_allmulticast_enable_t allmulticast_enable;
1341  eth_allmulticast_disable_t allmulticast_disable;
1342  eth_link_update_t link_update;
1343  eth_stats_get_t stats_get;
1344  eth_stats_reset_t stats_reset;
1345  eth_xstats_get_t xstats_get;
1346  eth_xstats_reset_t xstats_reset;
1347  eth_queue_stats_mapping_set_t queue_stats_mapping_set;
1349  eth_dev_infos_get_t dev_infos_get;
1350  mtu_set_t mtu_set;
1351  vlan_filter_set_t vlan_filter_set;
1352  vlan_tpid_set_t vlan_tpid_set;
1353  vlan_strip_queue_set_t vlan_strip_queue_set;
1354  vlan_offload_set_t vlan_offload_set;
1355  vlan_pvid_set_t vlan_pvid_set;
1356  eth_queue_start_t rx_queue_start;
1357  eth_queue_stop_t rx_queue_stop;
1358  eth_queue_start_t tx_queue_start;
1359  eth_queue_stop_t tx_queue_stop;
1360  eth_rx_queue_setup_t rx_queue_setup;
1361  eth_queue_release_t rx_queue_release;
1362  eth_rx_queue_count_t rx_queue_count;
1363  eth_rx_descriptor_done_t rx_descriptor_done;
1365  eth_rx_enable_intr_t rx_queue_intr_enable;
1367  eth_rx_disable_intr_t rx_queue_intr_disable;
1368  eth_tx_queue_setup_t tx_queue_setup;
1369  eth_queue_release_t tx_queue_release;
1370  eth_dev_led_on_t dev_led_on;
1371  eth_dev_led_off_t dev_led_off;
1372  flow_ctrl_get_t flow_ctrl_get;
1373  flow_ctrl_set_t flow_ctrl_set;
1374  priority_flow_ctrl_set_t priority_flow_ctrl_set;
1375  eth_mac_addr_remove_t mac_addr_remove;
1376  eth_mac_addr_add_t mac_addr_add;
1377  eth_mac_addr_set_t mac_addr_set;
1378  eth_uc_hash_table_set_t uc_hash_table_set;
1379  eth_uc_all_hash_table_set_t uc_all_hash_table_set;
1380  eth_mirror_rule_set_t mirror_rule_set;
1381  eth_mirror_rule_reset_t mirror_rule_reset;
1382  eth_set_vf_rx_mode_t set_vf_rx_mode;
1383  eth_set_vf_rx_t set_vf_rx;
1384  eth_set_vf_tx_t set_vf_tx;
1385  eth_set_vf_vlan_filter_t set_vf_vlan_filter;
1386  eth_udp_tunnel_add_t udp_tunnel_add;
1387  eth_udp_tunnel_del_t udp_tunnel_del;
1388  eth_set_queue_rate_limit_t set_queue_rate_limit;
1389  eth_set_vf_rate_limit_t set_vf_rate_limit;
1391  reta_update_t reta_update;
1393  reta_query_t reta_query;
1394 
1395  eth_get_reg_length_t get_reg_length;
1397  eth_get_reg_t get_reg;
1399  eth_get_eeprom_length_t get_eeprom_length;
1401  eth_get_eeprom_t get_eeprom;
1403  eth_set_eeprom_t set_eeprom;
1405  /* bypass control */
1406 #ifdef RTE_NIC_BYPASS
1407  bypass_init_t bypass_init;
1408  bypass_state_set_t bypass_state_set;
1409  bypass_state_show_t bypass_state_show;
1410  bypass_event_set_t bypass_event_set;
1411  bypass_event_show_t bypass_event_show;
1412  bypass_wd_timeout_set_t bypass_wd_timeout_set;
1413  bypass_wd_timeout_show_t bypass_wd_timeout_show;
1414  bypass_ver_show_t bypass_ver_show;
1415  bypass_wd_reset_t bypass_wd_reset;
1416 #endif
1417 
1419  rss_hash_update_t rss_hash_update;
1421  rss_hash_conf_get_t rss_hash_conf_get;
1422  eth_filter_ctrl_t filter_ctrl;
1424  eth_set_mc_addr_list_t set_mc_addr_list;
1425  eth_rxq_info_get_t rxq_info_get;
1427  eth_txq_info_get_t txq_info_get;
1430  eth_timesync_enable_t timesync_enable;
1432  eth_timesync_disable_t timesync_disable;
1434  eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
1436  eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
1437 
1439  eth_get_dcb_info get_dcb_info;
1441  eth_timesync_adjust_time timesync_adjust_time;
1443  eth_timesync_read_time timesync_read_time;
1445  eth_timesync_write_time timesync_write_time;
1446 };
1447 
1470 typedef uint16_t (*rte_rx_callback_fn)(uint8_t port, uint16_t queue,
1471  struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts,
1472  void *user_param);
1473 
1494 typedef uint16_t (*rte_tx_callback_fn)(uint8_t port, uint16_t queue,
1495  struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param);
1496 
1502 struct rte_eth_rxtx_callback {
1503  struct rte_eth_rxtx_callback *next;
1504  union{
1505  rte_rx_callback_fn rx;
1506  rte_tx_callback_fn tx;
1507  } fn;
1508  void *param;
1509 };
1510 
1520 };
1521 
1532 struct rte_eth_dev {
1533  eth_rx_burst_t rx_pkt_burst;
1534  eth_tx_burst_t tx_pkt_burst;
1535  struct rte_eth_dev_data *data;
1536  const struct eth_driver *driver;
1537  const struct eth_dev_ops *dev_ops;
1538  struct rte_pci_device *pci_dev;
1540  struct rte_eth_dev_cb_list link_intr_cbs;
1545  struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
1550  struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
1551  uint8_t attached;
1552  enum rte_eth_dev_type dev_type;
1553 };
1554 
1555 struct rte_eth_dev_sriov {
1556  uint8_t active;
1557  uint8_t nb_q_per_pool;
1558  uint16_t def_vmdq_idx;
1559  uint16_t def_pool_q_idx;
1560 };
1561 #define RTE_ETH_DEV_SRIOV(dev) ((dev)->data->sriov)
1562 
1563 #define RTE_ETH_NAME_MAX_LEN (32)
1564 
1572 struct rte_eth_dev_data {
1573  char name[RTE_ETH_NAME_MAX_LEN];
1575  void **rx_queues;
1576  void **tx_queues;
1577  uint16_t nb_rx_queues;
1578  uint16_t nb_tx_queues;
1580  struct rte_eth_dev_sriov sriov;
1582  void *dev_private;
1584  struct rte_eth_link dev_link;
1587  struct rte_eth_conf dev_conf;
1588  uint16_t mtu;
1590  uint32_t min_rx_buf_size;
1593  uint64_t rx_mbuf_alloc_failed;
1594  struct ether_addr* mac_addrs;
1595  uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
1597  struct ether_addr* hash_mac_addrs;
1599  uint8_t port_id;
1600  uint8_t promiscuous : 1,
1601  scattered_rx : 1,
1602  all_multicast : 1,
1603  dev_started : 1,
1604  lro : 1;
1605  uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
1607  uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
1609  uint32_t dev_flags;
1610  enum rte_kernel_driver kdrv;
1611  int numa_node;
1612  const char *drv_name;
1613 };
1614 
1616 #define RTE_ETH_DEV_DETACHABLE 0x0001
1617 
1618 #define RTE_ETH_DEV_INTR_LSC 0x0002
1619 
1620 #define RTE_ETH_DEV_BONDED_SLAVE 0x0004
1621 
1627 extern struct rte_eth_dev rte_eth_devices[];
1628 
1642 extern uint8_t rte_eth_dev_count(void);
1643 
1653 extern struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
1654 
1665 struct rte_eth_dev *rte_eth_dev_allocate(const char *name,
1666  enum rte_eth_dev_type type);
1667 
1677 int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
1678 
1691 int rte_eth_dev_attach(const char *devargs, uint8_t *port_id);
1692 
1705 int rte_eth_dev_detach(uint8_t port_id, char *devname);
1706 
1707 struct eth_driver;
1738 typedef int (*eth_dev_init_t)(struct rte_eth_dev *eth_dev);
1739 
1755 typedef int (*eth_dev_uninit_t)(struct rte_eth_dev *eth_dev);
1756 
1772 struct eth_driver {
1773  struct rte_pci_driver pci_drv;
1774  eth_dev_init_t eth_dev_init;
1775  eth_dev_uninit_t eth_dev_uninit;
1776  unsigned int dev_private_size;
1777 };
1778 
1789 extern void rte_eth_driver_register(struct eth_driver *eth_drv);
1790 
1820 extern int rte_eth_dev_configure(uint8_t port_id,
1821  uint16_t nb_rx_queue,
1822  uint16_t nb_tx_queue,
1823  const struct rte_eth_conf *eth_conf);
1824 
1864 extern int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id,
1865  uint16_t nb_rx_desc, unsigned int socket_id,
1866  const struct rte_eth_rxconf *rx_conf,
1867  struct rte_mempool *mb_pool);
1868 
1912 extern int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id,
1913  uint16_t nb_tx_desc, unsigned int socket_id,
1914  const struct rte_eth_txconf *tx_conf);
1915 
1916 /*
1917  * Return the NUMA socket to which an Ethernet device is connected
1918  *
1919  * @param port_id
1920  * The port identifier of the Ethernet device
1921  * @return
1922  * The NUMA socket id to which the Ethernet device is connected or
1923  * a default of zero if the socket could not be determined.
1924  * -1 is returned is the port_id value is out of range.
1925  */
1926 extern int rte_eth_dev_socket_id(uint8_t port_id);
1927 
1928 /*
1929  * Check if port_id of device is attached
1930  *
1931  * @param port_id
1932  * The port identifier of the Ethernet device
1933  * @return
1934  * - 0 if port is out of range or not attached
1935  * - 1 if device is attached
1936  */
1937 extern int rte_eth_dev_is_valid_port(uint8_t port_id);
1938 
1939 /*
1940  * Allocate mbuf from mempool, setup the DMA physical address
1941  * and then start RX for specified queue of a port. It is used
1942  * when rx_deferred_start flag of the specified queue is true.
1943  *
1944  * @param port_id
1945  * The port identifier of the Ethernet device
1946  * @param rx_queue_id
1947  * The index of the rx queue to update the ring.
1948  * The value must be in the range [0, nb_rx_queue - 1] previously supplied
1949  * to rte_eth_dev_configure().
1950  * @return
1951  * - 0: Success, the transmit queue is correctly set up.
1952  * - -EINVAL: The port_id or the queue_id out of range.
1953  * - -ENOTSUP: The function not supported in PMD driver.
1954  */
1955 extern int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id);
1956 
1957 /*
1958  * Stop specified RX queue of a port
1959  *
1960  * @param port_id
1961  * The port identifier of the Ethernet device
1962  * @param rx_queue_id
1963  * The index of the rx queue to update the ring.
1964  * The value must be in the range [0, nb_rx_queue - 1] previously supplied
1965  * to rte_eth_dev_configure().
1966  * @return
1967  * - 0: Success, the transmit queue is correctly set up.
1968  * - -EINVAL: The port_id or the queue_id out of range.
1969  * - -ENOTSUP: The function not supported in PMD driver.
1970  */
1971 extern int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id);
1972 
1973 /*
1974  * Start TX for specified queue of a port. It is used when tx_deferred_start
1975  * flag of the specified queue is true.
1976  *
1977  * @param port_id
1978  * The port identifier of the Ethernet device
1979  * @param tx_queue_id
1980  * The index of the tx queue to update the ring.
1981  * The value must be in the range [0, nb_tx_queue - 1] previously supplied
1982  * to rte_eth_dev_configure().
1983  * @return
1984  * - 0: Success, the transmit queue is correctly set up.
1985  * - -EINVAL: The port_id or the queue_id out of range.
1986  * - -ENOTSUP: The function not supported in PMD driver.
1987  */
1988 extern int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id);
1989 
1990 /*
1991  * Stop specified TX queue of a port
1992  *
1993  * @param port_id
1994  * The port identifier of the Ethernet device
1995  * @param tx_queue_id
1996  * The index of the tx queue to update the ring.
1997  * The value must be in the range [0, nb_tx_queue - 1] previously supplied
1998  * to rte_eth_dev_configure().
1999  * @return
2000  * - 0: Success, the transmit queue is correctly set up.
2001  * - -EINVAL: The port_id or the queue_id out of range.
2002  * - -ENOTSUP: The function not supported in PMD driver.
2003  */
2004 extern int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id);
2005 
2006 
2007 
2023 extern int rte_eth_dev_start(uint8_t port_id);
2024 
2032 extern void rte_eth_dev_stop(uint8_t port_id);
2033 
2034 
2047 extern int rte_eth_dev_set_link_up(uint8_t port_id);
2048 
2058 extern int rte_eth_dev_set_link_down(uint8_t port_id);
2059 
2068 extern void rte_eth_dev_close(uint8_t port_id);
2069 
2076 extern void rte_eth_promiscuous_enable(uint8_t port_id);
2077 
2084 extern void rte_eth_promiscuous_disable(uint8_t port_id);
2085 
2096 extern int rte_eth_promiscuous_get(uint8_t port_id);
2097 
2104 extern void rte_eth_allmulticast_enable(uint8_t port_id);
2105 
2112 extern void rte_eth_allmulticast_disable(uint8_t port_id);
2113 
2124 extern int rte_eth_allmulticast_get(uint8_t port_id);
2125 
2137 extern void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link);
2138 
2150 extern void rte_eth_link_get_nowait(uint8_t port_id,
2151  struct rte_eth_link *link);
2152 
2170 extern int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats);
2171 
2178 extern void rte_eth_stats_reset(uint8_t port_id);
2179 
2201 extern int rte_eth_xstats_get(uint8_t port_id,
2202  struct rte_eth_xstats *xstats, unsigned n);
2203 
2210 extern void rte_eth_xstats_reset(uint8_t port_id);
2211 
2229 extern int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id,
2230  uint16_t tx_queue_id,
2231  uint8_t stat_idx);
2232 
2250 extern int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id,
2251  uint16_t rx_queue_id,
2252  uint8_t stat_idx);
2253 
2263 extern void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr);
2264 
2274 extern void rte_eth_dev_info_get(uint8_t port_id,
2275  struct rte_eth_dev_info *dev_info);
2276 
2288 extern int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu);
2289 
2303 extern int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu);
2304 
2323 extern int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id , int on);
2324 
2344 extern int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id,
2345  uint16_t rx_queue_id, int on);
2346 
2361 extern int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, uint16_t tag_type);
2362 
2383 extern int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask);
2384 
2397 extern int rte_eth_dev_get_vlan_offload(uint8_t port_id);
2398 
2413 extern int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on);
2414 
2497 static inline uint16_t
2498 rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id,
2499  struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
2500 {
2501  struct rte_eth_dev *dev = &rte_eth_devices[port_id];
2502 
2503 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
2504  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
2505  RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
2506 
2507  if (queue_id >= dev->data->nb_rx_queues) {
2508  RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", queue_id);
2509  return 0;
2510  }
2511 #endif
2512  int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id],
2513  rx_pkts, nb_pkts);
2514 
2515 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
2516  struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id];
2517 
2518  if (unlikely(cb != NULL)) {
2519  do {
2520  nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx,
2521  nb_pkts, cb->param);
2522  cb = cb->next;
2523  } while (cb != NULL);
2524  }
2525 #endif
2526 
2527  return nb_rx;
2528 }
2529 
2542 static inline int
2543 rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id)
2544 {
2545  struct rte_eth_dev *dev = &rte_eth_devices[port_id];
2546  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
2547  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_count, -ENOTSUP);
2548  return (*dev->dev_ops->rx_queue_count)(dev, queue_id);
2549 }
2550 
2566 static inline int
2567 rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset)
2568 {
2569  struct rte_eth_dev *dev = &rte_eth_devices[port_id];
2570  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
2571  RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_done, -ENOTSUP);
2572  return (*dev->dev_ops->rx_descriptor_done)( \
2573  dev->data->rx_queues[queue_id], offset);
2574 }
2575 
2634 static inline uint16_t
2635 rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id,
2636  struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
2637 {
2638  struct rte_eth_dev *dev = &rte_eth_devices[port_id];
2639 
2640 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
2641  RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
2642  RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
2643 
2644  if (queue_id >= dev->data->nb_tx_queues) {
2645  RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", queue_id);
2646  return 0;
2647  }
2648 #endif
2649 
2650 #ifdef RTE_ETHDEV_RXTX_CALLBACKS
2651  struct rte_eth_rxtx_callback *cb = dev->pre_tx_burst_cbs[queue_id];
2652 
2653  if (unlikely(cb != NULL)) {
2654  do {
2655  nb_pkts = cb->fn.tx(port_id, queue_id, tx_pkts, nb_pkts,
2656  cb->param);
2657  cb = cb->next;
2658  } while (cb != NULL);
2659  }
2660 #endif
2661 
2662  return (*dev->tx_pkt_burst)(dev->data->tx_queues[queue_id], tx_pkts, nb_pkts);
2663 }
2664 
2672 };
2673 
2674 typedef void (*rte_eth_dev_cb_fn)(uint8_t port_id, \
2675  enum rte_eth_event_type event, void *cb_arg);
2696 int rte_eth_dev_callback_register(uint8_t port_id,
2697  enum rte_eth_event_type event,
2698  rte_eth_dev_cb_fn cb_fn, void *cb_arg);
2699 
2717 int rte_eth_dev_callback_unregister(uint8_t port_id,
2718  enum rte_eth_event_type event,
2719  rte_eth_dev_cb_fn cb_fn, void *cb_arg);
2720 
2734 void _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
2735  enum rte_eth_event_type event);
2736 
2757 int rte_eth_dev_rx_intr_enable(uint8_t port_id, uint16_t queue_id);
2758 
2778 int rte_eth_dev_rx_intr_disable(uint8_t port_id, uint16_t queue_id);
2779 
2797 int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data);
2798 
2820 int rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id,
2821  int epfd, int op, void *data);
2822 
2835 int rte_eth_led_on(uint8_t port_id);
2836 
2849 int rte_eth_led_off(uint8_t port_id);
2850 
2863 int rte_eth_dev_flow_ctrl_get(uint8_t port_id,
2864  struct rte_eth_fc_conf *fc_conf);
2865 
2880 int rte_eth_dev_flow_ctrl_set(uint8_t port_id,
2881  struct rte_eth_fc_conf *fc_conf);
2882 
2898 int rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id,
2899  struct rte_eth_pfc_conf *pfc_conf);
2900 
2919 int rte_eth_dev_mac_addr_add(uint8_t port, struct ether_addr *mac_addr,
2920  uint32_t pool);
2921 
2935 int rte_eth_dev_mac_addr_remove(uint8_t port, struct ether_addr *mac_addr);
2936 
2950 int rte_eth_dev_default_mac_addr_set(uint8_t port, struct ether_addr *mac_addr);
2951 
2952 
2968 int rte_eth_dev_rss_reta_update(uint8_t port,
2969  struct rte_eth_rss_reta_entry64 *reta_conf,
2970  uint16_t reta_size);
2971 
2987 int rte_eth_dev_rss_reta_query(uint8_t port,
2988  struct rte_eth_rss_reta_entry64 *reta_conf,
2989  uint16_t reta_size);
2990 
3009 int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr,
3010  uint8_t on);
3011 
3029 int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on);
3030 
3053 int rte_eth_dev_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mode,
3054  uint8_t on);
3055 
3072 int
3073 rte_eth_dev_set_vf_tx(uint8_t port,uint16_t vf, uint8_t on);
3074 
3091 int
3092 rte_eth_dev_set_vf_rx(uint8_t port,uint16_t vf, uint8_t on);
3093 
3113 int
3114 rte_eth_dev_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id,
3115  uint64_t vf_mask,
3116  uint8_t vlan_on);
3117 
3139 int rte_eth_mirror_rule_set(uint8_t port_id,
3140  struct rte_eth_mirror_conf *mirror_conf,
3141  uint8_t rule_id,
3142  uint8_t on);
3143 
3157 int rte_eth_mirror_rule_reset(uint8_t port_id,
3158  uint8_t rule_id);
3159 
3175 int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
3176  uint16_t tx_rate);
3177 
3195 int rte_eth_set_vf_rate_limit(uint8_t port_id, uint16_t vf,
3196  uint16_t tx_rate, uint64_t q_msk);
3197 
3209 int rte_eth_dev_bypass_init(uint8_t port);
3210 
3226 int rte_eth_dev_bypass_state_show(uint8_t port, uint32_t *state);
3227 
3243 int rte_eth_dev_bypass_state_set(uint8_t port, uint32_t *new_state);
3244 
3267 int rte_eth_dev_bypass_event_show(uint8_t port, uint32_t event, uint32_t *state);
3268 
3291 int rte_eth_dev_bypass_event_store(uint8_t port, uint32_t event, uint32_t state);
3292 
3313 int rte_eth_dev_wd_timeout_store(uint8_t port, uint32_t timeout);
3314 
3327 int rte_eth_dev_bypass_ver_show(uint8_t port, uint32_t *ver);
3328 
3349 int rte_eth_dev_bypass_wd_timeout_show(uint8_t port, uint32_t *wd_timeout);
3350 
3361 int rte_eth_dev_bypass_wd_reset(uint8_t port);
3362 
3376 int rte_eth_dev_rss_hash_update(uint8_t port_id,
3377  struct rte_eth_rss_conf *rss_conf);
3378 
3392 int
3393 rte_eth_dev_rss_hash_conf_get(uint8_t port_id,
3394  struct rte_eth_rss_conf *rss_conf);
3395 
3410 int
3411 rte_eth_dev_udp_tunnel_add(uint8_t port_id,
3412  struct rte_eth_udp_tunnel *tunnel_udp);
3413 
3427 int
3428 rte_eth_dev_udp_tunnel_delete(uint8_t port_id,
3429  struct rte_eth_udp_tunnel *tunnel_udp);
3430 
3444 int rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type);
3445 
3464 int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type,
3465  enum rte_filter_op filter_op, void *arg);
3466 
3479 int rte_eth_dev_get_dcb_info(uint8_t port_id,
3480  struct rte_eth_dcb_info *dcb_info);
3481 
3506 void *rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id,
3507  rte_rx_callback_fn fn, void *user_param);
3508 
3533 void *rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id,
3534  rte_tx_callback_fn fn, void *user_param);
3535 
3566 int rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id,
3567  struct rte_eth_rxtx_callback *user_cb);
3568 
3599 int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id,
3600  struct rte_eth_rxtx_callback *user_cb);
3601 
3619 int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id,
3620  struct rte_eth_rxq_info *qinfo);
3621 
3639 int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id,
3640  struct rte_eth_txq_info *qinfo);
3641 
3642 /*
3643  * Retrieve number of available registers for access
3644  *
3645  * @param port_id
3646  * The port identifier of the Ethernet device.
3647  * @return
3648  * - (>=0) number of registers if successful.
3649  * - (-ENOTSUP) if hardware doesn't support.
3650  * - (-ENODEV) if *port_id* invalid.
3651  * - others depends on the specific operations implementation.
3652  */
3653 int rte_eth_dev_get_reg_length(uint8_t port_id);
3654 
3668 int rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info);
3669 
3681 int rte_eth_dev_get_eeprom_length(uint8_t port_id);
3682 
3697 int rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info);
3698 
3713 int rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info);
3714 
3732 int rte_eth_dev_set_mc_addr_list(uint8_t port_id,
3733  struct ether_addr *mc_addr_set,
3734  uint32_t nb_mc_addr);
3735 
3747 extern int rte_eth_timesync_enable(uint8_t port_id);
3748 
3760 extern int rte_eth_timesync_disable(uint8_t port_id);
3761 
3779 extern int rte_eth_timesync_read_rx_timestamp(uint8_t port_id,
3780  struct timespec *timestamp,
3781  uint32_t flags);
3782 
3797 extern int rte_eth_timesync_read_tx_timestamp(uint8_t port_id,
3798  struct timespec *timestamp);
3799 
3816 extern int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta);
3817 
3832 extern int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time);
3833 
3851 extern int rte_eth_timesync_write_time(uint8_t port_id,
3852  const struct timespec *time);
3853 
3865 extern void rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_dev);
3866 
3867 
3887 const struct rte_memzone *
3888 rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name,
3889  uint16_t queue_id, size_t size,
3890  unsigned align, int socket_id);
3891 
3892 #ifdef __cplusplus
3893 }
3894 #endif
3895 
3896 #endif /* _RTE_ETHDEV_H_ */
int rte_eth_dev_get_vlan_offload(uint8_t port_id)
int rte_eth_dev_bypass_state_show(uint8_t port, uint32_t *state)
uint32_t txq_flags
Definition: rte_ethdev.h:655
uint64_t fdirmiss __rte_deprecated
Definition: rte_ethdev.h:214
#define ETH_VMDQ_MAX_VLAN_FILTERS
Definition: rte_ethdev.h:452
int rte_eth_dev_flow_ctrl_get(uint8_t port_id, struct rte_eth_fc_conf *fc_conf)
uint64_t ilbpackets
Definition: rte_ethdev.h:234
uint16_t(* rte_rx_callback_fn)(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param)
Definition: rte_ethdev.h:1470
uint16_t tx_rs_thresh
Definition: rte_ethdev.h:651
int rte_eth_dev_bypass_event_show(uint8_t port, uint32_t event, uint32_t *state)
int rte_eth_dev_bypass_ver_show(uint8_t port, uint32_t *ver)
int rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info)
uint16_t nb_desc
Definition: rte_ethdev.h:874
rte_eth_dev_type
Definition: rte_ethdev.h:1514
int rte_eth_timesync_read_tx_timestamp(uint8_t port_id, struct timespec *timestamp)
void rte_eth_stats_reset(uint8_t port_id)
int rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type)
void rte_eth_allmulticast_disable(uint8_t port_id)
int rte_eth_dev_attach(const char *devargs, uint8_t *port_id)
rte_eth_nb_tcs
Definition: rte_ethdev.h:531
uint8_t port
Definition: rte_mbuf.h:762
uint64_t q_errors[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:232
int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb)
int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg)
rte_fdir_pballoc_type
Definition: rte_ethdev.h:707
int rte_eth_dev_bypass_event_store(uint8_t port, uint32_t event, uint32_t state)
int rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_queue, uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf)
uint64_t imissed
Definition: rte_ethdev.h:199
uint32_t low_water
Definition: rte_ethdev.h:685
int rte_eth_dev_callback_unregister(uint8_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg)
int rte_eth_dev_bypass_state_set(uint8_t port, uint32_t *new_state)
uint32_t max_rx_pkt_len
Definition: rte_ethdev.h:340
int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on)
uint8_t rss_key_len
Definition: rte_ethdev.h:372
int rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, struct rte_eth_pfc_conf *pfc_conf)
uint8_t hthresh
Definition: rte_ethdev.h:272
uint64_t ibadlen __rte_deprecated
Definition: rte_ethdev.h:205
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)
int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, struct rte_eth_rxq_info *qinfo)
void rte_eth_dev_stop(uint8_t port_id)
uint32_t lpbk_mode
Definition: rte_ethdev.h:769
int rte_eth_dev_rss_reta_update(uint8_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size)
void rte_eth_xstats_reset(uint8_t port_id)
void rte_eth_promiscuous_disable(uint8_t port_id)
int rte_eth_dev_start(uint8_t port_id)
uint64_t rx_pause_xon __rte_deprecated
Definition: rte_ethdev.h:218
int rte_eth_dev_udp_tunnel_delete(uint8_t port_id, struct rte_eth_udp_tunnel *tunnel_udp)
rte_eth_tx_mq_mode
Definition: rte_ethdev.h:320
rte_eth_fc_mode
Definition: rte_ethdev.h:671
uint8_t enable_default_pool
Definition: rte_ethdev.h:583
int rte_eth_dev_rss_hash_conf_get(uint8_t port_id, struct rte_eth_rss_conf *rss_conf)
int rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *time)
int rte_eth_mirror_rule_set(uint8_t port_id, struct rte_eth_mirror_conf *mirror_conf, uint8_t rule_id, uint8_t on)
int rte_eth_mirror_rule_reset(uint8_t port_id, uint8_t rule_id)
uint64_t q_obytes[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:230
int rte_eth_dev_rx_intr_enable(uint8_t port_id, uint16_t queue_id)
int rte_eth_allmulticast_get(uint8_t port_id)
uint64_t opackets
Definition: rte_ethdev.h:196
rte_filter_op
Definition: rte_eth_ctrl.h:98
int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time)
uint16_t split_hdr_size
Definition: rte_ethdev.h:341
static int rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id)
Definition: rte_ethdev.h:2543
struct rte_mempool * mp
Definition: rte_ethdev.h:862
uint32_t dcb_capability_en
Definition: rte_ethdev.h:793
uint64_t tx_pause_xoff __rte_deprecated
Definition: rte_ethdev.h:220
#define ETH_NUM_RECEIVE_MAC_ADDR
Definition: rte_ethdev.h:473
uint64_t q_ibytes[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:228
uint16_t(* rte_tx_callback_fn)(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param)
Definition: rte_ethdev.h:1494
void * rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, rte_tx_callback_fn fn, void *user_param)
int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu)
int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on)
int rte_eth_dev_get_dcb_info(uint8_t port_id, struct rte_eth_dcb_info *dcb_info)
int rte_eth_set_vf_rate_limit(uint8_t port_id, uint16_t vf, uint16_t tx_rate, uint64_t q_msk)
uint64_t olbpackets
Definition: rte_ethdev.h:236
uint64_t rx_pause_xoff __rte_deprecated
Definition: rte_ethdev.h:222
int rte_eth_promiscuous_get(uint8_t port_id)
int rte_eth_dev_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mode, uint8_t on)
uint8_t rx_deferred_start
Definition: rte_ethdev.h:630
void rte_eth_promiscuous_enable(uint8_t port_id)
uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:224
uint32_t high_water
Definition: rte_ethdev.h:684
uint16_t lsc
Definition: rte_ethdev.h:752
uint64_t fdirmatch __rte_deprecated
Definition: rte_ethdev.h:212
int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu)
#define RTE_ETH_XSTATS_NAME_SIZE
Definition: rte_ethdev.h:878
int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats)
int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta)
void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info)
int rte_eth_timesync_disable(uint8_t port_id)
uint16_t send_xon
Definition: rte_ethdev.h:687
int rte_eth_dev_bypass_wd_timeout_show(uint8_t port, uint32_t *wd_timeout)
#define unlikely(x)
uint16_t nb_max
Definition: rte_ethdev.h:663
uint64_t ibytes
Definition: rte_ethdev.h:197
uint64_t oerrors
Definition: rte_ethdev.h:208
int rte_eth_timesync_read_rx_timestamp(uint8_t port_id, struct timespec *timestamp, uint32_t flags)
uint64_t ibadcrc __rte_deprecated
Definition: rte_ethdev.h:203
void rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *link)
uint16_t tx_free_thresh
Definition: rte_ethdev.h:652
int rte_eth_dev_rss_hash_update(uint8_t port_id, struct rte_eth_rss_conf *rss_conf)
uint16_t nb_desc
Definition: rte_ethdev.h:865
void rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_dev)
int rte_eth_dev_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, uint32_t pool)
int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, struct rte_eth_txq_info *qinfo)
uint8_t scattered_rx
Definition: rte_ethdev.h:864
int rte_eth_dev_set_link_down(uint8_t port_id)
uint64_t q_opackets[RTE_ETHDEV_QUEUE_STAT_CNTRS]
Definition: rte_ethdev.h:226
int rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info)
int rte_eth_dev_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on)
int rte_eth_led_off(uint8_t port_id)
int rte_eth_dev_mac_addr_remove(uint8_t port, struct ether_addr *mac_addr)
uint64_t obytes
Definition: rte_ethdev.h:198
int rte_eth_dev_bypass_init(uint8_t port)
int rte_eth_dev_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on)
void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link)
uint16_t link_speed
Definition: rte_ethdev.h:763
int rte_eth_rx_queue_setup(uint8_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)
#define ETH_DCB_NUM_USER_PRIORITIES
Definition: rte_ethdev.h:453
int rte_eth_dev_uc_all_hash_table_set(uint8_t port, uint8_t on)
uint16_t rx_free_thresh
Definition: rte_ethdev.h:628
uint16_t link_duplex
Definition: rte_ethdev.h:765
int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, uint16_t rx_queue_id, uint8_t stat_idx)
uint64_t ierrors
Definition: rte_ethdev.h:207
static uint16_t rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
Definition: rte_ethdev.h:2635
uint64_t ilbbytes
Definition: rte_ethdev.h:238
uint8_t rte_eth_dev_count(void)
uint8_t priority
Definition: rte_ethdev.h:700
TAILQ_HEAD(rte_driver_list, rte_driver)
int rte_eth_dev_wd_timeout_store(uint8_t port, uint32_t timeout)
int rte_eth_dev_flow_ctrl_set(uint8_t port_id, struct rte_eth_fc_conf *fc_conf)
int rte_eth_timesync_enable(uint8_t port_id)
int rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, int epfd, int op, void *data)
uint64_t ipackets
Definition: rte_ethdev.h:195
uint16_t pause_time
Definition: rte_ethdev.h:686
rte_filter_type
Definition: rte_eth_ctrl.h:82
uint64_t rx_nombuf
Definition: rte_ethdev.h:211
int rte_eth_dev_set_link_up(uint8_t port_id)
int rte_eth_dev_detach(uint8_t port_id, char *devname)
#define ETH_MQ_RX_RSS_FLAG
Definition: rte_ethdev.h:279
uint64_t olbbytes
Definition: rte_ethdev.h:240
int rte_eth_dev_set_mc_addr_list(uint8_t port_id, struct ether_addr *mc_addr_set, uint32_t nb_mc_addr)
int rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb)
rte_eth_nb_pools
Definition: rte_ethdev.h:540
int rte_eth_led_on(uint8_t port_id)
#define ETH_MIRROR_MAX_VLANS
Definition: rte_ethdev.h:486
uint16_t nb_align
Definition: rte_ethdev.h:665
int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, uint16_t tx_rate)
rte_eth_rx_mq_mode
Definition: rte_ethdev.h:287
int rte_eth_dev_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, uint64_t vf_mask, uint8_t vlan_on)
void(* rte_eth_dev_cb_fn)(uint8_t port_id, enum rte_eth_event_type event, void *cb_arg)
Definition: rte_ethdev.h:2674
static int rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset)
Definition: rte_ethdev.h:2567
void rte_eth_allmulticast_enable(uint8_t port_id)
void rte_eth_dev_close(uint8_t port_id)
int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf)
int rte_eth_dev_rss_reta_query(uint8_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size)
int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, int on)
char name[RTE_MEMZONE_NAMESIZE]
Definition: rte_memzone.h:78
int rte_eth_dev_udp_tunnel_add(uint8_t port_id, struct rte_eth_udp_tunnel *tunnel_udp)
uint64_t rss_hf
Definition: rte_ethdev.h:373
int rte_eth_dev_uc_hash_table_set(uint8_t port, struct ether_addr *addr, uint8_t on)
static uint16_t rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)
Definition: rte_ethdev.h:2498
int rte_eth_dev_rx_intr_disable(uint8_t port_id, uint16_t queue_id)
uint8_t mac_ctrl_frame_fwd
Definition: rte_ethdev.h:689
uint16_t rxq
Definition: rte_ethdev.h:754
int rte_eth_dev_get_eeprom_length(uint8_t port_id)
int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats, unsigned n)
rte_fdir_mode
Definition: rte_eth_ctrl.h:652
uint8_t * rss_key
Definition: rte_ethdev.h:371
rte_fdir_status_mode
Definition: rte_ethdev.h:716
uint8_t tx_deferred_start
Definition: rte_ethdev.h:656
uint8_t wthresh
Definition: rte_ethdev.h:273
int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask)
int rte_eth_dev_bypass_wd_reset(uint8_t port)
int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, uint16_t tag_type)
uint8_t rx_drop_en
Definition: rte_ethdev.h:629
void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr)
int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, uint16_t tx_queue_id, uint8_t stat_idx)
uint16_t nb_min
Definition: rte_ethdev.h:664
uint16_t max_vfs
Definition: rte_pci.h:165
int rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info)
uint8_t pthresh
Definition: rte_ethdev.h:271
int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data)
int rte_eth_dev_callback_register(uint8_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg)
void * rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param)
uint8_t drop_queue
Definition: rte_ethdev.h:733
uint64_t imcasts
Definition: rte_ethdev.h:209
uint64_t tx_pause_xon __rte_deprecated
Definition: rte_ethdev.h:216
uint8_t autoneg
Definition: rte_ethdev.h:690
int rte_eth_dev_default_mac_addr_set(uint8_t port, struct ether_addr *mac_addr)
#define __rte_cache_aligned
Definition: rte_memory.h:85
rte_eth_event_type
Definition: rte_ethdev.h:2668