DPDK  20.11.10
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 #include <sys/types.h>
10 
23 struct rte_eth_dev_callback;
25 TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
26 
27 struct rte_eth_dev;
28 
29 typedef uint16_t (*eth_rx_burst_t)(void *rxq,
30  struct rte_mbuf **rx_pkts,
31  uint16_t nb_pkts);
34 typedef uint16_t (*eth_tx_burst_t)(void *txq,
35  struct rte_mbuf **tx_pkts,
36  uint16_t nb_pkts);
39 typedef uint16_t (*eth_tx_prep_t)(void *txq,
40  struct rte_mbuf **tx_pkts,
41  uint16_t nb_pkts);
45 typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,
46  uint16_t rx_queue_id);
49 typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);
52 typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
55 typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
64 struct rte_eth_rxtx_callback {
65  struct rte_eth_rxtx_callback *next;
66  union{
69  } fn;
70  void *param;
71 };
72 
83 struct rte_eth_dev {
84  eth_rx_burst_t rx_pkt_burst;
85  eth_tx_burst_t tx_pkt_burst;
86  eth_tx_prep_t tx_pkt_prepare;
88  eth_rx_queue_count_t rx_queue_count;
89  eth_rx_descriptor_done_t rx_descriptor_done;
90  eth_rx_descriptor_status_t rx_descriptor_status;
91  eth_tx_descriptor_status_t tx_descriptor_status;
98  struct rte_eth_dev_data *data;
99  void *process_private;
100  const struct eth_dev_ops *dev_ops;
101  struct rte_device *device;
102  struct rte_intr_handle *intr_handle;
104  struct rte_eth_dev_cb_list link_intr_cbs;
109  struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
114  struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
115  enum rte_eth_dev_state state;
116  void *security_ctx;
118  uint64_t reserved_64s[4];
119  void *reserved_ptrs[4];
121 
122 struct rte_eth_dev_sriov;
123 struct rte_eth_dev_owner;
124 
132 struct rte_eth_dev_data {
133  char name[RTE_ETH_NAME_MAX_LEN];
135  void **rx_queues;
136  void **tx_queues;
137  uint16_t nb_rx_queues;
138  uint16_t nb_tx_queues;
140  struct rte_eth_dev_sriov sriov;
142  void *dev_private;
147  struct rte_eth_link dev_link;
148  struct rte_eth_conf dev_conf;
149  uint16_t mtu;
150  uint32_t min_rx_buf_size;
153  uint64_t rx_mbuf_alloc_failed;
154  struct rte_ether_addr *mac_addrs;
158  uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
160  struct rte_ether_addr *hash_mac_addrs;
164  uint16_t port_id;
166  __extension__
167  uint8_t promiscuous : 1,
168  scattered_rx : 1,
169  all_multicast : 1,
170  dev_started : 1,
171  lro : 1;
172  uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
174  uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
176  uint32_t dev_flags;
177  int numa_node;
178  struct rte_vlan_filter_conf vlan_filter_conf;
180  struct rte_eth_dev_owner owner;
181  uint16_t representor_id;
186  pthread_mutex_t flow_ops_mutex;
187  uint64_t reserved_64s[4];
188  void *reserved_ptrs[4];
190 
196 extern struct rte_eth_dev rte_eth_devices[];
197 
198 #endif /* _RTE_ETHDEV_CORE_H_ */
uint16_t txq
#define ETH_NUM_RECEIVE_MAC_ADDR
Definition: rte_ethdev.h:797
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:1778
rte_eth_dev_state
Definition: rte_ethdev.h:1784
#define __rte_cache_aligned
Definition: rte_common.h:405
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:1754