aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliezer Tamir <eliezer.tamir@linux.intel.com>2013-07-10 10:13:36 -0400
committerDavid S. Miller <davem@davemloft.net>2013-07-10 20:08:27 -0400
commit64b0dc517ea1b35d02565a779e6cb77ae9045685 (patch)
treef4701c62374a44db9f3be2d46f9420a328cd49ee
parent8b80cda536ea9bceec0364e897868a30ee13b992 (diff)
net: rename busy poll socket op and globals
Rename LL_SO to BUSY_POLL_SO Rename sysctl_net_ll_{read,poll} to sysctl_busy_{read,poll} Fix up users of these variables. Fix documentation for sysctl. a patch for the socket.7 man page will follow separately, because of limitations of my mail setup. Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--Documentation/sysctl/net.txt17
-rw-r--r--arch/alpha/include/uapi/asm/socket.h2
-rw-r--r--arch/avr32/include/uapi/asm/socket.h2
-rw-r--r--arch/cris/include/uapi/asm/socket.h2
-rw-r--r--arch/frv/include/uapi/asm/socket.h2
-rw-r--r--arch/h8300/include/uapi/asm/socket.h2
-rw-r--r--arch/ia64/include/uapi/asm/socket.h2
-rw-r--r--arch/m32r/include/uapi/asm/socket.h2
-rw-r--r--arch/mips/include/uapi/asm/socket.h2
-rw-r--r--arch/mn10300/include/uapi/asm/socket.h2
-rw-r--r--arch/parisc/include/uapi/asm/socket.h2
-rw-r--r--arch/powerpc/include/uapi/asm/socket.h2
-rw-r--r--arch/s390/include/uapi/asm/socket.h2
-rw-r--r--arch/sparc/include/uapi/asm/socket.h2
-rw-r--r--arch/xtensa/include/uapi/asm/socket.h2
-rw-r--r--include/net/busy_poll.h8
-rw-r--r--include/uapi/asm-generic/socket.h2
-rw-r--r--net/core/sock.c6
-rw-r--r--net/core/sysctl_net_core.c8
-rw-r--r--net/socket.c4
20 files changed, 37 insertions, 36 deletions
diff --git a/Documentation/sysctl/net.txt b/Documentation/sysctl/net.txt
index d69e14c9002c..1c15043aaee4 100644
--- a/Documentation/sysctl/net.txt
+++ b/Documentation/sysctl/net.txt
@@ -50,26 +50,27 @@ The maximum number of packets that kernel can handle on a NAPI interrupt,
50it's a Per-CPU variable. 50it's a Per-CPU variable.
51Default: 64 51Default: 64
52 52
53low_latency_read 53busy_read
54---------------- 54----------------
55Low latency busy poll timeout for socket reads. (needs CONFIG_NET_LL_RX_POLL) 55Low latency busy poll timeout for socket reads. (needs CONFIG_NET_LL_RX_POLL)
56Approximate time in us to busy loop waiting for packets on the device queue. 56Approximate time in us to busy loop waiting for packets on the device queue.
57This sets the default value of the SO_LL socket option. 57This sets the default value of the SO_BUSY_POLL socket option.
58Can be set or overridden per socket by setting socket option SO_LL, which is 58Can be set or overridden per socket by setting socket option SO_BUSY_POLL,
59the preferred method of enabling. 59which is the preferred method of enabling. If you need to enable the feature
60If you need to enable the feature globally via sysctl, a value of 50 is recommended. 60globally via sysctl, a value of 50 is recommended.
61Will increase power usage. 61Will increase power usage.
62Default: 0 (off) 62Default: 0 (off)
63 63
64low_latency_poll 64busy_poll
65---------------- 65----------------
66Low latency busy poll timeout for poll and select. (needs CONFIG_NET_LL_RX_POLL) 66Low latency busy poll timeout for poll and select. (needs CONFIG_NET_LL_RX_POLL)
67Approximate time in us to busy loop waiting for events. 67Approximate time in us to busy loop waiting for events.
68Recommended value depends on the number of sockets you poll on. 68Recommended value depends on the number of sockets you poll on.
69For several sockets 50, for several hundreds 100. 69For several sockets 50, for several hundreds 100.
70For more than that you probably want to use epoll. 70For more than that you probably want to use epoll.
71Note that only sockets with SO_LL set will be busy polled, so you want to either 71Note that only sockets with SO_BUSY_POLL set will be busy polled,
72selectively set SO_LL on those sockets or set sysctl.net.low_latency_read globally. 72so you want to either selectively set SO_BUSY_POLL on those sockets or set
73sysctl.net.busy_read globally.
73Will increase power usage. 74Will increase power usage.
74Default: 0 (off) 75Default: 0 (off)
75 76
diff --git a/arch/alpha/include/uapi/asm/socket.h b/arch/alpha/include/uapi/asm/socket.h
index 4885825e498d..467de010ea7e 100644
--- a/arch/alpha/include/uapi/asm/socket.h
+++ b/arch/alpha/include/uapi/asm/socket.h
@@ -81,6 +81,6 @@
81 81
82#define SO_SELECT_ERR_QUEUE 45 82#define SO_SELECT_ERR_QUEUE 45
83 83
84#define SO_LL 46 84#define SO_BUSY_POLL 46
85 85
86#endif /* _UAPI_ASM_SOCKET_H */ 86#endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/avr32/include/uapi/asm/socket.h b/arch/avr32/include/uapi/asm/socket.h
index 79b61798ebf8..11c4259c62fb 100644
--- a/arch/avr32/include/uapi/asm/socket.h
+++ b/arch/avr32/include/uapi/asm/socket.h
@@ -74,6 +74,6 @@
74 74
75#define SO_SELECT_ERR_QUEUE 45 75#define SO_SELECT_ERR_QUEUE 45
76 76
77#define SO_LL 46 77#define SO_BUSY_POLL 46
78 78
79#endif /* __ASM_AVR32_SOCKET_H */ 79#endif /* __ASM_AVR32_SOCKET_H */
diff --git a/arch/cris/include/uapi/asm/socket.h b/arch/cris/include/uapi/asm/socket.h
index 47b1ec55092d..eb723e51554e 100644
--- a/arch/cris/include/uapi/asm/socket.h
+++ b/arch/cris/include/uapi/asm/socket.h
@@ -76,7 +76,7 @@
76 76
77#define SO_SELECT_ERR_QUEUE 45 77#define SO_SELECT_ERR_QUEUE 45
78 78
79#define SO_LL 46 79#define SO_BUSY_POLL 46
80 80
81#endif /* _ASM_SOCKET_H */ 81#endif /* _ASM_SOCKET_H */
82 82
diff --git a/arch/frv/include/uapi/asm/socket.h b/arch/frv/include/uapi/asm/socket.h
index dbc08520f22c..f0cb1c341163 100644
--- a/arch/frv/include/uapi/asm/socket.h
+++ b/arch/frv/include/uapi/asm/socket.h
@@ -74,7 +74,7 @@
74 74
75#define SO_SELECT_ERR_QUEUE 45 75#define SO_SELECT_ERR_QUEUE 45
76 76
77#define SO_LL 46 77#define SO_BUSY_POLL 46
78 78
79#endif /* _ASM_SOCKET_H */ 79#endif /* _ASM_SOCKET_H */
80 80
diff --git a/arch/h8300/include/uapi/asm/socket.h b/arch/h8300/include/uapi/asm/socket.h
index a38d38a6520b..9490758c5e2b 100644
--- a/arch/h8300/include/uapi/asm/socket.h
+++ b/arch/h8300/include/uapi/asm/socket.h
@@ -74,6 +74,6 @@
74 74
75#define SO_SELECT_ERR_QUEUE 45 75#define SO_SELECT_ERR_QUEUE 45
76 76
77#define SO_LL 46 77#define SO_BUSY_POLL 46
78 78
79#endif /* _ASM_SOCKET_H */ 79#endif /* _ASM_SOCKET_H */
diff --git a/arch/ia64/include/uapi/asm/socket.h b/arch/ia64/include/uapi/asm/socket.h
index d3358b760681..556d0701a155 100644
--- a/arch/ia64/include/uapi/asm/socket.h
+++ b/arch/ia64/include/uapi/asm/socket.h
@@ -83,6 +83,6 @@
83 83
84#define SO_SELECT_ERR_QUEUE 45 84#define SO_SELECT_ERR_QUEUE 45
85 85
86#define SO_LL 46 86#define SO_BUSY_POLL 46
87 87
88#endif /* _ASM_IA64_SOCKET_H */ 88#endif /* _ASM_IA64_SOCKET_H */
diff --git a/arch/m32r/include/uapi/asm/socket.h b/arch/m32r/include/uapi/asm/socket.h
index 44aaf4639a4a..24be7c8da86a 100644
--- a/arch/m32r/include/uapi/asm/socket.h
+++ b/arch/m32r/include/uapi/asm/socket.h
@@ -74,6 +74,6 @@
74 74
75#define SO_SELECT_ERR_QUEUE 45 75#define SO_SELECT_ERR_QUEUE 45
76 76
77#define SO_LL 46 77#define SO_BUSY_POLL 46
78 78
79#endif /* _ASM_M32R_SOCKET_H */ 79#endif /* _ASM_M32R_SOCKET_H */
diff --git a/arch/mips/include/uapi/asm/socket.h b/arch/mips/include/uapi/asm/socket.h
index 6a07992ba6c6..61c01f054d1b 100644
--- a/arch/mips/include/uapi/asm/socket.h
+++ b/arch/mips/include/uapi/asm/socket.h
@@ -92,6 +92,6 @@
92 92
93#define SO_SELECT_ERR_QUEUE 45 93#define SO_SELECT_ERR_QUEUE 45
94 94
95#define SO_LL 46 95#define SO_BUSY_POLL 46
96 96
97#endif /* _UAPI_ASM_SOCKET_H */ 97#endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/mn10300/include/uapi/asm/socket.h b/arch/mn10300/include/uapi/asm/socket.h
index db80fd3e398b..e2a2b203eb00 100644
--- a/arch/mn10300/include/uapi/asm/socket.h
+++ b/arch/mn10300/include/uapi/asm/socket.h
@@ -74,6 +74,6 @@
74 74
75#define SO_SELECT_ERR_QUEUE 45 75#define SO_SELECT_ERR_QUEUE 45
76 76
77#define SO_LL 46 77#define SO_BUSY_POLL 46
78 78
79#endif /* _ASM_SOCKET_H */ 79#endif /* _ASM_SOCKET_H */
diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h
index f866fff9a004..71700e636a8e 100644
--- a/arch/parisc/include/uapi/asm/socket.h
+++ b/arch/parisc/include/uapi/asm/socket.h
@@ -73,7 +73,7 @@
73 73
74#define SO_SELECT_ERR_QUEUE 0x4026 74#define SO_SELECT_ERR_QUEUE 0x4026
75 75
76#define SO_LL 0x4027 76#define SO_BUSY_POLL 0x4027
77 77
78/* O_NONBLOCK clashes with the bits used for socket types. Therefore we 78/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
79 * have to define SOCK_NONBLOCK to a different value here. 79 * have to define SOCK_NONBLOCK to a different value here.
diff --git a/arch/powerpc/include/uapi/asm/socket.h b/arch/powerpc/include/uapi/asm/socket.h
index 405fb09bda94..a6d74467c9ed 100644
--- a/arch/powerpc/include/uapi/asm/socket.h
+++ b/arch/powerpc/include/uapi/asm/socket.h
@@ -81,6 +81,6 @@
81 81
82#define SO_SELECT_ERR_QUEUE 45 82#define SO_SELECT_ERR_QUEUE 45
83 83
84#define SO_LL 46 84#define SO_BUSY_POLL 46
85 85
86#endif /* _ASM_POWERPC_SOCKET_H */ 86#endif /* _ASM_POWERPC_SOCKET_H */
diff --git a/arch/s390/include/uapi/asm/socket.h b/arch/s390/include/uapi/asm/socket.h
index 0c5105fbaaf3..92494494692e 100644
--- a/arch/s390/include/uapi/asm/socket.h
+++ b/arch/s390/include/uapi/asm/socket.h
@@ -80,6 +80,6 @@
80 80
81#define SO_SELECT_ERR_QUEUE 45 81#define SO_SELECT_ERR_QUEUE 45
82 82
83#define SO_LL 46 83#define SO_BUSY_POLL 46
84 84
85#endif /* _ASM_SOCKET_H */ 85#endif /* _ASM_SOCKET_H */
diff --git a/arch/sparc/include/uapi/asm/socket.h b/arch/sparc/include/uapi/asm/socket.h
index b46c3fa0b265..4e1d66c3ce71 100644
--- a/arch/sparc/include/uapi/asm/socket.h
+++ b/arch/sparc/include/uapi/asm/socket.h
@@ -70,7 +70,7 @@
70 70
71#define SO_SELECT_ERR_QUEUE 0x0029 71#define SO_SELECT_ERR_QUEUE 0x0029
72 72
73#define SO_LL 0x0030 73#define SO_BUSY_POLL 0x0030
74 74
75/* Security levels - as per NRL IPv6 - don't actually do anything */ 75/* Security levels - as per NRL IPv6 - don't actually do anything */
76#define SO_SECURITY_AUTHENTICATION 0x5001 76#define SO_SECURITY_AUTHENTICATION 0x5001
diff --git a/arch/xtensa/include/uapi/asm/socket.h b/arch/xtensa/include/uapi/asm/socket.h
index b21ace4fc9ba..c114483010c1 100644
--- a/arch/xtensa/include/uapi/asm/socket.h
+++ b/arch/xtensa/include/uapi/asm/socket.h
@@ -85,6 +85,6 @@
85 85
86#define SO_SELECT_ERR_QUEUE 45 86#define SO_SELECT_ERR_QUEUE 45
87 87
88#define SO_LL 46 88#define SO_BUSY_POLL 46
89 89
90#endif /* _XTENSA_SOCKET_H */ 90#endif /* _XTENSA_SOCKET_H */
diff --git a/include/net/busy_poll.h b/include/net/busy_poll.h
index 4ff71908fd42..a14339c2985f 100644
--- a/include/net/busy_poll.h
+++ b/include/net/busy_poll.h
@@ -30,8 +30,8 @@
30#ifdef CONFIG_NET_LL_RX_POLL 30#ifdef CONFIG_NET_LL_RX_POLL
31 31
32struct napi_struct; 32struct napi_struct;
33extern unsigned int sysctl_net_ll_read __read_mostly; 33extern unsigned int sysctl_net_busy_read __read_mostly;
34extern unsigned int sysctl_net_ll_poll __read_mostly; 34extern unsigned int sysctl_net_busy_poll __read_mostly;
35 35
36/* return values from ndo_ll_poll */ 36/* return values from ndo_ll_poll */
37#define LL_FLUSH_FAILED -1 37#define LL_FLUSH_FAILED -1
@@ -39,7 +39,7 @@ extern unsigned int sysctl_net_ll_poll __read_mostly;
39 39
40static inline bool net_busy_loop_on(void) 40static inline bool net_busy_loop_on(void)
41{ 41{
42 return sysctl_net_ll_poll; 42 return sysctl_net_busy_poll;
43} 43}
44 44
45/* a wrapper to make debug_smp_processor_id() happy 45/* a wrapper to make debug_smp_processor_id() happy
@@ -72,7 +72,7 @@ static inline unsigned long sk_busy_loop_end_time(struct sock *sk)
72/* in poll/select we use the global sysctl_net_ll_poll value */ 72/* in poll/select we use the global sysctl_net_ll_poll value */
73static inline unsigned long busy_loop_end_time(void) 73static inline unsigned long busy_loop_end_time(void)
74{ 74{
75 return busy_loop_us_clock() + ACCESS_ONCE(sysctl_net_ll_poll); 75 return busy_loop_us_clock() + ACCESS_ONCE(sysctl_net_busy_poll);
76} 76}
77 77
78static inline bool sk_can_busy_loop(struct sock *sk) 78static inline bool sk_can_busy_loop(struct sock *sk)
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h
index ca3a20d772ac..f04b69b6abf2 100644
--- a/include/uapi/asm-generic/socket.h
+++ b/include/uapi/asm-generic/socket.h
@@ -76,6 +76,6 @@
76 76
77#define SO_SELECT_ERR_QUEUE 45 77#define SO_SELECT_ERR_QUEUE 45
78 78
79#define SO_LL 46 79#define SO_BUSY_POLL 46
80 80
81#endif /* __ASM_GENERIC_SOCKET_H */ 81#endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/net/core/sock.c b/net/core/sock.c
index 9bfe83f4d670..548d716c5f62 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -901,7 +901,7 @@ set_rcvbuf:
901 break; 901 break;
902 902
903#ifdef CONFIG_NET_LL_RX_POLL 903#ifdef CONFIG_NET_LL_RX_POLL
904 case SO_LL: 904 case SO_BUSY_POLL:
905 /* allow unprivileged users to decrease the value */ 905 /* allow unprivileged users to decrease the value */
906 if ((val > sk->sk_ll_usec) && !capable(CAP_NET_ADMIN)) 906 if ((val > sk->sk_ll_usec) && !capable(CAP_NET_ADMIN))
907 ret = -EPERM; 907 ret = -EPERM;
@@ -1171,7 +1171,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
1171 break; 1171 break;
1172 1172
1173#ifdef CONFIG_NET_LL_RX_POLL 1173#ifdef CONFIG_NET_LL_RX_POLL
1174 case SO_LL: 1174 case SO_BUSY_POLL:
1175 v.val = sk->sk_ll_usec; 1175 v.val = sk->sk_ll_usec;
1176 break; 1176 break;
1177#endif 1177#endif
@@ -2294,7 +2294,7 @@ void sock_init_data(struct socket *sock, struct sock *sk)
2294 2294
2295#ifdef CONFIG_NET_LL_RX_POLL 2295#ifdef CONFIG_NET_LL_RX_POLL
2296 sk->sk_napi_id = 0; 2296 sk->sk_napi_id = 0;
2297 sk->sk_ll_usec = sysctl_net_ll_read; 2297 sk->sk_ll_usec = sysctl_net_busy_read;
2298#endif 2298#endif
2299 2299
2300 /* 2300 /*
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 1a298cb3daee..660968616637 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -300,15 +300,15 @@ static struct ctl_table net_core_table[] = {
300#endif /* CONFIG_NET_FLOW_LIMIT */ 300#endif /* CONFIG_NET_FLOW_LIMIT */
301#ifdef CONFIG_NET_LL_RX_POLL 301#ifdef CONFIG_NET_LL_RX_POLL
302 { 302 {
303 .procname = "low_latency_poll", 303 .procname = "busy_poll",
304 .data = &sysctl_net_ll_poll, 304 .data = &sysctl_net_busy_poll,
305 .maxlen = sizeof(unsigned int), 305 .maxlen = sizeof(unsigned int),
306 .mode = 0644, 306 .mode = 0644,
307 .proc_handler = proc_dointvec 307 .proc_handler = proc_dointvec
308 }, 308 },
309 { 309 {
310 .procname = "low_latency_read", 310 .procname = "busy_read",
311 .data = &sysctl_net_ll_read, 311 .data = &sysctl_net_busy_read,
312 .maxlen = sizeof(unsigned int), 312 .maxlen = sizeof(unsigned int),
313 .mode = 0644, 313 .mode = 0644,
314 .proc_handler = proc_dointvec 314 .proc_handler = proc_dointvec
diff --git a/net/socket.c b/net/socket.c
index 6a3e9a3f50ad..829b460acb87 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -107,8 +107,8 @@
107#include <net/busy_poll.h> 107#include <net/busy_poll.h>
108 108
109#ifdef CONFIG_NET_LL_RX_POLL 109#ifdef CONFIG_NET_LL_RX_POLL
110unsigned int sysctl_net_ll_read __read_mostly; 110unsigned int sysctl_net_busy_read __read_mostly;
111unsigned int sysctl_net_ll_poll __read_mostly; 111unsigned int sysctl_net_busy_poll __read_mostly;
112#endif 112#endif
113 113
114static int sock_no_open(struct inode *irrelevant, struct file *dontcare); 114static int sock_no_open(struct inode *irrelevant, struct file *dontcare);