Skip to content

Commit 55ba49c

Browse files
oulijunjgunthorpe
authored andcommitted
RDMA/hns: Move the location for initializing tmp_len
When posted work request, it need to compute the length of all sges of every wr and fill it into the msg_len field of send wqe. Thus, While posting multiple wr, tmp_len should be reinitialized to zero. Fixes: 8b9b8d1 ("RDMA/hns: Fix the endian problem for hns") Signed-off-by: Lijun Ou <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 05d6a4d commit 55ba49c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/infiniband/hw/hns/hns_roce_hw_v2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
142142
unsigned long flags;
143143
unsigned int ind;
144144
void *wqe = NULL;
145-
u32 tmp_len = 0;
146145
bool loopback;
146+
u32 tmp_len;
147147
int ret = 0;
148148
u8 *smac;
149149
int nreq;
@@ -189,6 +189,7 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
189189

190190
owner_bit =
191191
~(((qp->sq.head + nreq) >> ilog2(qp->sq.wqe_cnt)) & 0x1);
192+
tmp_len = 0;
192193

193194
/* Corresponding to the QP type, wqe process separately */
194195
if (ibqp->qp_type == IB_QPT_GSI) {

0 commit comments

Comments
 (0)