svn commit: r280759 - head/sys/netinet
Gleb Smirnoff
glebius at FreeBSD.org
Sat Mar 28 19:16:32 UTC 2015
On Sat, Mar 28, 2015 at 11:34:43AM +0300, Gleb Smirnoff wrote:
T> On Fri, Mar 27, 2015 at 01:26:59PM +0000, Fabien Thomas wrote:
T> F> Author: fabient
T> F> Date: Fri Mar 27 13:26:59 2015
T> F> New Revision: 280759
T> F> URL: https://svnweb.freebsd.org/changeset/base/280759
T> F>
T> F> Log:
T> F> On multi CPU systems, we may emit successive packets with the same id.
T> F> Fix the race by using an atomic operation.
T> F>
T> F> Differential Revision: https://reviews.freebsd.org/D2141
T> F> Obtained from: emeric.poupon at stormshield.eu
T> F> MFC after: 1 week
T> F> Sponsored by: Stormshield
T>
T> The D2141 says that benchmarking were done in presence of IPSEC, which
T> of course is the bottleneck and performance of this instruction can't
T> be benchmarked in its presence. Anyway, I believe that results of
T> right benchmark would still show little difference between atomic and
T> non-atomic increment of a shared value.
T>
T> I think we can use per-cpu ID counters, each CPU incrementing its
T> own. If we start with random values, then probability of two packets with
T> the same ID emitting at the allowed timeframe will be acceptably small.
Here I've made a patch.
It will apply only to fresh head, though. To apply it to stable/10 you
probably need to replay these two commits before: r280787, r280788.
I'd appreciate if you test it in your environments, where you observed
IP id collisions.
--
Totus tuus, Glebius.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ip_newid-pcpu.diff
Type: text/x-diff
Size: 3735 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20150328/c03e3407/attachment.diff>
More information about the svn-src-all
mailing list