NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_dpdk.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES, ALL RIGHTS RESERVED.
3  *
4  * This software product is a proprietary product of NVIDIA CORPORATION &
5  * AFFILIATES (the "Company") and all right, title, and interest in and to the
6  * software product, including all associated intellectual property rights, are
7  * and shall remain exclusively with the Company.
8  *
9  * This software product is governed by the End User License Agreement
10  * provided with the software product.
11  *
12  */
13 
25 #ifndef DOCA_DPDK_H_
26 #define DOCA_DPDK_H_
27 
28 #include <doca_error.h>
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 struct doca_dev;
35 struct doca_dev_rep;
36 struct doca_devinfo;
37 struct doca_devinfo_rep;
38 struct doca_buf_inventory;
39 struct doca_buf;
40 
41 struct rte_mempool;
42 struct rte_mbuf;
43 
44 struct doca_dpdk_mempool;
45 
65 doca_error_t doca_dpdk_cap_is_rep_port_supported(const struct doca_devinfo *devinfo, uint8_t *is_rep_port_supported);
66 
93 doca_error_t doca_dpdk_port_probe(struct doca_dev *dev, const char *devargs);
94 
111 doca_error_t doca_dpdk_get_first_port_id(const struct doca_dev *dev, uint16_t *port_id);
112 
128 doca_error_t doca_dpdk_port_as_dev(uint16_t port_id, struct doca_dev **dev);
129 
148 doca_error_t doca_dpdk_open_dev_rep_by_port_id(uint16_t port_id, struct doca_dev *dev, struct doca_dev_rep **rep);
149 
168 doca_error_t doca_dpdk_get_rep_vf_index(const struct doca_devinfo_rep *rep, uint16_t *vf_idx);
169 
191 doca_error_t doca_dpdk_get_rep_sf_num(const struct doca_devinfo_rep *rep, uint16_t *sf_num);
192 
225 doca_error_t doca_dpdk_mempool_create(const struct rte_mempool *mbuf_pool, struct doca_dpdk_mempool **mempool_out);
226 
243 doca_error_t doca_dpdk_mempool_destroy(struct doca_dpdk_mempool *mempool);
244 
263 doca_error_t doca_dpdk_mempool_dev_add(struct doca_dpdk_mempool *mempool, struct doca_dev *dev);
264 
282 doca_error_t doca_dpdk_mempool_set_permissions(struct doca_dpdk_mempool *mempool, uint32_t access_mask);
283 
303 doca_error_t doca_dpdk_mempool_start(struct doca_dpdk_mempool *mempool);
304 
356 doca_error_t doca_dpdk_mempool_mbuf_to_buf(struct doca_dpdk_mempool *mempool,
357  struct doca_buf_inventory *inventory,
358  struct rte_mbuf *mbuf,
359  struct doca_buf **buf);
360 
361 #ifdef __cplusplus
362 }
363 #endif
364 
367 #endif /* DOCA_DPDK_H_ */
#define DOCA_EXPERIMENTAL
To set a Symbol (or specifically a function) as experimental.
Definition: doca_compat.h:103
DOCA_EXPERIMENTAL doca_error_t doca_dpdk_mempool_create(const struct rte_mempool *mbuf_pool, struct doca_dpdk_mempool **mempool_out)
Create a DOCA DPDK memory pool, with ability to convert rte_mbuf to doca_buf Expected flow is as foll...
DOCA_EXPERIMENTAL doca_error_t doca_dpdk_get_first_port_id(const struct doca_dev *dev, uint16_t *port_id)
Return the first DPDK port id associated to a DOCA device. Assumption is that the doca device that wa...
DOCA_EXPERIMENTAL doca_error_t doca_dpdk_mempool_dev_add(struct doca_dpdk_mempool *mempool, struct doca_dev *dev)
Add a DOCA device to the mempool This allows the DOCA bufs that are retrieved from the pool to be com...
DOCA_EXPERIMENTAL doca_error_t doca_dpdk_cap_is_rep_port_supported(const struct doca_devinfo *devinfo, uint8_t *is_rep_port_supported)
Check if the device supports representors for port_probe.
DOCA_EXPERIMENTAL doca_error_t doca_dpdk_open_dev_rep_by_port_id(uint16_t port_id, struct doca_dev *dev, struct doca_dev_rep **rep)
Return a new DOCA device representor associated with a DPDK port. Assumption is that the DPDK port is...
DOCA_EXPERIMENTAL doca_error_t doca_dpdk_port_probe(struct doca_dev *dev, const char *devargs)
Attach a DPDK port specified by DOCA device.
DOCA_EXPERIMENTAL doca_error_t doca_dpdk_mempool_start(struct doca_dpdk_mempool *mempool)
Start the DOCA DPDK memory pool Operations that must be done before start: Adding at least 1 device -...
DOCA_EXPERIMENTAL doca_error_t doca_dpdk_mempool_destroy(struct doca_dpdk_mempool *mempool)
Destroy a DOCA DPDK memory pool Before destroying need to make sure that all buffers that were acquir...
DOCA_EXPERIMENTAL doca_error_t doca_dpdk_get_rep_vf_index(const struct doca_devinfo_rep *rep, uint16_t *vf_idx)
Return the VF index of a network VF representor.
DOCA_EXPERIMENTAL doca_error_t doca_dpdk_get_rep_sf_num(const struct doca_devinfo_rep *rep, uint16_t *sf_num)
Return the SF number of a network SF representor.
DOCA_EXPERIMENTAL doca_error_t doca_dpdk_port_as_dev(uint16_t port_id, struct doca_dev **dev)
Return the DOCA device associated with a DPDK port.
DOCA_EXPERIMENTAL doca_error_t doca_dpdk_mempool_set_permissions(struct doca_dpdk_mempool *mempool, uint32_t access_mask)
Set the read/write permissions of the memory for devices Default: DOCA_ACCESS_FLAG_LOCAL_READ_WRITE S...
DOCA_EXPERIMENTAL doca_error_t doca_dpdk_mempool_mbuf_to_buf(struct doca_dpdk_mempool *mempool, struct doca_buf_inventory *inventory, struct rte_mbuf *mbuf, struct doca_buf **buf)
Acquire a doca_buf based on an rte_mbuf The acquired doca_buf attempts to be as similar as possible t...
enum doca_error doca_error_t
DOCA API return codes.