Configuration of device. 8< */
| 801 | |
| 802 | /* Configuration of device. 8< */ |
| 803 | static void |
| 804 | configure_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< */ |
no test coverage detected