From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Herbert Subject: Re: [PATCH net-next v2] net: Add sysctl to toggle early demux for tcp and udp Date: Tue, 21 Mar 2017 15:49:16 -0700 Message-ID: References: <1489116660-4244-1-git-send-email-subashab@codeaurora.org> <674d67f5d76f761f3e872dff274a8bda@codeaurora.org> <1489191742.28631.35.camel@edumazet-glaptop3.roam.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Eric Dumazet , Linux Kernel Network Developers , Stephen Hemminger , netdev-owner@vger.kernel.org To: Subash Abhinov Kasiviswanathan Return-path: Received: from mail-qt0-f196.google.com ([209.85.216.196]:35890 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933007AbdCUWtX (ORCPT ); Tue, 21 Mar 2017 18:49:23 -0400 Received: by mail-qt0-f196.google.com with SMTP id n37so23331825qtb.3 for ; Tue, 21 Mar 2017 15:49:22 -0700 (PDT) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Sat, Mar 18, 2017 at 7:07 PM, Subash Abhinov Kasiviswanathan wrote: >> Less than 1% performance improvement in a benchmark doesn't justify >> the complexity of the patch. Eric's hypothesis was that an unconnected >> UDP socket may show issues because of cache misses in look-ups due to >> so many different sources. This should be fairly easy to benchmark by >> randomly setting source address in your test (IP any and routing my >> need to be set appropriately). >> > > With different source addresses, a larger increase is seen here > (633->654Mbps). > Thanks for running the tests. It's obviously not a huge win at least relative to performance improvement we got from early demux, but I suppose with very specific and engineered loads this might have value. Please include this is next patch sets. Generally, I think a good goal moving forward would be a to apply the 0 or 1 times rule for connection lookup. That is for any transport tuple in a receive packet we want to do at most one connection lookup. So early demux would need to apply to unconnected sockets and then we wouldn't have to do the second lookup in UDP (or TCP for a SYN) receive (note we also do an extra lookup for GRO with UDP encapsulation). A reason we haven't this before might be that the lookup may actually find the wrong socket (for example we go into a different network namespace). Maybe the stack should consider any lookup result outside of the protocol stack to be provisional (and it would be super nice if we could somehow cache a dst with an unconnected socket also ;-) ) Tom > > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project