Skip to content

Commit

Permalink
net/virtio: propagate interrupt configuration error values
Browse files Browse the repository at this point in the history
[ upstream commit 5a475f73b084029444c7b83229aa9a4b6b3dac0c ]

rte_intr_vec_list_alloc() may fail because of different reasons which
are indicated by different negative errno values.

Fixes: d61138d ("drivers: remove direct access to interrupt handle")

Signed-off-by: Boleslav Stankevich <boleslav.stankevich@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
  • Loading branch information
ol-bstankevich authored and kevintraynor committed Jul 11, 2023
1 parent 11a426e commit 2c2d4e8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/net/virtio/virtio_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1796,6 +1796,7 @@ static int
virtio_configure_intr(struct rte_eth_dev *dev)
{
struct virtio_hw *hw = dev->data->dev_private;
int ret;

if (!rte_intr_cap_multiple(dev->intr_handle)) {
PMD_INIT_LOG(ERR, "Multiple intr vector not supported");
Expand All @@ -1807,11 +1808,12 @@ virtio_configure_intr(struct rte_eth_dev *dev)
return -1;
}

if (rte_intr_vec_list_alloc(dev->intr_handle, "intr_vec",
hw->max_queue_pairs)) {
ret = rte_intr_vec_list_alloc(dev->intr_handle, "intr_vec",
hw->max_queue_pairs);
if (ret < 0) {
PMD_INIT_LOG(ERR, "Failed to allocate %u rxq vectors",
hw->max_queue_pairs);
return -ENOMEM;
return ret;
}

if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) {
Expand Down

0 comments on commit 2c2d4e8

Please sign in to comment.