Skip to content

Commit 808ca6d

Browse files
kadesai16rleon
authored andcommitted
RDMA/bnxt_re: Check cqe flags to know imm_data vs inv_irkey
Invalidate rkey is cpu endian and immediate data is in big endian format. Both immediate data and invalidate the remote key returned by HW is in little endian format. While handling the commit in fixes tag, the difference between immediate data and invalidate rkey endianness was not considered. Without changes of this patch, Kernel ULP was failing while processing inv_rkey. dmesg log snippet - nvme nvme0: Bogus remote invalidation for rkey 0x2000019Fix in this patch Do endianness conversion based on completion queue entry flag. Also, the HW completions are already converted to host endianness in bnxt_qplib_cq_process_res_rc and bnxt_qplib_cq_process_res_ud and there is no need to convert it again in bnxt_re_poll_cq. Modified the union to hold the correct data type. Fixes: 95b087f ("bnxt_re: Fix imm_data endianness") Signed-off-by: Kashyap Desai <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent ea4c990 commit 808ca6d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

drivers/infiniband/hw/bnxt_re/ib_verbs.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3687,7 +3687,7 @@ static void bnxt_re_process_res_shadow_qp_wc(struct bnxt_re_qp *gsi_sqp,
36873687
wc->byte_len = orig_cqe->length;
36883688
wc->qp = &gsi_qp->ib_qp;
36893689

3690-
wc->ex.imm_data = cpu_to_be32(le32_to_cpu(orig_cqe->immdata));
3690+
wc->ex.imm_data = cpu_to_be32(orig_cqe->immdata);
36913691
wc->src_qp = orig_cqe->src_qp;
36923692
memcpy(wc->smac, orig_cqe->smac, ETH_ALEN);
36933693
if (bnxt_re_is_vlan_pkt(orig_cqe, &vlan_id, &sl)) {
@@ -3832,7 +3832,10 @@ int bnxt_re_poll_cq(struct ib_cq *ib_cq, int num_entries, struct ib_wc *wc)
38323832
(unsigned long)(cqe->qp_handle),
38333833
struct bnxt_re_qp, qplib_qp);
38343834
wc->qp = &qp->ib_qp;
3835-
wc->ex.imm_data = cpu_to_be32(le32_to_cpu(cqe->immdata));
3835+
if (cqe->flags & CQ_RES_RC_FLAGS_IMM)
3836+
wc->ex.imm_data = cpu_to_be32(cqe->immdata);
3837+
else
3838+
wc->ex.invalidate_rkey = cqe->invrkey;
38363839
wc->src_qp = cqe->src_qp;
38373840
memcpy(wc->smac, cqe->smac, ETH_ALEN);
38383841
wc->port_num = 1;

drivers/infiniband/hw/bnxt_re/qplib_fp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ struct bnxt_qplib_cqe {
410410
u16 cfa_meta;
411411
u64 wr_id;
412412
union {
413-
__le32 immdata;
413+
u32 immdata;
414414
u32 invrkey;
415415
};
416416
u64 qp_handle;

0 commit comments

Comments
 (0)