Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net/mlx5: Add VHCA RX flow destination support for FW steering

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>

authored by

Shay Drory and committed by
Leon Romanovsky
0bc9059f 971b28ac

+16 -2
+3
drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.c
··· 282 282 case MLX5_FLOW_DESTINATION_TYPE_NONE: 283 283 trace_seq_printf(p, "none\n"); 284 284 break; 285 + case MLX5_FLOW_DESTINATION_TYPE_VHCA_RX: 286 + trace_seq_printf(p, "rx_vhca_id=%u\n", dst->vhca.id); 287 + break; 285 288 } 286 289 287 290 trace_seq_putc(p, 0);
+4
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c
··· 716 716 id = dst->dest_attr.ft->id; 717 717 ifc_type = MLX5_IFC_FLOW_DESTINATION_TYPE_TABLE_TYPE; 718 718 break; 719 + case MLX5_FLOW_DESTINATION_TYPE_VHCA_RX: 720 + id = dst->dest_attr.vhca.id; 721 + ifc_type = MLX5_IFC_FLOW_DESTINATION_TYPE_VHCA_RX; 722 + break; 719 723 default: 720 724 id = dst->dest_attr.tir_num; 721 725 ifc_type = MLX5_IFC_FLOW_DESTINATION_TYPE_TIR;
+5 -2
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
··· 503 503 type == MLX5_FLOW_DESTINATION_TYPE_FLOW_SAMPLER || 504 504 type == MLX5_FLOW_DESTINATION_TYPE_TIR || 505 505 type == MLX5_FLOW_DESTINATION_TYPE_RANGE || 506 - type == MLX5_FLOW_DESTINATION_TYPE_TABLE_TYPE; 506 + type == MLX5_FLOW_DESTINATION_TYPE_TABLE_TYPE || 507 + type == MLX5_FLOW_DESTINATION_TYPE_VHCA_RX; 507 508 } 508 509 509 510 static bool check_valid_spec(const struct mlx5_flow_spec *spec) ··· 1891 1890 d1->range.hit_ft == d2->range.hit_ft && 1892 1891 d1->range.miss_ft == d2->range.miss_ft && 1893 1892 d1->range.min == d2->range.min && 1894 - d1->range.max == d2->range.max)) 1893 + d1->range.max == d2->range.max) || 1894 + (d1->type == MLX5_FLOW_DESTINATION_TYPE_VHCA_RX && 1895 + d1->vhca.id == d2->vhca.id)) 1895 1896 return true; 1896 1897 } 1897 1898
+4
include/linux/mlx5/fs.h
··· 55 55 MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE_NUM, 56 56 MLX5_FLOW_DESTINATION_TYPE_RANGE, 57 57 MLX5_FLOW_DESTINATION_TYPE_TABLE_TYPE, 58 + MLX5_FLOW_DESTINATION_TYPE_VHCA_RX, 58 59 }; 59 60 60 61 enum { ··· 190 189 u32 ft_num; 191 190 struct mlx5_flow_table *ft; 192 191 struct mlx5_fc *counter; 192 + struct { 193 + u16 id; 194 + } vhca; 193 195 struct { 194 196 u16 num; 195 197 u16 vhca_id;