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

Message ID tencent_09A024AB9B0623F42009B08CC7CA0BBAA707@qq.com (mailing list archive)
State Changes Requested, 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 success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance fail Performance Testing issues
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

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

Comments

Maxime Coquelin June 14, 2022, 1:50 p.m. UTC | #1
On 6/14/22 15:36, 835703180@qq.com wrote:
> From: Shiqi Liu <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: Shiqi Liu <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))

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

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