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: fs, add multiple prios to RDMA TRANSPORT steering domain

RDMA TRANSPORT domains were initially limited to a single priority.
This change allows the domains to have multiple priorities, making
it possible to add several rules and control the order in which
they're evaluated.

Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Link: https://patch.msgid.link/b299cbb4c8678a33da6e6b6988b5bf6145c54b88.1750148083.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>

authored by

Patrisious Haddad and committed by
Leon Romanovsky
52931f55 e04c78d8

+23 -9
+22 -8
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
··· 3245 3245 init_rdma_transport_rx_root_ns_one(struct mlx5_flow_steering *steering, 3246 3246 int vport_idx) 3247 3247 { 3248 + struct mlx5_flow_root_namespace *root_ns; 3248 3249 struct fs_prio *prio; 3250 + int i; 3249 3251 3250 3252 steering->rdma_transport_rx_root_ns[vport_idx] = 3251 3253 create_root_ns(steering, FS_FT_RDMA_TRANSPORT_RX); 3252 3254 if (!steering->rdma_transport_rx_root_ns[vport_idx]) 3253 3255 return -ENOMEM; 3254 3256 3255 - /* create 1 prio*/ 3256 - prio = fs_create_prio(&steering->rdma_transport_rx_root_ns[vport_idx]->ns, 3257 - MLX5_RDMA_TRANSPORT_BYPASS_PRIO, 1); 3258 - return PTR_ERR_OR_ZERO(prio); 3257 + root_ns = steering->rdma_transport_rx_root_ns[vport_idx]; 3258 + 3259 + for (i = 0; i < MLX5_RDMA_TRANSPORT_BYPASS_PRIO; i++) { 3260 + prio = fs_create_prio(&root_ns->ns, i, 1); 3261 + if (IS_ERR(prio)) 3262 + return PTR_ERR(prio); 3263 + } 3264 + set_prio_attrs(root_ns); 3265 + return 0; 3259 3266 } 3260 3267 3261 3268 static int 3262 3269 init_rdma_transport_tx_root_ns_one(struct mlx5_flow_steering *steering, 3263 3270 int vport_idx) 3264 3271 { 3272 + struct mlx5_flow_root_namespace *root_ns; 3265 3273 struct fs_prio *prio; 3274 + int i; 3266 3275 3267 3276 steering->rdma_transport_tx_root_ns[vport_idx] = 3268 3277 create_root_ns(steering, FS_FT_RDMA_TRANSPORT_TX); 3269 3278 if (!steering->rdma_transport_tx_root_ns[vport_idx]) 3270 3279 return -ENOMEM; 3271 3280 3272 - /* create 1 prio*/ 3273 - prio = fs_create_prio(&steering->rdma_transport_tx_root_ns[vport_idx]->ns, 3274 - MLX5_RDMA_TRANSPORT_BYPASS_PRIO, 1); 3275 - return PTR_ERR_OR_ZERO(prio); 3281 + root_ns = steering->rdma_transport_tx_root_ns[vport_idx]; 3282 + 3283 + for (i = 0; i < MLX5_RDMA_TRANSPORT_BYPASS_PRIO; i++) { 3284 + prio = fs_create_prio(&root_ns->ns, i, 1); 3285 + if (IS_ERR(prio)) 3286 + return PTR_ERR(prio); 3287 + } 3288 + set_prio_attrs(root_ns); 3289 + return 0; 3276 3290 } 3277 3291 3278 3292 static int init_rdma_transport_rx_root_ns(struct mlx5_flow_steering *steering)
+1 -1
include/linux/mlx5/fs.h
··· 40 40 41 41 #define MLX5_SET_CFG(p, f, v) MLX5_SET(create_flow_group_in, p, f, v) 42 42 43 - #define MLX5_RDMA_TRANSPORT_BYPASS_PRIO 0 43 + #define MLX5_RDMA_TRANSPORT_BYPASS_PRIO 16 44 44 #define MLX5_FS_MAX_POOL_SIZE BIT(30) 45 45 46 46 enum mlx5_flow_destination_type {