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 | |
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')
-rw-r--r-- | net/rds/af_rds.c | 1 | ||||
-rw-r--r-- | net/rds/connection.c | 1 | ||||
-rw-r--r-- | net/rds/ib_rdma.c | 1 | ||||
-rw-r--r-- | net/rds/ib_send.c | 1 | ||||
-rw-r--r-- | net/rds/iw_rdma.c | 1 | ||||
-rw-r--r-- | net/rds/iw_send.c | 1 | ||||
-rw-r--r-- | net/rds/message.c | 1 | ||||
-rw-r--r-- | net/rds/rdma.c | 2 | ||||
-rw-r--r-- | net/rds/rdma.h | 85 | ||||
-rw-r--r-- | net/rds/rds.h | 76 | ||||
-rw-r--r-- | net/rds/recv.c | 1 | ||||
-rw-r--r-- | net/rds/send.c | 1 |
12 files changed, 77 insertions, 95 deletions
diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c index 63474e1f4dd8..ef09340cf7a9 100644 --- a/net/rds/af_rds.c +++ b/net/rds/af_rds.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <net/sock.h> | 39 | #include <net/sock.h> |
40 | 40 | ||
41 | #include "rds.h" | 41 | #include "rds.h" |
42 | #include "rdma.h" | ||
43 | 42 | ||
44 | /* this is just used for stats gathering :/ */ | 43 | /* this is just used for stats gathering :/ */ |
45 | static DEFINE_SPINLOCK(rds_sock_lock); | 44 | static DEFINE_SPINLOCK(rds_sock_lock); |
diff --git a/net/rds/connection.c b/net/rds/connection.c index 9c9afb58a143..88bcaf3f3e16 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c | |||
@@ -37,7 +37,6 @@ | |||
37 | 37 | ||
38 | #include "rds.h" | 38 | #include "rds.h" |
39 | #include "loop.h" | 39 | #include "loop.h" |
40 | #include "rdma.h" | ||
41 | 40 | ||
42 | #define RDS_CONNECTION_HASH_BITS 12 | 41 | #define RDS_CONNECTION_HASH_BITS 12 |
43 | #define RDS_CONNECTION_HASH_ENTRIES (1 << RDS_CONNECTION_HASH_BITS) | 42 | #define RDS_CONNECTION_HASH_ENTRIES (1 << RDS_CONNECTION_HASH_BITS) |
diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c index a92aebcb7fcf..0f3b5a2f3fe0 100644 --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
35 | 35 | ||
36 | #include "rds.h" | 36 | #include "rds.h" |
37 | #include "rdma.h" | ||
38 | #include "ib.h" | 37 | #include "ib.h" |
39 | 38 | ||
40 | 39 | ||
diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c index 53750203c9e5..575fce463c65 100644 --- a/net/rds/ib_send.c +++ b/net/rds/ib_send.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <linux/dmapool.h> | 36 | #include <linux/dmapool.h> |
37 | 37 | ||
38 | #include "rds.h" | 38 | #include "rds.h" |
39 | #include "rdma.h" | ||
40 | #include "ib.h" | 39 | #include "ib.h" |
41 | 40 | ||
42 | static void rds_ib_send_rdma_complete(struct rds_message *rm, | 41 | static void rds_ib_send_rdma_complete(struct rds_message *rm, |
diff --git a/net/rds/iw_rdma.c b/net/rds/iw_rdma.c index 13dc1862d862..4e152e2daa3d 100644 --- a/net/rds/iw_rdma.c +++ b/net/rds/iw_rdma.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
35 | 35 | ||
36 | #include "rds.h" | 36 | #include "rds.h" |
37 | #include "rdma.h" | ||
38 | #include "iw.h" | 37 | #include "iw.h" |
39 | 38 | ||
40 | 39 | ||
diff --git a/net/rds/iw_send.c b/net/rds/iw_send.c index c187e8fdeab1..62234b804d93 100644 --- a/net/rds/iw_send.c +++ b/net/rds/iw_send.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <linux/dmapool.h> | 36 | #include <linux/dmapool.h> |
37 | 37 | ||
38 | #include "rds.h" | 38 | #include "rds.h" |
39 | #include "rdma.h" | ||
40 | #include "iw.h" | 39 | #include "iw.h" |
41 | 40 | ||
42 | static void rds_iw_send_rdma_complete(struct rds_message *rm, | 41 | static void rds_iw_send_rdma_complete(struct rds_message *rm, |
diff --git a/net/rds/message.c b/net/rds/message.c index 3498cbcc7542..fb382fbb5b6f 100644 --- a/net/rds/message.c +++ b/net/rds/message.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
35 | 35 | ||
36 | #include "rds.h" | 36 | #include "rds.h" |
37 | #include "rdma.h" | ||
38 | 37 | ||
39 | static DECLARE_WAIT_QUEUE_HEAD(rds_message_flush_waitq); | 38 | static DECLARE_WAIT_QUEUE_HEAD(rds_message_flush_waitq); |
40 | 39 | ||
diff --git a/net/rds/rdma.c b/net/rds/rdma.c index 5011efa62a92..a21edad33950 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c | |||
@@ -35,7 +35,7 @@ | |||
35 | #include <linux/rbtree.h> | 35 | #include <linux/rbtree.h> |
36 | #include <linux/dma-mapping.h> /* for DMA_*_DEVICE */ | 36 | #include <linux/dma-mapping.h> /* for DMA_*_DEVICE */ |
37 | 37 | ||
38 | #include "rdma.h" | 38 | #include "rds.h" |
39 | 39 | ||
40 | /* | 40 | /* |
41 | * XXX | 41 | * XXX |
diff --git a/net/rds/rdma.h b/net/rds/rdma.h deleted file mode 100644 index 909c39835a5d..000000000000 --- a/net/rds/rdma.h +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | #ifndef _RDS_RDMA_H | ||
2 | #define _RDS_RDMA_H | ||
3 | |||
4 | #include <linux/rbtree.h> | ||
5 | #include <linux/spinlock.h> | ||
6 | #include <linux/scatterlist.h> | ||
7 | |||
8 | #include "rds.h" | ||
9 | |||
10 | struct rds_mr { | ||
11 | struct rb_node r_rb_node; | ||
12 | atomic_t r_refcount; | ||
13 | u32 r_key; | ||
14 | |||
15 | /* A copy of the creation flags */ | ||
16 | unsigned int r_use_once:1; | ||
17 | unsigned int r_invalidate:1; | ||
18 | unsigned int r_write:1; | ||
19 | |||
20 | /* This is for RDS_MR_DEAD. | ||
21 | * It would be nice & consistent to make this part of the above | ||
22 | * bit field here, but we need to use test_and_set_bit. | ||
23 | */ | ||
24 | unsigned long r_state; | ||
25 | struct rds_sock *r_sock; /* back pointer to the socket that owns us */ | ||
26 | struct rds_transport *r_trans; | ||
27 | void *r_trans_private; | ||
28 | }; | ||
29 | |||
30 | /* Flags for mr->r_state */ | ||
31 | #define RDS_MR_DEAD 0 | ||
32 | |||
33 | struct rds_rdma_op { | ||
34 | u32 r_key; | ||
35 | u64 r_remote_addr; | ||
36 | unsigned int r_write:1; | ||
37 | unsigned int r_fence:1; | ||
38 | unsigned int r_notify:1; | ||
39 | unsigned int r_recverr:1; | ||
40 | unsigned int r_mapped:1; | ||
41 | struct rds_notifier *r_notifier; | ||
42 | unsigned int r_bytes; | ||
43 | unsigned int r_nents; | ||
44 | unsigned int r_count; | ||
45 | struct scatterlist r_sg[0]; | ||
46 | }; | ||
47 | |||
48 | static inline rds_rdma_cookie_t rds_rdma_make_cookie(u32 r_key, u32 offset) | ||
49 | { | ||
50 | return r_key | (((u64) offset) << 32); | ||
51 | } | ||
52 | |||
53 | static inline u32 rds_rdma_cookie_key(rds_rdma_cookie_t cookie) | ||
54 | { | ||
55 | return cookie; | ||
56 | } | ||
57 | |||
58 | static inline u32 rds_rdma_cookie_offset(rds_rdma_cookie_t cookie) | ||
59 | { | ||
60 | return cookie >> 32; | ||
61 | } | ||
62 | |||
63 | int rds_get_mr(struct rds_sock *rs, char __user *optval, int optlen); | ||
64 | int rds_get_mr_for_dest(struct rds_sock *rs, char __user *optval, int optlen); | ||
65 | int rds_free_mr(struct rds_sock *rs, char __user *optval, int optlen); | ||
66 | void rds_rdma_drop_keys(struct rds_sock *rs); | ||
67 | int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm, | ||
68 | struct cmsghdr *cmsg); | ||
69 | int rds_cmsg_rdma_dest(struct rds_sock *rs, struct rds_message *rm, | ||
70 | struct cmsghdr *cmsg); | ||
71 | int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm, | ||
72 | struct cmsghdr *cmsg); | ||
73 | int rds_cmsg_rdma_map(struct rds_sock *rs, struct rds_message *rm, | ||
74 | struct cmsghdr *cmsg); | ||
75 | void rds_rdma_free_op(struct rds_rdma_op *ro); | ||
76 | void rds_rdma_send_complete(struct rds_message *rm, int); | ||
77 | |||
78 | extern void __rds_put_mr_final(struct rds_mr *mr); | ||
79 | static inline void rds_mr_put(struct rds_mr *mr) | ||
80 | { | ||
81 | if (atomic_dec_and_test(&mr->r_refcount)) | ||
82 | __rds_put_mr_final(mr); | ||
83 | } | ||
84 | |||
85 | #endif | ||
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); |
diff --git a/net/rds/recv.c b/net/rds/recv.c index 88f1f5aecfa6..5188763b609b 100644 --- a/net/rds/recv.c +++ b/net/rds/recv.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <linux/in.h> | 36 | #include <linux/in.h> |
37 | 37 | ||
38 | #include "rds.h" | 38 | #include "rds.h" |
39 | #include "rdma.h" | ||
40 | 39 | ||
41 | void rds_inc_init(struct rds_incoming *inc, struct rds_connection *conn, | 40 | void rds_inc_init(struct rds_incoming *inc, struct rds_connection *conn, |
42 | __be32 saddr) | 41 | __be32 saddr) |
diff --git a/net/rds/send.c b/net/rds/send.c index 28d09447207b..89e26ffdc812 100644 --- a/net/rds/send.c +++ b/net/rds/send.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <linux/list.h> | 37 | #include <linux/list.h> |
38 | 38 | ||
39 | #include "rds.h" | 39 | #include "rds.h" |
40 | #include "rdma.h" | ||
41 | 40 | ||
42 | /* When transmitting messages in rds_send_xmit, we need to emerge from | 41 | /* When transmitting messages in rds_send_xmit, we need to emerge from |
43 | * time to time and briefly release the CPU. Otherwise the softlock watchdog | 42 | * time to time and briefly release the CPU. Otherwise the softlock watchdog |