NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_eth_rxq.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES, ALL RIGHTS RESERVED.
3  *
4  * This software product is a proprietary product of NVIDIA CORPORATION &
5  * AFFILIATES (the "Company") and all right, title, and interest in and to the
6  * software product, including all associated intellectual property rights, are
7  * and shall remain exclusively with the Company.
8  *
9  * This software product is governed by the End User License Agreement
10  * provided with the software product.
11  *
12  */
13 
31 #ifndef DOCA_ETH_RXQ_H_
32 #define DOCA_ETH_RXQ_H_
33 
34 #include <doca_compat.h>
35 #include <doca_error.h>
36 #include <doca_types.h>
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /**********************************************************************************************************************
43  * DOCA core opaque types
44  *********************************************************************************************************************/
45 
46 struct doca_ctx;
47 struct doca_dev;
48 struct doca_devinfo;
49 struct doca_mmap;
50 
51 /*********************************************************************************************************************
52  * DOCA ETH RXQ Context
53  *********************************************************************************************************************/
54 
58 struct doca_eth_rxq;
59 struct doca_gpu_eth_rxq;
60 
89 };
90 
97 };
98 
119 doca_error_t doca_eth_rxq_create(struct doca_dev *dev,
120  uint32_t max_burst_size,
121  uint32_t max_packet_size,
122  struct doca_eth_rxq **eth_rxq);
123 
137 doca_error_t doca_eth_rxq_destroy(struct doca_eth_rxq *eth_rxq);
138 
149 struct doca_ctx *doca_eth_rxq_as_doca_ctx(struct doca_eth_rxq *eth_rxq);
150 
168 doca_error_t doca_eth_rxq_set_max_burst_size(struct doca_eth_rxq *eth_rxq, uint32_t max_burst_size);
169 
188 doca_error_t doca_eth_rxq_set_max_packet_size(struct doca_eth_rxq *eth_rxq, uint32_t max_packet_size);
189 
209 doca_error_t doca_eth_rxq_set_metadata_num(struct doca_eth_rxq *eth_rxq, uint8_t metadata_num);
210 
230 doca_error_t doca_eth_rxq_set_flow_tag(struct doca_eth_rxq *eth_rxq, uint8_t enable_flow_tag);
231 
251 doca_error_t doca_eth_rxq_set_rx_hash(struct doca_eth_rxq *eth_rxq, uint8_t enable_rx_hash);
252 
273 doca_error_t doca_eth_rxq_set_packet_headroom(struct doca_eth_rxq *eth_rxq, uint16_t head_size);
274 
295 doca_error_t doca_eth_rxq_set_packet_tailroom(struct doca_eth_rxq *eth_rxq, uint16_t tail_size);
296 
317 doca_error_t doca_eth_rxq_set_timestamp(struct doca_eth_rxq *eth_rxq, uint8_t enable_timestamp);
318 
339 doca_error_t doca_eth_rxq_set_max_recv_buf_list_len(struct doca_eth_rxq *eth_rxq, uint32_t max_recv_buf_list_len);
340 
363 doca_error_t doca_eth_rxq_set_pkt_buf(struct doca_eth_rxq *eth_rxq,
364  struct doca_mmap *mmap,
365  uint32_t mmap_offset,
366  uint32_t mmap_len);
367 
386 doca_error_t doca_eth_rxq_set_type(struct doca_eth_rxq *eth_rxq, enum doca_eth_rxq_type type);
387 
410  uint16_t period_usec,
411  uint16_t comp_count);
412 
429 doca_error_t doca_eth_rxq_get_flow_queue_id(struct doca_eth_rxq *eth_rxq, uint16_t *flow_queue_id);
430 
455 doca_error_t doca_eth_rxq_get_gpu_handle(const struct doca_eth_rxq *eth_rxq, struct doca_gpu_eth_rxq **eth_rxq_ext);
456 
474 doca_error_t doca_eth_rxq_cap_get_max_burst_size(const struct doca_devinfo *devinfo, uint32_t *max_burst_size);
475 
491 doca_error_t doca_eth_rxq_cap_get_max_metadata_num(const struct doca_devinfo *devinfo, uint8_t *max_metadata_num);
492 
511 doca_error_t doca_eth_rxq_cap_get_max_packet_headroom(const struct doca_devinfo *devinfo,
512  uint16_t *max_packet_headroom);
513 
532 doca_error_t doca_eth_rxq_cap_get_max_packet_tailroom(const struct doca_devinfo *devinfo,
533  uint16_t *max_packet_tailroom);
534 
550 doca_error_t doca_eth_rxq_cap_get_max_recv_buf_list_len(const struct doca_devinfo *devinfo,
551  uint32_t *max_recv_buf_list_len);
552 
567 doca_error_t doca_eth_rxq_cap_get_max_packet_size(const struct doca_devinfo *devinfo, uint32_t *max_packet_size);
568 
586 doca_error_t doca_eth_rxq_cap_is_type_supported(const struct doca_devinfo *devinfo,
587  enum doca_eth_rxq_type type,
588  enum doca_eth_rxq_data_path_type data_path_type);
589 
625  uint32_t rate,
626  uint16_t pkt_max_time,
627  uint32_t max_packet_size,
628  uint32_t max_burst_size,
629  uint8_t log_max_lro_pkt_sz,
630  uint16_t head_size,
631  uint16_t tail_size,
632  uint32_t *buf_size);
633 
634 #ifdef __cplusplus
635 } /* extern "C" */
636 #endif
637 
638 #endif /* DOCA_ETH_RXQ_H_ */
639 
doca_dpa_dev_mmap_t mmap
#define DOCA_EXPERIMENTAL
To set a Symbol (or specifically a function) as experimental.
Definition: doca_compat.h:103
enum doca_error doca_error_t
DOCA API return codes.
doca_eth_rxq_type
Definition: doca_eth_rxq.h:64
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_set_flow_tag(struct doca_eth_rxq *eth_rxq, uint8_t enable_flow_tag)
Setter to enable flow tag support. User can retrieve flow tag per packet when this is enabled....
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_get_flow_queue_id(struct doca_eth_rxq *eth_rxq, uint16_t *flow_queue_id)
Get the DPDK queue ID of the doca_eth receive queue. can only be called after calling doca_ctx_start(...
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_cap_get_max_metadata_num(const struct doca_devinfo *devinfo, uint8_t *max_metadata_num)
Get the maximum metadata number supported by the device.
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_set_packet_tailroom(struct doca_eth_rxq *eth_rxq, uint16_t tail_size)
Setter to enable packet tailroom support. User can use doca_buf's tailroom of size tail_size when thi...
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_set_max_burst_size(struct doca_eth_rxq *eth_rxq, uint32_t max_burst_size)
Set max burst size property for doca_eth_rxq. This value dictates the maximal number of packets the H...
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_set_type(struct doca_eth_rxq *eth_rxq, enum doca_eth_rxq_type type)
Set RX queue type property for doca_eth_rxq. can only be called before calling doca_ctx_start().
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_cap_get_max_recv_buf_list_len(const struct doca_devinfo *devinfo, uint32_t *max_recv_buf_list_len)
Get the maximum receive buffer list length supported by the device.
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_cap_get_max_packet_headroom(const struct doca_devinfo *devinfo, uint16_t *max_packet_headroom)
Get the maximum packet headroom size supported by the device.
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_destroy(struct doca_eth_rxq *eth_rxq)
Destroy a DOCA ETH RXQ instance.
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_get_gpu_handle(const struct doca_eth_rxq *eth_rxq, struct doca_gpu_eth_rxq **eth_rxq_ext)
Get a gpu handle of a doca_eth_rxq.
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_set_packet_headroom(struct doca_eth_rxq *eth_rxq, uint16_t head_size)
Setter to enable packet headroom support. User can use doca_buf's headroom of size head_size when thi...
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_cap_get_max_packet_tailroom(const struct doca_devinfo *devinfo, uint16_t *max_packet_tailroom)
Get the maximum packet tailroom size supported by the device.
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_set_timestamp(struct doca_eth_rxq *eth_rxq, uint8_t enable_timestamp)
Setter to enable timestamp support. User can retrieve timestamp in nanoseconds per packet when this i...
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_cap_is_type_supported(const struct doca_devinfo *devinfo, enum doca_eth_rxq_type type, enum doca_eth_rxq_data_path_type data_path_type)
Check if RX queue type is supported.
DOCA_EXPERIMENTAL struct doca_ctx * doca_eth_rxq_as_doca_ctx(struct doca_eth_rxq *eth_rxq)
Convert doca_eth_rxq instance into a generalized context for use with doca core objects.
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_set_max_recv_buf_list_len(struct doca_eth_rxq *eth_rxq, uint32_t max_recv_buf_list_len)
Set the maximal receive buffer list length for doca_eth_rxq. This value indicated what the maximal nu...
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_cap_get_max_packet_size(const struct doca_devinfo *devinfo, uint32_t *max_packet_size)
Get the maximum packet size supported by the device.
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_create(struct doca_dev *dev, uint32_t max_burst_size, uint32_t max_packet_size, struct doca_eth_rxq **eth_rxq)
Create a DOCA ETH RXQ instance.
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_set_notification_moderation(struct doca_eth_rxq *eth_rxq, uint16_t period_usec, uint16_t comp_count)
Set notification moderation.
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_set_pkt_buf(struct doca_eth_rxq *eth_rxq, struct doca_mmap *mmap, uint32_t mmap_offset, uint32_t mmap_len)
Set Eth packet buffer for a doca_eth_rxq. can only be called before calling doca_ctx_start().
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_set_max_packet_size(struct doca_eth_rxq *eth_rxq, uint32_t max_packet_size)
Set max packet size property for doca_eth_rxq. can only be called before calling doca_ctx_start().
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_cap_get_max_burst_size(const struct doca_devinfo *devinfo, uint32_t *max_burst_size)
Get the maximum burst size supported by the device.
doca_eth_rxq_data_path_type
Definition: doca_eth_rxq.h:94
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_estimate_packet_buf_size(enum doca_eth_rxq_type type, uint32_t rate, uint16_t pkt_max_time, uint32_t max_packet_size, uint32_t max_burst_size, uint8_t log_max_lro_pkt_sz, uint16_t head_size, uint16_t tail_size, uint32_t *buf_size)
Get the recommended size for the mmap buffer of a doca_eth_rxq.
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_set_metadata_num(struct doca_eth_rxq *eth_rxq, uint8_t metadata_num)
Set metadata number for doca_eth_rxq. can only be called before calling doca_ctx_start().
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_set_rx_hash(struct doca_eth_rxq *eth_rxq, uint8_t enable_rx_hash)
Setter to enable RX hash support. User can retrieve RX hash per packet when this is enabled....
@ DOCA_ETH_RXQ_TYPE_MANAGED_MEMPOOL
Definition: doca_eth_rxq.h:75
@ DOCA_ETH_RXQ_TYPE_CYCLIC
Definition: doca_eth_rxq.h:65
@ DOCA_ETH_RXQ_TYPE_REGULAR
Definition: doca_eth_rxq.h:85
@ DOCA_ETH_RXQ_DATA_PATH_TYPE_CPU
Definition: doca_eth_rxq.h:95
@ DOCA_ETH_RXQ_DATA_PATH_TYPE_GPU
Definition: doca_eth_rxq.h:96
uint8_t type
Definition: packets.h:0