> -----Original Message-----
> From: Boleslav Stankevich <[email protected]>
> Sent: Wednesday, March 22, 2023 6:23 PM
> To: [email protected]
> Cc: Boleslav Stankevich <[email protected]>;
> [email protected]; Andrew Rybchenko <[email protected]>; Maxime
> Coquelin <[email protected]>; Xia, Chenbo <[email protected]>;
> David Marchand <[email protected]>; Hyong Youb Kim
> <[email protected]>; Harman Kalra <[email protected]>
> Subject: [PATCH 1/2] net/virtio: propagate return value of called function
> 
> rte_intr_vec_list_alloc() may fail because of different reasons which
> are indicated by different negative errno values.
> 
> Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")
> Cc: [email protected]
> 
> Signed-off-by: Boleslav Stankevich <[email protected]>
> Signed-off-by: Andrew Rybchenko <[email protected]>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c
> b/drivers/net/virtio/virtio_ethdev.c
> index ae84d313be..5c8b7b95e9 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1390,6 +1390,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");
> @@ -1401,11 +1402,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) {
> --
> 2.30.2

I assume the mailmap warning should be fixed when merging. So:

Reviewed-by: Chenbo Xia <[email protected]> 

Reply via email to