Functions¶
rte_pmd_qdma_dbg_regdump¶
Syntax:
int rte_pmd_qdma_dbg_regdump (uint8_t port_id)
Details:
Dumps the QDMA configuration registers for the given port
None
Parameters:
port_id | Port ID |
Returns:
‘0’ on success and “< 0” on failure
rte_pmd_qdma_dbg_reg_info_dump¶
Syntax:
int rte_pmd_qdma_dbg_reg_info_dump ( uint8_t port_id, uint32_t num_regs, uint32_t reg_addr )
Details:
Dumps the QDMA register field information for a given register offset
None
Parameters:
port_id | Port ID |
reg_addr | Register Address |
Returns:
‘0’ on success and “< 0” on failure
rte_pmd_qdma_dbg_qdevice¶
Syntax:
int rte_pmd_qdma_dbg_qdevice (uint8_t port_id)
Details:
Dumps the device specific SW structure for the given port
None
Parameters:
port_id | Port ID |
Returns:
‘0’ on success and “< 0” on failure
rte_pmd_qdma_qstats¶
Syntax:
int rte_pmd_qdma_qstats ( uint8_t port_id, uint16_t queue )
Details:
Dumps the qdma Tx and Rx queue stats for the given queue ID
None
Parameters:
port_id | Port ID |
queue | Queue ID relative to the Port |
Returns:
‘0’ on success and “< 0” on failure
rte_pmd_qdma_qstats_clear¶
Syntax:
int rte_pmd_qdma_qstats_clear ( uint8_t port_id, uint16_t queue )
Details:
Clear the qdma Tx and Rx queue stats for the given queue ID
None
Parameters:
port_id | Port ID |
queue | Queue ID relative to the Port |
Returns:
‘0’ on success and “< 0” on failure
rte_pmd_qdma_dbg_qinfo¶
Syntax:
int rte_pmd_qdma_dbg_qinfo ( uint8_t port_id, uint16_t queue )
Details:
Dumps the queue contexts and queue specific SW structures for the given queue ID
None
Parameters:
port_id | Port ID |
queue | Queue ID relative to the Port |
Returns:
‘0’ on success and “< 0” on failure
rte_pmd_qdma_dbg_qdesc¶
Syntax:
int rte_pmd_qdma_dbg_qdesc ( uint8_t port_id, uint16_t queue, int start, int end, enum rte_pmd_qdma_xdebug_desc_type type )
Details:
Dumps the Queue descriptors
None
Parameters:
port_id | Port ID |
queue | Queue ID relative to the Port |
start | Start index of the descriptor to dump |
end | End index of the descriptor to dump |
type | Descriptor type |
Returns:
‘0’ on success and “< 0” on failure
rte_pmd_qdma_get_bar_details¶
Syntax:
int rte_pmd_qdma_get_bar_details ( int port_id, int32_t* config_bar_idx, int32_t* user_bar_idx, int32_t* bypass_bar_idx )
Details:
Returns the BAR indices of the QDMA BARs
None
Parameters:
port_id | Port ID |
config_bar_idx | Config BAR index |
user_bar_idx | AXI Master Lite BAR(user bar) index |
bypass_bar_idx | AXI Bridge Master BAR(bypass bar) index |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_get_queue_base¶
Syntax:
int rte_pmd_qdma_get_queue_base ( int port_id, uint32_t* queue_base )
Details:
Returns queue base for given port
Application can call this API only after successful call to rte_eh_dev_configure() API
Parameters:
port_id | Port ID |
queue_base | Queue base |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_get_pci_func_type¶
Syntax:
int rte_pmd_qdma_get_pci_func_type ( int port_id, enum rte_pmd_qdma_pci_func_type* func_type )
Details:
Retrieves PCIe function type i.e. PF or VF
Returns the PCIe function type i.e. PF or VF of the given port
Parameters:
port_id | Port ID |
func_type | Indicates PCIe function type |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_get_immediate_data_state¶
Syntax:
int rte_pmd_qdma_get_immediate_data_state ( int port_id, uint32_t qid, int* state )
Details:
Returns immediate data state i.e. whether enabled or disabled, for the specified queue
Application can call this function after rte_eth_rx_queue_setup() is called. API is applicable for streaming queues only.
Parameters:
port_id | Port ID |
qid | Queue ID |
state | Pointer to the state specifying whether immediate data is enabled or not |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_set_queue_mode¶
Syntax:
int rte_pmd_qdma_set_queue_mode ( int port_id, uint32_t qid, enum rte_pmd_qdma_queue_mode_t mode )
Details:
Sets queue interface mode for the specified queue
Application can call this API after successful call to rte_eth_dev_configure() but before rte_eth_tx_queue_setup()/rte_eth_rx_queue_setup() API. By default, all queues are setup in streaming mode.
Parameters:
port_id | Port ID |
qid | Queue ID |
mode | Queue interface mode to be set |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_set_immediate_data_state¶
Syntax:
int rte_pmd_qdma_set_immediate_data_state ( int port_id, uint32_t qid, uint8_t state )
Details:
Sets immediate data state i.e. enable or disable, for the specified queue. If enabled, the user defined data in the completion ring are dumped in to a queue specific file “q_<qid>_immmediate_data.txt” in the local directory.
Application can call this API after successful call to rte_eth_rx_queue_setup() API. This API is applicable for streaming queues only.
Parameters:
port_id | Port ID |
qid | Queue ID |
state | Immediate data state to be set. Set ‘0’ to disable and ‘1’ to enable. |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_set_cmpt_overflow_check¶
Syntax:
int rte_pmd_qdma_set_cmpt_overflow_check ( int port_id, uint32_t qid, uint8_t enable )
Details:
Enables or disables the overflow check (whether PIDX is overflowing the CIDX) performed by QDMA on the completion descriptor ring of specified queue.
Application can call this API after successful call to rte_eth_rx_queue_setup() API, but before calling rte_eth_rx_queue_start() or rte_eth_dev_start() API.
Parameters:
port_id | Port ID |
qid | Queue ID |
enable | ‘1’ to enable and ‘0’ to disable the overflow check |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_set_cmpt_descriptor_size¶
Syntax:
int rte_pmd_qdma_set_cmpt_descriptor_size ( int port_id, uint32_t qid, enum rte_pmd_qdma_cmpt_desc_len size )
Details:
Configures the completion ring descriptor size
Application can call this API after successful call to rte_eth_dev_configure() but before rte_eth_rx_queue_setup() API when queue is in streaming mode, and before rte_pmd_qdma_dev_cmptq_setup when queue is in memory mapped mode. By default, the completion desciptor size is set to 8 bytes.
Parameters:
port_id | Port ID |
qid | Queue ID |
size | Descriptor size to be configured |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_set_cmpt_trigger_mode¶
Syntax:
int rte_pmd_qdma_set_cmpt_trigger_mode ( int port_id, uint32_t qid, enum rte_pmd_qdma_tigger_mode_t mode )
Details:
Configures the trigger mode for completion ring CIDX updates
Application can call this API before calling rte_eth_rx_queue_start() or rte_eth_dev_start() API. By default, trigger mode is set to RTE_PMD_QDMA_TRIG_MODE_USER_TIMER_COUNT.
Parameters:
port_id | Port ID |
qid | Queue ID |
mode | Trigger mode to be configured |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_set_cmpt_timer¶
Syntax:
int rte_pmd_qdma_set_cmpt_timer ( int port_id, uint32_t qid, uint32_t value )
Details:
Configures the timer interval in microseconds to trigger the completion ring CIDX updates
Application can call this API before calling rte_eth_rx_queue_start() or rte_eth_dev_start() API.
Parameters:
port_id | Port ID |
qid | Queue ID |
value | Timer interval for completion trigger to be configured |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_set_c2h_descriptor_prefetch¶
Syntax:
int rte_pmd_qdma_set_c2h_descriptor_prefetch ( int port_id, uint32_t qid, uint8_t enable )
Details:
Enables or disables prefetch of the descriptors by prefetch engine
Application can call this API after successful call to rte_eth_rx_queue_setup() API, but before calling rte_eth_rx_queue_start() or rte_eth_dev_start() API.
Parameters:
port_id | Port ID |
qid | Queue ID |
enable | ‘1’ to enable and ‘0’ to disable the descriptor prefetch |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_set_mm_endpoint_addr¶
Syntax:
int rte_pmd_qdma_set_mm_endpoint_addr ( int port_id, uint32_t qid, enum rte_pmd_qdma_dir_type dir, uint64_t addr )
Details:
Sets the PCIe endpoint memory offset at which to perform DMA operation for the specified queue operating in memory mapped mode.
This API can be called before Tx/Rx burst API’s (rte_eth_tx_burst() and rte_eth_rx_burst()) are called.
Parameters:
port_id | Port ID |
qid | Queue ID |
dir | Direction i.e. Tx or Rx |
addr | Destination address for Tx, Source address for Rx |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_configure_tx_bypass¶
Syntax:
int rte_pmd_qdma_configure_tx_bypass ( int port_id, uint32_t qid, enum rte_pmd_qdma_tx_bypass_mode bypass_mode, enum rte_pmd_qdma_bypass_desc_len size )
Details:
Sets the Tx bypass mode and bypass descriptor size for the specified queue
Application can call this API after successful call to rte_eth_dev_configure() but before tx_setup() API. By default, all queues are configured in internal mode i.e. bypass disabled. If size is specified zero, then the bypass descriptor size is set to the one used in internal mode.
Parameters:
port_id | Port ID |
qid | Queue ID |
bypass_mode | Bypass mode to be set |
size | Bypass descriptor size to be set |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_configure_rx_bypass¶
Syntax:
int rte_pmd_qdma_configure_rx_bypass ( int port_id, uint32_t qid, enum rte_pmd_qdma_rx_bypass_mode bypass_mode, enum rte_pmd_qdma_bypass_desc_len size )
Details:
Sets the Rx bypass mode and bypass descriptor size for the specified queue
Application can call this API after successful call to rte_eth_dev_configure() but before rte_eth_rx_queue_setup() API. By default, all queues are configured in internal mode i.e. bypass disabled. If size is specified zero, then the bypass descriptor size is set to the one used in internal mode.
Parameters:
port_id | Port ID |
qid | Queue ID |
bypass_mode | Bypass mode to be set |
size | Bypass descriptor size to be set |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_get_device_capabilities¶
Syntax:
int rte_pmd_qdma_get_device_capabilities ( int port_id, struct rte_pmd_qdma_dev_attributes* dev_attr )
Details:
Retrive the device capabilities
None.
Parameters:
port_id | Port ID |
dev_attr | Pointer to the device capabilities structure |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_dev_cmptq_setup¶
Syntax:
int rte_pmd_qdma_dev_cmptq_setup ( int port_id, uint32_t cmpt_queue_id, uint16_t nb_cmpt_desc, unsigned int socket_id )
Details:
Allocate and set up a completion queue for memory mapped mode
Application can call this API after successful call to rte_eth_dev_configure() and rte_pmd_qdma_set_queue_mode() for queues in memory mapped mode.
Parameters:
port_id | Port ID |
qid | Queue ID |
nb_cmpt_desc | Completion queue ring size |
socket_id | The socket_id argument is the socket identifier in case of NUMA. Its value can be SOCKET_ID_ANY if there is no NUMA constraint for the DMA memory allocated for the transmit descriptors of the ring. |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_dev_cmptq_start¶
Syntax:
int rte_pmd_qdma_dev_cmptq_start ( int port_id, uint32_t qid )
Details:
Start the MM completion queue
Application can call this API after successful call to rte_pmd_qdma_dev_cmptq_setup() API when queue is in memory mapped mode.
Parameters:
port_id | Port ID |
qid | Queue ID |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_dev_cmptq_stop¶
Syntax:
int rte_pmd_qdma_dev_cmptq_stop ( int port_id, uint32_t qid )
Details:
Stop the MM completion queue
Application can call this API after successful call to rte_pmd_qdma_dev_cmptq_start() API when queue is in memory mapped mode.
Parameters:
port_id | Port ID |
qid | Queue ID |
Returns:
‘0’ on success and ‘< 0’ on failure
rte_pmd_qdma_mm_cmpt_process¶
Syntax:
uint16_t rte_pmd_qdma_mm_cmpt_process ( int port_id, uint32_t qid, void* cmpt_buff, uint16_t nb_entries )
Details:
Process the MM Completion queue entries
Application can call this API after successful call to rte_pmd_qdma_dev_cmptq_start() API
Parameters:
port_id | Port ID |
qid | Queue ID |
cmpt_buff | User buffer pointer to store the completion data |
nb_entries | Number of compeltion entries to process |
Returns:
‘number of entries processed’ on success and ‘< 0’ on failure