[PATCH] vdpa/mlx5: return correct error code after rte_intr_instance_alloc failed

Matan Azrad matan at nvidia.com
Wed Jun 22 10:03:44 CEST 2022


Hi

I put here again the comment the putted on another version of this commit.

I saw it is already integrated but still not in master.

But please look.

From: Maxime Coquelin
> Hi newsky647,
> 
> On 6/12/22 16:09, 835703180 at qq.com wrote:
> > From: newsky647 <835703180 at qq.com>
> >
> > After function rte_intr_instance_alloc failed, we should return ENOMEM
> > for error code.
> >
> > Fixes: 5fe068bf7a2 ("vdpa/mlx5: reuse resources in reconfiguration")
> >
> > Signed-off-by: newsky647 <835703180 at qq.com>
> > ---
> >   drivers/vdpa/mlx5/mlx5_vdpa_event.c | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> > b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> > index 7167a98db0..6223afaae8 100644
> > --- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> > +++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
> > @@ -395,6 +395,7 @@ mlx5_vdpa_err_event_setup(struct mlx5_vdpa_priv
> *priv)
> >               rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_SHARED);
> >       if (priv->err_intr_handle == NULL) {
> >               DRV_LOG(ERR, "Fail to allocate intr_handle");
> > +             rte_errno = ENOMEM;

Shouldn't rte_intr_instance_alloc set it?

> >               goto error;
> >       }
> >       if (rte_intr_fd_set(priv->err_intr_handle, priv->err_chnl->fd))
> 
> The patch looks good to me, but I would need your real name for the sign-off.
> 
> Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
> 
> Thanks,
> Maxime



More information about the dev mailing list