28 #include <rte_ethdev.h>
37 struct doca_dev *
ddev,
43 uint32_t cyclic_buffer_size = 0;
57 for (uint32_t idx = 0; idx < queue_num; idx++) {
122 DOCA_LOG_INFO(
"Mapping receive queue buffer (0x%p size %dB) with nvidia-peermem mode",
136 DOCA_LOG_INFO(
"Mapping receive queue buffer (0x%p size %dB dmabuf fd %d) with dmabuf mode",
236 event_user_data[idx].
u64 = idx;
238 event_error_send_packet_cb,
239 event_user_data[idx]);
241 DOCA_LOG_ERR(
"Unable to set DOCA progress engine callback: %s",
248 event_notify_send_packet_cb,
249 event_user_data[idx]);
251 DOCA_LOG_ERR(
"Unable to set DOCA progress engine callback: %s",
259 DOCA_LOG_ERR(
"Unable to set DOCA progress engine to DOCA Eth Txq: %s",
296 DOCA_LOG_ERR(
"Can't destroy ICMP queues, invalid input");
doca_error_t create_icmp_gpu_pipe(struct rxq_icmp_queues *icmp_queues, struct doca_flow_port *port)
#define MAX_PKT_SIZE_ICMP
static struct doca_pe * pe
static struct rxq_icmp_queues icmp_queues
static struct doca_flow_port * df_port
static struct doca_gpu * gpu_dev
static struct doca_dev * ddev
DOCA_STABLE doca_error_t doca_ctx_start(struct doca_ctx *ctx)
Finalizes all configurations, and starts the DOCA CTX.
DOCA_EXPERIMENTAL doca_error_t doca_ctx_set_datapath_on_gpu(struct doca_ctx *ctx, struct doca_gpu *gpu_dev)
This function binds the DOCA context to a gpu device.
DOCA_STABLE doca_error_t doca_ctx_stop(struct doca_ctx *ctx)
Stops the context allowing reconfiguration.
enum doca_error doca_error_t
DOCA API return codes.
DOCA_STABLE const char * doca_error_get_descr(doca_error_t error)
Returns the description string of an error code.
@ DOCA_ERROR_INVALID_VALUE
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_gpu_event_notify_send_packet_register(struct doca_eth_txq *eth_txq, doca_eth_txq_gpu_event_notify_send_packet_cb_t event_notify_send_packet_cb, union doca_data event_user_data)
This method registers a doca_eth_txq_gpu_event_notify_send_packet event. can only be called before ca...
DOCA_EXPERIMENTAL doca_error_t doca_eth_txq_gpu_event_error_send_packet_register(struct doca_eth_txq *eth_txq, doca_eth_txq_gpu_event_error_send_packet_cb_t event_error_send_packet_cb, union doca_data event_user_data)
This method registers a doca_eth_txq_gpu_event_error_send_packet event. can only be called before cal...
void(* doca_eth_txq_gpu_event_error_send_packet_cb_t)(struct doca_eth_txq_gpu_event_error_send_packet *event_error, union doca_data event_user_data)
Function to be executed on send packet error event occurrence.
void(* doca_eth_txq_gpu_event_notify_send_packet_cb_t)(struct doca_eth_txq_gpu_event_notify_send_packet *event_notify, union doca_data event_user_data)
Function to be executed on send packet notify event occurrence.
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_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_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_destroy(struct doca_eth_txq *eth_txq)
Destroy a DOCA ETH TXQ instance.
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().
DOCA_EXPERIMENTAL doca_error_t doca_eth_rxq_destroy(struct doca_eth_rxq *eth_rxq)
Destroy a DOCA ETH RXQ instance.
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.
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.
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.
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().
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.
@ DOCA_ETH_RXQ_TYPE_CYCLIC
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
#define DOCA_LOG_INFO(format,...)
Generates an INFO application log message.
DOCA_STABLE doca_error_t doca_mmap_set_memrange(struct doca_mmap *mmap, void *addr, size_t len)
Set the memory range of DOCA memory map.
DOCA_STABLE doca_error_t doca_mmap_destroy(struct doca_mmap *mmap)
Destroy DOCA Memory Map structure.
DOCA_STABLE doca_error_t doca_mmap_create(struct doca_mmap **mmap)
Allocates zero size memory map object with default/unset attributes.
DOCA_STABLE doca_error_t doca_mmap_set_permissions(struct doca_mmap *mmap, uint32_t access_mask)
Set access flags of the registered memory.
DOCA_STABLE doca_error_t doca_mmap_start(struct doca_mmap *mmap)
Start DOCA Memory Map.
DOCA_STABLE doca_error_t doca_mmap_add_dev(struct doca_mmap *mmap, struct doca_dev *dev)
Register DOCA memory map on a given device.
DOCA_STABLE doca_error_t doca_mmap_set_dmabuf_memrange(struct doca_mmap *mmap, int dmabuf_fd, void *addr, size_t dmabuf_offset, size_t len)
Set the memory range of DOCA memory map using dmabuf.
DOCA_STABLE doca_error_t doca_pe_connect_ctx(struct doca_pe *pe, struct doca_ctx *ctx)
This method connects a context to a progress engine.
@ DOCA_ACCESS_FLAG_LOCAL_READ_WRITE
@ DOCA_ACCESS_FLAG_PCI_RELAXED_ORDERING
doca_error_t destroy_icmp_queues(struct rxq_icmp_queues *icmp_queues)
doca_error_t create_icmp_queues(struct rxq_icmp_queues *icmp_queues, struct doca_flow_port *df_port, struct doca_gpu *gpu_dev, struct doca_dev *ddev, uint32_t queue_num, struct doca_pe *pe, doca_eth_txq_gpu_event_error_send_packet_cb_t event_error_send_packet_cb, doca_eth_txq_gpu_event_notify_send_packet_cb_t event_notify_send_packet_cb)
DOCA_LOG_REGISTER(GPU_PACKET_PROCESSING_UDP)
struct doca_gpu * gpu_dev
struct doca_flow_port * port
struct doca_mmap * pkt_buff_mmap[MAX_QUEUES]
struct doca_eth_txq * eth_txq_cpu[MAX_QUEUES]
void * gpu_pkt_addr[MAX_QUEUES]
int dmabuf_fd[MAX_QUEUES]
struct doca_ctx * eth_txq_ctx[MAX_QUEUES]
struct doca_ctx * eth_rxq_ctx[MAX_QUEUES]
struct doca_gpu_eth_txq * eth_txq_gpu[MAX_QUEUES]
struct doca_gpu_eth_rxq * eth_rxq_gpu[MAX_QUEUES]
struct doca_eth_rxq * eth_rxq_cpu[MAX_QUEUES]
Convenience type for representing opaque data.