aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/socket.c
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2014-04-17 15:26:51 -0400
committerDavid S. Miller <davem@davemloft.net>2014-04-20 18:18:55 -0400
commit8465a5fcd1ceba8f2b55121d47b73f4025401490 (patch)
tree3e4d11d4a9452569be5e4a94a1d1cc8e90050408 /net/sctp/socket.c
parent85da101f54bf40aecc258ab0c2e9e26f9d58a361 (diff)
sctp: add support for busy polling to sctp protocol
The busy polling socket option adds support for sockets to busy wait on data arriving on the napi queue from which they have most recently received a frame. Currently only tcp and udp support this feature, but theres no reason sctp can't do so as well. Add it in so appliations can take advantage of it Signed-off-by: Neil Horman <nhorman@tuxdriver.com> CC: Vlad Yasevich <vyasevich@gmail.com> CC: "David S. Miller" <davem@davemloft.net> CC: Daniel Borkmann <dborkman@redhat.com> CC: netdev@vger.kernel.org Acked-by: Vlad Yasevich <vyasevich@gmail.com> Acked-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r--net/sctp/socket.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index fee06b99a4da..e37b2cbbf177 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -71,6 +71,7 @@
71#include <net/route.h> 71#include <net/route.h>
72#include <net/ipv6.h> 72#include <net/ipv6.h>
73#include <net/inet_common.h> 73#include <net/inet_common.h>
74#include <net/busy_poll.h>
74 75
75#include <linux/socket.h> /* for sa_family_t */ 76#include <linux/socket.h> /* for sa_family_t */
76#include <linux/export.h> 77#include <linux/export.h>
@@ -6557,6 +6558,10 @@ static struct sk_buff *sctp_skb_recv_datagram(struct sock *sk, int flags,
6557 if (sk->sk_shutdown & RCV_SHUTDOWN) 6558 if (sk->sk_shutdown & RCV_SHUTDOWN)
6558 break; 6559 break;
6559 6560
6561 if (sk_can_busy_loop(sk) &&
6562 sk_busy_loop(sk, noblock))
6563 continue;
6564
6560 /* User doesn't want to wait. */ 6565 /* User doesn't want to wait. */
6561 error = -EAGAIN; 6566 error = -EAGAIN;
6562 if (!timeo) 6567 if (!timeo)