aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2014-12-02 09:57:44 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2014-12-13 02:32:31 -0500
commit37d9fe80a3afc87a3d9f3d83aa0e6137f9fd7cde (patch)
treeb82fdaddb210cf6c69c9411014db8a705038dfe0 /drivers/infiniband/ulp
parentbdf20e72548cdcca1c16f29ad30c5725fa1d8d11 (diff)
iser-target: Introduce isert_poll_budget
In case the CQ is packed with completions, we can't just hog the CPU forever. Poll until a sufficient budget (currently hard-coded to 64k completions) and if budget is exhausted, bailout and give a chance to other threads. Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/isert/ib_isert.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index eb3d628ec4dd..22841487f600 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -2044,13 +2044,19 @@ isert_handle_wc(struct ib_wc *wc)
2044static void 2044static void
2045isert_cq_work(struct work_struct *work) 2045isert_cq_work(struct work_struct *work)
2046{ 2046{
2047 enum { isert_poll_budget = 65536 };
2047 struct isert_comp *comp = container_of(work, struct isert_comp, 2048 struct isert_comp *comp = container_of(work, struct isert_comp,
2048 work); 2049 work);
2050 int completed = 0;
2049 struct ib_wc wc; 2051 struct ib_wc wc;
2050 2052
2051 while (ib_poll_cq(comp->cq, 1, &wc) == 1) 2053 while (ib_poll_cq(comp->cq, 1, &wc) == 1) {
2052 isert_handle_wc(&wc); 2054 isert_handle_wc(&wc);
2053 2055
2056 if (++completed >= isert_poll_budget)
2057 break;
2058 }
2059
2054 ib_req_notify_cq(comp->cq, IB_CQ_NEXT_COMP); 2060 ib_req_notify_cq(comp->cq, IB_CQ_NEXT_COMP);
2055} 2061}
2056 2062