| 312 | } |
| 313 | |
| 314 | static int |
| 315 | virtio_alloc_queues(struct rte_eth_dev *dev) |
| 316 | { |
| 317 | struct virtio_hw *hw = dev->data->dev_private; |
| 318 | uint16_t nr_vq = virtio_get_nr_vq(hw); |
| 319 | uint16_t i; |
| 320 | int ret; |
| 321 | |
| 322 | hw->vqs = rte_zmalloc(NULL, sizeof(struct virtqueue *) * nr_vq, 0); |
| 323 | if (!hw->vqs) { |
| 324 | PMD_INIT_LOG(ERR, "failed to allocate vqs"); |
| 325 | return -ENOMEM; |
| 326 | } |
| 327 | |
| 328 | for (i = 0; i < nr_vq; i++) { |
| 329 | ret = virtio_init_queue(dev, i); |
| 330 | if (ret < 0) { |
| 331 | virtio_free_queues(hw); |
| 332 | return ret; |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | return 0; |
| 337 | } |
| 338 | |
| 339 | static void virtio_queues_unbind_intr(struct rte_eth_dev *dev); |
| 340 |
no test coverage detected