diff options
author | Sagi Grimberg <sagig@mellanox.com> | 2014-10-01 07:02:08 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-10-09 03:06:06 -0400 |
commit | 183cfa434ec90897b1423ce4f916e8a237139133 (patch) | |
tree | 9987bfe5479c8f6792adafbc0221e704dc657613 /drivers/infiniband/ulp | |
parent | bf17554035ab2aaf770321208ce48e69aab71cc8 (diff) |
IB/iser: Use internal polling budget to avoid possible live-lock
We need a way to guarentee that we don't stay in soft-IRQ context for
too long. We might starve other pending CQ tasklets or worse lock
against application trying to issue IO on the running CPU.
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Ariel Nahum <arieln@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r-- | drivers/infiniband/ulp/iser/iser_verbs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 94d1b46b467a..e31ac57accc9 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c | |||
@@ -42,6 +42,8 @@ | |||
42 | #define ISER_MAX_RX_CQ_LEN (ISER_QP_MAX_RECV_DTOS * ISCSI_ISER_MAX_CONN) | 42 | #define ISER_MAX_RX_CQ_LEN (ISER_QP_MAX_RECV_DTOS * ISCSI_ISER_MAX_CONN) |
43 | #define ISER_MAX_TX_CQ_LEN (ISER_QP_MAX_REQ_DTOS * ISCSI_ISER_MAX_CONN) | 43 | #define ISER_MAX_TX_CQ_LEN (ISER_QP_MAX_REQ_DTOS * ISCSI_ISER_MAX_CONN) |
44 | 44 | ||
45 | static int iser_cq_poll_limit = 512; | ||
46 | |||
45 | static void iser_cq_tasklet_fn(unsigned long data); | 47 | static void iser_cq_tasklet_fn(unsigned long data); |
46 | static void iser_cq_callback(struct ib_cq *cq, void *cq_context); | 48 | static void iser_cq_callback(struct ib_cq *cq, void *cq_context); |
47 | static int iser_drain_tx_cq(struct iser_comp *comp); | 49 | static int iser_drain_tx_cq(struct iser_comp *comp); |
@@ -1248,6 +1250,8 @@ static void iser_cq_tasklet_fn(unsigned long data) | |||
1248 | completed_rx++; | 1250 | completed_rx++; |
1249 | if (!(completed_rx & 63)) | 1251 | if (!(completed_rx & 63)) |
1250 | completed_tx += iser_drain_tx_cq(comp); | 1252 | completed_tx += iser_drain_tx_cq(comp); |
1253 | if (completed_rx >= iser_cq_poll_limit) | ||
1254 | break; | ||
1251 | } | 1255 | } |
1252 | /* #warning "it is assumed here that arming CQ only once its empty" * | 1256 | /* #warning "it is assumed here that arming CQ only once its empty" * |
1253 | * " would not cause interrupts to be missed" */ | 1257 | * " would not cause interrupts to be missed" */ |