RDS: fold rdma.h into rds.h
authorAndy Grover <andy.grover@oracle.com>
Tue, 12 Jan 2010 20:57:27 +0000 (12:57 -0800)
committerAndy Grover <andy.grover@oracle.com>
Thu, 9 Sep 2010 01:11:37 +0000 (18:11 -0700)
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>
12 files changed:
net/rds/af_rds.c
net/rds/connection.c
net/rds/ib_rdma.c
net/rds/ib_send.c
net/rds/iw_rdma.c
net/rds/iw_send.c
net/rds/message.c
net/rds/rdma.c
net/rds/rdma.h [deleted file]
net/rds/rds.h
net/rds/recv.c
net/rds/send.c

index 63474e1f4dd8b980296e0cec31e98c36675ceef0..ef09340cf7a972e437e3695960505b149244ab7a 100644 (file)
@@ -39,7 +39,6 @@
 #include <net/sock.h>
 
 #include "rds.h"
-#include "rdma.h"
 
 /* this is just used for stats gathering :/ */
 static DEFINE_SPINLOCK(rds_sock_lock);
index 9c9afb58a143cdf9170da09cc8e239d90dc1fa59..88bcaf3f3e169e93543cf59d79eb47d6a3d482db 100644 (file)
@@ -37,7 +37,6 @@
 
 #include "rds.h"
 #include "loop.h"
-#include "rdma.h"
 
 #define RDS_CONNECTION_HASH_BITS 12
 #define RDS_CONNECTION_HASH_ENTRIES (1 << RDS_CONNECTION_HASH_BITS)
index a92aebcb7fcf872e712189a9dbe1d66bd0df47c0..0f3b5a2f3fe0293adb313ed40dff1d321c502701 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/slab.h>
 
 #include "rds.h"
-#include "rdma.h"
 #include "ib.h"
 
 
index 53750203c9e5442fdd6cfc658c507074fe43cff6..575fce463c65003d015be67fb925339f0032a84c 100644 (file)
@@ -36,7 +36,6 @@
 #include <linux/dmapool.h>
 
 #include "rds.h"
-#include "rdma.h"
 #include "ib.h"
 
 static void rds_ib_send_rdma_complete(struct rds_message *rm,
index 13dc1862d86264288eb0455056d289008d072234..4e152e2daa3d02cc1ca2397853d00cbca8d75809 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/slab.h>
 
 #include "rds.h"
-#include "rdma.h"
 #include "iw.h"
 
 
index c187e8fdeab1b8044f762f99aa3a976809f68568..62234b804d93e09fbd7fa3994e4cdea4f709741d 100644 (file)
@@ -36,7 +36,6 @@
 #include <linux/dmapool.h>
 
 #include "rds.h"
-#include "rdma.h"
 #include "iw.h"
 
 static void rds_iw_send_rdma_complete(struct rds_message *rm,
index 3498cbcc7542752af3d42c68d886c151fdde79df..fb382fbb5b6f794442d69b27ec00617c087769c7 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/slab.h>
 
 #include "rds.h"
-#include "rdma.h"
 
 static DECLARE_WAIT_QUEUE_HEAD(rds_message_flush_waitq);
 
index 5011efa62a92c0ccea593521ddd58611adf52186..a21edad339508d714643b739a8d54c945c1e2417 100644 (file)
@@ -35,7 +35,7 @@
 #include <linux/rbtree.h>
 #include <linux/dma-mapping.h> /* for DMA_*_DEVICE */
 
-#include "rdma.h"
+#include "rds.h"
 
 /*
  * XXX
diff --git a/net/rds/rdma.h b/net/rds/rdma.h
deleted file mode 100644 (file)
index 909c398..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#ifndef _RDS_RDMA_H
-#define _RDS_RDMA_H
-
-#include <linux/rbtree.h>
-#include <linux/spinlock.h>
-#include <linux/scatterlist.h>
-
-#include "rds.h"
-
-struct rds_mr {
-       struct rb_node          r_rb_node;
-       atomic_t                r_refcount;
-       u32                     r_key;
-
-       /* A copy of the creation flags */
-       unsigned int            r_use_once:1;
-       unsigned int            r_invalidate:1;
-       unsigned int            r_write:1;
-
-       /* This is for RDS_MR_DEAD.
-        * It would be nice & consistent to make this part of the above
-        * bit field here, but we need to use test_and_set_bit.
-        */
-       unsigned long           r_state;
-       struct rds_sock         *r_sock; /* back pointer to the socket that owns us */
-       struct rds_transport    *r_trans;
-       void                    *r_trans_private;
-};
-
-/* Flags for mr->r_state */
-#define RDS_MR_DEAD            0
-
-struct rds_rdma_op {
-       u32                     r_key;
-       u64                     r_remote_addr;
-       unsigned int            r_write:1;
-       unsigned int            r_fence:1;
-       unsigned int            r_notify:1;
-       unsigned int            r_recverr:1;
-       unsigned int            r_mapped:1;
-       struct rds_notifier     *r_notifier;
-       unsigned int            r_bytes;
-       unsigned int            r_nents;
-       unsigned int            r_count;
-       struct scatterlist      r_sg[0];
-};
-
-static inline rds_rdma_cookie_t rds_rdma_make_cookie(u32 r_key, u32 offset)
-{
-       return r_key | (((u64) offset) << 32);
-}
-
-static inline u32 rds_rdma_cookie_key(rds_rdma_cookie_t cookie)
-{
-       return cookie;
-}
-
-static inline u32 rds_rdma_cookie_offset(rds_rdma_cookie_t cookie)
-{
-       return cookie >> 32;
-}
-
-int rds_get_mr(struct rds_sock *rs, char __user *optval, int optlen);
-int rds_get_mr_for_dest(struct rds_sock *rs, char __user *optval, int optlen);
-int rds_free_mr(struct rds_sock *rs, char __user *optval, int optlen);
-void rds_rdma_drop_keys(struct rds_sock *rs);
-int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm,
-                         struct cmsghdr *cmsg);
-int rds_cmsg_rdma_dest(struct rds_sock *rs, struct rds_message *rm,
-                         struct cmsghdr *cmsg);
-int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm,
-                         struct cmsghdr *cmsg);
-int rds_cmsg_rdma_map(struct rds_sock *rs, struct rds_message *rm,
-                         struct cmsghdr *cmsg);
-void rds_rdma_free_op(struct rds_rdma_op *ro);
-void rds_rdma_send_complete(struct rds_message *rm, int);
-
-extern void __rds_put_mr_final(struct rds_mr *mr);
-static inline void rds_mr_put(struct rds_mr *mr)
-{
-       if (atomic_dec_and_test(&mr->r_refcount))
-               __rds_put_mr_final(mr);
-}
-
-#endif
index d29c71aabbd4ac08216217b3165e38b2a99b5fee..7c4adbe8c2848ad4733155fb3ce18b3492ef0aa4 100644 (file)
@@ -206,6 +206,60 @@ struct rds_incoming {
        rds_rdma_cookie_t       i_rdma_cookie;
 };
 
+struct rds_mr {
+       struct rb_node          r_rb_node;
+       atomic_t                r_refcount;
+       u32                     r_key;
+
+       /* A copy of the creation flags */
+       unsigned int            r_use_once:1;
+       unsigned int            r_invalidate:1;
+       unsigned int            r_write:1;
+
+       /* This is for RDS_MR_DEAD.
+        * It would be nice & consistent to make this part of the above
+        * bit field here, but we need to use test_and_set_bit.
+        */
+       unsigned long           r_state;
+       struct rds_sock         *r_sock; /* back pointer to the socket that owns us */
+       struct rds_transport    *r_trans;
+       void                    *r_trans_private;
+};
+
+/* Flags for mr->r_state */
+#define RDS_MR_DEAD            0
+
+struct rds_rdma_op {
+       u32                     r_key;
+       u64                     r_remote_addr;
+       unsigned int            r_write:1;
+       unsigned int            r_fence:1;
+       unsigned int            r_notify:1;
+       unsigned int            r_recverr:1;
+       unsigned int            r_mapped:1;
+       unsigned int            r_active:1;
+       struct rds_notifier     *r_notifier;
+       unsigned int            r_bytes;
+       unsigned int            r_nents;
+       unsigned int            r_count;
+       struct scatterlist      *r_sg;
+};
+
+static inline rds_rdma_cookie_t rds_rdma_make_cookie(u32 r_key, u32 offset)
+{
+       return r_key | (((u64) offset) << 32);
+}
+
+static inline u32 rds_rdma_cookie_key(rds_rdma_cookie_t cookie)
+{
+       return cookie;
+}
+
+static inline u32 rds_rdma_cookie_offset(rds_rdma_cookie_t cookie)
+{
+       return cookie >> 32;
+}
+
 /*
  * m_sock_item and m_conn_item are on lists that are serialized under
  * 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 *,
 
 /* rdma.c */
 void rds_rdma_unuse(struct rds_sock *rs, u32 r_key, int force);
+int rds_get_mr(struct rds_sock *rs, char __user *optval, int optlen);
+int rds_get_mr_for_dest(struct rds_sock *rs, char __user *optval, int optlen);
+int rds_free_mr(struct rds_sock *rs, char __user *optval, int optlen);
+void rds_rdma_drop_keys(struct rds_sock *rs);
+int rds_rdma_extra_size(struct rds_rdma_args *args);
+int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm,
+                         struct cmsghdr *cmsg);
+int rds_cmsg_rdma_dest(struct rds_sock *rs, struct rds_message *rm,
+                         struct cmsghdr *cmsg);
+int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm,
+                         struct cmsghdr *cmsg);
+int rds_cmsg_rdma_map(struct rds_sock *rs, struct rds_message *rm,
+                         struct cmsghdr *cmsg);
+void rds_rdma_free_op(struct rds_rdma_op *ro);
+void rds_rdma_send_complete(struct rds_message *rm, int);
+
+extern void __rds_put_mr_final(struct rds_mr *mr);
+static inline void rds_mr_put(struct rds_mr *mr)
+{
+       if (atomic_dec_and_test(&mr->r_refcount))
+               __rds_put_mr_final(mr);
+}
 
 /* stats.c */
 DECLARE_PER_CPU_SHARED_ALIGNED(struct rds_statistics, rds_stats);
index 88f1f5aecfa6e07e1671af8d48b12bdbe3870900..5188763b609b4d84a22ec0934d5e8e5355e67ce7 100644 (file)
@@ -36,7 +36,6 @@
 #include <linux/in.h>
 
 #include "rds.h"
-#include "rdma.h"
 
 void rds_inc_init(struct rds_incoming *inc, struct rds_connection *conn,
                  __be32 saddr)
index 28d09447207b8b765b3df543acbeffa544fde906..89e26ffdc812637b0a845339937cfcde7f180e9d 100644 (file)
@@ -37,7 +37,6 @@
 #include <linux/list.h>
 
 #include "rds.h"
-#include "rdma.h"
 
 /* When transmitting messages in rds_send_xmit, we need to emerge from
  * time to time and briefly release the CPU. Otherwise the softlock watchdog