[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1564053847-28756-1-git-send-email-wenxu@ucloud.cn>
Date: Thu, 25 Jul 2019 19:24:07 +0800
From: wenxu@...oud.cn
To: saeedm@...lanox.com
Cc: netdev@...r.kernel.org
Subject: [PATCH] net/mlx5e: Fix zero table prio set by user.
From: wenxu <wenxu@...oud.cn>
The flow_cls_common_offload prio is zero
It leads the invalid table prio in hw.
Error: Could not process rule: Invalid argument
kernel log:
mlx5_core 0000:81:00.0: E-Switch: Failed to create FDB Table err -22 (table prio: 65535, level: 0, size: 4194304)
table_prio = (chain * FDB_MAX_PRIO) + prio - 1;
should check (chain * FDB_MAX_PRIO) + prio is not 0
Signed-off-by: wenxu <wenxu@...oud.cn>
---
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 089ae4d..64ca90f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -970,7 +970,9 @@ static int esw_add_fdb_miss_rule(struct mlx5_eswitch *esw)
flags |= (MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT |
MLX5_FLOW_TABLE_TUNNEL_EN_DECAP);
- table_prio = (chain * FDB_MAX_PRIO) + prio - 1;
+ table_prio = (chain * FDB_MAX_PRIO) + prio;
+ if (table_prio)
+ table_prio = table_prio - 1;
/* create earlier levels for correct fs_core lookup when
* connecting tables
--
1.8.3.1
Powered by blists - more mailing lists