DPDK  21.08.0
rte_ethdev_core.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2017 Intel Corporation
3  */
4 
5 #ifndef _RTE_ETHDEV_CORE_H_
6 #define _RTE_ETHDEV_CORE_H_
7 
8 #include <pthread.h>
9 
22 struct rte_eth_dev_callback;
24 TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
25 
26 struct rte_eth_dev;
27 
28 typedef uint16_t (*eth_rx_burst_t)(void *rxq,
29  struct rte_mbuf **rx_pkts,
30  uint16_t nb_pkts);
33 typedef uint16_t (*eth_tx_burst_t)(void *txq,
34  struct rte_mbuf **tx_pkts,
35  uint16_t nb_pkts);
38 typedef uint16_t (*eth_tx_prep_t)(void *txq,
39  struct rte_mbuf **tx_pkts,
40  uint16_t nb_pkts);
44 typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
45  uint16_t rx_queue_id);
48 typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
51 typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
54 typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
63 struct rte_eth_rxtx_callback {
64  struct rte_eth_rxtx_callback *next;
65  union{
68  } fn;
69  void *param;
70 };
71 
82 struct rte_eth_dev {
83  eth_rx_burst_t rx_pkt_burst;
84  eth_tx_burst_t tx_pkt_burst;
85  eth_tx_prep_t tx_pkt_prepare;
87  eth_rx_queue_count_t rx_queue_count;
88  eth_rx_descriptor_done_t rx_descriptor_done;
89  eth_rx_descriptor_status_t rx_descriptor_status;
90  eth_tx_descriptor_status_t tx_descriptor_status;
97  struct rte_eth_dev_data *data;
98  void *process_private;
99  const struct eth_dev_ops *dev_ops;
100  struct rte_device *device;
101  struct rte_intr_handle *intr_handle;
103  struct rte_eth_dev_cb_list link_intr_cbs;
108  struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
113  struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
114  enum rte_eth_dev_state state;
115  void *security_ctx;
117  uint64_t reserved_64s[4];
118  void *reserved_ptrs[4];
120 
121 struct rte_eth_dev_sriov;
122 struct rte_eth_dev_owner;
123 
131 struct rte_eth_dev_data {
132  char name[RTE_ETH_NAME_MAX_LEN];
134  void **rx_queues;
135  void **tx_queues;
136  uint16_t nb_rx_queues;
137  uint16_t nb_tx_queues;
139  struct rte_eth_dev_sriov sriov;
141  void *dev_private;
146  struct rte_eth_link dev_link;
147  struct rte_eth_conf dev_conf;
148  uint16_t mtu;
149  uint32_t min_rx_buf_size;
152  uint64_t rx_mbuf_alloc_failed;
153  struct rte_ether_addr *mac_addrs;
157  uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
159  struct rte_ether_addr *hash_mac_addrs;
163  uint16_t port_id;
165  __extension__
166  uint8_t promiscuous : 1,
167  scattered_rx : 1,
168  all_multicast : 1,
169  dev_started : 1,
170  lro : 1,
171  dev_configured : 1;
175  uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
177  uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
179  uint32_t dev_flags;
180  int numa_node;
181  struct rte_vlan_filter_conf vlan_filter_conf;
183  struct rte_eth_dev_owner owner;
184  uint16_t representor_id;
189  pthread_mutex_t flow_ops_mutex;
190  uint64_t reserved_64s[4];
191  void *reserved_ptrs[4];
193 
199 extern struct rte_eth_dev rte_eth_devices[];
200 
201 #endif /* _RTE_ETHDEV_CORE_H_ */
uint16_t txq
#define ETH_NUM_RECEIVE_MAC_ADDR
Definition: rte_ethdev.h:809
uint16_t(* rte_tx_callback_fn)(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param)
Definition: rte_ethdev.h:1806
rte_eth_dev_state
Definition: rte_ethdev.h:1812
#define __rte_cache_aligned
Definition: rte_common.h:402
TAILQ_HEAD(vdev_driver_list, rte_vdev_driver)
uint16_t(* rte_rx_callback_fn)(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param)
Definition: rte_ethdev.h:1782