Skip to content

Commit 0373d71

Browse files
committed
Merge branch 'mlx5-misc-fixes-2024-08-15'
Tariq Toukan says: ==================== mlx5 misc fixes 2024-08-15 This patchset provides misc bug fixes from the team to the mlx5 driver. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 3d93a14 + 607e1df commit 0373d71

File tree

4 files changed

+37
-17
lines changed

4 files changed

+37
-17
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,7 @@ void mlx5e_build_ptys2ethtool_map(void);
998998
bool mlx5e_check_fragmented_striding_rq_cap(struct mlx5_core_dev *mdev, u8 page_shift,
999999
enum mlx5e_mpwrq_umr_mode umr_mode);
10001000

1001+
void mlx5e_shampo_fill_umr(struct mlx5e_rq *rq, int len);
10011002
void mlx5e_shampo_dealloc_hd(struct mlx5e_rq *rq);
10021003
void mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats);
10031004
void mlx5e_fold_sw_stats64(struct mlx5e_priv *priv, struct rtnl_link_stats64 *s);

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,6 +1236,14 @@ void mlx5e_free_rx_missing_descs(struct mlx5e_rq *rq)
12361236
rq->mpwqe.actual_wq_head = wq->head;
12371237
rq->mpwqe.umr_in_progress = 0;
12381238
rq->mpwqe.umr_completed = 0;
1239+
1240+
if (test_bit(MLX5E_RQ_STATE_SHAMPO, &rq->state)) {
1241+
struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo;
1242+
u16 len;
1243+
1244+
len = (shampo->pi - shampo->ci) & shampo->hd_per_wq;
1245+
mlx5e_shampo_fill_umr(rq, len);
1246+
}
12391247
}
12401248

12411249
void mlx5e_free_rx_descs(struct mlx5e_rq *rq)
@@ -3020,15 +3028,18 @@ int mlx5e_update_tx_netdev_queues(struct mlx5e_priv *priv)
30203028
static void mlx5e_set_default_xps_cpumasks(struct mlx5e_priv *priv,
30213029
struct mlx5e_params *params)
30223030
{
3023-
struct mlx5_core_dev *mdev = priv->mdev;
3024-
int num_comp_vectors, ix, irq;
3025-
3026-
num_comp_vectors = mlx5_comp_vectors_max(mdev);
3031+
int ix;
30273032

30283033
for (ix = 0; ix < params->num_channels; ix++) {
3034+
int num_comp_vectors, irq, vec_ix;
3035+
struct mlx5_core_dev *mdev;
3036+
3037+
mdev = mlx5_sd_ch_ix_get_dev(priv->mdev, ix);
3038+
num_comp_vectors = mlx5_comp_vectors_max(mdev);
30293039
cpumask_clear(priv->scratchpad.cpumask);
3040+
vec_ix = mlx5_sd_ch_ix_get_vec_ix(mdev, ix);
30303041

3031-
for (irq = ix; irq < num_comp_vectors; irq += params->num_channels) {
3042+
for (irq = vec_ix; irq < num_comp_vectors; irq += params->num_channels) {
30323043
int cpu = mlx5_comp_vector_get_cpu(mdev, irq);
30333044

30343045
cpumask_set_cpu(cpu, priv->scratchpad.cpumask);

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,7 @@ static int mlx5e_alloc_rx_hd_mpwqe(struct mlx5e_rq *rq)
735735
ksm_entries = bitmap_find_window(shampo->bitmap,
736736
shampo->hd_per_wqe,
737737
shampo->hd_per_wq, shampo->pi);
738+
ksm_entries = ALIGN_DOWN(ksm_entries, MLX5E_SHAMPO_WQ_HEADER_PER_PAGE);
738739
if (!ksm_entries)
739740
return 0;
740741

@@ -962,26 +963,31 @@ void mlx5e_free_icosq_descs(struct mlx5e_icosq *sq)
962963
sq->cc = sqcc;
963964
}
964965

965-
static void mlx5e_handle_shampo_hd_umr(struct mlx5e_shampo_umr umr,
966-
struct mlx5e_icosq *sq)
966+
void mlx5e_shampo_fill_umr(struct mlx5e_rq *rq, int len)
967967
{
968-
struct mlx5e_channel *c = container_of(sq, struct mlx5e_channel, icosq);
969-
struct mlx5e_shampo_hd *shampo;
970-
/* assume 1:1 relationship between RQ and icosq */
971-
struct mlx5e_rq *rq = &c->rq;
972-
int end, from, len = umr.len;
968+
struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo;
969+
int end, from, full_len = len;
973970

974-
shampo = rq->mpwqe.shampo;
975971
end = shampo->hd_per_wq;
976972
from = shampo->ci;
977-
if (from + len > shampo->hd_per_wq) {
973+
if (from + len > end) {
978974
len -= end - from;
979975
bitmap_set(shampo->bitmap, from, end - from);
980976
from = 0;
981977
}
982978

983979
bitmap_set(shampo->bitmap, from, len);
984-
shampo->ci = (shampo->ci + umr.len) & (shampo->hd_per_wq - 1);
980+
shampo->ci = (shampo->ci + full_len) & (shampo->hd_per_wq - 1);
981+
}
982+
983+
static void mlx5e_handle_shampo_hd_umr(struct mlx5e_shampo_umr umr,
984+
struct mlx5e_icosq *sq)
985+
{
986+
struct mlx5e_channel *c = container_of(sq, struct mlx5e_channel, icosq);
987+
/* assume 1:1 relationship between RQ and icosq */
988+
struct mlx5e_rq *rq = &c->rq;
989+
990+
mlx5e_shampo_fill_umr(rq, umr.len);
985991
}
986992

987993
int mlx5e_poll_ico_cq(struct mlx5e_cq *cq)

drivers/net/ethernet/mellanox/mlx5/core/lib/ipsec_fs_roce.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,8 @@ static int ipsec_fs_roce_tx_mpv_create(struct mlx5_core_dev *mdev,
386386
return -EOPNOTSUPP;
387387

388388
peer_priv = mlx5_devcom_get_next_peer_data(*ipsec_roce->devcom, &tmp);
389-
if (!peer_priv) {
389+
if (!peer_priv || !peer_priv->ipsec) {
390+
mlx5_core_err(mdev, "IPsec not supported on master device\n");
390391
err = -EOPNOTSUPP;
391392
goto release_peer;
392393
}
@@ -455,7 +456,8 @@ static int ipsec_fs_roce_rx_mpv_create(struct mlx5_core_dev *mdev,
455456
return -EOPNOTSUPP;
456457

457458
peer_priv = mlx5_devcom_get_next_peer_data(*ipsec_roce->devcom, &tmp);
458-
if (!peer_priv) {
459+
if (!peer_priv || !peer_priv->ipsec) {
460+
mlx5_core_err(mdev, "IPsec not supported on master device\n");
459461
err = -EOPNOTSUPP;
460462
goto release_peer;
461463
}

0 commit comments

Comments
 (0)