diff options
author | Sagi Grimberg <sagig@mellanox.com> | 2015-08-06 18:33:02 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-08-30 18:12:31 -0400 |
commit | 32467c420bb68776ebaa53ddf6712e1dba7bb5da (patch) | |
tree | 8c9b19f1c5a5e6e624444e745e45a35a9fbe701d /drivers/infiniband/ulp/iser/iscsi_iser.h | |
parent | 81722909c8f78ee2db62373a74ec2ecb709c112e (diff) | |
download | linux-rt-32467c420bb68776ebaa53ddf6712e1dba7bb5da.tar.gz |
IB/iser: Unify fast memory registration flows
iser_reg_rdma_mem_[fastreg|fmr] share a lot of code, and
logically do the same thing other than the buffer registration
method itself (iser_fast_reg_mr vs. iser_fast_reg_fmr).
The DIF logic is not implemented in the FMR flow as there is no
existing device that supports FMRs and Signature feature.
This patch unifies the flow in a single routine iser_reg_rdma_mem
and just split to fmr/frwr for the buffer registration itself.
Also, for symmetry reasons, unify iser_unreg_rdma_mem (which will
call the relevant device specific unreg routine).
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Adir Lev <adirl@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/ulp/iser/iscsi_iser.h')
-rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h index 611abaa8e714..e6105d25e6c8 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.h +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h @@ -239,6 +239,7 @@ struct iser_data_buf { struct iser_device; struct iscsi_iser_task; struct iscsi_endpoint; +struct iser_reg_resources; /** * struct iser_mem_reg - iSER memory registration info @@ -331,8 +332,8 @@ struct iser_comp { * * @alloc_reg_res: Allocate registration resources * @free_reg_res: Free registration resources - * @reg_rdma_mem: Register memory buffers - * @unreg_rdma_mem: Un-register memory buffers + * @fast_reg_mem: Register memory buffers + * @unreg_mem: Un-register memory buffers * @reg_desc_get: Get a registration descriptor for pool * @reg_desc_put: Get a registration descriptor to pool */ @@ -340,10 +341,12 @@ struct iser_reg_ops { int (*alloc_reg_res)(struct ib_conn *ib_conn, unsigned cmds_max); void (*free_reg_res)(struct ib_conn *ib_conn); - int (*reg_rdma_mem)(struct iscsi_iser_task *iser_task, - enum iser_data_dir cmd_dir); - void (*unreg_rdma_mem)(struct iscsi_iser_task *iser_task, - enum iser_data_dir cmd_dir); + int (*reg_mem)(struct iscsi_iser_task *iser_task, + struct iser_data_buf *mem, + struct iser_reg_resources *rsc, + struct iser_mem_reg *reg); + void (*unreg_mem)(struct iscsi_iser_task *iser_task, + enum iser_data_dir cmd_dir); struct iser_fr_desc * (*reg_desc_get)(struct ib_conn *ib_conn); void (*reg_desc_put)(struct ib_conn *ib_conn, struct iser_fr_desc *desc); @@ -622,10 +625,10 @@ void iser_finalize_rdma_unaligned_sg(struct iscsi_iser_task *iser_task, struct iser_data_buf *mem, enum iser_data_dir cmd_dir); -int iser_reg_rdma_mem_fmr(struct iscsi_iser_task *task, - enum iser_data_dir cmd_dir); -int iser_reg_rdma_mem_fastreg(struct iscsi_iser_task *task, - enum iser_data_dir cmd_dir); +int iser_reg_rdma_mem(struct iscsi_iser_task *task, + enum iser_data_dir dir); +void iser_unreg_rdma_mem(struct iscsi_iser_task *task, + enum iser_data_dir dir); int iser_connect(struct iser_conn *iser_conn, struct sockaddr *src_addr, |