Skip to content

Commit 8fed756

Browse files
committed
Merge tag 'mlx5-fixes-2023-01-09' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
mlx5-fixes-2023-01-09
2 parents cb3e986 + 9828994 commit 8fed756

File tree

17 files changed

+104
-49
lines changed

17 files changed

+104
-49
lines changed

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

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,15 +2176,9 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev)
21762176
return -EINVAL;
21772177
}
21782178

2179-
cmd->stats = kvcalloc(MLX5_CMD_OP_MAX, sizeof(*cmd->stats), GFP_KERNEL);
2180-
if (!cmd->stats)
2181-
return -ENOMEM;
2182-
21832179
cmd->pool = dma_pool_create("mlx5_cmd", mlx5_core_dma_dev(dev), size, align, 0);
2184-
if (!cmd->pool) {
2185-
err = -ENOMEM;
2186-
goto dma_pool_err;
2187-
}
2180+
if (!cmd->pool)
2181+
return -ENOMEM;
21882182

21892183
err = alloc_cmd_page(dev, cmd);
21902184
if (err)
@@ -2268,8 +2262,6 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev)
22682262

22692263
err_free_pool:
22702264
dma_pool_destroy(cmd->pool);
2271-
dma_pool_err:
2272-
kvfree(cmd->stats);
22732265
return err;
22742266
}
22752267

@@ -2282,7 +2274,6 @@ void mlx5_cmd_cleanup(struct mlx5_core_dev *dev)
22822274
destroy_msg_cache(dev);
22832275
free_cmd_page(dev, cmd);
22842276
dma_pool_destroy(cmd->pool);
2285-
kvfree(cmd->stats);
22862277
}
22872278

22882279
void mlx5_cmd_set_state(struct mlx5_core_dev *dev,

drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/police.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ static int police_act_validate(const struct flow_action_entry *act,
3434
return -EOPNOTSUPP;
3535
}
3636

37-
if (act->police.rate_pkt_ps) {
38-
NL_SET_ERR_MSG_MOD(extack,
39-
"QoS offload not support packets per second");
40-
return -EOPNOTSUPP;
41-
}
42-
4337
return 0;
4438
}
4539

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ mlx5e_post_meter_add_rule(struct mlx5e_priv *priv,
127127
attr->counter = act_counter;
128128

129129
attr->flags |= MLX5_ATTR_FLAG_NO_IN_PORT;
130+
attr->inner_match_level = MLX5_MATCH_NONE;
130131
attr->outer_match_level = MLX5_MATCH_NONE;
131132
attr->chain = 0;
132133
attr->prio = 0;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ static int mlx5e_gen_ip_tunnel_header_vxlan(char buf[],
8888
struct udphdr *udp = (struct udphdr *)(buf);
8989
struct vxlanhdr *vxh;
9090

91+
if (tun_key->tun_flags & TUNNEL_VXLAN_OPT)
92+
return -EOPNOTSUPP;
9193
vxh = (struct vxlanhdr *)((char *)udp + sizeof(struct udphdr));
9294
*ip_proto = IPPROTO_UDP;
9395

drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ struct mlx5e_macsec_sa {
6262
u32 enc_key_id;
6363
u32 next_pn;
6464
sci_t sci;
65+
ssci_t ssci;
6566
salt_t salt;
6667

6768
struct rhash_head hash;
@@ -358,7 +359,6 @@ static int mlx5e_macsec_init_sa(struct macsec_context *ctx,
358359
struct mlx5_core_dev *mdev = priv->mdev;
359360
struct mlx5_macsec_obj_attrs obj_attrs;
360361
union mlx5e_macsec_rule *macsec_rule;
361-
struct macsec_key *key;
362362
int err;
363363

364364
obj_attrs.next_pn = sa->next_pn;
@@ -368,13 +368,9 @@ static int mlx5e_macsec_init_sa(struct macsec_context *ctx,
368368
obj_attrs.aso_pdn = macsec->aso.pdn;
369369
obj_attrs.epn_state = sa->epn_state;
370370

371-
key = (is_tx) ? &ctx->sa.tx_sa->key : &ctx->sa.rx_sa->key;
372-
373371
if (sa->epn_state.epn_enabled) {
374-
obj_attrs.ssci = (is_tx) ? cpu_to_be32((__force u32)ctx->sa.tx_sa->ssci) :
375-
cpu_to_be32((__force u32)ctx->sa.rx_sa->ssci);
376-
377-
memcpy(&obj_attrs.salt, &key->salt, sizeof(key->salt));
372+
obj_attrs.ssci = cpu_to_be32((__force u32)sa->ssci);
373+
memcpy(&obj_attrs.salt, &sa->salt, sizeof(sa->salt));
378374
}
379375

380376
obj_attrs.replay_window = ctx->secy->replay_window;
@@ -499,10 +495,11 @@ mlx5e_macsec_get_macsec_device_context(const struct mlx5e_macsec *macsec,
499495
}
500496

501497
static void update_macsec_epn(struct mlx5e_macsec_sa *sa, const struct macsec_key *key,
502-
const pn_t *next_pn_halves)
498+
const pn_t *next_pn_halves, ssci_t ssci)
503499
{
504500
struct mlx5e_macsec_epn_state *epn_state = &sa->epn_state;
505501

502+
sa->ssci = ssci;
506503
sa->salt = key->salt;
507504
epn_state->epn_enabled = 1;
508505
epn_state->epn_msb = next_pn_halves->upper;
@@ -550,7 +547,8 @@ static int mlx5e_macsec_add_txsa(struct macsec_context *ctx)
550547
tx_sa->assoc_num = assoc_num;
551548

552549
if (secy->xpn)
553-
update_macsec_epn(tx_sa, &ctx_tx_sa->key, &ctx_tx_sa->next_pn_halves);
550+
update_macsec_epn(tx_sa, &ctx_tx_sa->key, &ctx_tx_sa->next_pn_halves,
551+
ctx_tx_sa->ssci);
554552

555553
err = mlx5_create_encryption_key(mdev, ctx->sa.key, secy->key_len,
556554
MLX5_ACCEL_OBJ_MACSEC_KEY,
@@ -945,7 +943,8 @@ static int mlx5e_macsec_add_rxsa(struct macsec_context *ctx)
945943
rx_sa->fs_id = rx_sc->sc_xarray_element->fs_id;
946944

947945
if (ctx->secy->xpn)
948-
update_macsec_epn(rx_sa, &ctx_rx_sa->key, &ctx_rx_sa->next_pn_halves);
946+
update_macsec_epn(rx_sa, &ctx_rx_sa->key, &ctx_rx_sa->next_pn_halves,
947+
ctx_rx_sa->ssci);
949948

950949
err = mlx5_create_encryption_key(mdev, ctx->sa.key, ctx->secy->key_len,
951950
MLX5_ACCEL_OBJ_MACSEC_KEY,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4084,6 +4084,9 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev,
40844084
struct mlx5e_vlan_table *vlan;
40854085
struct mlx5e_params *params;
40864086

4087+
if (!netif_device_present(netdev))
4088+
return features;
4089+
40874090
vlan = mlx5e_fs_get_vlan(priv->fs);
40884091
mutex_lock(&priv->state_lock);
40894092
params = &priv->channels.params;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vport_rep)
191191
if (err) {
192192
netdev_warn(priv->netdev, "vport %d error %d reading stats\n",
193193
rep->vport, err);
194-
return;
194+
goto out;
195195
}
196196

197197
#define MLX5_GET_CTR(p, x) \
@@ -241,6 +241,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vport_rep)
241241
rep_stats->tx_vport_rdma_multicast_bytes =
242242
MLX5_GET_CTR(out, received_ib_multicast.octets);
243243

244+
out:
244245
kvfree(out);
245246
}
246247

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2419,7 +2419,7 @@ static inline void mlx5i_complete_rx_cqe(struct mlx5e_rq *rq,
24192419

24202420
priv = mlx5i_epriv(netdev);
24212421
tstamp = &priv->tstamp;
2422-
stats = rq->stats;
2422+
stats = &priv->channel_stats[rq->ix]->rq;
24232423

24242424
flags_rqpn = be32_to_cpu(cqe->flags_rqpn);
24252425
g = (flags_rqpn >> 28) & 3;

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,6 @@ mlx5e_tc_add_nic_flow(struct mlx5e_priv *priv,
13011301

13021302
if (attr->action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR) {
13031303
err = mlx5e_attach_mod_hdr(priv, flow, parse_attr);
1304-
mlx5e_mod_hdr_dealloc(&parse_attr->mod_hdr_acts);
13051304
if (err)
13061305
return err;
13071306
}
@@ -1359,8 +1358,10 @@ static void mlx5e_tc_del_nic_flow(struct mlx5e_priv *priv,
13591358
}
13601359
mutex_unlock(&tc->t_lock);
13611360

1362-
if (attr->action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR)
1361+
if (attr->action & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR) {
1362+
mlx5e_mod_hdr_dealloc(&attr->parse_attr->mod_hdr_acts);
13631363
mlx5e_detach_mod_hdr(priv, flow);
1364+
}
13641365

13651366
if (attr->action & MLX5_FLOW_CONTEXT_ACTION_COUNT)
13661367
mlx5_fc_destroy(priv->mdev, attr->counter);

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ mlx5_eswitch_set_rule_source_port(struct mlx5_eswitch *esw,
143143
if (mlx5_esw_indir_table_decap_vport(attr))
144144
vport = mlx5_esw_indir_table_decap_vport(attr);
145145

146-
if (attr && !attr->chain && esw_attr->int_port)
146+
if (!attr->chain && esw_attr && esw_attr->int_port)
147147
metadata =
148148
mlx5e_tc_int_port_get_metadata_for_match(esw_attr->int_port);
149149
else
@@ -4143,8 +4143,6 @@ int mlx5_devlink_port_fn_migratable_set(struct devlink_port *port, bool enable,
41434143
}
41444144

41454145
hca_caps = MLX5_ADDR_OF(query_hca_cap_out, query_ctx, capability);
4146-
memcpy(hca_caps, MLX5_ADDR_OF(query_hca_cap_out, query_ctx, capability),
4147-
MLX5_UN_SZ_BYTES(hca_cap_union));
41484146
MLX5_SET(cmd_hca_cap_2, hca_caps, migratable, 1);
41494147

41504148
err = mlx5_vport_set_other_func_cap(esw->dev, hca_caps, vport->vport,
@@ -4236,8 +4234,6 @@ int mlx5_devlink_port_fn_roce_set(struct devlink_port *port, bool enable,
42364234
}
42374235

42384236
hca_caps = MLX5_ADDR_OF(query_hca_cap_out, query_ctx, capability);
4239-
memcpy(hca_caps, MLX5_ADDR_OF(query_hca_cap_out, query_ctx, capability),
4240-
MLX5_UN_SZ_BYTES(hca_cap_union));
42414237
MLX5_SET(cmd_hca_cap, hca_caps, roce, enable);
42424238

42434239
err = mlx5_vport_set_other_func_cap(esw->dev, hca_caps, vport_num,

0 commit comments

Comments
 (0)