]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net/mlx5: Add VHCA RX flow destination support for FW steering
authorShay Drory <shayd@nvidia.com>
Mon, 9 Mar 2026 09:34:33 +0000 (11:34 +0200)
committerLeon Romanovsky <leon@kernel.org>
Mon, 16 Mar 2026 20:23:00 +0000 (16:23 -0400)
Introduce MLX5_FLOW_DESTINATION_TYPE_VHCA_RX as a new flow steering
destination type.

Wire the new destination through flow steering command setup by mapping
it to MLX5_IFC_FLOW_DESTINATION_TYPE_VHCA_RX and passing the vhca id,
extend forward-destination validation to accept it, and teach the flow
steering tracepoint formatter to print rx_vhca_id.

Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260309093435.1850724-8-tariqt@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.c
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
include/linux/mlx5/fs.h

index 6d73127b7217fdeb1e05ca500125f6111de2e640..2cf1d3825defad0bbaf16874a32ab7c334e2cd5a 100644 (file)
@@ -282,6 +282,9 @@ const char *parse_fs_dst(struct trace_seq *p,
        case MLX5_FLOW_DESTINATION_TYPE_NONE:
                trace_seq_printf(p, "none\n");
                break;
+       case MLX5_FLOW_DESTINATION_TYPE_VHCA_RX:
+               trace_seq_printf(p, "rx_vhca_id=%u\n", dst->vhca.id);
+               break;
        }
 
        trace_seq_putc(p, 0);
index 16b28028609d8bdbbf5d4bdc9744857811d135d4..1cd4cd898ec2f27a0445edf2b58cea7a6da9cc62 100644 (file)
@@ -716,6 +716,10 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
                                id = dst->dest_attr.ft->id;
                                ifc_type = MLX5_IFC_FLOW_DESTINATION_TYPE_TABLE_TYPE;
                                break;
+                       case MLX5_FLOW_DESTINATION_TYPE_VHCA_RX:
+                               id = dst->dest_attr.vhca.id;
+                               ifc_type = MLX5_IFC_FLOW_DESTINATION_TYPE_VHCA_RX;
+                               break;
                        default:
                                id = dst->dest_attr.tir_num;
                                ifc_type = MLX5_IFC_FLOW_DESTINATION_TYPE_TIR;
index 2c3544880a3060d6bfc32e013009f0b994f2054e..003d211306a7d9f9929af5dd4865b983bfde2549 100644 (file)
@@ -503,7 +503,8 @@ static bool is_fwd_dest_type(enum mlx5_flow_destination_type type)
                type == MLX5_FLOW_DESTINATION_TYPE_FLOW_SAMPLER ||
                type == MLX5_FLOW_DESTINATION_TYPE_TIR ||
                type == MLX5_FLOW_DESTINATION_TYPE_RANGE ||
-               type == MLX5_FLOW_DESTINATION_TYPE_TABLE_TYPE;
+               type == MLX5_FLOW_DESTINATION_TYPE_TABLE_TYPE ||
+               type == MLX5_FLOW_DESTINATION_TYPE_VHCA_RX;
 }
 
 static bool check_valid_spec(const struct mlx5_flow_spec *spec)
@@ -1890,7 +1891,9 @@ static bool mlx5_flow_dests_cmp(struct mlx5_flow_destination *d1,
                     d1->range.hit_ft == d2->range.hit_ft &&
                     d1->range.miss_ft == d2->range.miss_ft &&
                     d1->range.min == d2->range.min &&
-                    d1->range.max == d2->range.max))
+                    d1->range.max == d2->range.max) ||
+                   (d1->type == MLX5_FLOW_DESTINATION_TYPE_VHCA_RX &&
+                    d1->vhca.id == d2->vhca.id))
                        return true;
        }
 
index 9cadb1d5e6df038fa1d2a6bce9918df24e5ec350..02064424e868a15993bb4ba9659c96851a40f403 100644 (file)
@@ -55,6 +55,7 @@ enum mlx5_flow_destination_type {
        MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE_NUM,
        MLX5_FLOW_DESTINATION_TYPE_RANGE,
        MLX5_FLOW_DESTINATION_TYPE_TABLE_TYPE,
+       MLX5_FLOW_DESTINATION_TYPE_VHCA_RX,
 };
 
 enum {
@@ -189,6 +190,9 @@ struct mlx5_flow_destination {
                u32                     ft_num;
                struct mlx5_flow_table  *ft;
                struct mlx5_fc          *counter;
+               struct {
+                       u16             id;
+               } vhca;
                struct {
                        u16             num;
                        u16             vhca_id;