Skip to content

Commit ac7ca8d

Browse files
sowminivMukesh Kacker
authored andcommitted
Declare SO_RDS_TRANSPORT and RDS_TRANS_* constants in uapi/linux/rds.h
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Mukesh Kacker <[email protected]>
1 parent a9b63e2 commit ac7ca8d

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

include/uapi/linux/rds.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@
3535
#define _LINUX_RDS_H
3636

3737
#include <linux/types.h>
38+
/* XXX <net/sock.h> was included as part of NETFILTER support (commit f13bbf62)
39+
* but <net/sock.h> is not exported to uapi, although <linux/rds.h> is
40+
* (in theory). Is <net/sock.h> needed for user-apps that use netfilter?
41+
*/
42+
#ifdef __KERNEL__
3843
#include <net/sock.h>
44+
#endif
3945

4046
/* These sparse annotated types shouldn't be in any user
4147
* visible header file. We should clean this up rather
@@ -48,6 +54,7 @@
4854

4955
#define RDS_IB_ABI_VERSION 0x301
5056

57+
#define SOL_RDS 276
5158
/*
5259
* setsockopt/getsockopt for SOL_RDS
5360
*/
@@ -59,6 +66,14 @@
5966
#define RDS_CONG_MONITOR 6
6067
#define RDS_GET_MR_FOR_DEST 7
6168
#define RDS_CONN_RESET 8
69+
#define SO_RDS_TRANSPORT 9
70+
71+
/* supported values for SO_RDS_TRANSPORT */
72+
#define RDS_TRANS_IB 0
73+
#define RDS_TRANS_IWARP 1
74+
#define RDS_TRANS_TCP 2
75+
#define RDS_TRANS_COUNT 3
76+
#define RDS_TRANS_NONE (~0)
6277

6378
/*
6479
* ioctl commands for SOL_RDS

net/rds/rds.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -467,11 +467,6 @@ struct rds_notifier {
467467
* should try hard not to block.
468468
*/
469469

470-
#define RDS_TRANS_IB 0
471-
#define RDS_TRANS_IWARP 1
472-
#define RDS_TRANS_TCP 2
473-
#define RDS_TRANS_COUNT 3
474-
475470
struct rds_transport {
476471
char t_name[TRANSNAMSIZ];
477472
struct list_head t_item;

0 commit comments

Comments
 (0)