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

Function configure_dmadev_queue

dpdk/examples/dma/dmafwd.c:803–828  ·  view source on GitHub ↗

Configuration of device. 8< */

Source from the content-addressed store, hash-verified

801
802/* Configuration of device. 8< */
803static void
804configure_dmadev_queue(uint32_t dev_id)
805{
806 struct rte_dma_info info;
807 struct rte_dma_conf dev_config = { .nb_vchans = 1 };
808 struct rte_dma_vchan_conf qconf = {
809 .direction = RTE_DMA_DIR_MEM_TO_MEM,
810 .nb_desc = ring_size
811 };
812 uint16_t vchan = 0;
813
814 if (rte_dma_configure(dev_id, &dev_config) != 0)
815 rte_exit(EXIT_FAILURE, "Error with rte_dma_configure()\n");
816
817 if (rte_dma_vchan_setup(dev_id, vchan, &qconf) != 0) {
818 printf("Error with queue configuration\n");
819 rte_panic();
820 }
821 rte_dma_info_get(dev_id, &info);
822 if (info.nb_vchans != 1) {
823 printf("Error, no configured queues reported on device id %u\n", dev_id);
824 rte_panic();
825 }
826 if (rte_dma_start(dev_id) != 0)
827 rte_exit(EXIT_FAILURE, "Error with rte_dma_start()\n");
828}
829/* >8 End of configuration of device. */
830
831/* Using dmadev API functions. 8< */

Callers 1

assign_dmadevsFunction · 0.70

Calls 6

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
printfFunction · 0.50

Tested by

no test coverage detected