From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH v2] ipv4: Early TCP socket demux. Date: Wed, 20 Jun 2012 07:49:19 +0200 Message-ID: <1340171359.4604.794.camel@edumazet-glaptop> References: <20120619.163911.2094057156011157978.davem@davemloft.net> <20120619193549.13bcffa7@s6510.linuxnetplumber.net> <20120619.214657.1345825814176201681.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: shemminger@vyatta.com, netdev@vger.kernel.org To: David Miller Return-path: Received: from mail-wg0-f44.google.com ([74.125.82.44]:39269 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752359Ab2FTFt1 (ORCPT ); Wed, 20 Jun 2012 01:49:27 -0400 Received: by wgbdr13 with SMTP id dr13so7587847wgb.1 for ; Tue, 19 Jun 2012 22:49:25 -0700 (PDT) In-Reply-To: <20120619.214657.1345825814176201681.davem@davemloft.net> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, 2012-06-19 at 21:46 -0700, David Miller wrote: > From: Stephen Hemminger > Date: Tue, 19 Jun 2012 19:35:49 -0700 > > > Any benchmark numbers? > > Measuring the path from ip_rcv_finish() to where we lock the socket in > tcp_v4_rcv(), on a SPARC-T3, with a pre-warmed routing cache: > > Both sk and RT lookup: ~4200 cycles > Optimized early demux: ~2800 cycles > > These numbers can be decreased further, because since we're already > looking at the TCP header we can pre-cook the TCP control block in the > SKB and skip much of the stuff that tcp_v4_rcv() does since we've done > it already in the early demux code. > > > I think the number of ref count operations per packet is going to be > > the next line in the sand. > > There is only one, for the socket. We haven't taken a reference on the > route for years. Actually this patch makes things probably slower for : 1) routers : Each incoming tcp packet has to perform lookups (ESTABLISHED and TIMEWAIT), adding one cache miss 2) small lived tcp sessions input dst is now dirtied because of the additional dst_clone()/dst_release() 1) can be solved using a knob as suggested by Changli, possibly using a JUMP_LABEL shadowing ip_forward ?