Skip to content

Commit 44dcfa4

Browse files
mmarcinidledford
authored andcommitted
IB/rdmavt: Avoid reseting wqe send_flags in unreserve
The wqe should be read only and in fact the superfluous reset of the RVT_SEND_RESERVE_USED flag causes an issue where reserved operations elicit a bad completion to the ULP. The maintenance of the flag is now entirely within rvt_post_one_wr() where a reserved operation will set the flag and a non-reserved operation will insure the operation that is about to be posted has the flag reset. Fixes: Commit 856cc4c ("IB/hfi1: Add the capability for reserved operations") Reviewed-by: Don Hiatt <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Dennis Dalessandro <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 5f14e4e commit 44dcfa4

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

drivers/infiniband/sw/rdmavt/qp.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1772,10 +1772,13 @@ static int rvt_post_one_wr(struct rvt_qp *qp,
17721772
0);
17731773
qp->s_next_psn = wqe->lpsn + 1;
17741774
}
1775-
if (unlikely(reserved_op))
1775+
if (unlikely(reserved_op)) {
1776+
wqe->wr.send_flags |= RVT_SEND_RESERVE_USED;
17761777
rvt_qp_wqe_reserve(qp, wqe);
1777-
else
1778+
} else {
1779+
wqe->wr.send_flags &= ~RVT_SEND_RESERVE_USED;
17781780
qp->s_avail--;
1781+
}
17791782
trace_rvt_post_one_wr(qp, wqe);
17801783
smp_wmb(); /* see request builders */
17811784
qp->s_head = next;

include/rdma/rdmavt_qp.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define DEF_RDMAVT_INCQP_H
33

44
/*
5-
* Copyright(c) 2016 Intel Corporation.
5+
* Copyright(c) 2016, 2017 Intel Corporation.
66
*
77
* This file is provided under a dual BSD/GPLv2 license. When using or
88
* redistributing this file, you may do so under either license.
@@ -526,7 +526,6 @@ static inline void rvt_qp_wqe_reserve(
526526
struct rvt_qp *qp,
527527
struct rvt_swqe *wqe)
528528
{
529-
wqe->wr.send_flags |= RVT_SEND_RESERVE_USED;
530529
atomic_inc(&qp->s_reserved_used);
531530
}
532531

@@ -550,7 +549,6 @@ static inline void rvt_qp_wqe_unreserve(
550549
struct rvt_swqe *wqe)
551550
{
552551
if (unlikely(wqe->wr.send_flags & RVT_SEND_RESERVE_USED)) {
553-
wqe->wr.send_flags &= ~RVT_SEND_RESERVE_USED;
554552
atomic_dec(&qp->s_reserved_used);
555553
/* insure no compiler re-order up to s_last change */
556554
smp_mb__after_atomic();

0 commit comments

Comments
 (0)