Commit 6aabfa76 authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Roland Dreier

IB/iser: Use single CQ for RX and TX

This will solve a possible condition where we might miss TX completion
(flush error) during session teardown.  Since we are using a single
CQ, we don't need to actively drain the TX CQ, instead just wait for
flush_completion (when counters reach zero) and remove iser_poll_for_flush_errors().

This patch might introduce a minor performance regression on its own,
but the next patches will enhance performance using a single CQ for RX
and TX.
Signed-off-by: default avatarSagi Grimberg <sagig@mellanox.com>
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 183cfa43
......@@ -271,16 +271,14 @@ struct iscsi_iser_task;
* struct iser_comp - iSER completion context
*
* @device: pointer to device handle
* @rx_cq: RX completion queue
* @tx_cq: TX completion queue
* @cq: completion queue
* @tasklet: Tasklet handle
* @active_qps: Number of active QPs attached
* to completion context
*/
struct iser_comp {
struct iser_device *device;
struct ib_cq *rx_cq;
struct ib_cq *tx_cq;
struct ib_cq *cq;
struct tasklet_struct tasklet;
int active_qps;
};
......@@ -342,6 +340,7 @@ struct fast_reg_descriptor {
* @device: reference to iser device
* @comp: iser completion context
* @pi_support: Indicate device T10-PI support
* @flush_comp: completes when all connection completions consumed
* @lock: protects fmr/fastreg pool
* @union.fmr:
* @pool: FMR pool for fast registrations
......@@ -361,6 +360,7 @@ struct ib_conn {
struct iser_device *device;
struct iser_comp *comp;
bool pi_support;
struct completion flush_comp;
spinlock_t lock;
union {
struct {
......@@ -395,6 +395,7 @@ struct iser_conn {
u64 login_req_dma, login_resp_dma;
unsigned int rx_desc_head;
struct iser_rx_desc *rx_descs;
u32 num_rx_descs;
};
struct iscsi_iser_task {
......
......@@ -272,7 +272,8 @@ int iser_alloc_rx_descriptors(struct iser_conn *iser_conn,
if (iser_alloc_login_buf(iser_conn))
goto alloc_login_buf_fail;
iser_conn->rx_descs = kmalloc(session->cmds_max *
iser_conn->num_rx_descs = session->cmds_max;
iser_conn->rx_descs = kmalloc(iser_conn->num_rx_descs *
sizeof(struct iser_rx_desc), GFP_KERNEL);
if (!iser_conn->rx_descs)
goto rx_desc_alloc_fail;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment