aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorEliezer Tamir <eliezer.tamir@linux.intel.com>2013-06-10 04:39:50 -0400
committerDavid S. Miller <davem@davemloft.net>2013-06-11 00:22:35 -0400
commit060212928670593fb89243640bf05cf89560b023 (patch)
tree32ae5c7be094983fb06430dbe09d36e2b317ca9c /net/core/sock.c
parentaf12fa6e46aa651e7b86a4c4117b562518fef184 (diff)
net: add low latency socket poll
Adds an ndo_ll_poll method and the code that supports it. This method can be used by low latency applications to busy-poll Ethernet device queues directly from the socket code. sysctl_net_ll_poll controls how many microseconds to poll. Default is zero (disabled). Individual protocol support will be added by subsequent patches. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com> Acked-by: Eric Dumazet <edumazet@google.com> Tested-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r--net/core/sock.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index 88868a9d21da..788c0da5eed1 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -139,6 +139,8 @@
139#include <net/tcp.h> 139#include <net/tcp.h>
140#endif 140#endif
141 141
142#include <net/ll_poll.h>
143
142static DEFINE_MUTEX(proto_list_mutex); 144static DEFINE_MUTEX(proto_list_mutex);
143static LIST_HEAD(proto_list); 145static LIST_HEAD(proto_list);
144 146
@@ -2284,6 +2286,10 @@ void sock_init_data(struct socket *sock, struct sock *sk)
2284 2286
2285 sk->sk_stamp = ktime_set(-1L, 0); 2287 sk->sk_stamp = ktime_set(-1L, 0);
2286 2288
2289#ifdef CONFIG_NET_LL_RX_POLL
2290 sk->sk_napi_id = 0;
2291#endif
2292
2287 /* 2293 /*
2288 * Before updating sk_refcnt, we must commit prior changes to memory 2294 * Before updating sk_refcnt, we must commit prior changes to memory
2289 * (Documentation/RCU/rculist_nulls.txt for details) 2295 * (Documentation/RCU/rculist_nulls.txt for details)