diff options
author | Adir Lev <adirl@mellanox.com> | 2015-08-06 18:32:59 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-08-30 18:12:30 -0400 |
commit | 2b3bf958103899a96d230c9f2e0d87606f08a7be (patch) | |
tree | 9639c689b81d58f16f201d6a8d6ffa22e3570668 /drivers/infiniband/ulp/iser/iscsi_iser.h | |
parent | 385ad87d4b637c1ebdb54bc93274fc2c267dfc16 (diff) | |
download | linux-2b3bf958103899a96d230c9f2e0d87606f08a7be.tar.bz2 |
IB/iser: Maintain connection fmr_pool under a single registration descriptor
This will allow us to unify the memory registration code path between
the various methods which vary by the device capabilities. This change
will make it easier and less intrusive to remove fmr_pools from the
code when we'd want to.
The reason we use a single descriptor is to avoid taking a
redundant spinlock when working with FMRs.
We also change the signature of iser_reg_page_vec to make it match
iser_fast_reg_mr (and the future indirect registration method).
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 | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h index 1fc4c231fb4a..a8c81774ca53 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.h +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h @@ -380,12 +380,20 @@ struct iser_device { * struct iser_reg_resources - Fast registration recources * * @mr: memory region - * @frpl: fast reg page list + * @fmr_pool: pool of fmrs + * @frpl: fast reg page list used by frwrs + * @page_vec: fast reg page list used by fmr pool * @mr_valid: is mr valid indicator */ struct iser_reg_resources { - struct ib_mr *mr; - struct ib_fast_reg_page_list *frpl; + union { + struct ib_mr *mr; + struct ib_fmr_pool *fmr_pool; + }; + union { + struct ib_fast_reg_page_list *frpl; + struct iser_page_vec *page_vec; + }; u8 mr_valid:1; }; @@ -420,28 +428,14 @@ struct iser_fr_desc { /** * struct iser_fr_pool: connection fast registration pool * + * @list: list of fastreg descriptors * @lock: protects fmr/fastreg pool - * @union.fmr: - * @pool: FMR pool for fast registrations - * @page_vec: fast reg page list to hold mapped commands pages - * used for registration - * @union.fastreg: - * @pool: Fast registration descriptors pool for fast - * registrations - * @pool_size: Size of pool + * @size: size of the pool */ struct iser_fr_pool { - spinlock_t lock; - union { - struct { - struct ib_fmr_pool *pool; - struct iser_page_vec *page_vec; - } fmr; - struct { - struct list_head pool; - int pool_size; - } fastreg; - }; + struct list_head list; + spinlock_t lock; + int size; }; /** |