]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Declare SO_RDS_TRANSPORT and RDS_TRANS_* constants in uapi/linux/rds.h
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Tue, 2 Jun 2015 00:24:10 +0000 (20:24 -0400)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Wed, 8 Jul 2015 21:00:20 +0000 (14:00 -0700)
User space applications that desire to explicitly select the
underlying transport for a PF_RDS socket may do so by using the
SO_RDS_TRANSPORT socket option at the SOL_RDS level before bind().
The integer argument provided to the socket option would be one
of the RDS_TRANS_* values, e.g., RDS_TRANS_TCP. This commit exports
the constant values need by such applications via <linux/rds.h>

Orabug: 21061146

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
include/uapi/linux/rds.h
net/rds/rds.h

index 83370cdd898aff6bb5db1ae35fa8c907d446a009..40090ebf54333e40aee18486e4f4bdfd07db9f84 100644 (file)
 #define _LINUX_RDS_H
 
 #include <linux/types.h>
+/* XXX <net/sock.h> was included as part of NETFILTER support (commit f13bbf62)
+ * but <net/sock.h> is not exported to uapi, although <linux/rds.h> is
+ * (in theory). Is <net/sock.h> needed for user-apps that use netfilter?
+ */
+#ifdef __KERNEL__
 #include <net/sock.h>
+#endif
 
 /* These sparse annotated types shouldn't be in any user
  * visible header file. We should clean this up rather
@@ -48,6 +54,7 @@
 
 #define RDS_IB_ABI_VERSION             0x301
 
+#define        SOL_RDS                         276
 /*
  * setsockopt/getsockopt for SOL_RDS
  */
 #define RDS_CONG_MONITOR               6
 #define RDS_GET_MR_FOR_DEST            7
 #define RDS_CONN_RESET                  8
+#define SO_RDS_TRANSPORT               9
+
+/* supported values for SO_RDS_TRANSPORT */
+#define        RDS_TRANS_IB    0
+#define        RDS_TRANS_IWARP 1
+#define        RDS_TRANS_TCP   2
+#define        RDS_TRANS_COUNT 3
+#define        RDS_TRANS_NONE  (~0)
 
 /*
  * ioctl commands for SOL_RDS
index f02621dd9ea99a0fc7d4d76cc07b945bd96fcd0a..70f27f972f568da1c0f2bd2368fc6fc5ea3d76d4 100644 (file)
@@ -467,11 +467,6 @@ struct rds_notifier {
  *                 should try hard not to block.
  */
 
-#define RDS_TRANS_IB   0
-#define RDS_TRANS_IWARP        1
-#define RDS_TRANS_TCP  2
-#define RDS_TRANS_COUNT        3
-
 struct rds_transport {
        char                    t_name[TRANSNAMSIZ];
        struct list_head        t_item;