Message ID | 20240709150119.29937-3-jinpu.wang@ionos.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Fix for bnxt_re endianness issue | expand |
On Tue, Jul 9, 2024 at 11:03 PM Jack Wang <jinpu.wang@ionos.com> wrote: > > Similar like previous patch, this change the endianness for inv_key, > hw expect LE, so change the type accordingly. Too bad, the commit log. A lot of errors > > Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") > Signed-off-by: Jack Wang <jinpu.wang@ionos.com> > --- > drivers/infiniband/hw/bnxt_re/ib_verbs.c | 6 +++--- > drivers/infiniband/hw/bnxt_re/qplib_fp.h | 6 +++--- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c > index c5080028247e..cdc8ebcf3a76 100644 > --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c > +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c > @@ -2483,7 +2483,7 @@ static int bnxt_re_build_send_wqe(struct bnxt_re_qp *qp, > break; > case IB_WR_SEND_WITH_INV: > wqe->type = BNXT_QPLIB_SWQE_TYPE_SEND_WITH_INV; > - wqe->send.inv_key = wr->ex.invalidate_rkey; > + wqe->send.inv_key = cpu_to_le32(wr->ex.invalidate_rkey); > break; > default: > return -EINVAL; > @@ -2513,7 +2513,7 @@ static int bnxt_re_build_rdma_wqe(const struct ib_send_wr *wr, > break; > case IB_WR_RDMA_READ: > wqe->type = BNXT_QPLIB_SWQE_TYPE_RDMA_READ; > - wqe->rdma.inv_key = wr->ex.invalidate_rkey; > + wqe->rdma.inv_key = cpu_to_le32(wr->ex.invalidate_rkey); > break; > default: > return -EINVAL; > @@ -2563,7 +2563,7 @@ static int bnxt_re_build_inv_wqe(const struct ib_send_wr *wr, > struct bnxt_qplib_swqe *wqe) > { > wqe->type = BNXT_QPLIB_SWQE_TYPE_LOCAL_INV; > - wqe->local_inv.inv_l_key = wr->ex.invalidate_rkey; > + wqe->local_inv.inv_l_key = cpu_to_le32(wr->ex.invalidate_rkey); > > if (wr->send_flags & IB_SEND_SIGNALED) > wqe->flags |= BNXT_QPLIB_SWQE_FLAGS_SIGNAL_COMP; > diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.h b/drivers/infiniband/hw/bnxt_re/qplib_fp.h > index 1fcaba0f680b..813332b2c872 100644 > --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.h > +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.h > @@ -165,7 +165,7 @@ struct bnxt_qplib_swqe { > struct { > union { > __le32 imm_data; > - u32 inv_key; > + __le32 inv_key; > }; > u32 q_key; > u32 dst_qp; > @@ -183,7 +183,7 @@ struct bnxt_qplib_swqe { > struct { > union { > __le32 imm_data; > - u32 inv_key; > + __le32 inv_key; > }; > u64 remote_va; > u32 r_key; > @@ -199,7 +199,7 @@ struct bnxt_qplib_swqe { > > /* Local Invalidate */ > struct { > - u32 inv_l_key; > + __le32 inv_l_key; > } local_inv; > > /* FR-PMR */ > -- > 2.34.1 > >
diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index c5080028247e..cdc8ebcf3a76 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -2483,7 +2483,7 @@ static int bnxt_re_build_send_wqe(struct bnxt_re_qp *qp, break; case IB_WR_SEND_WITH_INV: wqe->type = BNXT_QPLIB_SWQE_TYPE_SEND_WITH_INV; - wqe->send.inv_key = wr->ex.invalidate_rkey; + wqe->send.inv_key = cpu_to_le32(wr->ex.invalidate_rkey); break; default: return -EINVAL; @@ -2513,7 +2513,7 @@ static int bnxt_re_build_rdma_wqe(const struct ib_send_wr *wr, break; case IB_WR_RDMA_READ: wqe->type = BNXT_QPLIB_SWQE_TYPE_RDMA_READ; - wqe->rdma.inv_key = wr->ex.invalidate_rkey; + wqe->rdma.inv_key = cpu_to_le32(wr->ex.invalidate_rkey); break; default: return -EINVAL; @@ -2563,7 +2563,7 @@ static int bnxt_re_build_inv_wqe(const struct ib_send_wr *wr, struct bnxt_qplib_swqe *wqe) { wqe->type = BNXT_QPLIB_SWQE_TYPE_LOCAL_INV; - wqe->local_inv.inv_l_key = wr->ex.invalidate_rkey; + wqe->local_inv.inv_l_key = cpu_to_le32(wr->ex.invalidate_rkey); if (wr->send_flags & IB_SEND_SIGNALED) wqe->flags |= BNXT_QPLIB_SWQE_FLAGS_SIGNAL_COMP; diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.h b/drivers/infiniband/hw/bnxt_re/qplib_fp.h index 1fcaba0f680b..813332b2c872 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.h @@ -165,7 +165,7 @@ struct bnxt_qplib_swqe { struct { union { __le32 imm_data; - u32 inv_key; + __le32 inv_key; }; u32 q_key; u32 dst_qp; @@ -183,7 +183,7 @@ struct bnxt_qplib_swqe { struct { union { __le32 imm_data; - u32 inv_key; + __le32 inv_key; }; u64 remote_va; u32 r_key; @@ -199,7 +199,7 @@ struct bnxt_qplib_swqe { /* Local Invalidate */ struct { - u32 inv_l_key; + __le32 inv_l_key; } local_inv; /* FR-PMR */
Similar like previous patch, this change the endianness for inv_key, hw expect LE, so change the type accordingly. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Signed-off-by: Jack Wang <jinpu.wang@ionos.com> --- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 6 +++--- drivers/infiniband/hw/bnxt_re/qplib_fp.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)