aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/i40iw/i40iw_verbs.c
diff options
context:
space:
mode:
authorShiraz Saleem <shiraz.saleem@intel.com>2017-10-03 11:11:48 -0500
committerDoug Ledford <dledford@redhat.com>2017-10-04 15:29:39 -0400
commit40837273d084ad1584dbaea5e8fbefe0a64f2a6b (patch)
treed380b30b05f89030c4b0ecbaf7873517795e6e5a /drivers/infiniband/hw/i40iw/i40iw_verbs.c
parenti40iw: Do not generate CQE for RTR on QP flush (diff)
downloadlinux-dev-40837273d084ad1584dbaea5e8fbefe0a64f2a6b.tar.xz
linux-dev-40837273d084ad1584dbaea5e8fbefe0a64f2a6b.zip
i40iw: Do not allow posting WR after QP is flushed
A Work Request (WR) posted after QP is flushed will not get a flush completion. Correct this problem by not allowing posting of WRs after a QP is flushed. Fixes: d37498417947 ("i40iw: add files for iwarp interface") Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/i40iw/i40iw_verbs.c')
-rw-r--r--drivers/infiniband/hw/i40iw/i40iw_verbs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
index 28b3d02d511b..58d815f06e4e 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
@@ -2202,6 +2202,12 @@ static int i40iw_post_send(struct ib_qp *ibqp,
ukqp = &iwqp->sc_qp.qp_uk;
spin_lock_irqsave(&iwqp->lock, flags);
+
+ if (iwqp->flush_issued) {
+ err = -EINVAL;
+ goto out;
+ }
+
while (ib_wr) {
inv_stag = false;
memset(&info, 0, sizeof(info));
@@ -2344,6 +2350,7 @@ static int i40iw_post_send(struct ib_qp *ibqp,
ib_wr = ib_wr->next;
}
+out:
if (err)
*bad_wr = ib_wr;
else
@@ -2376,6 +2383,12 @@ static int i40iw_post_recv(struct ib_qp *ibqp,
memset(&post_recv, 0, sizeof(post_recv));
spin_lock_irqsave(&iwqp->lock, flags);
+
+ if (iwqp->flush_issued) {
+ err = -EINVAL;
+ goto out;
+ }
+
while (ib_wr) {
post_recv.num_sges = ib_wr->num_sge;
post_recv.wr_id = ib_wr->wr_id;