Skip to content

Commit 5fe2a6b

Browse files
committed
Merge tag 'mlx5-fixes-2021-08-26' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
Saeed Mahameed says: ==================== mlx5 fixes 2021-08-26 This series introduces some fixes to mlx5 driver. Please pull and let me know if there is any problem. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents d0efb16 + 6cc6477 commit 5fe2a6b

File tree

8 files changed

+34
-4
lines changed

8 files changed

+34
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ int mlx5_register_device(struct mlx5_core_dev *dev)
397397
void mlx5_unregister_device(struct mlx5_core_dev *dev)
398398
{
399399
mutex_lock(&mlx5_intf_mutex);
400-
dev->priv.flags |= MLX5_PRIV_FLAGS_DISABLE_ALL_ADEV;
400+
dev->priv.flags = MLX5_PRIV_FLAGS_DISABLE_ALL_ADEV;
401401
mlx5_rescan_drivers_locked(dev);
402402
mutex_unlock(&mlx5_intf_mutex);
403403
}

drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void mlx5e_tc_encap_flows_add(struct mlx5e_priv *priv,
147147
mlx5e_rep_queue_neigh_stats_work(priv);
148148

149149
list_for_each_entry(flow, flow_list, tmp_list) {
150-
if (!mlx5e_is_offloaded_flow(flow))
150+
if (!mlx5e_is_offloaded_flow(flow) || !flow_flag_test(flow, SLOW))
151151
continue;
152152
attr = flow->attr;
153153
esw_attr = attr->esw_attr;
@@ -188,7 +188,7 @@ void mlx5e_tc_encap_flows_del(struct mlx5e_priv *priv,
188188
int err;
189189

190190
list_for_each_entry(flow, flow_list, tmp_list) {
191-
if (!mlx5e_is_offloaded_flow(flow))
191+
if (!mlx5e_is_offloaded_flow(flow) || flow_flag_test(flow, SLOW))
192192
continue;
193193
attr = flow->attr;
194194
esw_attr = attr->esw_attr;

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,7 @@ bool mlx5e_tc_is_vf_tunnel(struct net_device *out_dev, struct net_device *route_
13381338
int mlx5e_tc_query_route_vport(struct net_device *out_dev, struct net_device *route_dev, u16 *vport)
13391339
{
13401340
struct mlx5e_priv *out_priv, *route_priv;
1341+
struct mlx5_devcom *devcom = NULL;
13411342
struct mlx5_core_dev *route_mdev;
13421343
struct mlx5_eswitch *esw;
13431344
u16 vhca_id;
@@ -1349,7 +1350,24 @@ int mlx5e_tc_query_route_vport(struct net_device *out_dev, struct net_device *ro
13491350
route_mdev = route_priv->mdev;
13501351

13511352
vhca_id = MLX5_CAP_GEN(route_mdev, vhca_id);
1353+
if (mlx5_lag_is_active(out_priv->mdev)) {
1354+
/* In lag case we may get devices from different eswitch instances.
1355+
* If we failed to get vport num, it means, mostly, that we on the wrong
1356+
* eswitch.
1357+
*/
1358+
err = mlx5_eswitch_vhca_id_to_vport(esw, vhca_id, vport);
1359+
if (err != -ENOENT)
1360+
return err;
1361+
1362+
devcom = out_priv->mdev->priv.devcom;
1363+
esw = mlx5_devcom_get_peer_data(devcom, MLX5_DEVCOM_ESW_OFFLOADS);
1364+
if (!esw)
1365+
return -ENODEV;
1366+
}
1367+
13521368
err = mlx5_eswitch_vhca_id_to_vport(esw, vhca_id, vport);
1369+
if (devcom)
1370+
mlx5_devcom_release_peer_data(devcom, MLX5_DEVCOM_ESW_OFFLOADS);
13531371
return err;
13541372
}
13551373

drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ static int mlx5_create_indir_fwd_group(struct mlx5_eswitch *esw,
364364
dest.type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
365365
dest.vport.num = e->vport;
366366
dest.vport.vhca_id = MLX5_CAP_GEN(esw->dev, vhca_id);
367+
dest.vport.flags = MLX5_FLOW_DEST_VPORT_VHCA_ID;
367368
e->fwd_rule = mlx5_add_flow_rules(e->ft, spec, &flow_act, &dest, 1);
368369
if (IS_ERR(e->fwd_rule)) {
369370
mlx5_destroy_flow_group(e->fwd_grp);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ static int mlx5_deactivate_lag(struct mlx5_lag *ldev)
277277
int err;
278278

279279
ldev->flags &= ~MLX5_LAG_MODE_FLAGS;
280+
mlx5_lag_mp_reset(ldev);
280281

281282
MLX5_SET(destroy_lag_in, in, opcode, MLX5_CMD_OP_DESTROY_LAG);
282283
err = mlx5_cmd_exec_in(dev0, destroy_lag, in);

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,14 @@ static int mlx5_lag_fib_event(struct notifier_block *nb,
302302
return NOTIFY_DONE;
303303
}
304304

305+
void mlx5_lag_mp_reset(struct mlx5_lag *ldev)
306+
{
307+
/* Clear mfi, as it might become stale when a route delete event
308+
* has been missed, see mlx5_lag_fib_route_event().
309+
*/
310+
ldev->lag_mp.mfi = NULL;
311+
}
312+
305313
int mlx5_lag_mp_init(struct mlx5_lag *ldev)
306314
{
307315
struct lag_mp *mp = &ldev->lag_mp;

drivers/net/ethernet/mellanox/mlx5/core/lag_mp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ struct lag_mp {
2121

2222
#ifdef CONFIG_MLX5_ESWITCH
2323

24+
void mlx5_lag_mp_reset(struct mlx5_lag *ldev);
2425
int mlx5_lag_mp_init(struct mlx5_lag *ldev);
2526
void mlx5_lag_mp_cleanup(struct mlx5_lag *ldev);
2627

2728
#else /* CONFIG_MLX5_ESWITCH */
2829

30+
static inline void mlx5_lag_mp_reset(struct mlx5_lag *ldev) {};
2931
static inline int mlx5_lag_mp_init(struct mlx5_lag *ldev) { return 0; }
3032
static inline void mlx5_lag_mp_cleanup(struct mlx5_lag *ldev) {}
3133

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,9 +846,9 @@ dr_rule_handle_ste_branch(struct mlx5dr_rule *rule,
846846
new_htbl = dr_rule_rehash(rule, nic_rule, cur_htbl,
847847
ste_location, send_ste_list);
848848
if (!new_htbl) {
849-
mlx5dr_htbl_put(cur_htbl);
850849
mlx5dr_err(dmn, "Failed creating rehash table, htbl-log_size: %d\n",
851850
cur_htbl->chunk_size);
851+
mlx5dr_htbl_put(cur_htbl);
852852
} else {
853853
cur_htbl = new_htbl;
854854
}

0 commit comments

Comments
 (0)