NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_eth_txq.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 
30 #ifndef DOCA_ETH_TXQ_H_
31 #define DOCA_ETH_TXQ_H_
32 
33 #include <stdint.h>
34 
35 #include <doca_compat.h>
36 #include <doca_error.h>
37 #include <doca_types.h>
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /**********************************************************************************************************************
44  * DOCA core opaque types
45  *********************************************************************************************************************/
46 
47 struct doca_ctx;
48 struct doca_dev;
49 struct doca_devinfo;
50 
51 /*********************************************************************************************************************
52  * DOCA ETH TXQ Context
53  *********************************************************************************************************************/
54 
58 struct doca_eth_txq;
59 struct doca_gpu_eth_txq;
60 
66 };
67 
74 };
75 
94 doca_error_t doca_eth_txq_create(struct doca_dev *dev, uint32_t max_burst_size, struct doca_eth_txq **eth_txq);
95 
109 doca_error_t doca_eth_txq_destroy(struct doca_eth_txq *eth_txq);
110 
121 struct doca_ctx *doca_eth_txq_as_doca_ctx(struct doca_eth_txq *eth_txq);
122 
140 doca_error_t doca_eth_txq_set_max_burst_size(struct doca_eth_txq *eth_txq, uint32_t max_burst_size);
141 
161 doca_error_t doca_eth_txq_set_max_send_buf_list_len(struct doca_eth_txq *eth_txq, uint32_t max_send_buf_list_len);
162 
183 doca_error_t doca_eth_txq_set_metadata_num(struct doca_eth_txq *eth_txq, uint8_t metadata_num);
184 
205 doca_error_t doca_eth_txq_set_mss(struct doca_eth_txq *eth_txq, uint16_t mss);
206 
227 doca_error_t doca_eth_txq_set_max_lso_header_size(struct doca_eth_txq *eth_txq, uint16_t max_lso_header_size);
228 
247 doca_error_t doca_eth_txq_set_type(struct doca_eth_txq *eth_txq, enum doca_eth_txq_type type);
248 
270 doca_error_t doca_eth_txq_set_l3_chksum_offload(struct doca_eth_txq *eth_txq, uint8_t enable_l3_chksum);
271 
293 doca_error_t doca_eth_txq_set_l4_chksum_offload(struct doca_eth_txq *eth_txq, uint8_t enable_l4_chksum);
294 
313 
338 doca_error_t doca_eth_txq_get_gpu_handle(const struct doca_eth_txq *eth_txq, struct doca_gpu_eth_txq **eth_txq_ext);
339 
360 doca_error_t doca_eth_txq_cap_get_max_burst_size(const struct doca_devinfo *devinfo,
361  uint32_t max_send_buf_list_len,
362  uint16_t max_lso_header_size,
363  uint32_t *max_burst_size);
364 
380 doca_error_t doca_eth_txq_cap_get_max_send_buf_list_len(const struct doca_devinfo *devinfo,
381  uint32_t *max_send_buf_list_len);
382 
398 doca_error_t doca_eth_txq_cap_get_max_metadata_num(const struct doca_devinfo *devinfo, uint8_t *max_metadata_num);
399 
416 doca_error_t doca_eth_txq_cap_get_max_lso_header_size(const struct doca_devinfo *devinfo,
417  uint16_t *max_lso_header_size);
418 
436 doca_error_t doca_eth_txq_cap_is_type_supported(const struct doca_devinfo *devinfo,
437  enum doca_eth_txq_type type,
438  enum doca_eth_txq_data_path_type data_path_type);
439 
454 
469 
486 doca_error_t doca_eth_txq_cap_get_max_lso_msg_size(const struct doca_devinfo *devinfo, uint32_t *max_lso_msg_size);
487 
505  enum doca_eth_wait_on_time_type *wait_on_time_mode);
506 
527 doca_error_t doca_eth_txq_calculate_timestamp(struct doca_eth_txq *eth_txq,
528  uint64_t timestamp_ns,
529  uint64_t *wait_on_time_value);
530 
547 doca_error_t doca_eth_txq_get_flow_queue_id(struct doca_eth_txq *eth_txq, uint16_t *flow_queue_id);
548 
549 #ifdef __cplusplus
550 } /* extern "C" */
551 #endif
552 
553 #endif /* DOCA_ETH_TXQ_H_ */
554 
#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_EXPERIMENTAL doca_error_t doca_eth_txq_cap_get_max_send_buf_list_len(const struct doca_devinfo *devinfo, uint32_t *max_send_buf_list_len)
Get the maximum send buffer list length supported by the device.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_cap_is_l4_chksum_offload_supported(const struct doca_devinfo *devinfo)
Check if L4 checksum offload is supported by the device.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_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 struct doca_ctx * doca_eth_txq_as_doca_ctx(struct doca_eth_txq *eth_txq)
Convert doca_eth_txq instance into a generalized context for use with doca core objects.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_cap_get_max_burst_size(const struct doca_devinfo *devinfo, uint32_t max_send_buf_list_len, uint16_t max_lso_header_size, uint32_t *max_burst_size)
Get the maximum burst size supported by the device.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_get_gpu_handle(const struct doca_eth_txq *eth_txq, struct doca_gpu_eth_txq **eth_txq_ext)
Get a gpu handle of a doca_eth_txq.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_cap_is_l3_chksum_offload_supported(const struct doca_devinfo *devinfo)
Check if L3 checksum offload is supported by the device.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_set_wait_on_time_offload(struct doca_eth_txq *eth_txq)
Set offload to enable wait on time feature on the queue. can only be called before calling doca_ctx_s...
doca_eth_txq_data_path_type
Definition: doca_eth_txq.h:71
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_set_metadata_num(struct doca_eth_txq *eth_txq, uint8_t metadata_num)
Set metadata number for doca_eth_txq. This value is the number of metadata per packet....
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_create(struct doca_dev *dev, uint32_t max_burst_size, struct doca_eth_txq **eth_txq)
Create a DOCA ETH TXQ instance.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_set_l3_chksum_offload(struct doca_eth_txq *eth_txq, uint8_t enable_l3_chksum)
Set offload for the calculation of IPv4 checksum (L3) on transmitted packets. If the users enables L3...
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_set_max_send_buf_list_len(struct doca_eth_txq *eth_txq, uint32_t max_send_buf_list_len)
Set the maximal send buffer list length for doca_eth_txq. This value indicated what the maximal numbe...
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_destroy(struct doca_eth_txq *eth_txq)
Destroy a DOCA ETH TXQ instance.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_get_flow_queue_id(struct doca_eth_txq *eth_txq, uint16_t *flow_queue_id)
Get the DPDK queue ID of the doca_eth send queue. can only be called after calling doca_ctx_start().
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_set_l4_chksum_offload(struct doca_eth_txq *eth_txq, uint8_t enable_l4_chksum)
Set offload for the calculation of TCP/UDP checksum (L4) on transmitted packets. If the users enables...
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_set_type(struct doca_eth_txq *eth_txq, enum doca_eth_txq_type type)
Set TX queue type property for doca_eth_txq. can only be called before calling doca_ctx_start().
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_cap_get_wait_on_time_offload_supported(const struct doca_devinfo *devinfo, enum doca_eth_wait_on_time_type *wait_on_time_mode)
Check if wait on time offload is supported by the network device.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_cap_is_type_supported(const struct doca_devinfo *devinfo, enum doca_eth_txq_type type, enum doca_eth_txq_data_path_type data_path_type)
Check if TX queue type is supported.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_set_mss(struct doca_eth_txq *eth_txq, uint16_t mss)
Set the Maximum Segment Size for doca_eth_txq. This value will be used per LSO send task / task_batch...
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_set_max_lso_header_size(struct doca_eth_txq *eth_txq, uint16_t max_lso_header_size)
Set the maximum LSO header size for doca_eth_txq. This value is the maximum header size of the LSO pa...
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_cap_get_max_lso_header_size(const struct doca_devinfo *devinfo, uint16_t *max_lso_header_size)
Get the maximum header size of an LSO packet supported by the device.
doca_eth_txq_type
Definition: doca_eth_txq.h:64
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_calculate_timestamp(struct doca_eth_txq *eth_txq, uint64_t timestamp_ns, uint64_t *wait_on_time_value)
Calculate timestamp to use when setting the wait on time on the Tx queue.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_cap_get_max_lso_msg_size(const struct doca_devinfo *devinfo, uint32_t *max_lso_msg_size)
Get the max LSO message size by the network device.
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_set_max_burst_size(struct doca_eth_txq *eth_txq, uint32_t max_burst_size)
Set max burst size property for doca_eth_txq. This value dictates the maximal number of packets the H...
@ DOCA_ETH_TXQ_DATA_PATH_TYPE_CPU
Definition: doca_eth_txq.h:72
@ DOCA_ETH_TXQ_DATA_PATH_TYPE_GPU
Definition: doca_eth_txq.h:73
@ DOCA_ETH_TXQ_TYPE_REGULAR
Definition: doca_eth_txq.h:65
doca_eth_wait_on_time_type
Type of wait on time the network card can support.
Definition: doca_types.h:142
uint8_t type
Definition: packets.h:0