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

Function config_dmadevs

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

Source from the content-addressed store, hash-verified

157}
158
159static int
160config_dmadevs(struct test_configure *cfg)
161{
162 uint32_t ring_size = cfg->ring_size.cur;
163 struct lcore_dma_map_t *ldm = &cfg->lcore_dma_map;
164 uint32_t nb_workers = ldm->cnt;
165 uint32_t i;
166 int dev_id;
167 uint16_t nb_dmadevs = 0;
168 char *dma_name;
169
170 for (i = 0; i < ldm->cnt; i++) {
171 dma_name = ldm->dma_names[i];
172 dev_id = rte_dma_get_dev_id_by_name(dma_name);
173 if (dev_id < 0) {
174 fprintf(stderr, "Error: Fail to find DMA %s.\n", dma_name);
175 goto end;
176 }
177
178 ldm->dma_ids[i] = dev_id;
179 configure_dmadev_queue(dev_id, ring_size);
180 ++nb_dmadevs;
181 }
182
183end:
184 if (nb_dmadevs < nb_workers) {
185 printf("Not enough dmadevs (%u) for all workers (%u).\n", nb_dmadevs, nb_workers);
186 return -1;
187 }
188
189 printf("Number of used dmadevs: %u.\n", nb_dmadevs);
190
191 return 0;
192}
193
194static void
195error_exit(int dev_id)

Callers 1

mem_copy_benchmarkFunction · 0.85

Calls 3

configure_dmadev_queueFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected