diff options
author | Sagi Grimberg <sagig@mellanox.com> | 2014-02-23 07:19:04 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-03-07 14:26:49 -0500 |
commit | 17cd3a2db825506c3e3bb9548ad20f67e2f8d0e7 (patch) | |
tree | 907165457888d6c3ecf54247b736ca17bd894b20 /include/rdma/ib_verbs.h | |
parent | eeb8461e36c99fdf2d058751be924a2aab215005 (diff) |
IB/core: Introduce protected memory regions
This commit introduces verbs for creating/destoying memory
regions which will allow new types of memory key operations such
as protected memory registration.
Indirect memory registration is registering several (one
of more) pre-registered memory regions in a specific layout.
The Indirect region may potentialy describe several regions
and some repitition format between them.
Protected Memory registration is registering a memory region
with various data integrity attributes which will describe protection
schemes that will be handled by the HCA in an offloaded manner.
These memory regions will be applicable for a new REG_SIG_MR
work request introduced later in this patchset.
In the future these routines may replace or implement current memory
regions creation routines existing today:
- ib_reg_user_mr
- ib_alloc_fast_reg_mr
- ib_get_dma_mr
- ib_dereg_mr
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'include/rdma/ib_verbs.h')
-rw-r--r-- | include/rdma/ib_verbs.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 6793f32ccb58..cb12e6a4e553 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -461,6 +461,22 @@ int ib_rate_to_mult(enum ib_rate rate) __attribute_const__; | |||
461 | */ | 461 | */ |
462 | int ib_rate_to_mbps(enum ib_rate rate) __attribute_const__; | 462 | int ib_rate_to_mbps(enum ib_rate rate) __attribute_const__; |
463 | 463 | ||
464 | enum ib_mr_create_flags { | ||
465 | IB_MR_SIGNATURE_EN = 1, | ||
466 | }; | ||
467 | |||
468 | /** | ||
469 | * ib_mr_init_attr - Memory region init attributes passed to routine | ||
470 | * ib_create_mr. | ||
471 | * @max_reg_descriptors: max number of registration descriptors that | ||
472 | * may be used with registration work requests. | ||
473 | * @flags: MR creation flags bit mask. | ||
474 | */ | ||
475 | struct ib_mr_init_attr { | ||
476 | int max_reg_descriptors; | ||
477 | u32 flags; | ||
478 | }; | ||
479 | |||
464 | /** | 480 | /** |
465 | * mult_to_ib_rate - Convert a multiple of 2.5 Gbit/sec to an IB rate | 481 | * mult_to_ib_rate - Convert a multiple of 2.5 Gbit/sec to an IB rate |
466 | * enum. | 482 | * enum. |
@@ -1407,6 +1423,9 @@ struct ib_device { | |||
1407 | int (*query_mr)(struct ib_mr *mr, | 1423 | int (*query_mr)(struct ib_mr *mr, |
1408 | struct ib_mr_attr *mr_attr); | 1424 | struct ib_mr_attr *mr_attr); |
1409 | int (*dereg_mr)(struct ib_mr *mr); | 1425 | int (*dereg_mr)(struct ib_mr *mr); |
1426 | int (*destroy_mr)(struct ib_mr *mr); | ||
1427 | struct ib_mr * (*create_mr)(struct ib_pd *pd, | ||
1428 | struct ib_mr_init_attr *mr_init_attr); | ||
1410 | struct ib_mr * (*alloc_fast_reg_mr)(struct ib_pd *pd, | 1429 | struct ib_mr * (*alloc_fast_reg_mr)(struct ib_pd *pd, |
1411 | int max_page_list_len); | 1430 | int max_page_list_len); |
1412 | struct ib_fast_reg_page_list * (*alloc_fast_reg_page_list)(struct ib_device *device, | 1431 | struct ib_fast_reg_page_list * (*alloc_fast_reg_page_list)(struct ib_device *device, |
@@ -2250,6 +2269,25 @@ int ib_query_mr(struct ib_mr *mr, struct ib_mr_attr *mr_attr); | |||
2250 | */ | 2269 | */ |
2251 | int ib_dereg_mr(struct ib_mr *mr); | 2270 | int ib_dereg_mr(struct ib_mr *mr); |
2252 | 2271 | ||
2272 | |||
2273 | /** | ||
2274 | * ib_create_mr - Allocates a memory region that may be used for | ||
2275 | * signature handover operations. | ||
2276 | * @pd: The protection domain associated with the region. | ||
2277 | * @mr_init_attr: memory region init attributes. | ||
2278 | */ | ||
2279 | struct ib_mr *ib_create_mr(struct ib_pd *pd, | ||
2280 | struct ib_mr_init_attr *mr_init_attr); | ||
2281 | |||
2282 | /** | ||
2283 | * ib_destroy_mr - Destroys a memory region that was created using | ||
2284 | * ib_create_mr and removes it from HW translation tables. | ||
2285 | * @mr: The memory region to destroy. | ||
2286 | * | ||
2287 | * This function can fail, if the memory region has memory windows bound to it. | ||
2288 | */ | ||
2289 | int ib_destroy_mr(struct ib_mr *mr); | ||
2290 | |||
2253 | /** | 2291 | /** |
2254 | * ib_alloc_fast_reg_mr - Allocates memory region usable with the | 2292 | * ib_alloc_fast_reg_mr - Allocates memory region usable with the |
2255 | * IB_WR_FAST_REG_MR send work request. | 2293 | * IB_WR_FAST_REG_MR send work request. |