diff options
author | Andy Grover <andy.grover@oracle.com> | 2010-01-12 15:57:27 -0500 |
---|---|---|
committer | Andy Grover <andy.grover@oracle.com> | 2010-09-08 21:11:37 -0400 |
commit | 21f79afa5fda2820671a8f64c3d0e43bb118053b (patch) | |
tree | 54029e0dbe3e4a68d579c02c5e9ed9d1fb63cfae /net/rds/rds.h | |
parent | fc445084f185cdd877bec323bfe724a361e2292a (diff) |
RDS: fold rdma.h into rds.h
RDMA is now an intrinsic part of RDS, so it's easier to just have
a single header.
Signed-off-by: Andy Grover <andy.grover@oracle.com>
Diffstat (limited to 'net/rds/rds.h')
-rw-r--r-- | net/rds/rds.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/net/rds/rds.h b/net/rds/rds.h index d29c71aabbd4..7c4adbe8c284 100644 --- a/net/rds/rds.h +++ b/net/rds/rds.h | |||
@@ -206,6 +206,60 @@ struct rds_incoming { | |||
206 | rds_rdma_cookie_t i_rdma_cookie; | 206 | rds_rdma_cookie_t i_rdma_cookie; |
207 | }; | 207 | }; |
208 | 208 | ||
209 | struct rds_mr { | ||
210 | struct rb_node r_rb_node; | ||
211 | atomic_t r_refcount; | ||
212 | u32 r_key; | ||
213 | |||
214 | /* A copy of the creation flags */ | ||
215 | unsigned int r_use_once:1; | ||
216 | unsigned int r_invalidate:1; | ||
217 | unsigned int r_write:1; | ||
218 | |||
219 | /* This is for RDS_MR_DEAD. | ||
220 | * It would be nice & consistent to make this part of the above | ||
221 | * bit field here, but we need to use test_and_set_bit. | ||
222 | */ | ||
223 | unsigned long r_state; | ||
224 | struct rds_sock *r_sock; /* back pointer to the socket that owns us */ | ||
225 | struct rds_transport *r_trans; | ||
226 | void *r_trans_private; | ||
227 | }; | ||
228 | |||
229 | /* Flags for mr->r_state */ | ||
230 | #define RDS_MR_DEAD 0 | ||
231 | |||
232 | struct rds_rdma_op { | ||
233 | u32 r_key; | ||
234 | u64 r_remote_addr; | ||
235 | unsigned int r_write:1; | ||
236 | unsigned int r_fence:1; | ||
237 | unsigned int r_notify:1; | ||
238 | unsigned int r_recverr:1; | ||
239 | unsigned int r_mapped:1; | ||
240 | unsigned int r_active:1; | ||
241 | struct rds_notifier *r_notifier; | ||
242 | unsigned int r_bytes; | ||
243 | unsigned int r_nents; | ||
244 | unsigned int r_count; | ||
245 | struct scatterlist *r_sg; | ||
246 | }; | ||
247 | |||
248 | static inline rds_rdma_cookie_t rds_rdma_make_cookie(u32 r_key, u32 offset) | ||
249 | { | ||
250 | return r_key | (((u64) offset) << 32); | ||
251 | } | ||
252 | |||
253 | static inline u32 rds_rdma_cookie_key(rds_rdma_cookie_t cookie) | ||
254 | { | ||
255 | return cookie; | ||
256 | } | ||
257 | |||
258 | static inline u32 rds_rdma_cookie_offset(rds_rdma_cookie_t cookie) | ||
259 | { | ||
260 | return cookie >> 32; | ||
261 | } | ||
262 | |||
209 | /* | 263 | /* |
210 | * m_sock_item and m_conn_item are on lists that are serialized under | 264 | * m_sock_item and m_conn_item are on lists that are serialized under |
211 | * conn->c_lock. m_sock_item has additional meaning in that once it is empty | 265 | * conn->c_lock. m_sock_item has additional meaning in that once it is empty |
@@ -654,6 +708,28 @@ struct rds_message *rds_send_get_message(struct rds_connection *, | |||
654 | 708 | ||
655 | /* rdma.c */ | 709 | /* rdma.c */ |
656 | void rds_rdma_unuse(struct rds_sock *rs, u32 r_key, int force); | 710 | void rds_rdma_unuse(struct rds_sock *rs, u32 r_key, int force); |
711 | int rds_get_mr(struct rds_sock *rs, char __user *optval, int optlen); | ||
712 | int rds_get_mr_for_dest(struct rds_sock *rs, char __user *optval, int optlen); | ||
713 | int rds_free_mr(struct rds_sock *rs, char __user *optval, int optlen); | ||
714 | void rds_rdma_drop_keys(struct rds_sock *rs); | ||
715 | int rds_rdma_extra_size(struct rds_rdma_args *args); | ||
716 | int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm, | ||
717 | struct cmsghdr *cmsg); | ||
718 | int rds_cmsg_rdma_dest(struct rds_sock *rs, struct rds_message *rm, | ||
719 | struct cmsghdr *cmsg); | ||
720 | int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm, | ||
721 | struct cmsghdr *cmsg); | ||
722 | int rds_cmsg_rdma_map(struct rds_sock *rs, struct rds_message *rm, | ||
723 | struct cmsghdr *cmsg); | ||
724 | void rds_rdma_free_op(struct rds_rdma_op *ro); | ||
725 | void rds_rdma_send_complete(struct rds_message *rm, int); | ||
726 | |||
727 | extern void __rds_put_mr_final(struct rds_mr *mr); | ||
728 | static inline void rds_mr_put(struct rds_mr *mr) | ||
729 | { | ||
730 | if (atomic_dec_and_test(&mr->r_refcount)) | ||
731 | __rds_put_mr_final(mr); | ||
732 | } | ||
657 | 733 | ||
658 | /* stats.c */ | 734 | /* stats.c */ |
659 | DECLARE_PER_CPU_SHARED_ALIGNED(struct rds_statistics, rds_stats); | 735 | DECLARE_PER_CPU_SHARED_ALIGNED(struct rds_statistics, rds_stats); |