Multi Channel DMA Intel® FPGA IP for PCI Express User Guide

ID 683821
Date 10/29/2021
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

8.2.7. API List

Table 102.  rte_eth_dev_configure
API API Description Input Parameters Return Values
int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, const struct rte_eth_conf *dev_conf)

This API configures an Ethernet device. This function must be invoked first before any other function in the Ethernet API.

port ID: device ID

nb_tx_queues : Number of TX Queues

num_rx_queues: Number of Rx Queues

eth_config : input configuration

0 Success, device configured

<0 Error code returned by the driver configuration function

Table 103.  rte_eth_tx_queue_setup
API API Description Input Parameters Return Values

Int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_rxconf *tx_conf)

This API allocates and set up a receive queue for DMA device.

port ID: Port ID of device

tx_queue_id: Queue ID

nb_tx_desc: Number of Tx descriptors to allocate for the transmit ring

socket_id: socket identifier

tx_conf: TX configuration context

0 on success

negative otherwise

Table 104.  rte_eth_rx_queue_setup
API API Description Input Parameters Return Values

int rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp)

This API allocates and set up a receive queue for DMA device.

port ID: Port ID of device

rx_queue_id: Queue ID

nb_rx_desc: Number of Rx descriptors to allocate for the receive ring

socket_id: socket identifier

rx_conf: RX configuration context

mp: Pointer to the memory pool from which is used to allocate memory buffers for each descriptor of the receive ring

0 on success

negative otherwise
Table 105.  rte_eth_dev_set_mtu
API API Description Input Parameters Return Values

int rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu)

This API sets the payload value for the processing.

port ID: Port ID of device

mtu: MTU to be applied

0 on success

negative otherwise

Table 106.  rte_eth_dev_start
API API Description Input Parameters Return Values

int rte_eth_dev_start(uint16_t port_id)

This API starts the Ethernet device by initializing descriptors, QCSR Rx and Tx context.

port ID: Port ID of device

0 on success

negative otherwise

Table 107.  rte_eth_dev_stop
API API Description Input Parameters Return Values

void rte_eth_dev_stop(uint16_t port_id)

This API stops the Ethernet device.

port ID: Port ID of device

void

Table 108.  rte_eth_dev_close
API API Description Input Parameters Return Values

Void rte_eth_dev_close(uint16_t port_id)

This API closes the Ethernet device.

port ID: Port ID of device

void

Table 109.  rte_eth_tx_burst
API API Description Input Parameters Return Values

static inline uint16_t rte_eth_tx_burst (uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, const uint16_t nb_pkts)

This API is used to transmit burst of packets.

port ID: Port ID of device queue_id:

Queue ID tx_pkts: Array of pointers to *rte_mbuf* structures

nb_pkts: Maximum number of packets to retrieve

The number of output packets actually stored in transmit descriptors.

Table 110.  rte_eth_rx_burst
API API Description Input Parameters Return Values

static inline uint16_t rte_eth_rx_burst (uint16_t port_id, uint16_t queue_id, struct rte_mbuf **rx_pkts, const uint16_t nb_pkts)

This API is used to receives burst of packets.

port ID: Port ID of device

queue_id: Queue ID rx_pkts: Array of pointers to *rte_mbuf* structures

nb_pkts: Maximum number of packets to retrieve

The number of packets actually retrieved.

Table 111.   ifc_mcdma_pio_read32
API API Description Input Parameters Return Values

uint32_t ifc_mcdma_pio_read32(struct ifc_mcdma_device *qdev, uint64_t addr); - New

Read 32b value from BAR2 address This API is used for PIO testing, dumping statistics, pattern generation etc.

qdev: MCDMA device

addr: address to read

0 on success

negative otherwise

Table 112.   ifc_mcdma_pio_write32
API API Description Input Parameters Return Values

void ifc_mcdma_pio_write32( struct ifc_mcdma_device *qdev, uint64_t addr, uint32_t val) - New

Writes 32b value to BAR2 address

qdev: MCDMA device

addr: address to write val: value to write

0 on success and populates channel context

negative otherwise

Table 113.   ifc_mcdma_pio_read64
API API Description Input Parameters Return Values

Uint64_t ifc_mcdma_pio_read64(struct ifc_mcdma_device *qdev, uint64_t addr); - New

Read 64b value from BAR2 address This API is used for PIO testing, dumping statistics, pattern generation etc.

qdev: MCDMA device

addr: address to read

0 on success

negative otherwise

Table 114.   ifc_mcdma_pio_write64
API API Description Input Parameters Return Values

void ifc_mcdma_pio_write64(struct ifc_mcdma_device *qdev, uint64_t addr, uint64_t val) - New

Writes 64 bit value to BAR2 address

qdev: MCDMA device addr: address to write

val: value to write

0 on success and populates channel context

negative otherwise