Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause
2 : : * Copyright(C) 2022 Intel Corporation
3 : : */
4 : :
5 : : #ifndef _GVE_ETHDEV_H_
6 : : #define _GVE_ETHDEV_H_
7 : :
8 : : #include <ethdev_driver.h>
9 : : #include <ethdev_pci.h>
10 : : #include <rte_alarm.h>
11 : : #include <rte_ether.h>
12 : : #include <rte_pci.h>
13 : : #include <pthread.h>
14 : : #include <rte_bitmap.h>
15 : : #include <rte_memzone.h>
16 : : #include <rte_thread.h>
17 : :
18 : : #include "base/gve.h"
19 : :
20 : : /* TODO: this is a workaround to ensure that Tx complq is enough */
21 : : #define DQO_TX_MULTIPLIER 4
22 : :
23 : : #define GVE_DEFAULT_MAX_RING_SIZE 1024
24 : : #define GVE_MAX_RING_SIZE_GQ_QPL 2048
25 : : #define GVE_DEFAULT_MIN_RX_RING_SIZE 512
26 : : #define GVE_DEFAULT_MIN_TX_RING_SIZE 256
27 : :
28 : : #define GVE_DEFAULT_RX_FREE_THRESH 64
29 : : #define GVE_DEFAULT_TX_FREE_THRESH 32
30 : : #define GVE_DEFAULT_TX_RS_THRESH 32
31 : : #define GVE_TX_MAX_FREE_SZ 512
32 : :
33 : : #define GVE_RX_BUF_ALIGN_DQO 128
34 : : #define GVE_RX_MIN_BUF_SIZE_DQO 1024
35 : : #define GVE_RX_MAX_BUF_SIZE_DQO ((16 * 1024) - GVE_RX_BUF_ALIGN_DQO)
36 : : #define GVE_MAX_QUEUE_SIZE_DQO 4096
37 : :
38 : : #define GVE_RX_BUF_ALIGN_GQI 2048
39 : : #define GVE_RX_MIN_BUF_SIZE_GQI 2048
40 : : #define GVE_RX_MAX_BUF_SIZE_GQI 4096
41 : :
42 : : #define GVE_RSS_HASH_KEY_SIZE 40
43 : : #define GVE_RSS_INDIR_SIZE 128
44 : :
45 : : #define GVE_NIC_CLOCK_READ_PERIOD_MS 250
46 : : #define GVE_NIC_CLOCK_READ_MAX_FAILS 7
47 : :
48 : : #define GVE_TX_CKSUM_OFFLOAD_MASK ( \
49 : : RTE_MBUF_F_TX_L4_MASK | \
50 : : RTE_MBUF_F_TX_TCP_SEG)
51 : :
52 : : #define GVE_TX_CKSUM_OFFLOAD_MASK_DQO ( \
53 : : GVE_TX_CKSUM_OFFLOAD_MASK | \
54 : : RTE_MBUF_F_TX_IP_CKSUM)
55 : :
56 : : #define GVE_RTE_RSS_OFFLOAD_ALL ( \
57 : : RTE_ETH_RSS_IPV4 | \
58 : : RTE_ETH_RSS_NONFRAG_IPV4_TCP | \
59 : : RTE_ETH_RSS_IPV6 | \
60 : : RTE_ETH_RSS_IPV6_EX | \
61 : : RTE_ETH_RSS_NONFRAG_IPV6_TCP | \
62 : : RTE_ETH_RSS_IPV6_TCP_EX | \
63 : : RTE_ETH_RSS_NONFRAG_IPV4_UDP | \
64 : : RTE_ETH_RSS_NONFRAG_IPV6_UDP | \
65 : : RTE_ETH_RSS_IPV6_UDP_EX)
66 : :
67 : : #define GVE_DEV_POLL_INTERVAL_US (1 * 1000 * 1000) /* 1 second in microseconds */
68 : :
69 : : /* A list of pages registered with the device during setup and used by a queue
70 : : * as buffers
71 : : */
72 : : struct gve_queue_page_list {
73 : : uint32_t id; /* unique id */
74 : : uint32_t num_entries;
75 : : dma_addr_t *page_buses; /* the dma addrs of the pages */
76 : : union {
77 : : const struct rte_memzone *mz; /* memzone allocated for TX queue */
78 : : void **qpl_bufs; /* RX qpl-buffer list allocated using malloc*/
79 : : };
80 : : };
81 : :
82 : : /* A TX desc ring entry */
83 : : union gve_tx_desc {
84 : : struct gve_tx_pkt_desc pkt; /* first desc for a packet */
85 : : struct gve_tx_seg_desc seg; /* subsequent descs for a packet */
86 : : };
87 : :
88 : : /* Tx desc for DQO format */
89 : : union gve_tx_desc_dqo {
90 : : struct gve_tx_pkt_desc_dqo pkt;
91 : : struct gve_tx_tso_context_desc_dqo tso_ctx;
92 : : struct gve_tx_general_context_desc_dqo general_ctx;
93 : : };
94 : :
95 : : /* Offload features */
96 : : union gve_tx_offload {
97 : : uint64_t data;
98 : : struct {
99 : : uint64_t l2_len:7; /* L2 (MAC) Header Length. */
100 : : uint64_t l3_len:9; /* L3 (IP) Header Length. */
101 : : uint64_t l4_len:8; /* L4 Header Length. */
102 : : uint64_t tso_segsz:16; /* TCP TSO segment size */
103 : : /* uint64_t unused : 24; */
104 : : };
105 : : };
106 : :
107 : : struct gve_tx_iovec {
108 : : uint32_t iov_base; /* offset in fifo */
109 : : uint32_t iov_len;
110 : : };
111 : :
112 : : struct gve_tx_stats {
113 : : uint64_t packets;
114 : : uint64_t bytes;
115 : : uint64_t errors;
116 : : uint64_t too_many_descs;
117 : : };
118 : :
119 : : struct gve_rx_stats {
120 : : uint64_t packets;
121 : : uint64_t bytes;
122 : : uint64_t errors;
123 : : uint64_t no_mbufs;
124 : : uint64_t no_mbufs_bulk;
125 : : uint64_t imissed;
126 : : };
127 : :
128 : : struct gve_xstats_name_offset {
129 : : char name[RTE_ETH_XSTATS_NAME_SIZE];
130 : : unsigned int offset;
131 : : };
132 : :
133 : : struct gve_tx_pkt {
134 : : struct rte_mbuf *mbuf;
135 : : int16_t next_avail_pkt; /* Entry in software ring for next free packet slot */
136 : : };
137 : :
138 : : struct gve_tx_queue {
139 : : volatile union gve_tx_desc *tx_desc_ring;
140 : : const struct rte_memzone *mz;
141 : : uint64_t tx_ring_phys_addr;
142 : : union {
143 : : struct rte_mbuf **sw_ring;
144 : : struct gve_tx_pkt *pkt_ring_dqo;
145 : : };
146 : : volatile rte_be32_t *qtx_tail;
147 : : volatile rte_be32_t *qtx_head;
148 : :
149 : : uint32_t tx_tail;
150 : : uint16_t nb_tx_desc;
151 : : uint16_t nb_complq_desc;
152 : : uint16_t nb_free;
153 : : uint16_t nb_used;
154 : : uint32_t next_to_clean;
155 : : uint16_t free_thresh;
156 : : uint16_t rs_thresh;
157 : :
158 : : /* Only valid for DQO_QPL queue format */
159 : : uint16_t sw_tail;
160 : : uint16_t sw_ntc;
161 : : uint16_t sw_nb_free;
162 : : uint32_t fifo_size;
163 : : uint32_t fifo_head;
164 : : uint32_t fifo_avail;
165 : : uint64_t fifo_base;
166 : : struct gve_queue_page_list *qpl;
167 : : struct gve_tx_iovec *iov_ring;
168 : :
169 : : /* stats items */
170 : : struct gve_tx_stats stats;
171 : :
172 : : uint16_t port_id;
173 : : uint16_t queue_id;
174 : :
175 : : uint16_t ntfy_id;
176 : : volatile rte_be32_t *ntfy_addr;
177 : :
178 : : struct gve_priv *hw;
179 : : const struct rte_memzone *qres_mz;
180 : : struct gve_queue_resources *qres;
181 : :
182 : : /* newly added for DQO */
183 : : volatile union gve_tx_desc_dqo *tx_ring;
184 : : struct gve_tx_compl_desc *compl_ring;
185 : :
186 : : /* List of free completion tags that map into sw_ring. */
187 : : int16_t free_compl_tags_head;
188 : : uint16_t num_free_compl_tags;
189 : :
190 : : const struct rte_memzone *compl_ring_mz;
191 : : uint64_t compl_ring_phys_addr;
192 : : uint32_t complq_tail;
193 : : uint16_t sw_size;
194 : : uint8_t cur_gen_bit;
195 : : uint32_t last_desc_cleaned;
196 : : void **txqs;
197 : : uint16_t re_cnt;
198 : :
199 : : /* Only valid for DQO_RDA queue format */
200 : : struct gve_tx_queue *complq;
201 : :
202 : : uint8_t is_gqi_qpl;
203 : : };
204 : :
205 : : struct gve_rx_ctx {
206 : : struct rte_mbuf *mbuf_head;
207 : : struct rte_mbuf *mbuf_tail;
208 : : uint16_t total_frags;
209 : : bool drop_pkt;
210 : : };
211 : :
212 : : struct gve_rx_queue {
213 : : volatile struct gve_rx_desc *rx_desc_ring;
214 : : volatile union gve_rx_data_slot *rx_data_ring;
215 : : const struct rte_memzone *mz;
216 : : const struct rte_memzone *data_mz;
217 : : uint64_t rx_ring_phys_addr;
218 : : struct rte_mbuf **sw_ring;
219 : : struct rte_mempool *mpool;
220 : : struct gve_rx_ctx ctx;
221 : :
222 : : uint16_t rx_tail;
223 : : uint16_t nb_rx_desc;
224 : : uint16_t expected_seqno; /* the next expected seqno */
225 : : uint16_t free_thresh;
226 : : uint16_t nb_rx_hold;
227 : : uint32_t next_avail;
228 : : uint32_t nb_avail;
229 : :
230 : : volatile rte_be32_t *qrx_tail;
231 : : volatile rte_be32_t *ntfy_addr;
232 : :
233 : : /* only valid for GQI_QPL queue format */
234 : : struct gve_queue_page_list *qpl;
235 : :
236 : : /* stats items */
237 : : struct gve_rx_stats stats;
238 : :
239 : : struct gve_priv *hw;
240 : : const struct rte_memzone *qres_mz;
241 : : struct gve_queue_resources *qres;
242 : :
243 : : uint16_t port_id;
244 : : uint16_t queue_id;
245 : : uint16_t ntfy_id;
246 : : uint16_t rx_buf_len;
247 : :
248 : : /* newly added for DQO */
249 : : volatile struct gve_rx_desc_dqo *rx_ring;
250 : : struct gve_rx_compl_desc_dqo *compl_ring;
251 : : const struct rte_memzone *compl_ring_mz;
252 : : uint64_t compl_ring_phys_addr;
253 : : uint8_t cur_gen_bit;
254 : : uint16_t bufq_tail;
255 : :
256 : : /* List of buffers which are known to be completed by the hardware. */
257 : : int16_t *completed_buf_list;
258 : : int16_t completed_buf_list_head;
259 : :
260 : : /* Only valid for DQO_RDA queue format */
261 : : struct gve_rx_queue *bufq;
262 : : struct rte_mbuf **refill_bufs;
263 : :
264 : : uint8_t is_gqi_qpl;
265 : : bool timestamp_enabled;
266 : : };
267 : :
268 : : struct gve_flow {
269 : : uint32_t rule_id;
270 : : TAILQ_ENTRY(gve_flow) list_handle;
271 : : };
272 : :
273 : : extern const struct rte_flow_ops gve_flow_ops;
274 : :
275 : : struct gve_priv {
276 : : struct gve_irq_db *irq_dbs; /* array of num_ntfy_blks */
277 : : const struct rte_memzone *irq_dbs_mz;
278 : : uint32_t mgmt_msix_idx;
279 : : rte_be32_t *cnt_array; /* array of num_event_counters */
280 : : const struct rte_memzone *cnt_array_mz;
281 : :
282 : : uint16_t num_event_counters;
283 : :
284 : : /* TX ring size default and limits. */
285 : : uint16_t default_tx_desc_cnt;
286 : : uint16_t max_tx_desc_cnt;
287 : : uint16_t min_tx_desc_cnt;
288 : :
289 : : /* RX ring size default and limits. */
290 : : uint16_t default_rx_desc_cnt;
291 : : uint16_t max_rx_desc_cnt;
292 : : uint16_t min_rx_desc_cnt;
293 : :
294 : : uint16_t tx_pages_per_qpl;
295 : :
296 : : /* Only valid for DQO_RDA queue format */
297 : : uint16_t tx_compq_size; /* tx completion queue size */
298 : : uint16_t rx_bufq_size; /* rx buff queue size */
299 : :
300 : : uint64_t max_registered_pages;
301 : : uint64_t num_registered_pages; /* num pages registered with NIC */
302 : : uint16_t default_num_queues; /* default num queues to set up */
303 : : enum gve_queue_format queue_format; /* see enum gve_queue_format */
304 : : uint8_t enable_rsc;
305 : :
306 : : uint16_t max_nb_txq;
307 : : uint16_t max_nb_rxq;
308 : : uint32_t num_ntfy_blks; /* spilt between TX and RX so must be even */
309 : :
310 : : struct gve_registers __iomem *reg_bar0; /* see gve_register.h */
311 : : rte_be32_t __iomem *db_bar2; /* "array" of doorbells */
312 : : struct rte_pci_device *pci_dev;
313 : :
314 : : /* Admin queue - see gve_adminq.h*/
315 : : union gve_adminq_command *adminq;
316 : : struct gve_dma_mem adminq_dma_mem;
317 : : uint32_t adminq_mask; /* masks prod_cnt to adminq size */
318 : : uint32_t adminq_prod_cnt; /* free-running count of AQ cmds executed */
319 : : uint32_t adminq_cmd_fail; /* free-running count of AQ cmds failed */
320 : : uint32_t adminq_timeouts; /* free-running count of AQ cmds timeouts */
321 : : /* free-running count of per AQ cmd executed */
322 : : uint32_t adminq_describe_device_cnt;
323 : : uint32_t adminq_cfg_device_resources_cnt;
324 : : uint32_t adminq_register_page_list_cnt;
325 : : uint32_t adminq_unregister_page_list_cnt;
326 : : uint32_t adminq_create_tx_queue_cnt;
327 : : uint32_t adminq_create_rx_queue_cnt;
328 : : uint32_t adminq_destroy_tx_queue_cnt;
329 : : uint32_t adminq_destroy_rx_queue_cnt;
330 : : uint32_t adminq_dcfg_device_resources_cnt;
331 : : uint32_t adminq_cfg_rss_cnt;
332 : : uint32_t adminq_set_driver_parameter_cnt;
333 : : uint32_t adminq_report_stats_cnt;
334 : : uint32_t adminq_report_link_speed_cnt;
335 : : uint32_t adminq_get_ptype_map_cnt;
336 : : uint32_t adminq_verify_driver_compatibility_cnt;
337 : : uint32_t adminq_cfg_flow_rule_cnt;
338 : : uint32_t adminq_report_nic_timestamp_cnt;
339 : : volatile uint32_t state_flags;
340 : :
341 : : /* Gvnic device link speed from hypervisor. */
342 : : uint64_t link_speed;
343 : :
344 : : uint16_t max_mtu;
345 : : struct rte_ether_addr dev_addr; /* mac address */
346 : :
347 : : struct gve_tx_queue **txqs;
348 : : struct gve_rx_queue **rxqs;
349 : :
350 : : pthread_mutex_t adminq_lock; /* Protects AdminQ command execution */
351 : : uint32_t stats_report_len;
352 : : const struct rte_memzone *stats_report_mem;
353 : : uint16_t stats_start_idx; /* start index of array of stats written by NIC */
354 : : uint16_t stats_end_idx; /* end index of array of stats written by NIC */
355 : :
356 : : struct gve_rss_config rss_config;
357 : : struct gve_ptype_lut *ptype_lut_dqo;
358 : :
359 : : /* Flow rule management */
360 : : uint32_t max_flow_rules;
361 : : uint32_t flow_rule_bmp_size;
362 : : struct rte_bitmap *avail_flow_rule_bmp; /* Tracks available rule IDs (1 = available) */
363 : : void *avail_flow_rule_bmp_mem; /* Backing memory for the bitmap */
364 : : pthread_mutex_t flow_rule_lock; /* Lock for bitmap and tailq access */
365 : : TAILQ_HEAD(, gve_flow) active_flows;
366 : :
367 : : /* HW Timestamping Fields */
368 : : bool nic_timestamp_supported;
369 : : const struct rte_memzone *nic_ts_report_mz;
370 : : struct gve_nic_ts_report *nic_ts_report;
371 : : pthread_mutex_t nic_ts_lock;
372 : : RTE_ATOMIC(uint64_t) last_read_nic_timestamp;
373 : : RTE_ATOMIC(uint32_t) nic_ts_read_fails;
374 : : RTE_ATOMIC(uint8_t) nic_ts_stale;
375 : : rte_thread_t nic_ts_thread_id;
376 : : RTE_ATOMIC(uint8_t) nic_ts_thread_should_stop;
377 : :
378 : : int mbuf_timestamp_offset;
379 : : uint64_t mbuf_timestamp_mask;
380 : : };
381 : :
382 : : /* Expand the hardware timestamp to the full 64 bits of width.
383 : : *
384 : : * This algorithm works by using the passed hardware timestamp to generate a
385 : : * diff relative to the last read of the nic clock. This diff can be positive or
386 : : * negative, as it is possible that we have read the clock more recently than
387 : : * the hardware has received this packet. To detect this, we use the high bit of
388 : : * the diff, and assume that the read is more recent if the high bit is set. In
389 : : * this case we invert the process.
390 : : *
391 : : * Note that this means if the time delta between packet reception and the last
392 : : * clock read is greater than ~2 seconds, this will provide invalid results.
393 : : */
394 : : static inline uint64_t
395 : : gve_reconstruct_ts(uint64_t last_sync, uint32_t ts)
396 : : {
397 : 0 : uint32_t low = (uint32_t)last_sync;
398 : 0 : int32_t diff = (int32_t)(ts - low);
399 : :
400 : 0 : return last_sync + diff;
401 : : }
402 : :
403 : : static inline bool
404 : : gve_is_gqi(struct gve_priv *priv)
405 : : {
406 [ # # # # : 0 : return priv->queue_format == GVE_GQI_RDA_FORMAT ||
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# ]
407 : : priv->queue_format == GVE_GQI_QPL_FORMAT;
408 : : }
409 : :
410 : : static inline bool
411 : : gve_get_admin_queue_ok(struct gve_priv *priv)
412 : : {
413 : : return !!rte_bit_relaxed_get32(GVE_PRIV_FLAGS_ADMIN_QUEUE_OK,
414 : : &priv->state_flags);
415 : : }
416 : :
417 : : static inline void
418 : : gve_set_admin_queue_ok(struct gve_priv *priv)
419 : : {
420 : : rte_bit_relaxed_set32(GVE_PRIV_FLAGS_ADMIN_QUEUE_OK,
421 : : &priv->state_flags);
422 : : }
423 : :
424 : : static inline void
425 : : gve_clear_admin_queue_ok(struct gve_priv *priv)
426 : : {
427 : : rte_bit_relaxed_clear32(GVE_PRIV_FLAGS_ADMIN_QUEUE_OK,
428 : : &priv->state_flags);
429 : 0 : }
430 : :
431 : : static inline bool
432 : : gve_get_device_resources_ok(struct gve_priv *priv)
433 : : {
434 : : return !!rte_bit_relaxed_get32(GVE_PRIV_FLAGS_DEVICE_RESOURCES_OK,
435 : : &priv->state_flags);
436 : : }
437 : :
438 : : static inline void
439 : : gve_set_device_resources_ok(struct gve_priv *priv)
440 : : {
441 : : rte_bit_relaxed_set32(GVE_PRIV_FLAGS_DEVICE_RESOURCES_OK,
442 : : &priv->state_flags);
443 : : }
444 : :
445 : : static inline void
446 : : gve_clear_device_resources_ok(struct gve_priv *priv)
447 : : {
448 : : rte_bit_relaxed_clear32(GVE_PRIV_FLAGS_DEVICE_RESOURCES_OK,
449 : : &priv->state_flags);
450 : : }
451 : :
452 : : static inline bool
453 : : gve_get_device_rings_ok(struct gve_priv *priv)
454 : : {
455 : : return !!rte_bit_relaxed_get32(GVE_PRIV_FLAGS_DEVICE_RINGS_OK,
456 : : &priv->state_flags);
457 : : }
458 : :
459 : : static inline void
460 : : gve_set_device_rings_ok(struct gve_priv *priv)
461 : : {
462 : : rte_bit_relaxed_set32(GVE_PRIV_FLAGS_DEVICE_RINGS_OK,
463 : : &priv->state_flags);
464 : : }
465 : :
466 : : static inline void
467 : : gve_clear_device_rings_ok(struct gve_priv *priv)
468 : : {
469 : : rte_bit_relaxed_clear32(GVE_PRIV_FLAGS_DEVICE_RINGS_OK,
470 : : &priv->state_flags);
471 : : }
472 : :
473 : : static inline bool
474 : : gve_get_flow_subsystem_ok(struct gve_priv *priv)
475 : : {
476 : : bool ret;
477 : :
478 : : ret = !!rte_bit_relaxed_get32(GVE_PRIV_FLAGS_FLOW_SUBSYSTEM_OK,
479 : : &priv->state_flags);
480 : : rte_atomic_thread_fence(rte_memory_order_acquire);
481 : :
482 : : return ret;
483 : : }
484 : :
485 : : static inline void
486 : : gve_set_flow_subsystem_ok(struct gve_priv *priv)
487 : : {
488 : : rte_atomic_thread_fence(rte_memory_order_release);
489 : : rte_bit_relaxed_set32(GVE_PRIV_FLAGS_FLOW_SUBSYSTEM_OK,
490 : : &priv->state_flags);
491 : : }
492 : :
493 : : static inline void
494 : : gve_clear_flow_subsystem_ok(struct gve_priv *priv)
495 : : {
496 : : rte_atomic_thread_fence(rte_memory_order_release);
497 : : rte_bit_relaxed_clear32(GVE_PRIV_FLAGS_FLOW_SUBSYSTEM_OK,
498 : : &priv->state_flags);
499 : : }
500 : :
501 : : int
502 : : gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, uint16_t nb_desc,
503 : : unsigned int socket_id, const struct rte_eth_rxconf *conf,
504 : : struct rte_mempool *pool);
505 : : int
506 : : gve_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, uint16_t nb_desc,
507 : : unsigned int socket_id, const struct rte_eth_txconf *conf);
508 : :
509 : : void
510 : : gve_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
511 : :
512 : : void
513 : : gve_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
514 : :
515 : : int
516 : : gve_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id);
517 : :
518 : : int
519 : : gve_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
520 : :
521 : : int
522 : : gve_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id);
523 : :
524 : : int
525 : : gve_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
526 : :
527 : : void
528 : : gve_stop_tx_queues(struct rte_eth_dev *dev);
529 : :
530 : : void
531 : : gve_stop_rx_queues(struct rte_eth_dev *dev);
532 : :
533 : : uint16_t
534 : : gve_rx_burst(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
535 : :
536 : : uint16_t
537 : : gve_tx_burst(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
538 : :
539 : : void
540 : : gve_set_rx_function(struct rte_eth_dev *dev);
541 : :
542 : : void
543 : : gve_set_tx_function(struct rte_eth_dev *dev);
544 : :
545 : : struct gve_queue_page_list *
546 : : gve_setup_queue_page_list(struct gve_priv *priv, uint16_t queue_id, bool is_rx,
547 : : uint32_t num_pages);
548 : : int
549 : : gve_teardown_queue_page_list(struct gve_priv *priv,
550 : : struct gve_queue_page_list *qpl);
551 : :
552 : : /* Below functions are used for DQO */
553 : :
554 : : int
555 : : gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
556 : : uint16_t nb_desc, unsigned int socket_id,
557 : : const struct rte_eth_rxconf *conf,
558 : : struct rte_mempool *pool);
559 : : int
560 : : gve_tx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
561 : : uint16_t nb_desc, unsigned int socket_id,
562 : : const struct rte_eth_txconf *conf);
563 : :
564 : : void
565 : : gve_tx_queue_release_dqo(struct rte_eth_dev *dev, uint16_t qid);
566 : :
567 : : void
568 : : gve_rx_queue_release_dqo(struct rte_eth_dev *dev, uint16_t qid);
569 : :
570 : : int
571 : : gve_rx_queue_start_dqo(struct rte_eth_dev *dev, uint16_t rx_queue_id);
572 : :
573 : : int
574 : : gve_tx_queue_start_dqo(struct rte_eth_dev *dev, uint16_t tx_queue_id);
575 : :
576 : : int
577 : : gve_rx_queue_stop_dqo(struct rte_eth_dev *dev, uint16_t rx_queue_id);
578 : :
579 : : int
580 : : gve_tx_queue_stop_dqo(struct rte_eth_dev *dev, uint16_t tx_queue_id);
581 : :
582 : : void
583 : : gve_stop_tx_queues_dqo(struct rte_eth_dev *dev);
584 : :
585 : : void
586 : : gve_stop_rx_queues_dqo(struct rte_eth_dev *dev);
587 : :
588 : : uint16_t
589 : : gve_rx_burst_dqo(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts);
590 : :
591 : : uint16_t
592 : : gve_tx_burst_dqo(void *txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
593 : :
594 : : void
595 : : gve_set_rx_function_dqo(struct rte_eth_dev *dev);
596 : :
597 : : void
598 : : gve_set_tx_function_dqo(struct rte_eth_dev *dev);
599 : :
600 : : #endif /* _GVE_ETHDEV_H_ */
|