[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1414432875-23795-2-git-send-email-therbert@google.com>
Date: Mon, 27 Oct 2014 11:01:15 -0700
From: Tom Herbert <therbert@...gle.com>
To: davem@...emloft.net, netdev@...r.kernel.org
Subject: [PATCH net-next 2/2] udp: Reset flow table for flows over unconnected sockets
When receiving a packet on an unconnected UDP socket clear the
flow table for the corresponding hash. This is needed so flows over
unconnected UDP sockets will use RPS instead of using what is
present in the flow table. In particular, this avoids having flows
over unconnected sockets be perpetually steered by unrelated
entries in the flow table (idle TCP connections for instance).
Tested:
First filled up the RPS flow tables by creating a bunch of TCP
connections and letting them turn idle. Next, run netperf UDP_RR
with 200 flows.
Before fix:
Client (connected UDP)
81.15% CPU uilization
Server (unneconnedted UDP)
83.63% CPU uilization
118/167/249 90/95/99% latencies
1.59215e+06 tps
After fix:
Client (connected UDP)
81.13% CPU uilization
Server (unneconnedted UDP)
80.68% CPU uilization
116/167/248 90/95/99% latencies
1.61048e+06 tps
Signed-off-by: Tom Herbert <therbert@...gle.com>
---
net/ipv4/udp.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 9a0d346..e58d841 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1451,6 +1451,11 @@ static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
if (inet_sk(sk)->inet_daddr) {
sock_rps_save_rxhash(sk, skb);
sk_mark_napi_id(sk, skb);
+ } else {
+ /* For an unconnected socket reset flow hash so that related
+ * flow will use RPS.
+ */
+ sock_rps_reset_flow_hash(skb->hash);
}
rc = sock_queue_rcv_skb(sk, skb);
--
2.1.0.rc2.206.gedb03e5
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists