diff options
| author | Sagi Grimberg <sagig@mellanox.com> | 2014-12-02 09:57:45 -0500 |
|---|---|---|
| committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-12-13 02:32:32 -0500 |
| commit | 36ea63b523f3f3b57f708f14af848cac100677d5 (patch) | |
| tree | 0b0078eb6547ab90a215dd0eb196c65c09316f46 /drivers/infiniband/ulp/isert | |
| parent | 37d9fe80a3afc87a3d9f3d83aa0e6137f9fd7cde (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')
| -rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 12 | ||||
| -rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.h | 2 |
2 files changed, 9 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) | |||
| 2047 | enum { isert_poll_budget = 65536 }; | 2047 | enum { isert_poll_budget = 65536 }; |
| 2048 | struct isert_comp *comp = container_of(work, struct isert_comp, | 2048 | struct isert_comp *comp = container_of(work, struct isert_comp, |
| 2049 | work); | 2049 | work); |
| 2050 | int completed = 0; | 2050 | struct ib_wc *const wcs = comp->wcs; |
| 2051 | struct ib_wc wc; | 2051 | int i, n, completed = 0; |
| 2052 | 2052 | ||
| 2053 | while (ib_poll_cq(comp->cq, 1, &wc) == 1) { | 2053 | while ((n = ib_poll_cq(comp->cq, ARRAY_SIZE(comp->wcs), wcs)) > 0) { |
| 2054 | isert_handle_wc(&wc); | 2054 | for (i = 0; i < n; i++) |
| 2055 | isert_handle_wc(&wcs[i]); | ||
| 2055 | 2056 | ||
| 2056 | if (++completed >= isert_poll_budget) | 2057 | completed += n; |
| 2058 | if (completed >= isert_poll_budget) | ||
| 2057 | break; | 2059 | break; |
| 2058 | } | 2060 | } |
| 2059 | 2061 | ||
diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h index fc1d3232f896..2a0721f1f5df 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.h +++ b/drivers/infiniband/ulp/isert/ib_isert.h | |||
| @@ -165,6 +165,7 @@ struct isert_conn { | |||
| 165 | * | 165 | * |
| 166 | * @device: pointer to device handle | 166 | * @device: pointer to device handle |
| 167 | * @cq: completion queue | 167 | * @cq: completion queue |
| 168 | * @wcs: work completion array | ||
| 168 | * @active_qps: Number of active QPs attached | 169 | * @active_qps: Number of active QPs attached |
| 169 | * to completion context | 170 | * to completion context |
| 170 | * @work: completion work handle | 171 | * @work: completion work handle |
| @@ -172,6 +173,7 @@ struct isert_conn { | |||
| 172 | struct isert_comp { | 173 | struct isert_comp { |
| 173 | struct isert_device *device; | 174 | struct isert_device *device; |
| 174 | struct ib_cq *cq; | 175 | struct ib_cq *cq; |
| 176 | struct ib_wc wcs[16]; | ||
| 175 | int active_qps; | 177 | int active_qps; |
| 176 | struct work_struct work; | 178 | struct work_struct work; |
| 177 | }; | 179 | }; |
