[v2] net/mlx5/hws: fix possible action setter segmenation fault

Message ID 20221107101824.16288-1-valex@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series [v2] net/mlx5/hws: fix possible action setter segmenation fault |

Checks

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

Commit Message

Alex Vesker Nov. 7, 2022, 10:18 a.m. UTC
  When the maximum action combination in RX is used we can get
a segfault due to an incorrecrt max array size define.
This bug can happen on RX/TX or FDB in the most complex
cases.
Current max was set to 7, but actual max is:
Max TX: 8, Max RX: 10, Max FDB: 9

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.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Raslan Darawsheh Nov. 8, 2022, 8:59 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Alex Vesker <valex@nvidia.com>
> Sent: Monday, November 7, 2022 12:18 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 possible action setter segmenation
> fault
> 
> When the maximum action combination in RX is used we can get a segfault
> due to an incorrecrt max array size define.
> This bug can happen on RX/TX or FDB in the most complex cases.
> Current max was set to 7, but actual max is:
> Max TX: 8, Max RX: 10, Max FDB: 9
> 
> Fixes: f8c8a6d ("net/mlx5/hws: add action object")
missing empty line - will handle during integration
> 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
  

Patch

diff --git a/drivers/net/mlx5/hws/mlx5dr_action.h b/drivers/net/mlx5/hws/mlx5dr_action.h
index 3b31ffc90e..9a4827481a 100644
--- a/drivers/net/mlx5/hws/mlx5dr_action.h
+++ b/drivers/net/mlx5/hws/mlx5dr_action.h
@@ -6,7 +6,7 @@ 
 #define MLX5DR_ACTION_H_
 
 /* Max number of STEs needed for a rule (including match) */
-#define MLX5DR_ACTION_MAX_STE 7
+#define MLX5DR_ACTION_MAX_STE 10
 
 enum mlx5dr_action_stc_idx {
 	MLX5DR_ACTION_STC_IDX_CTRL = 0,