summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSagi Grimberg2016-04-26 16:55:38 +0200
committerDoug Ledford2016-04-26 18:40:50 +0200
commit42235f80ab205bf5020cf33cb3e94455410abe36 (patch)
tree6c268d22e51a547ce9d145125368e18d36556cb3
parentIB/core: Fix oops in ib_cache_gid_set_default_gid (diff)
downloadkernel-qcow2-linux-42235f80ab205bf5020cf33cb3e94455410abe36.tar.gz
kernel-qcow2-linux-42235f80ab205bf5020cf33cb3e94455410abe36.tar.xz
kernel-qcow2-linux-42235f80ab205bf5020cf33cb3e94455410abe36.zip
IB/core: Don't drain non-existent rq queue-pair
The drain_rq function expects a normal receive qp to drain. A qp can only have either a normal rq or an srq. If there is an srq, there is no rq to drain. Until the API supports draining SRQs, simply skip draining the rq when the qp has an srq attached. Fixes: 765d67748bcf ("IB: new common API for draining queues") Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/core/verbs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 15b8adbf39c0..b65b3541e732 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -1860,6 +1860,7 @@ EXPORT_SYMBOL(ib_drain_rq);
void ib_drain_qp(struct ib_qp *qp)
{
ib_drain_sq(qp);
- ib_drain_rq(qp);
+ if (!qp->srq)
+ ib_drain_rq(qp);
}
EXPORT_SYMBOL(ib_drain_qp);