vdpa/mlx5: return correct error code after rte_intr_instance_alloc failed

Message ID tencent_2E08A11F49A4644857BAD2E506ED59F9350A@qq.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers
Series vdpa/mlx5: return correct error code after rte_intr_instance_alloc failed |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

biggest dreamer June 12, 2022, 2:09 p.m. UTC
  From: newsky647 <835703180@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@qq.com>
---
 drivers/vdpa/mlx5/mlx5_vdpa_event.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Maxime Coquelin June 14, 2022, 9:43 a.m. UTC | #1
Hi newsky647,

On 6/12/22 16:09, 835703180@qq.com wrote:
> From: newsky647 <835703180@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@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;
>   		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@redhat.com>

Thanks,
Maxime
  
Matan Azrad June 22, 2022, 8:03 a.m. UTC | #2
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@qq.com wrote:
> > From: newsky647 <835703180@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@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@redhat.com>
> 
> Thanks,
> Maxime
  
Maxime Coquelin June 22, 2022, 8:11 a.m. UTC | #3
Hi Matan,

On 6/22/22 10:03, Matan Azrad wrote:
> 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.

Thanks for the heads-up, I missed your initial comment.

> From: Maxime Coquelin
>> Hi newsky647,
>>
>> On 6/12/22 16:09, 835703180@qq.com wrote:
>>> From: newsky647 <835703180@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@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?

I think it makes sense, Thomas could you drop the patch while pulling my
branch? Or do you prefer I remove it directly from my tree?

Shiqi, can you send a new version of the patch taking Matan comment into
account?

Thanks,
Maxime

>>>                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@redhat.com>
>>
>> Thanks,
>> Maxime
>
  
Thomas Monjalon June 22, 2022, 8:46 a.m. UTC | #4
22/06/2022 10:11, Maxime Coquelin:
> >>> --- 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?
> 
> I think it makes sense, Thomas could you drop the patch while pulling my
> branch? Or do you prefer I remove it directly from my tree?

I'll drop it, no problem.
  
Maxime Coquelin June 22, 2022, 8:46 a.m. UTC | #5
On 6/22/22 10:46, Thomas Monjalon wrote:
> 22/06/2022 10:11, Maxime Coquelin:
>>>>> --- 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?
>>
>> I think it makes sense, Thomas could you drop the patch while pulling my
>> branch? Or do you prefer I remove it directly from my tree?
> 
> I'll drop it, no problem.
> 
> 
> 

Thanks, I'll update its patchwork status to change requested

Maxime
  

Patch

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;
 		goto error;
 	}
 	if (rte_intr_fd_set(priv->err_intr_handle, priv->err_chnl->fd))