Configuration of device. */
| 129 | |
| 130 | /* Configuration of device. */ |
| 131 | static void |
| 132 | configure_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 | |
| 159 | static int |
| 160 | config_dmadevs(struct test_configure *cfg) |
no test coverage detected