netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] udp: Record RPS flow in socket operations
@ 2014-10-27 18:01 Tom Herbert
  2014-10-27 18:01 ` [PATCH net-next 2/2] udp: Reset flow table for flows over unconnected sockets Tom Herbert
  2014-10-27 18:50 ` [PATCH net-next 1/2] udp: Record RPS flow in socket operations Eric Dumazet
  0 siblings, 2 replies; 13+ messages in thread
From: Tom Herbert @ 2014-10-27 18:01 UTC (permalink / raw)
  To: davem, netdev

Add calls to sock_rps_record_flow for udp_sendmsg, udp_sendpage
and udp_recvmsg. This enables RFS for connected UDP sockets.

Tested:
  Ran netperf UDP_RR with 200 flows, with and without UDP RSS enabled

Before fix:
  No RSS
    Client (connected UDP)
      36.87% CPU utilization
    Server (unconnected UDP)
      33.64% CPU utilization
    256/440/687 90/95/99% latencies
    727273 tps

  UDP RSS
    Client
      79.59% CPU utilization
    Server
      78.83% CPU utilization
    116/159/226 90/95/99% latencies
    1.60974e+06 tps

After fix:
  No RSS
    Client
      44.38% CPU utilization
    Server
      50.46% CPU utilization
    192/245/343 90/95/99% latencies
    1.01413e+06

  UDP RSS
    Client
      79.98% CPU utilization
    Server
      80.35% CPU utilization
    113/158/230 90/95/99% latencies
    1.60622e+06 tps

Signed-off-by: Tom Herbert <therbert@google.com>
---
 net/ipv4/udp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index cd0db54..9a0d346 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -881,6 +881,8 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 	struct sk_buff *skb;
 	struct ip_options_data opt_copy;
 
+	sock_rps_record_flow(sk);
+
 	if (len > 0xFFFF)
 		return -EMSGSIZE;
 
@@ -1113,6 +1115,8 @@ int udp_sendpage(struct sock *sk, struct page *page, int offset,
 	struct udp_sock *up = udp_sk(sk);
 	int ret;
 
+	sock_rps_record_flow(sk);
+
 	if (flags & MSG_SENDPAGE_NOTLAST)
 		flags |= MSG_MORE;
 
@@ -1253,6 +1257,8 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 	int is_udplite = IS_UDPLITE(sk);
 	bool slow;
 
+	sock_rps_record_flow(sk);
+
 	if (flags & MSG_ERRQUEUE)
 		return ip_recv_error(sk, msg, len, addr_len);
 
-- 
2.1.0.rc2.206.gedb03e5

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-10-29  1:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-27 18:01 [PATCH net-next 1/2] udp: Record RPS flow in socket operations Tom Herbert
2014-10-27 18:01 ` [PATCH net-next 2/2] udp: Reset flow table for flows over unconnected sockets Tom Herbert
2014-10-27 18:43   ` Eric Dumazet
2014-10-27 19:36     ` Tom Herbert
2014-10-27 23:19       ` Eric Dumazet
2014-10-28  1:09         ` Tom Herbert
2014-10-28  4:51           ` David Miller
2014-10-28 15:18             ` Tom Herbert
2014-10-28 17:38               ` Eric Dumazet
2014-10-28 19:07                 ` Tom Herbert
2014-10-28 19:59                   ` Eric Dumazet
2014-10-29  1:35                 ` Tom Herbert
2014-10-27 18:50 ` [PATCH net-next 1/2] udp: Record RPS flow in socket operations Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).