Skip to content

Commit 4c9fce5

Browse files
Jianbo Liukuba-moo
authored andcommitted
net/mlx5e: Add new prio for promiscuous mode
An optimization for promiscuous mode adds a high-priority steering table with a single catch-all rule to steer all traffic directly to the TTC table. However, a gap exists between the creation of this table and the insertion of the catch-all rule. Packets arriving in this brief window would miss as no rule was inserted yet, unnecessarily incrementing the 'rx_steer_missed_packets' counter and dropped. This patch resolves the issue by introducing a new prio for this table, placing it between MLX5E_TC_PRIO and MLX5E_NIC_PRIO. By doing so, packets arriving during the window now fall through to the next prio (at MLX5E_NIC_PRIO) instead of being dropped. Fixes: 1c46d74 ("net/mlx5e: Optimize promiscuous mode") Signed-off-by: Jianbo Liu <[email protected]> Reviewed-by: Mark Bloch <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent eb41a26 commit 4c9fce5

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/fs.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ enum {
1818

1919
enum {
2020
MLX5E_TC_PRIO = 0,
21-
MLX5E_NIC_PRIO
21+
MLX5E_PROMISC_PRIO,
22+
MLX5E_NIC_PRIO,
2223
};
2324

2425
struct mlx5e_flow_table {
@@ -68,9 +69,13 @@ struct mlx5e_l2_table {
6869
MLX5_HASH_FIELD_SEL_DST_IP |\
6970
MLX5_HASH_FIELD_SEL_IPSEC_SPI)
7071

71-
/* NIC prio FTS */
72+
/* NIC promisc FT level */
7273
enum {
7374
MLX5E_PROMISC_FT_LEVEL,
75+
};
76+
77+
/* NIC prio FTS */
78+
enum {
7479
MLX5E_VLAN_FT_LEVEL,
7580
MLX5E_L2_FT_LEVEL,
7681
MLX5E_TTC_FT_LEVEL,

drivers/net/ethernet/mellanox/mlx5/core/en_fs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ static int mlx5e_create_promisc_table(struct mlx5e_flow_steering *fs)
780780
ft_attr.max_fte = MLX5E_PROMISC_TABLE_SIZE;
781781
ft_attr.autogroup.max_num_groups = 1;
782782
ft_attr.level = MLX5E_PROMISC_FT_LEVEL;
783-
ft_attr.prio = MLX5E_NIC_PRIO;
783+
ft_attr.prio = MLX5E_PROMISC_PRIO;
784784

785785
ft->t = mlx5_create_auto_grouped_flow_table(fs->ns, &ft_attr);
786786
if (IS_ERR(ft->t)) {

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,16 @@
113113
#define ETHTOOL_PRIO_NUM_LEVELS 1
114114
#define ETHTOOL_NUM_PRIOS 11
115115
#define ETHTOOL_MIN_LEVEL (KERNEL_MIN_LEVEL + ETHTOOL_NUM_PRIOS)
116-
/* Promiscuous, Vlan, mac, ttc, inner ttc, {UDP/ANY/aRFS/accel/{esp, esp_err}}, IPsec policy,
116+
/* Vlan, mac, ttc, inner ttc, {UDP/ANY/aRFS/accel/{esp, esp_err}}, IPsec policy,
117117
* {IPsec RoCE MPV,Alias table},IPsec RoCE policy
118118
*/
119-
#define KERNEL_NIC_PRIO_NUM_LEVELS 11
119+
#define KERNEL_NIC_PRIO_NUM_LEVELS 10
120120
#define KERNEL_NIC_NUM_PRIOS 1
121-
/* One more level for tc */
122-
#define KERNEL_MIN_LEVEL (KERNEL_NIC_PRIO_NUM_LEVELS + 1)
121+
/* One more level for tc, and one more for promisc */
122+
#define KERNEL_MIN_LEVEL (KERNEL_NIC_PRIO_NUM_LEVELS + 2)
123+
124+
#define KERNEL_NIC_PROMISC_NUM_PRIOS 1
125+
#define KERNEL_NIC_PROMISC_NUM_LEVELS 1
123126

124127
#define KERNEL_NIC_TC_NUM_PRIOS 1
125128
#define KERNEL_NIC_TC_NUM_LEVELS 3
@@ -187,6 +190,8 @@ static struct init_tree_node {
187190
ADD_NS(MLX5_FLOW_TABLE_MISS_ACTION_DEF,
188191
ADD_MULTIPLE_PRIO(KERNEL_NIC_TC_NUM_PRIOS,
189192
KERNEL_NIC_TC_NUM_LEVELS),
193+
ADD_MULTIPLE_PRIO(KERNEL_NIC_PROMISC_NUM_PRIOS,
194+
KERNEL_NIC_PROMISC_NUM_LEVELS),
190195
ADD_MULTIPLE_PRIO(KERNEL_NIC_NUM_PRIOS,
191196
KERNEL_NIC_PRIO_NUM_LEVELS))),
192197
ADD_PRIO(0, BY_PASS_MIN_LEVEL, 0, FS_CHAINING_CAPS,

0 commit comments

Comments
 (0)