DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5/hws: check action creation for HWS support
@ 2022-11-03 12:50 Alex Vesker
  2022-11-07 11:04 ` [PATCH v2] net/mlx5/hws: fix action creation check " Alex Vesker
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Vesker @ 2022-11-03 12:50 UTC (permalink / raw)
  To: valex, viacheslavo, thomas, suanmingm, Matan Azrad; +Cc: dev, orika

Fix segmentation fault when user will request to allocate
a HWS action while current device doesn't support HWS.

Fixes: f8c8a6d ("net/mlx5/hws: add action object")
Signed-off-by: Alex Vesker <valex@nvidia.com>
Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_action.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c
index 755d5d09cf..a0c34c3e35 100644
--- a/drivers/net/mlx5/hws/mlx5dr_action.c
+++ b/drivers/net/mlx5/hws/mlx5dr_action.c
@@ -699,6 +699,13 @@ mlx5dr_action_create_generic(struct mlx5dr_context *ctx,
 		return NULL;
 	}
 
+	if (mlx5dr_action_is_hws_flags(flags) &&
+	    !(ctx->flags & MLX5DR_CONTEXT_FLAG_HWS_SUPPORT)) {
+		DR_LOG(ERR, "Cannot create HWS action since HWS is not supported");
+		rte_errno = ENOTSUP;
+		return NULL;
+	}
+
 	action = simple_calloc(1, sizeof(*action));
 	if (!action) {
 		DR_LOG(ERR, "Failed to allocate memory for action [%d]", action_type);
-- 
2.18.1


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

* [PATCH v2] net/mlx5/hws: fix action creation check for HWS support
  2022-11-03 12:50 [PATCH] net/mlx5/hws: check action creation for HWS support Alex Vesker
@ 2022-11-07 11:04 ` Alex Vesker
  2022-11-08  9:00   ` Raslan Darawsheh
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Vesker @ 2022-11-07 11:04 UTC (permalink / raw)
  To: valex, viacheslavo, thomas, suanmingm, Matan Azrad; +Cc: dev, orika

Fix segmentation fault when a user will request to allocate
a HWS action while current device doesn't support HWS.

Fixes: f8c8a6d ("net/mlx5/hws: add action object")
Signed-off-by: Alex Vesker <valex@nvidia.com>
Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_action.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c
index a9e12aa1f5..b0ae4e7693 100644
--- a/drivers/net/mlx5/hws/mlx5dr_action.c
+++ b/drivers/net/mlx5/hws/mlx5dr_action.c
@@ -697,6 +697,13 @@ mlx5dr_action_create_generic(struct mlx5dr_context *ctx,
 		return NULL;
 	}
 
+	if (mlx5dr_action_is_hws_flags(flags) &&
+	    !(ctx->flags & MLX5DR_CONTEXT_FLAG_HWS_SUPPORT)) {
+		DR_LOG(ERR, "Cannot create HWS action since HWS is not supported");
+		rte_errno = ENOTSUP;
+		return NULL;
+	}
+
 	action = simple_calloc(1, sizeof(*action));
 	if (!action) {
 		DR_LOG(ERR, "Failed to allocate memory for action [%d]", action_type);
-- 
2.18.1


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

* RE: [PATCH v2] net/mlx5/hws: fix action creation check for HWS support
  2022-11-07 11:04 ` [PATCH v2] net/mlx5/hws: fix action creation check " Alex Vesker
@ 2022-11-08  9:00   ` Raslan Darawsheh
  0 siblings, 0 replies; 3+ messages in thread
From: Raslan Darawsheh @ 2022-11-08  9:00 UTC (permalink / raw)
  To: Alex Vesker, Alex Vesker, Slava Ovsiienko,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Suanming Mou, Matan Azrad
  Cc: dev, Ori Kam

Hi,

> -----Original Message-----
> From: Alex Vesker <valex@nvidia.com>
> Sent: Monday, November 7, 2022 1:04 PM
> To: Alex Vesker <valex@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; NBU-Contact-Thomas Monjalon (EXTERNAL)
> <thomas@monjalon.net>; Suanming Mou <suanmingm@nvidia.com>;
> Matan Azrad <matan@nvidia.com>
> Cc: dev@dpdk.org; Ori Kam <orika@nvidia.com>
> Subject: [PATCH v2] net/mlx5/hws: fix action creation check for HWS support
> 
> Fix segmentation fault when a user will request to allocate a HWS action
> while current device doesn't support HWS.
> 
> Fixes: f8c8a6d ("net/mlx5/hws: add action object")

> Signed-off-by: Alex Vesker <valex@nvidia.com>
> Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2022-11-08  9:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-03 12:50 [PATCH] net/mlx5/hws: check action creation for HWS support Alex Vesker
2022-11-07 11:04 ` [PATCH v2] net/mlx5/hws: fix action creation check " Alex Vesker
2022-11-08  9:00   ` Raslan Darawsheh

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