aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2016-02-29 12:07:32 -0500
committerDoug Ledford <dledford@redhat.com>2016-03-04 11:59:34 -0500
commitf5aa9159a418726d74b67c8815ffd2739afb4c7a (patch)
tree2205e3e00c4200279cd467f787c7aaae0204a5fd
parent911f4331bc87f4589b9096f4fb24b335d4c2967d (diff)
IB/core: Add arbitrary sg_list support
Devices that are capable in registering SG lists with gaps can now expose it in the core to ULPs using a new device capability IB_DEVICE_SG_GAPS_REG (in a new field device_cap_flags_ex in the device attributes as we ran out of bits), and a new mr_type IB_MR_TYPE_SG_GAPS_REG which allocates a memory region which is capable of handling SG lists with gaps. Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/core/verbs.c2
-rw-r--r--include/rdma/ib_verbs.h6
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 5af6d024e053..16f3fb1b9d75 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -1567,6 +1567,8 @@ EXPORT_SYMBOL(ib_check_mr_status);
1567 * - The last sg element is allowed to have length less than page_size. 1567 * - The last sg element is allowed to have length less than page_size.
1568 * - If sg_nents total byte length exceeds the mr max_num_sge * page_size 1568 * - If sg_nents total byte length exceeds the mr max_num_sge * page_size
1569 * then only max_num_sg entries will be mapped. 1569 * then only max_num_sg entries will be mapped.
1570 * - If the MR was allocated with type IB_MR_TYPE_SG_GAPS_REG, non of these
1571 * constraints holds and the page_size argument is ignored.
1570 * 1572 *
1571 * Returns the number of sg elements that were mapped to the memory region. 1573 * Returns the number of sg elements that were mapped to the memory region.
1572 * 1574 *
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 3f79070de547..bcd5b242e6b1 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -212,6 +212,7 @@ enum ib_device_cap_flags {
212 IB_DEVICE_MANAGED_FLOW_STEERING = (1 << 29), 212 IB_DEVICE_MANAGED_FLOW_STEERING = (1 << 29),
213 IB_DEVICE_SIGNATURE_HANDOVER = (1 << 30), 213 IB_DEVICE_SIGNATURE_HANDOVER = (1 << 30),
214 IB_DEVICE_ON_DEMAND_PAGING = (1 << 31), 214 IB_DEVICE_ON_DEMAND_PAGING = (1 << 31),
215 IB_DEVICE_SG_GAPS_REG = (1ULL << 32),
215}; 216};
216 217
217enum ib_signature_prot_cap { 218enum ib_signature_prot_cap {
@@ -662,10 +663,15 @@ __attribute_const__ int ib_rate_to_mbps(enum ib_rate rate);
662 * @IB_MR_TYPE_SIGNATURE: memory region that is used for 663 * @IB_MR_TYPE_SIGNATURE: memory region that is used for
663 * signature operations (data-integrity 664 * signature operations (data-integrity
664 * capable regions) 665 * capable regions)
666 * @IB_MR_TYPE_SG_GAPS: memory region that is capable to
667 * register any arbitrary sg lists (without
668 * the normal mr constraints - see
669 * ib_map_mr_sg)
665 */ 670 */
666enum ib_mr_type { 671enum ib_mr_type {
667 IB_MR_TYPE_MEM_REG, 672 IB_MR_TYPE_MEM_REG,
668 IB_MR_TYPE_SIGNATURE, 673 IB_MR_TYPE_SIGNATURE,
674 IB_MR_TYPE_SG_GAPS,
669}; 675};
670 676
671/** 677/**