From owner-svn-src-all@FreeBSD.ORG Sat Mar 28 17:23:21 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF5B08F8; Sat, 28 Mar 2015 17:23:20 +0000 (UTC) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "gold.funkthat.com", Issuer "gold.funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AEAF1D40; Sat, 28 Mar 2015 17:23:20 +0000 (UTC) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.14.5/8.14.5) with ESMTP id t2SHNDux038563 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 28 Mar 2015 10:23:13 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.14.5/8.14.5/Submit) id t2SHNDRw038562; Sat, 28 Mar 2015 10:23:13 -0700 (PDT) (envelope-from jmg) Date: Sat, 28 Mar 2015 10:23:13 -0700 From: John-Mark Gurney To: Gleb Smirnoff Subject: Re: svn commit: r280759 - head/sys/netinet Message-ID: <20150328172313.GC51048@funkthat.com> References: <201503271326.t2RDQxd3056112@svn.freebsd.org> <20150328083443.GV64665@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150328083443.GV64665@FreeBSD.org> X-Operating-System: FreeBSD 9.1-PRERELEASE amd64 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (gold.funkthat.com [127.0.0.1]); Sat, 28 Mar 2015 10:23:13 -0700 (PDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Fabien Thomas X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Mar 2015 17:23:21 -0000 Gleb Smirnoff wrote this message on Sat, Mar 28, 2015 at 11:34 +0300: > On Fri, Mar 27, 2015 at 01:26:59PM +0000, Fabien Thomas wrote: > F> Author: fabient > F> Date: Fri Mar 27 13:26:59 2015 > F> New Revision: 280759 > F> URL: https://svnweb.freebsd.org/changeset/base/280759 > F> > F> Log: > F> On multi CPU systems, we may emit successive packets with the same id. > F> Fix the race by using an atomic operation. > F> > F> Differential Revision: https://reviews.freebsd.org/D2141 > F> Obtained from: emeric.poupon@stormshield.eu > F> MFC after: 1 week > F> Sponsored by: Stormshield > > The D2141 says that benchmarking were done in presence of IPSEC, which > of course is the bottleneck and performance of this instruction can't > be benchmarked in its presence. Anyway, I believe that results of > right benchmark would still show little difference between atomic and > non-atomic increment of a shared value. > > I think we can use per-cpu ID counters, each CPU incrementing its > own. If we start with random values, then probability of two packets with > the same ID emitting at the allowed timeframe will be acceptably small. Please do not use per-cpu id counters.. That will just push the duplicate ids to being more rare, but just as much of a problem... Please read: https://tools.ietf.org/html/rfc6864 And then implement one hased upon source/dest/protocol... Thanks. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."