summaryrefslogtreecommitdiff
path: root/drivers/infiniband/ulp/isert/ib_isert.c
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2014-12-02 16:57:45 +0200
committerNicholas Bellinger <nab@linux-iscsi.org>2014-12-12 23:32:32 -0800
commit36ea63b523f3f3b57f708f14af848cac100677d5 (patch)
tree0b0078eb6547ab90a215dd0eb196c65c09316f46 /drivers/infiniband/ulp/isert/ib_isert.c
parent37d9fe80a3afc87a3d9f3d83aa0e6137f9fd7cde (diff)
iser-target: Reduce CQ lock contention by batch polling
In order to reduce the contention on CQ locking (present in some LLDDs) we poll in batches of 16 work completion items. Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/infiniband/ulp/isert/ib_isert.c')
-rw-r--r--drivers/infiniband/ulp/isert/ib_isert.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 22841487f600..276054b65b98 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -2047,13 +2047,15 @@ isert_cq_work(struct work_struct *work)
enum { isert_poll_budget = 65536 };
struct isert_comp *comp = container_of(work, struct isert_comp,
work);
- int completed = 0;
- struct ib_wc wc;
+ struct ib_wc *const wcs = comp->wcs;
+ int i, n, completed = 0;
- while (ib_poll_cq(comp->cq, 1, &wc) == 1) {
- isert_handle_wc(&wc);
+ while ((n = ib_poll_cq(comp->cq, ARRAY_SIZE(comp->wcs), wcs)) > 0) {
+ for (i = 0; i < n; i++)
+ isert_handle_wc(&wcs[i]);
- if (++completed >= isert_poll_budget)
+ completed += n;
+ if (completed >= isert_poll_budget)
break;
}