[v6,05/10] net/mlx5/hws: allow destination into default miss FT

Message ID 20231025112232.201606-6-getelson@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: support indirect actions list |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Gregory Etelson Oct. 25, 2023, 11:22 a.m. UTC
  From: Erez Shitrit <erezsh@nvidia.com>

In FDB it will direct the packet into the hypervisor vport.
That allows the user to mirror packets into the default-miss vport.

Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_action.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
  

Patch

diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c
index f068bc7e9c..6b62111593 100644
--- a/drivers/net/mlx5/hws/mlx5dr_action.c
+++ b/drivers/net/mlx5/hws/mlx5dr_action.c
@@ -1769,6 +1769,17 @@  mlx5dr_action_create_dest_array(struct mlx5dr_context *ctx,
 				fte_attr.action_flags |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
 				fte_attr.ignore_flow_level = 1;
 				break;
+			case MLX5DR_ACTION_TYP_MISS:
+				if (table_type != MLX5DR_TABLE_TYPE_FDB) {
+					DR_LOG(ERR, "Miss action supported for FDB only");
+					rte_errno = ENOTSUP;
+					goto free_dest_list;
+				}
+				dest_list[i].destination_type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
+				dest_list[i].destination_id =
+					ctx->caps->eswitch_manager_vport_number;
+				fte_attr.action_flags |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
+				break;
 			case MLX5DR_ACTION_TYP_VPORT:
 				dest_list[i].destination_type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
 				dest_list[i].destination_id = dests[i].dest->vport.vport_num;