From 4a295bae7e72d870354d337fe42360b0e4441e57 Mon Sep 17 00:00:00 2001 From: Sagi Grimberg Date: Tue, 2 Dec 2014 16:57:40 +0200 Subject: iser-target: Centralize completion elements to a context A pre-step before going to a single CQ. Also this makes the code a little more simple to read. Signed-off-by: Sagi Grimberg Signed-off-by: Nicholas Bellinger --- drivers/infiniband/ulp/isert/ib_isert.h | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'drivers/infiniband/ulp/isert/ib_isert.h') diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h index b3735a07ca47..3f93cb0a0f03 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.h +++ b/drivers/infiniband/ulp/isert/ib_isert.h @@ -159,23 +159,33 @@ struct isert_conn { #define ISERT_MAX_CQ 64 -struct isert_cq_desc { - struct isert_device *device; - int cq_index; - struct work_struct cq_rx_work; - struct work_struct cq_tx_work; +/** + * struct isert_comp - iSER completion context + * + * @device: pointer to device handle + * @rx_cq: RX completion queue + * @tx_cq: TX completion queue + * @active_qps: Number of active QPs attached + * to completion context + * @rx_work: RX work handle + * @tx_work: TX work handle + */ +struct isert_comp { + struct isert_device *device; + struct ib_cq *rx_cq; + struct ib_cq *tx_cq; + int active_qps; + struct work_struct rx_work; + struct work_struct tx_work; }; struct isert_device { int use_fastreg; bool pi_capable; - int cqs_used; int refcount; - int cq_active_qps[ISERT_MAX_CQ]; struct ib_device *ib_device; - struct ib_cq *dev_rx_cq[ISERT_MAX_CQ]; - struct ib_cq *dev_tx_cq[ISERT_MAX_CQ]; - struct isert_cq_desc *cq_desc; + struct isert_comp *comps; + int comps_used; struct list_head dev_node; struct ib_device_attr dev_attr; int (*reg_rdma_mem)(struct iscsi_conn *conn, -- cgit v1.2.3-59-g8ed1b