From owner-freebsd-net@FreeBSD.ORG Tue Jul 3 20:08:33 2012 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEA80106564A; Tue, 3 Jul 2012 20:08:33 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 7995F8FC0A; Tue, 3 Jul 2012 20:08:33 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id E232273029; Tue, 3 Jul 2012 22:27:57 +0200 (CEST) Date: Tue, 3 Jul 2012 22:27:57 +0200 From: Luigi Rizzo To: "Alexander V. Chernikov" Message-ID: <20120703202757.GA90741@onelab2.iet.unipi.it> References: <4FF319A2.6070905@FreeBSD.org> <20120703165506.GA90114@onelab2.iet.unipi.it> <4FF32DE2.2010606@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FF32DE2.2010606@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: hackers@freebsd.org, performance@freebsd.org, net@freebsd.org Subject: Re: FreeBSD 10G forwarding performance @Intel X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jul 2012 20:08:33 -0000 On Tue, Jul 03, 2012 at 09:37:38PM +0400, Alexander V. Chernikov wrote: ... > Thanks, another good point. I forgot to merge this option from andre's > patch. > > Another 30-40-50kpps to win. not much gain though. What about the other IPSTAT_INC counters ? I think the IPSTAT_INC macros were introduced (by rwatson ?) following a discussion on how to make the counters per-cpu and avoid the contention on cache lines. But they are still implemented as a single instance, and neither volatile nor atomic, so it is not even clear that they can give reliable results, let alone the fact that you are likely to get some cache misses. the relevant macro is in ip_var.h. Cheers luigi > > +u_int rt_count = 1; > +SYSCTL_INT(_net, OID_AUTO, rt_count, CTLFLAG_RW, &rt_count, 1, ""); > > @@ -601,17 +625,20 @@ passout: > if (error != 0) > IPSTAT_INC(ips_odropped); > else { > - ro.ro_rt->rt_rmx.rmx_pksent++; > + if (rt_count) > + ro.ro_rt->rt_rmx.rmx_pksent++; > IPSTAT_INC(ips_forward); > IPSTAT_INC(ips_fastforward); > > > > > >cheers > >luigi > > > > > -- > WBR, Alexander > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"