Skip to content

Commit 94e5219

Browse files
dtatuleakuba-moo
authored andcommitted
net/mlx5e: SHAMPO, Release in progress headers
The change in the fixes tag cleaned up too much: it removed the part that was releasing header pages that were posted via UMR but haven't been acknowledged yet on the ICOSQ. This patch corrects this omission by setting the bits between pi and ci to on when shutting down a queue with SHAMPO. To be consistent with the Striding RQ code, this action is done in mlx5e_free_rx_missing_descs(). Fixes: e839ac9 ("net/mlx5e: SHAMPO, Simplify header page release in teardown") Signed-off-by: Dragos Tatulea <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f232de7 commit 94e5219

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
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: 8 additions & 0 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)

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

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -963,26 +963,31 @@ void mlx5e_free_icosq_descs(struct mlx5e_icosq *sq)
963963
sq->cc = sqcc;
964964
}
965965

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

975-
shampo = rq->mpwqe.shampo;
976971
end = shampo->hd_per_wq;
977972
from = shampo->ci;
978-
if (from + len > shampo->hd_per_wq) {
973+
if (from + len > end) {
979974
len -= end - from;
980975
bitmap_set(shampo->bitmap, from, end - from);
981976
from = 0;
982977
}
983978

984979
bitmap_set(shampo->bitmap, from, len);
985-
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);
986991
}
987992

988993
int mlx5e_poll_ico_cq(struct mlx5e_cq *cq)

0 commit comments

Comments
 (0)