aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2007-03-08 10:05:24 -0800
committerRoland Dreier <rolandd@cisco.com>2007-03-08 10:05:24 -0800
commit34030a52fed2ffc38167083c1286cc71d4f1e1d5 (patch)
tree1996eb18d62c7417ce0882c0e6956177a44e1252
parent94bede79e2852f870b023366fbb3588db5683ac9 (diff)
downloadlibibverbs-34030a52fed2ffc38167083c1286cc71d4f1e1d5.tar.gz
Add low-level driver hooks for reregister MR and memory windows
Add methods to struct ibv_context_ops to make it possible to implement reregister memory region and alloc/bind/dealloc memory window operations in the future without breaking the libibverbs ABI. Assuming these methods and data structures are designed properly (which is hard to say, absent any real implementation) then it will only be necessary to add new libibverbs functions to call the hooks, which will be source and binary compatible with existing applications and low-level drivers. Applications that want to use the new functions can easily check for their existence at compile time. Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--include/infiniband/verbs.h38
1 files changed, 37 insertions, 1 deletions
diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h
index 49cd581..2ae50ab 100644
--- a/include/infiniband/verbs.h
+++ b/include/infiniband/verbs.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2004, 2005 Topspin Communications. All rights reserved.
* Copyright (c) 2004 Intel Corporation. All rights reserved.
- * Copyright (c) 2005, 2006 Cisco Systems, Inc. All rights reserved.
+ * Copyright (c) 2005, 2006, 2007 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2005 PathScale, Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
@@ -288,6 +288,13 @@ struct ibv_pd {
uint32_t handle;
};
+enum ibv_rereg_mr_flags {
+ IBV_REREG_MR_CHANGE_TRANSLATION = (1 << 0),
+ IBV_REREG_MR_CHANGE_PD = (1 << 1),
+ IBV_REREG_MR_CHANGE_ACCESS = (1 << 2),
+ IBV_REREG_MR_KEEP_VALID = (1 << 3)
+};
+
struct ibv_mr {
struct ibv_context *context;
struct ibv_pd *pd;
@@ -298,6 +305,17 @@ struct ibv_mr {
uint32_t rkey;
};
+enum ibv_mw_type {
+ IBV_MW_TYPE_1 = 1,
+ IBV_MW_TYPE_2 = 2
+};
+
+struct ibv_mw {
+ struct ibv_context *context;
+ struct ibv_pd *pd;
+ uint32_t rkey;
+};
+
struct ibv_global_route {
union ibv_gid dgid;
uint32_t flow_label;
@@ -517,6 +535,15 @@ struct ibv_recv_wr {
int num_sge;
};
+struct ibv_mw_bind {
+ uint64_t wr_id;
+ struct ibv_mr *mr;
+ void *addr;
+ size_t length;
+ enum ibv_send_flags send_flags;
+ enum ibv_access_flags mw_access_flags;
+};
+
struct ibv_srq {
struct ibv_context *context;
void *srq_context;
@@ -603,7 +630,16 @@ struct ibv_context_ops {
int (*dealloc_pd)(struct ibv_pd *pd);
struct ibv_mr * (*reg_mr)(struct ibv_pd *pd, void *addr, size_t length,
enum ibv_access_flags access);
+ struct ibv_mr * (*rereg_mr)(struct ibv_mr *mr,
+ enum ibv_rereg_mr_flags flags,
+ struct ibv_pd *pd, void *addr,
+ size_t length,
+ enum ibv_access_flags access);
int (*dereg_mr)(struct ibv_mr *mr);
+ struct ibv_mw * (*alloc_mw)(struct ibv_pd *pd, enum ibv_mw_type type);
+ int (*bind_mw)(struct ibv_qp *qp, struct ibv_mw *mw,
+ struct ibv_mw_bind *mw_bind);
+ int (*dealloc_mw)(struct ibv_mw *mw);
struct ibv_cq * (*create_cq)(struct ibv_context *context, int cqe,
struct ibv_comp_channel *channel,
int comp_vector);