* [PATCH 1/2] net/mlx5: add DROP destination to mirror clone actions
@ 2025-02-13 8:32 Gregory Etelson
2025-02-13 8:32 ` [PATCH 2/2] net/mlx5/hws: add DROP action to multi destination actions Gregory Etelson
0 siblings, 1 reply; 2+ messages in thread
From: Gregory Etelson @ 2025-02-13 8:32 UTC (permalink / raw)
To: dev; +Cc: getelson, , rasland, Tamar Mashiah, stable
From: Tamar Mashiah <tmashiah@nvidia.com>
Add DROP destination to mirror clone actions.
cc: stable@dpdk.org
Signed-off-by: Tamar Mashiah <tmashiah@nvidia.com>
---
.mailmap | 1 +
drivers/common/mlx5/mlx5_prm.h | 1 +
drivers/net/mlx5/mlx5_flow_hw.c | 5 +++++
3 files changed, 7 insertions(+)
diff --git a/.mailmap b/.mailmap
index a03d3cfb59..8e6e2d58a6 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1517,6 +1517,7 @@ Takeshi Yoshimura <tyos@jp.ibm.com> <t.yoshimura8869@gmail.com>
Takuya Asada <syuu@cloudius-systems.com>
Tal Avraham <talavr@annapurnalabs.com>
Tal Shnaiderman <talshn@nvidia.com> <talshn@mellanox.com>
+Tamar Mashiah <tmashiah@nvidia.com>
Tao Y Yang <tao.y.yang@intel.com>
Tao Zhu <taox.zhu@intel.com>
Taripin Samuel <samuel.taripin@intel.com>
diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index d0cb0131f6..4e630254f8 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -5221,6 +5221,7 @@ enum mlx5_flow_destination_type {
MLX5_FLOW_DESTINATION_TYPE_VPORT = 0x0,
MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE = 0x1,
MLX5_FLOW_DESTINATION_TYPE_TIR = 0x2,
+ MLX5_FLOW_DESTINATION_TYPE_NOP = 0xb,
};
enum mlx5_flow_context_action {
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 501bf33f94..39da3543b4 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -14144,6 +14144,7 @@ mlx5_mirror_terminal_action(const struct rte_flow_action *action)
case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT:
case RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR:
case RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX:
+ case RTE_FLOW_ACTION_TYPE_DROP:
return true;
default:
break;
@@ -14187,6 +14188,8 @@ mlx5_mirror_validate_sample_action(struct rte_eth_dev *dev,
return false;
break;
case RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX:
+ case RTE_FLOW_ACTION_TYPE_JUMP:
+ case RTE_FLOW_ACTION_TYPE_DROP:
break;
default:
return false;
@@ -14382,6 +14385,8 @@ hw_mirror_format_clone(struct rte_eth_dev *dev,
&actions[i],
"failed to create reformat action");
break;
+ case RTE_FLOW_ACTION_TYPE_DROP:
+ break;
default:
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION,
--
2.45.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 2/2] net/mlx5/hws: add DROP action to multi destination actions
2025-02-13 8:32 [PATCH 1/2] net/mlx5: add DROP destination to mirror clone actions Gregory Etelson
@ 2025-02-13 8:32 ` Gregory Etelson
0 siblings, 0 replies; 2+ messages in thread
From: Gregory Etelson @ 2025-02-13 8:32 UTC (permalink / raw)
To: dev; +Cc: getelson, , rasland, Tamar Mashiah, stable
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(+)
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;
--
2.45.2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-13 8:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-13 8:32 [PATCH 1/2] net/mlx5: add DROP destination to mirror clone actions Gregory Etelson
2025-02-13 8:32 ` [PATCH 2/2] net/mlx5/hws: add DROP action to multi destination actions Gregory Etelson
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).