[2/2] net/mlx5/hws: add DROP action to multi destination actions

Message ID 20250213083239.94360-2-getelson@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series [1/2] net/mlx5: add DROP destination to mirror clone actions |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-abi-testing pending Testing pending
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing pending Testing pending
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS

Commit Message

Gregory Etelson Feb. 13, 2025, 8:32 a.m. UTC
From: Tamar Mashiah <tmashiah@nvidia.com>

Add DROP action to multi destination actions, set NOP
destination type when DROP is specified.

cc: stable@dpdk.org

Signed-off-by: Tamar Mashiah <tmashiah@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_action.c | 4 ++++
 drivers/net/mlx5/hws/mlx5dr_cmd.c    | 4 ++++
 2 files changed, 8 insertions(+)
  

Comments

Dariusz Sosnowski Feb. 26, 2025, 8:38 a.m. UTC | #1
> -----Original Message-----
> From: Gregory Etelson <getelson@nvidia.com>
> Sent: Thursday, February 13, 2025 9:33 AM
> To: dev@dpdk.org
> Cc: Gregory Etelson <getelson@nvidia.com>; Maayan Kashani
> <mkashani@nvidia.com>; Raslan Darawsheh <rasland@nvidia.com>; Tamar
> Mashiah <tmashiah@nvidia.com>; stable@dpdk.org
> Subject: [PATCH 2/2] net/mlx5/hws: add DROP action to multi destination actions
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Tamar Mashiah <tmashiah@nvidia.com>
> 
> Add DROP action to multi destination actions, set NOP destination type when
> DROP is specified.
> 
> cc: stable@dpdk.org
> 
> Signed-off-by: Tamar Mashiah <tmashiah@nvidia.com>

Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>

Best regards,
Dariusz Sosnowski
  

Patch

diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c
index b038ca6879..309a55629b 100644
--- a/drivers/net/mlx5/hws/mlx5dr_action.c
+++ b/drivers/net/mlx5/hws/mlx5dr_action.c
@@ -2389,6 +2389,10 @@  mlx5dr_action_create_dest_array(struct mlx5dr_context *ctx,
 				dest_list[i].destination_id = dests[i].dest->devx_dest.devx_obj->id;
 				fte_attr.action_flags |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
 				break;
+			case MLX5DR_ACTION_TYP_DROP:
+				dest_list[i].destination_type = MLX5_FLOW_DESTINATION_TYPE_NOP;
+				fte_attr.action_flags |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
+				break;
 			case MLX5DR_ACTION_TYP_REFORMAT_L2_TO_TNL_L2:
 			case MLX5DR_ACTION_TYP_REFORMAT_L2_TO_TNL_L3:
 				packet_reformat = mlx5dr_action_dest_array_process_reformat
diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c
index a4f778a8a4..2127757aab 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.c
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c
@@ -239,6 +239,10 @@  mlx5dr_cmd_set_fte(struct ibv_context *ctx,
 						 dest->ext_reformat->id);
 				}
 				break;
+			case MLX5_FLOW_DESTINATION_TYPE_NOP:
+				MLX5_SET(dest_format, in_dests, destination_type,
+					 dest->destination_type);
+				break;
 			default:
 				rte_errno = EOPNOTSUPP;
 				goto free_devx;