MCPcopy Create free account
hub / github.com/F-Stack/f-stack / configure_dmadev_queue

Function configure_dmadev_queue

dpdk/app/test-dma-perf/benchmark.c:131–157  ·  view source on GitHub ↗

Configuration of device. */

Source from the content-addressed store, hash-verified

129
130/* Configuration of device. */
131static void
132configure_dmadev_queue(uint32_t dev_id, uint32_t ring_size)
133{
134 uint16_t vchan = 0;
135 struct rte_dma_info info;
136 struct rte_dma_conf dev_config = { .nb_vchans = 1 };
137 struct rte_dma_vchan_conf qconf = {
138 .direction = RTE_DMA_DIR_MEM_TO_MEM,
139 .nb_desc = ring_size
140 };
141
142 if (rte_dma_configure(dev_id, &dev_config) != 0)
143 rte_exit(EXIT_FAILURE, "Error with dma configure.\n");
144
145 if (rte_dma_vchan_setup(dev_id, vchan, &qconf) != 0)
146 rte_exit(EXIT_FAILURE, "Error with queue configuration.\n");
147
148 if (rte_dma_info_get(dev_id, &info) != 0)
149 rte_exit(EXIT_FAILURE, "Error with getting device info.\n");
150
151 if (info.nb_vchans != 1)
152 rte_exit(EXIT_FAILURE, "Error, no configured queues reported on device id. %u\n",
153 dev_id);
154
155 if (rte_dma_start(dev_id) != 0)
156 rte_exit(EXIT_FAILURE, "Error with dma start.\n");
157}
158
159static int
160config_dmadevs(struct test_configure *cfg)

Callers 1

config_dmadevsFunction · 0.70

Calls 5

rte_dma_configureFunction · 0.85
rte_exitFunction · 0.85
rte_dma_vchan_setupFunction · 0.85
rte_dma_info_getFunction · 0.85
rte_dma_startFunction · 0.85

Tested by

no test coverage detected