summaryrefslogtreecommitdiff
path: root/drivers/infiniband/ulp/iser/iser_verbs.c
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2014-10-01 15:02:11 +0400
committerRoland Dreier <roland@purestorage.com>2014-10-09 11:06:07 +0400
commit6e6fe2fb1d61b4baef1cf350049c6877583681ee (patch)
tree67293f7bfbed569b1b5150f4a4b077c626804b1b /drivers/infiniband/ulp/iser/iser_verbs.c
parentff3dd52d267165347d6f92a90016e692d074a00c (diff)
downloadlinux-6e6fe2fb1d61b4baef1cf350049c6877583681ee.tar.xz
IB/iser: Optimize completion polling
Poll in batch of 16. Since we don't want it on the stack, keep under iser completion context (iser_comp). Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/ulp/iser/iser_verbs.c')
-rw-r--r--drivers/infiniband/ulp/iser/iser_verbs.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index 805a9bdc9520..82bedbc260b2 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -1232,13 +1232,15 @@ static void iser_cq_tasklet_fn(unsigned long data)
{
struct iser_comp *comp = (struct iser_comp *)data;
struct ib_cq *cq = comp->cq;
- struct ib_wc wc;
- int completed = 0;
+ struct ib_wc *const wcs = comp->wcs;
+ int i, n, completed = 0;
- while (ib_poll_cq(cq, 1, &wc) == 1) {
- iser_handle_wc(&wc);
+ while ((n = ib_poll_cq(cq, ARRAY_SIZE(comp->wcs), wcs)) > 0) {
+ for (i = 0; i < n; i++)
+ iser_handle_wc(&wcs[i]);
- if (++completed >= iser_cq_poll_limit)
+ completed += n;
+ if (completed >= iser_cq_poll_limit)
break;
}