patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 22.11] net/mlx5: fix testpmd crash by action template
@ 2023-03-06  9:15 Rongwei Liu
  2023-03-06 10:55 ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Rongwei Liu @ 2023-03-06  9:15 UTC (permalink / raw)
  To: matan, viacheslavo, orika, thomas, Suanming Mou; +Cc: stable, rasland

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@dpdk.org
Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 22.11] net/mlx5: fix testpmd crash by action template
  2023-03-06  9:15 [PATCH 22.11] net/mlx5: fix testpmd crash by action template Rongwei Liu
@ 2023-03-06 10:55 ` Thomas Monjalon
  2023-03-06 11:04   ` [PATCH 22.11] net/mlx5: fix crash on action template failure Rongwei Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2023-03-06 10:55 UTC (permalink / raw)
  To: matan, viacheslavo, orika, Suanming Mou, Rongwei Liu; +Cc: stable, rasland

This patch is not specific to testpmd.
We should drop "testpmd" from the title.
Something like "fix crash on flow action template failure"


06/03/2023 10:15, Rongwei Liu:
> 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@dpdk.org
> Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@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;
>  }
> 






^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 22.11] net/mlx5: fix crash on action template failure
  2023-03-06 10:55 ` Thomas Monjalon
@ 2023-03-06 11:04   ` Rongwei Liu
  2023-04-08 13:31     ` Xueming(Steven) Li
  0 siblings, 1 reply; 4+ messages in thread
From: Rongwei Liu @ 2023-03-06 11:04 UTC (permalink / raw)
  To: matan, viacheslavo, orika, thomas, Suanming Mou; +Cc: stable, rasland

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@dpdk.org
Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 22.11] net/mlx5: fix crash on action template failure
  2023-03-06 11:04   ` [PATCH 22.11] net/mlx5: fix crash on action template failure Rongwei Liu
@ 2023-04-08 13:31     ` Xueming(Steven) Li
  0 siblings, 0 replies; 4+ messages in thread
From: Xueming(Steven) Li @ 2023-04-08 13:31 UTC (permalink / raw)
  To: Rongwei Liu, Matan Azrad, Slava Ovsiienko, Ori Kam,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Suanming Mou
  Cc: stable, Raslan Darawsheh

Thanks, patch queued to 22.11.2.

Best Regards,
Xueming Li

> -----Original Message-----
> From: Rongwei Liu <rongweil@nvidia.com>
> Sent: 3/6/2023 19:04
> To: Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; NBU-Contact-
> Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>; Suanming Mou
> <suanmingm@nvidia.com>
> Cc: stable@dpdk.org; Raslan Darawsheh <rasland@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@dpdk.org
> Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-08 13:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-06  9:15 [PATCH 22.11] net/mlx5: fix testpmd crash by action template Rongwei Liu
2023-03-06 10:55 ` Thomas Monjalon
2023-03-06 11:04   ` [PATCH 22.11] net/mlx5: fix crash on action template failure Rongwei Liu
2023-04-08 13:31     ` Xueming(Steven) Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).