diff mbox

[v1,rdma-core,2/2] bnxt_re/lib: increment psn in case of 0 length packets

Message ID 1510225840-20034-3-git-send-email-devesh.sharma@broadcom.com (mailing list archive)
State Accepted
Headers show

Commit Message

Devesh Sharma Nov. 9, 2017, 11:10 a.m. UTC
If application posts a 0 length packet, post send routine
is skipping to increment the psn number. This will cause
PSN number to go out of sync and eventually connection would
terminate due to sequence error.

post_send routine must increment the psn number by 1 even
for zero length packets.

Signed-off-by: Devesh Sharma <devesh.sharma@broadcom.com>
---
 providers/bnxt_re/verbs.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c
index 4d9b044..9d4e02b 100644
--- a/providers/bnxt_re/verbs.c
+++ b/providers/bnxt_re/verbs.c
@@ -1048,6 +1048,8 @@  static void bnxt_re_fill_psns(struct bnxt_re_qp *qp, struct bnxt_re_psns *psns,
 		pkt_cnt = (len / qp->mtu);
 		if (len % qp->mtu)
 			pkt_cnt++;
+		if (len == 0)
+			pkt_cnt = 1;
 		nxt_psn = ((qp->sq_psn + pkt_cnt) & BNXT_RE_PSNS_NPSN_MASK);
 		psns->flg_npsn = htole32(nxt_psn);
 		qp->sq_psn = nxt_psn;