summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2014-03-05 19:43:43 +0200
committerRoland Dreier <roland@purestorage.com>2014-03-17 22:33:57 -0700
commit73bc06b7edd8ce4ccbce7ffd28978ce16b97e5d8 (patch)
treea8f84b544a9f51a36db2fe47cf7e8fdf131cba76 /drivers/infiniband/ulp
parent65198d6b843bf43650781f71caac1266d6b407cb (diff)
downloadtalos-op-linux-73bc06b7edd8ce4ccbce7ffd28978ce16b97e5d8.tar.gz
talos-op-linux-73bc06b7edd8ce4ccbce7ffd28978ce16b97e5d8.zip
IB/iser: Replace fastreg descriptor valid bool with indicators container
In T10-PI support we will have memory keys for protection buffers and signature transactions. We prefer to compact indicators rather than keeping multiple bools. This commit does not change any functionality. Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Alex Tabachnik <alext@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/iser/iscsi_iser.h8
-rw-r--r--drivers/infiniband/ulp/iser/iser_memory.c4
-rw-r--r--drivers/infiniband/ulp/iser/iser_verbs.c2
3 files changed, 9 insertions, 5 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
index b4290f509a39..56607140ff3a 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -280,13 +280,17 @@ struct iser_device {
enum iser_data_dir cmd_dir);
};
+enum iser_reg_indicator {
+ ISER_DATA_KEY_VALID = 1 << 0,
+};
+
struct fast_reg_descriptor {
struct list_head list;
/* For fast registration - FRWR */
struct ib_mr *data_mr;
struct ib_fast_reg_page_list *data_frpl;
- /* Valid for fast registration flag */
- bool valid;
+ /* registration indicators container */
+ u8 reg_indicators;
};
struct iser_conn {
diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c
index d25587e2f296..a7a0d3e8f822 100644
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -479,7 +479,7 @@ static int iser_fast_reg_mr(struct iscsi_iser_task *iser_task,
return -EINVAL;
}
- if (!desc->valid) {
+ if (!(desc->reg_indicators & ISER_DATA_KEY_VALID)) {
memset(&inv_wr, 0, sizeof(inv_wr));
inv_wr.wr_id = ISER_FASTREG_LI_WRID;
inv_wr.opcode = IB_WR_LOCAL_INV;
@@ -514,7 +514,7 @@ static int iser_fast_reg_mr(struct iscsi_iser_task *iser_task,
iser_err("fast registration failed, ret:%d\n", ret);
return ret;
}
- desc->valid = false;
+ desc->reg_indicators &= ~ISER_DATA_KEY_VALID;
sge->lkey = desc->data_mr->lkey;
sge->addr = desc->data_frpl->page_list[0] + offset;
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index 95fcfcac0100..6a5f4245182a 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -296,7 +296,7 @@ iser_create_fastreg_desc(struct ib_device *ib_device, struct ib_pd *pd,
}
iser_info("Create fr_desc %p page_list %p\n",
desc, desc->data_frpl->page_list);
- desc->valid = true;
+ desc->reg_indicators |= ISER_DATA_KEY_VALID;
return 0;
OpenPOWER on IntegriCloud