[PATCH 22.11] net/mlx5: fix crash on action template failure

Xueming(Steven) Li xuemingl at nvidia.com
Sat Apr 8 15:31:20 CEST 2023


Thanks, patch queued to 22.11.2.

Best Regards,
Xueming Li

> -----Original Message-----
> From: Rongwei Liu <rongweil at nvidia.com>
> Sent: 3/6/2023 19:04
> To: Matan Azrad <matan at nvidia.com>; Slava Ovsiienko
> <viacheslavo at nvidia.com>; Ori Kam <orika at nvidia.com>; NBU-Contact-
> Thomas Monjalon (EXTERNAL) <thomas at monjalon.net>; Suanming Mou
> <suanmingm at nvidia.com>
> Cc: stable at dpdk.org; Raslan Darawsheh <rasland at nvidia.com>
> Subject: [PATCH 22.11] net/mlx5: fix crash on action template failure
> 
> When action template creation fails the testpmd expects error details.
> The driver did not set the error structure and testpmd failed with a
> segmentation fault.
> 
> Fixes: 836b5c9b5e0e ("net/mlx5: add action template management")
> Cc: stable at dpdk.org
> Signed-off-by: Rongwei Liu <rongweil at nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
> ---
>  drivers/net/mlx5/mlx5_flow_hw.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_hw.c
> b/drivers/net/mlx5/mlx5_flow_hw.c index b4a80f977f..9e5f263ccf 100644
> --- a/drivers/net/mlx5/mlx5_flow_hw.c
> +++ b/drivers/net/mlx5/mlx5_flow_hw.c
> @@ -4946,6 +4950,9 @@ flow_hw_actions_template_create(struct
> rte_eth_dev *dev,
>  			mlx5dr_action_template_destroy(at->tmpl);
>  		mlx5_free(at);
>  	}
> +	rte_flow_error_set(error, rte_errno,
> +			   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
> +			   "Failed to create action template");
>  	return NULL;
>  }
> --
> 2.27.0



More information about the stable mailing list