diff options
author | Eliezer Tamir <eliezer.tamir@linux.intel.com> | 2013-06-10 04:40:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-11 00:22:36 -0400 |
commit | a5b50476f77a8fcc8055c955720d05a7c2d9c532 (patch) | |
tree | 4b12eb7d102a3c0ce4799e00bc4a9c0b10026db7 /net/core | |
parent | 060212928670593fb89243640bf05cf89560b023 (diff) |
udp: add low latency socket poll support
Add upport for busy-polling on UDP sockets.
In __udp[46]_lib_rcv add a call to sk_mark_ll() to copy the napi_id
from the skb into the sk.
This is done at the earliest possible moment, right after we identify
which socket this skb is for.
In __skb_recv_datagram When there is no data and the user
tries to read we busy poll.
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')
-rw-r--r-- | net/core/datagram.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/core/datagram.c b/net/core/datagram.c index b71423db7785..9cbaba98ce4c 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c | |||
@@ -56,6 +56,7 @@ | |||
56 | #include <net/sock.h> | 56 | #include <net/sock.h> |
57 | #include <net/tcp_states.h> | 57 | #include <net/tcp_states.h> |
58 | #include <trace/events/skb.h> | 58 | #include <trace/events/skb.h> |
59 | #include <net/ll_poll.h> | ||
59 | 60 | ||
60 | /* | 61 | /* |
61 | * Is a socket 'connection oriented' ? | 62 | * Is a socket 'connection oriented' ? |
@@ -207,6 +208,9 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags, | |||
207 | } | 208 | } |
208 | spin_unlock_irqrestore(&queue->lock, cpu_flags); | 209 | spin_unlock_irqrestore(&queue->lock, cpu_flags); |
209 | 210 | ||
211 | if (sk_valid_ll(sk) && sk_poll_ll(sk, flags & MSG_DONTWAIT)) | ||
212 | continue; | ||
213 | |||
210 | /* User doesn't want to wait */ | 214 | /* User doesn't want to wait */ |
211 | error = -EAGAIN; | 215 | error = -EAGAIN; |
212 | if (!timeo) | 216 | if (!timeo) |