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

ID 683821
Date 7/14/2023
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 122.  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 123.  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 124.  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 125.  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 126.  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 127.  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 128.  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 129.  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 130.  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 131.   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 132.   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

Table 133.   ifc_mcdma_pio_read128
API API Description Input Parameters Return Values

int ifc_mcdma_pio_read128(uint16_t portid, uint64_t offset, uint64_t *buf, int bar_num) - New

Read 128 bit value from specified address of specified BAR

This API is used for PIO testing etc.

qdev: MCDMA device

addr: address to read

0 on success

negative otherwise

Table 134.   ifc_mcdma_pio_write128
API API Description Input Parameters Return Values

int ifc_mcdma_pio_write128(uint16_t portid, uint64_t offset, uint64_t *val, int bar_num) – New

Writes 128 bit value to specified address of specified BAR.

This API is used for PIO testing etc.

qdev: MCDMA device

addr: address to write

val: value to write

0 on success and populates channel context

negative otherwise

Table 135.   ifc_mcdma_pio_read256
API API Description Input Parameters Return Values

int ifc_mcdma_pio_read256(uint16_t portid, uint64_t offset, uint64_t *buf, int bar_num) – New

Read 256 bit value from specified address of specified BAR

This API is used for PIO testing etc.

qdev: MCDMA device

addr: address to read

0 on success

negative otherwise

Table 136.   ifc_mcdma_pio_write256
API API Description Input Parameters Return Values

int ifc_mcdma_pio_write512(uint16_t portid, uint64_t offset, uint64_t *val, int bar_num) – New

Writes 128 bit value to specified address of specified BAR

This API is used for PIO testing etc.

qdev: MCDMA device

addr: address to write

val: value to write

0 on success and populates channel context

negative otherwise