NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
DOCA ETH
Collaboration diagram for DOCA ETH:

Modules

 DOCA ETH RXQ
 
 DOCA ETH TXQ
 

Enumerations

enum  doca_eth_rxq_type { DOCA_ETH_RXQ_TYPE_CYCLIC = 0 , DOCA_ETH_RXQ_TYPE_MANAGED_MEMPOOL , DOCA_ETH_RXQ_TYPE_REGULAR }
 
enum  doca_eth_rxq_data_path_type { DOCA_ETH_RXQ_DATA_PATH_TYPE_CPU = 0 , DOCA_ETH_RXQ_DATA_PATH_TYPE_GPU }
 

Functions

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. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_destroy (struct doca_eth_rxq *eth_rxq)
 Destroy a DOCA ETH RXQ instance. More...
 
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. More...
 
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 HW can handle at the same time. can only be called before calling doca_ctx_start(). More...
 
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(). More...
 
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(). More...
 
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. can only be called before calling doca_ctx_start(). More...
 
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. can only be called before calling doca_ctx_start(). More...
 
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 this is enabled. can only be called before calling doca_ctx_start(). More...
 
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 this is enabled. can only be called before calling doca_ctx_start(). More...
 
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 is enabled. can only be called before calling doca_ctx_start(). More...
 
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 number of elements in a doca_buf list is. can only be called before calling doca_ctx_start(). More...
 
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(). More...
 
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(). More...
 
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. More...
 
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(). More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

DOCA ETH RXQ library.

Note
There are 2 data path options to use DOCA ETH RXQ context, a GPU managed control path and a CPU managed one. Other than the need to use doca_ctx_set_datapath_on_gpu() on a GPU context before starting it, both cases share the same control path functions (unless mentioned otherwise in the function documentation). The data path functions are different for the different options. The GPU managed data path functions are not included in the DOCA ETH RXQ API (check DOCA GPUNetIO).

Enumeration Type Documentation

◆ doca_eth_rxq_data_path_type

RX data-path type.

Enumerator
DOCA_ETH_RXQ_DATA_PATH_TYPE_CPU 

Enable data path management on the CPU

DOCA_ETH_RXQ_DATA_PATH_TYPE_GPU 

Enable data path management on the GPU

Definition at line 94 of file doca_eth_rxq.h.

◆ doca_eth_rxq_type

RX queue type.

Enumerator
DOCA_ETH_RXQ_TYPE_CYCLIC 

This mode is optimized for max packet rate. In this mode the library will receive packets in a cyclic manner. The processing time of packets should be faster than the rate in which they are received. If the application did not process the packets fast enough, the packet may be overrun by a new packet once the recv callback has ended. The receive callback should finish processing the packet before returning or copy the content. The user will supply a doca_mmap for DOCA ETH RXQ context. The recommended size of this mmap should be calculated using doca_eth_rxq_estimate_packet_buf_size.

DOCA_ETH_RXQ_TYPE_MANAGED_MEMPOOL 

In this mode the library will manage the memory and use various HW features to optimize memory consumption while increasing packet rate. The user will supply a doca_mmap for DOCA ETH RXQ context. The recommended size of this mmap should be calculated using doca_eth_rxq_estimate_packet_buf_size. The library assumes the user will release the packet buffer within a bound amount of time. Keeping packets for a long time without freeing it will block receiving incoming packets. NOTE: This type is supported only for DOCA ETH RXQ instance for CPU

DOCA_ETH_RXQ_TYPE_REGULAR 

In this mode the user posts a receive task, telling DOCA_RXQ to which buffer to scatter the incoming packet. NOTE: This type is supported only for DOCA ETH RXQ instance for CPU

Definition at line 64 of file doca_eth_rxq.h.

Function Documentation

◆ doca_eth_rxq_as_doca_ctx()

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.

Parameters
[in]eth_rxqPointer to doca_eth_rxq instance.
Returns
Non NULL upon success, NULL otherwise.

◆ doca_eth_rxq_cap_get_max_burst_size()

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.

Note
Function is relevant only in the case of context of type DOCA_ETH_RXQ_TYPE_REGULAR (max_burst_size isn't limited in other modes).
Parameters
[in]devinfoPointer to doca_devinfo instance.
[out]max_burst_sizeThe max burst size.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.

◆ doca_eth_rxq_cap_get_max_metadata_num()

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.

Parameters
[in]devinfoPointer to doca_devinfo instance.
[out]max_metadata_numMaximal metadata number to get. (check doca_eth_rxq_set_metadata_num)
Returns
DOCA_SUCCESS - if property set successfully. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.

◆ doca_eth_rxq_cap_get_max_packet_headroom()

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.

Note
In case of context of type DOCA_ETH_RXQ_TYPE_MANAGED_MEMPOOL where headroom (or tailroom) is used, the following should be satisfied: (packet_headroom + packet_tailroom + max_packet_size) <= 8KB
Parameters
[in]devinfoPointer to doca_devinfo instance.
[out]max_packet_headroomMaximal packet headroom size to get. (check doca_eth_rxq_set_packet_headroom)
Returns
DOCA_SUCCESS - if property set successfully. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.

◆ doca_eth_rxq_cap_get_max_packet_size()

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.

Parameters
[in]devinfoPointer to doca_devinfo instance.
[out]max_packet_sizeThe max packet size.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.

◆ doca_eth_rxq_cap_get_max_packet_tailroom()

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.

Note
In case of context of type DOCA_ETH_RXQ_TYPE_MANAGED_MEMPOOL where headroom (or tailroom) is used, the following should be satisfied: (packet_headroom + packet_tailroom + max_packet_size) <= 8KB
Parameters
[in]devinfoPointer to doca_devinfo instance.
[out]max_packet_tailroomMaximal packet tailroom size to get. (check doca_eth_rxq_set_packet_tailroom)
Returns
DOCA_SUCCESS - if property set successfully. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.

◆ doca_eth_rxq_cap_get_max_recv_buf_list_len()

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.

Parameters
[in]devinfoPointer to doca_devinfo instance.
[out]max_recv_buf_list_lenMaximal receive buffer list length to get. (check doca_eth_rxq_set_max_recv_buf_list_len)
Returns
DOCA_SUCCESS - if property set successfully. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.

◆ doca_eth_rxq_cap_is_type_supported()

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.

Parameters
[in]devinfoPointer to doca_devinfo instance.
[in]typeRX queue type - see enum doca_eth_rxq_type.
[in]data_path_typeRX data-path type - see enum doca_eth_rxq_data_path_type.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.
  • DOCA_ERROR_NOT_SUPPORTED - if type is not supported.

◆ doca_eth_rxq_create()

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.

Parameters
[in]devDevice to bind the context.
[in]max_burst_sizeMax burst size to use in context.
[in]max_packet_sizeMax packet size to use in context.
[out]eth_rxqPointer to pointer to be set to point to the created doca_eth_rxq instance.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - eth_rxq argument is a NULL pointer.
  • DOCA_ERROR_NO_MEMORY - failed to allocate resources.

◆ doca_eth_rxq_destroy()

DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_destroy ( struct doca_eth_rxq *  eth_rxq)

Destroy a DOCA ETH RXQ instance.

Parameters
[in]eth_rxqPointer to instance to be destroyed.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - eth_rxq argument is a NULL pointer.
  • DOCA_ERROR_BAD_STATE - eth_rxq context state is not idle.

◆ doca_eth_rxq_estimate_packet_buf_size()

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.

This function should be used for calculating the recommended size of the doca_mmap given to doca_eth_rxq_set_pkt_buf().

Note
Function is irrelevant in the case of context of type DOCA_ETH_RXQ_TYPE_REGULAR.
Parameters
[in]typeType of DOCA ETH RXQ.
[in]rateRate in [MB/s] in which the doca_rxq is expected to receive traffic.
[in]pkt_max_timeMax time in [μs] a packet may take to be processed.
[in]max_packet_sizeMax non-LRO packet size in [B].
[in]max_burst_sizeMax size of packets burst.
[in]log_max_lro_pkt_szLog of max LRO packet size.
[in]head_sizePacket headroom size.
[in]tail_sizePacket tailroom size.
[out]buf_sizeThe recommended size for the mmap buffer in [B].
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.
  • DOCA_ERROR_NOT_SUPPORTED - if the given type does not require packet buffer size.

◆ doca_eth_rxq_get_flow_queue_id()

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().

Parameters
[in]eth_rxqPointer to doca_eth_rxq instance.
[out]flow_queue_idThe queue ID to be used in rte_flow or doca_flow.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.
  • DOCA_ERROR_BAD_STATE - if context was not started.

◆ doca_eth_rxq_get_gpu_handle()

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.

Note
Supported for DOCA ETH RXQ instance for GPU only.

This method should be used after ctx is started. The expected flow is as follows:

  1. bind the ctx to a gpu device using doca_ctx_set_datapath_on_gpu()
  2. start the ctx using doca_ctx_start()
  3. call doca_eth_rxq_get_gpu_handle() to get the gpu_handle
Parameters
[in]eth_rxqPointer to doca_eth_rxq instance.
[out]eth_rxq_extA doca gpu eth_rxq handle.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.
  • DOCA_ERROR_BAD_STATE - if context is not started.
  • DOCA_ERROR_NOT_SUPPORTED - in case eth_rxq isn't an instance for GPU.

◆ doca_eth_rxq_set_flow_tag()

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. can only be called before calling doca_ctx_start().

Note
Supported for DOCA ETH RXQ instance for CPU only.
The default configuration is to disable flow tag support.
Parameters
[in]eth_rxqPointer to doca_eth_rxq instance.
[in]enable_flow_tagAn indicator to enable/disable flow tag.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.
  • DOCA_ERROR_BAD_STATE - if context is not idle.

◆ doca_eth_rxq_set_max_burst_size()

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 HW can handle at the same time. can only be called before calling doca_ctx_start().

Parameters
[in]eth_rxqPointer to doca_eth_rxq instance.
[in]max_burst_sizeMax burst size to use in context.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.
  • DOCA_ERROR_BAD_STATE - if context is not idle.

◆ doca_eth_rxq_set_max_packet_size()

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().

Note
Function is irrelevant in the case of context of type DOCA_ETH_RXQ_TYPE_REGULAR.
Parameters
[in]eth_rxqPointer to doca_eth_rxq instance.
[in]max_packet_sizeMax packet size to use in context.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.
  • DOCA_ERROR_BAD_STATE - if context is not idle.

◆ doca_eth_rxq_set_max_recv_buf_list_len()

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 number of elements in a doca_buf list is. can only be called before calling doca_ctx_start().

Note
Function is relevant only in the case of context of type DOCA_ETH_RXQ_TYPE_REGULAR.
The default maximal receive buffer list length is 1.
Parameters
[in]eth_rxqPointer to doca_eth_rxq instance.
[in]max_recv_buf_list_lenMaximal receive buffer list length to use in context.
Returns
DOCA_SUCCESS - if property set successfully. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.
  • DOCA_ERROR_BAD_STATE - if context is not idle.

◆ doca_eth_rxq_set_metadata_num()

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().

Note
Supported for DOCA ETH RXQ instance for CPU only.
The default configuration is to disable metadta support (0 metadata per packet).
Parameters
[in]eth_rxqPointer to doca_eth_rxq instance.
[in]metadata_numNumber of metadata per packet.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.
  • DOCA_ERROR_BAD_STATE - if context is not idle.

◆ doca_eth_rxq_set_notification_moderation()

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.

Notification moderation affects the number of events Rx completion events. Notification moderation can be modified at run time.

Parameters
[in]eth_rxqPointer to instance to set the moderation
[in]period_usec(0 disables moderation) Period in microseconds from the first completion until event is fired
[in]comp_count(0 disables moderation) Number of Rx completions until event is fired
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_BAD_STATE - if context was not started.
  • DOCA_ERROR_DRIVER - Failed to set moderation.

◆ doca_eth_rxq_set_packet_headroom()

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 this is enabled. can only be called before calling doca_ctx_start().

Note
Supported for DOCA ETH RXQ instance for CPU only.
Supported for DOCA_ETH_RXQ_TYPE_MANAGED_MEMPOOL mode only.
The default configuration is to disable packet headroom support.
Parameters
[in]eth_rxqPointer to doca_eth_rxq instance.
[in]head_sizeHead size to use for packet's headroom.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.
  • DOCA_ERROR_BAD_STATE - if context is not idle.

◆ doca_eth_rxq_set_packet_tailroom()

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 this is enabled. can only be called before calling doca_ctx_start().

Note
Supported for DOCA ETH RXQ instance for CPU only.
Supported for DOCA_ETH_RXQ_TYPE_MANAGED_MEMPOOL mode only.
The default configuration is to disable packet tailroom support.
Parameters
[in]eth_rxqPointer to doca_eth_rxq instance.
[in]tail_sizeTail size to use for packet's tailroom.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.
  • DOCA_ERROR_BAD_STATE - if context is not idle.

◆ doca_eth_rxq_set_pkt_buf()

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().

Note
Function is irrelevant in the case of context of type DOCA_ETH_RXQ_TYPE_REGULAR.
Parameters
[in]eth_rxqPointer to doca_eth_rxq instance.
[in]mmapThe mmap consist of the memrange for the Eth packet buffer.
[in]mmap_offsetThe offset from mmap start to set the packet buffer.
[in]mmap_lenThe mmap length of the packet buffer, starting from offset.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.
  • DOCA_ERROR_BAD_STATE - if context is not idle.

◆ doca_eth_rxq_set_rx_hash()

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. can only be called before calling doca_ctx_start().

Note
Supported for DOCA ETH RXQ instance for CPU only.
The default configuration is to disable RX hash support.
Parameters
[in]eth_rxqPointer to doca_eth_rxq instance.
[in]enable_rx_hashAn indicator to enable/disable RX hash.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.
  • DOCA_ERROR_BAD_STATE - if context is not idle.

◆ doca_eth_rxq_set_timestamp()

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 is enabled. can only be called before calling doca_ctx_start().

Note
Supported for DOCA ETH RXQ instance for CPU only.
The default configuration is to disable timestamp support.
This feature return the real time in nanoseconds when REAL_TIME_CLOCK_ENABLE ("mlxconfig" parameter) is TRUE.
Parameters
[in]eth_rxqPointer to doca_eth_rxq instance.
[in]enable_timestampAn indicator to enable/disable timestamp.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.
  • DOCA_ERROR_BAD_STATE - if context is not idle.

◆ doca_eth_rxq_set_type()

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().

Note
The default type is DOCA_ETH_RXQ_TYPE_REGULAR.
Parameters
[in]eth_rxqPointer to doca_eth_rxq instance.
[in]typeRX queue type - see enum doca_eth_rxq_type.
Returns
DOCA_SUCCESS - in case of success. doca_error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - if an invalid parameter was given.
  • DOCA_ERROR_BAD_STATE - if context is not idle.