From owner-svn-src-all@FreeBSD.ORG Sun Mar 29 08:12:56 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3510218; Sun, 29 Mar 2015 08:12:56 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AF02F72; Sun, 29 Mar 2015 08:12:56 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E0D6A1FE023; Sun, 29 Mar 2015 10:12:53 +0200 (CEST) Message-ID: <5517B433.5010508@selasky.org> Date: Sun, 29 Mar 2015 10:13:39 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Gleb Smirnoff , Fabien Thomas Subject: Re: svn commit: r280759 - head/sys/netinet References: <201503271326.t2RDQxd3056112@svn.freebsd.org> <20150328083443.GV64665@FreeBSD.org> <20150328191629.GY64665@FreeBSD.org> In-Reply-To: <20150328191629.GY64665@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org 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: Sun, 29 Mar 2015 08:12:56 -0000 On 03/28/15 20:16, Gleb Smirnoff wrote: > +uint16_t > +ip_newid(void) > +{ > + > + counter_u64_add(V_ip_id, 1); > + return (htons((*(uint64_t *)zpcpu_get(V_ip_id)) & 0xffff)); > +} Technically you would need to enter a critical section here, so that the current process doesn't get swapped to a different CPU between the counter add and the zpcpu_get. --HPS