Commit 1e5887b7 authored by Artemy Kovalyov's avatar Artemy Kovalyov Committed by Jason Gunthorpe

IB/mlx5: WQE dump jumps over first 16 bytes

Move index increment after its is used or otherwise it will start the dump
of the WQE from second WQE BB.

Fixes: 34f4c955 ("IB/mlx5: Use fragmented QP's buffer for in-kernel users")
Signed-off-by: default avatarArtemy Kovalyov <artemyko@mellanox.com>
Signed-off-by: default avatarMoni Shoua <monis@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent e95e52a1
...@@ -4726,16 +4726,15 @@ static void set_linv_wr(struct mlx5_ib_qp *qp, void **seg, int *size, ...@@ -4726,16 +4726,15 @@ static void set_linv_wr(struct mlx5_ib_qp *qp, void **seg, int *size,
static void dump_wqe(struct mlx5_ib_qp *qp, u32 idx, int size_16) static void dump_wqe(struct mlx5_ib_qp *qp, u32 idx, int size_16)
{ {
__be32 *p = NULL; __be32 *p = NULL;
u32 tidx = idx;
int i, j; int i, j;
pr_debug("dump WQE index %u:\n", idx); pr_debug("dump WQE index %u:\n", idx);
for (i = 0, j = 0; i < size_16 * 4; i += 4, j += 4) { for (i = 0, j = 0; i < size_16 * 4; i += 4, j += 4) {
if ((i & 0xf) == 0) { if ((i & 0xf) == 0) {
tidx = (tidx + 1) & (qp->sq.wqe_cnt - 1); p = mlx5_frag_buf_get_wqe(&qp->sq.fbc, idx);
p = mlx5_frag_buf_get_wqe(&qp->sq.fbc, tidx);
pr_debug("WQBB at %p:\n", (void *)p); pr_debug("WQBB at %p:\n", (void *)p);
j = 0; j = 0;
idx = (idx + 1) & (qp->sq.wqe_cnt - 1);
} }
pr_debug("%08x %08x %08x %08x\n", be32_to_cpu(p[j]), pr_debug("%08x %08x %08x %08x\n", be32_to_cpu(p[j]),
be32_to_cpu(p[j + 1]), be32_to_cpu(p[j + 2]), be32_to_cpu(p[j + 1]), be32_to_cpu(p[j + 2]),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment