-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net/mlx5e: CT: Add initial support for Hardware Steering
Connection tracking can offload tuple matches to the NIC either via firmware commands (when the steering mode is dmfs or offload support is disabled due to eswitch being set to legacy) or via software-managed flow steering (smfs). This commit adds stub operations for a third mode, hardware-managed flow steering. This is enabled when both CONFIG_MLX5_TC_CT and CONFIG_MLX5_HW_STEERING are enabled. Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com> Reviewed-by: Jianbo Liu <jianbol@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20250114130646.1937192-3-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
- Loading branch information
Cosmin Ratiu
authored and
Jakub Kicinski
committed
Jan 16, 2025
1 parent
af02dbf
commit 34eea5b
Showing
4 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_hmfs.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB | ||
/* Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. */ | ||
|
||
#include "en_tc.h" | ||
#include "en/tc_ct.h" | ||
#include "en/tc/ct_fs.h" | ||
|
||
static int mlx5_ct_fs_hmfs_init(struct mlx5_ct_fs *fs, struct mlx5_flow_table *ct, | ||
struct mlx5_flow_table *ct_nat, struct mlx5_flow_table *post_ct) | ||
{ | ||
return 0; | ||
} | ||
|
||
static void mlx5_ct_fs_hmfs_destroy(struct mlx5_ct_fs *fs) | ||
{ | ||
} | ||
|
||
static struct mlx5_ct_fs_rule * | ||
mlx5_ct_fs_hmfs_ct_rule_add(struct mlx5_ct_fs *fs, struct mlx5_flow_spec *spec, | ||
struct mlx5_flow_attr *attr, struct flow_rule *flow_rule) | ||
{ | ||
return ERR_PTR(-EOPNOTSUPP); | ||
} | ||
|
||
static void mlx5_ct_fs_hmfs_ct_rule_del(struct mlx5_ct_fs *fs, struct mlx5_ct_fs_rule *fs_rule) | ||
{ | ||
} | ||
|
||
static int mlx5_ct_fs_hmfs_ct_rule_update(struct mlx5_ct_fs *fs, struct mlx5_ct_fs_rule *fs_rule, | ||
struct mlx5_flow_spec *spec, struct mlx5_flow_attr *attr) | ||
{ | ||
return -EOPNOTSUPP; | ||
} | ||
|
||
static struct mlx5_ct_fs_ops hmfs_ops = { | ||
.ct_rule_add = mlx5_ct_fs_hmfs_ct_rule_add, | ||
.ct_rule_del = mlx5_ct_fs_hmfs_ct_rule_del, | ||
.ct_rule_update = mlx5_ct_fs_hmfs_ct_rule_update, | ||
|
||
.init = mlx5_ct_fs_hmfs_init, | ||
.destroy = mlx5_ct_fs_hmfs_destroy, | ||
}; | ||
|
||
struct mlx5_ct_fs_ops *mlx5_ct_fs_hmfs_ops_get(void) | ||
{ | ||
return &hmfs_ops; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters