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

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

Checks

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

Commit Message

biggest dreamer June 14, 2022, 1:48 p.m. UTC
  From: Shiqi Liu <835703180@qq.com>

To Maxime,
I am so sorry too late to reply your comment.My name is Shiqi Liu.
I got stuck in how to reply the comment before.Now, it seenms to be ok!Maybe there will be some mistakes I have taken ,
when I reply,please tell me how to do it correctly!
Thanks,
Shiqi Liu

--
  

Comments

Matan Azrad June 15, 2022, 7:47 a.m. UTC | #1
Hi Shiqi

From: 835703180@qq.com <835703180@qq.com>
> From: Shiqi Liu <835703180@qq.com>
> 
> To Maxime,
> I am so sorry too late to reply your comment.My name is Shiqi Liu.
> I got stuck in how to reply the comment before.Now, it seenms to be
> ok!Maybe there will be some mistakes I have taken , when I reply,please tell
> me how to do it correctly!
> Thanks,
> Shiqi Liu
> 
> 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))
> --
  

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))