Skip to content

Commit 6e79bd2

Browse files
committed
Merge tag 'mlx5-fixes-2023-04-20' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
Saeed Mahameed says: ==================== mlx5 fixes 2023-04-19 This series provides bug fixes to mlx5 driver. * tag 'mlx5-fixes-2023-04-20' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: Revert "net/mlx5e: Don't use termination table when redundant" net/mlx5e: Nullify table pointer when failing to create net/mlx5: Use recovery timeout on sync reset flow Revert "net/mlx5: Remove "recovery" arg from mlx5_load_one() function" net/mlx5e: Fix error flow in representor failing to add vport rx rule net/mlx5: Release tunnel device after tc update skb net/mlx5: E-switch, Don't destroy indirect table in split rule net/mlx5: E-switch, Create per vport table based on devlink encap mode net/mlx5e: Release the label when replacing existing ct entry net/mlx5e: Don't clone flow post action attributes second time ==================== Link: https://lore.kernel.org/r/20230421015057.355468-1-saeed@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 7ecebee + 081abca commit 6e79bd2

16 files changed

Lines changed: 40 additions & 54 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ static int mlx5_devlink_reload_up(struct devlink *devlink, enum devlink_reload_a
202202
break;
203203
/* On fw_activate action, also driver is reloaded and reinit performed */
204204
*actions_performed |= BIT(DEVLINK_RELOAD_ACTION_DRIVER_REINIT);
205-
ret = mlx5_load_one_devl_locked(dev, false);
205+
ret = mlx5_load_one_devl_locked(dev, true);
206206
break;
207207
default:
208208
/* Unsupported action should not get to this function */

drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,5 +715,6 @@ void mlx5e_rep_tc_receive(struct mlx5_cqe64 *cqe, struct mlx5e_rq *rq,
715715
return;
716716

717717
free_skb:
718+
dev_put(tc_priv.fwd_dev);
718719
dev_kfree_skb_any(skb);
719720
}

drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,22 +106,17 @@ mlx5e_tc_post_act_offload(struct mlx5e_post_act *post_act,
106106
}
107107

108108
struct mlx5e_post_act_handle *
109-
mlx5e_tc_post_act_add(struct mlx5e_post_act *post_act, struct mlx5_flow_attr *attr)
109+
mlx5e_tc_post_act_add(struct mlx5e_post_act *post_act, struct mlx5_flow_attr *post_attr)
110110
{
111-
u32 attr_sz = ns_to_attr_sz(post_act->ns_type);
112111
struct mlx5e_post_act_handle *handle;
113-
struct mlx5_flow_attr *post_attr;
114112
int err;
115113

116114
handle = kzalloc(sizeof(*handle), GFP_KERNEL);
117-
post_attr = mlx5_alloc_flow_attr(post_act->ns_type);
118-
if (!handle || !post_attr) {
119-
kfree(post_attr);
115+
if (!handle) {
120116
kfree(handle);
121117
return ERR_PTR(-ENOMEM);
122118
}
123119

124-
memcpy(post_attr, attr, attr_sz);
125120
post_attr->chain = 0;
126121
post_attr->prio = 0;
127122
post_attr->ft = post_act->ft;
@@ -145,7 +140,6 @@ mlx5e_tc_post_act_add(struct mlx5e_post_act *post_act, struct mlx5_flow_attr *at
145140
return handle;
146141

147142
err_xarray:
148-
kfree(post_attr);
149143
kfree(handle);
150144
return ERR_PTR(err);
151145
}
@@ -164,7 +158,6 @@ mlx5e_tc_post_act_del(struct mlx5e_post_act *post_act, struct mlx5e_post_act_han
164158
if (!IS_ERR_OR_NULL(handle->rule))
165159
mlx5e_tc_post_act_unoffload(post_act, handle);
166160
xa_erase(&post_act->ids, handle->id);
167-
kfree(handle->attr);
168161
kfree(handle);
169162
}
170163

drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ void
1919
mlx5e_tc_post_act_destroy(struct mlx5e_post_act *post_act);
2020

2121
struct mlx5e_post_act_handle *
22-
mlx5e_tc_post_act_add(struct mlx5e_post_act *post_act, struct mlx5_flow_attr *attr);
22+
mlx5e_tc_post_act_add(struct mlx5e_post_act *post_act, struct mlx5_flow_attr *post_attr);
2323

2424
void
2525
mlx5e_tc_post_act_del(struct mlx5e_post_act *post_act, struct mlx5e_post_act_handle *handle);

drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
#define MLX5_ESW_VPORT_TBL_SIZE_SAMPLE (64 * 1024)
1616

17-
static const struct esw_vport_tbl_namespace mlx5_esw_vport_tbl_sample_ns = {
17+
static struct esw_vport_tbl_namespace mlx5_esw_vport_tbl_sample_ns = {
1818
.max_fte = MLX5_ESW_VPORT_TBL_SIZE_SAMPLE,
1919
.max_num_groups = 0, /* default num of groups */
20-
.flags = MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT | MLX5_FLOW_TABLE_TUNNEL_EN_DECAP,
20+
.flags = 0,
2121
};
2222

2323
struct mlx5e_tc_psample {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,7 @@ mlx5_tc_ct_entry_replace_rule(struct mlx5_tc_ct_priv *ct_priv,
920920
zone_rule->rule = rule;
921921
mlx5_tc_ct_entry_destroy_mod_hdr(ct_priv, old_attr, zone_rule->mh);
922922
zone_rule->mh = mh;
923+
mlx5_put_label_mapping(ct_priv, old_attr->ct_attr.ct_labels_id);
923924

924925
kfree(old_attr);
925926
kvfree(spec);

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ static int mlx5e_create_promisc_table(struct mlx5e_flow_steering *fs)
783783
ft->t = mlx5_create_auto_grouped_flow_table(fs->ns, &ft_attr);
784784
if (IS_ERR(ft->t)) {
785785
err = PTR_ERR(ft->t);
786+
ft->t = NULL;
786787
fs_err(fs, "fail to create promisc table err=%d\n", err);
787788
return err;
788789
}
@@ -810,7 +811,7 @@ static void mlx5e_del_promisc_rule(struct mlx5e_flow_steering *fs)
810811

811812
static void mlx5e_destroy_promisc_table(struct mlx5e_flow_steering *fs)
812813
{
813-
if (WARN(!fs->promisc.ft.t, "Trying to remove non-existing promiscuous table"))
814+
if (!fs->promisc.ft.t)
814815
return;
815816
mlx5e_del_promisc_rule(fs);
816817
mlx5_destroy_flow_table(fs->promisc.ft.t);
@@ -1490,6 +1491,8 @@ struct mlx5e_flow_steering *mlx5e_fs_init(const struct mlx5e_profile *profile,
14901491

14911492
void mlx5e_fs_cleanup(struct mlx5e_flow_steering *fs)
14921493
{
1494+
if (!fs)
1495+
return;
14931496
debugfs_remove_recursive(fs->dfs_root);
14941497
mlx5e_fs_ethtool_free(fs);
14951498
mlx5e_fs_tc_free(fs);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5270,6 +5270,7 @@ static void mlx5e_nic_cleanup(struct mlx5e_priv *priv)
52705270
mlx5e_health_destroy_reporters(priv);
52715271
mlx5e_ktls_cleanup(priv);
52725272
mlx5e_fs_cleanup(priv->fs);
5273+
priv->fs = NULL;
52735274
}
52745275

52755276
static int mlx5e_init_nic_rx(struct mlx5e_priv *priv)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,7 @@ static int mlx5e_init_ul_rep(struct mlx5_core_dev *mdev,
828828
static void mlx5e_cleanup_rep(struct mlx5e_priv *priv)
829829
{
830830
mlx5e_fs_cleanup(priv->fs);
831+
priv->fs = NULL;
831832
}
832833

833834
static int mlx5e_create_rep_ttc_table(struct mlx5e_priv *priv)
@@ -994,6 +995,7 @@ static int mlx5e_init_rep_rx(struct mlx5e_priv *priv)
994995
priv->rx_res = NULL;
995996
err_free_fs:
996997
mlx5e_fs_cleanup(priv->fs);
998+
priv->fs = NULL;
997999
return err;
9981000
}
9991001

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct mlx5_vport_key {
1111
u16 prio;
1212
u16 vport;
1313
u16 vhca_id;
14-
const struct esw_vport_tbl_namespace *vport_ns;
14+
struct esw_vport_tbl_namespace *vport_ns;
1515
} __packed;
1616

1717
struct mlx5_vport_table {
@@ -21,6 +21,14 @@ struct mlx5_vport_table {
2121
struct mlx5_vport_key key;
2222
};
2323

24+
static void
25+
esw_vport_tbl_init(struct mlx5_eswitch *esw, struct esw_vport_tbl_namespace *ns)
26+
{
27+
if (esw->offloads.encap != DEVLINK_ESWITCH_ENCAP_MODE_NONE)
28+
ns->flags |= (MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT |
29+
MLX5_FLOW_TABLE_TUNNEL_EN_DECAP);
30+
}
31+
2432
static struct mlx5_flow_table *
2533
esw_vport_tbl_create(struct mlx5_eswitch *esw, struct mlx5_flow_namespace *ns,
2634
const struct esw_vport_tbl_namespace *vport_ns)
@@ -80,6 +88,7 @@ mlx5_esw_vporttbl_get(struct mlx5_eswitch *esw, struct mlx5_vport_tbl_attr *attr
8088
u32 hkey;
8189

8290
mutex_lock(&esw->fdb_table.offloads.vports.lock);
91+
esw_vport_tbl_init(esw, attr->vport_ns);
8392
hkey = flow_attr_to_vport_key(esw, attr, &skey);
8493
e = esw_vport_tbl_lookup(esw, &skey, hkey);
8594
if (e) {
@@ -127,6 +136,7 @@ mlx5_esw_vporttbl_put(struct mlx5_eswitch *esw, struct mlx5_vport_tbl_attr *attr
127136
u32 hkey;
128137

129138
mutex_lock(&esw->fdb_table.offloads.vports.lock);
139+
esw_vport_tbl_init(esw, attr->vport_ns);
130140
hkey = flow_attr_to_vport_key(esw, attr, &key);
131141
e = esw_vport_tbl_lookup(esw, &key, hkey);
132142
if (!e || --e->num_rules)

0 commit comments

Comments
 (0)