Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
libhns: Write all 64 bytes of a direct WQE explicitly
hns_roce_write512() passes sizeof(struct hns_roce_rc_sq_wqe), which is
32, to mmio_memcpy_x64(). It writes a 64-byte direct WQE only because
the aarch64 macro takes its 64-byte path for any constant length. On
the generic implementation a length of 32 makes the size_t counter
wrap, and the copy does not stop.

Pass the size of a direct WQE, 1 << HNS_ROCE_SQWQE_SHIFT. On aarch64
the generated code does not change.

Fixes: 159933c ("libhns: Add support for direct wqe")
Reviewed-by: Junxian Huang <huangjunxian6@hisilicon.com>
Tested-by: Junxian Huang <huangjunxian6@hisilicon.com>
Assisted-by: Claude:claude-opus-5-5 <noreply@anthropic.com>
Signed-off-by: Dezhen Lu <dezhen.lu@student.uni-tuebingen.de>
  • Loading branch information
0z5a committed Nov 9, 2026
commit ffcb5072a2aeffe62dbc782c8431bd062eef78eb
2 changes: 1 addition & 1 deletion providers/hns/hns_roce_u_hw_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ static void hns_roce_update_sq_db(struct hns_roce_context *ctx,

static void hns_roce_write512(uint64_t *dest, uint64_t *val)
{
mmio_memcpy_x64(dest, val, sizeof(struct hns_roce_rc_sq_wqe));
mmio_memcpy_x64(dest, val, 1 << HNS_ROCE_SQWQE_SHIFT);
}

static void hns_roce_write_dwqe(struct hns_roce_qp *qp, void *wqe)
Expand Down