From owner-svn-src-all@freebsd.org Wed May 18 17:35:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00061B41906; Wed, 18 May 2016 17:35:47 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8377D1471; Wed, 18 May 2016 17:35:46 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id C955425D388E; Wed, 18 May 2016 17:35:43 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id EA8CED1F8BA; Wed, 18 May 2016 17:35:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id AGoFHXD2uH12; Wed, 18 May 2016 17:35:41 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:10a6:9e53:5e9c:c191] (unknown [IPv6:fde9:577b:c1a9:4410:10a6:9e53:5e9c:c191]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id B29E4D1F8A6; Wed, 18 May 2016 17:35:39 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r300154 - head/sys/net From: "Bjoern A. Zeeb" In-Reply-To: <1463592737.1180.294.camel@freebsd.org> Date: Wed, 18 May 2016 17:35:06 +0000 Cc: Nathan Whitehorn , Justin Hibbits , Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1EED3540-DCCF-40D2-91BA-CE0AA54C5D08@lists.zabbadoz.net> References: <201605181545.u4IFjCKD030751@repo.freebsd.org> <20160518105033.1eae7432@zhabar.knownspace> <759d085c-a485-c2ed-5d70-26eb4d27cdc2@freebsd.org> <1463592737.1180.294.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 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: Wed, 18 May 2016 17:35:48 -0000 > On 18 May 2016, at 17:32 , Ian Lepore wrote: >=20 > On Wed, 2016-05-18 at 10:14 -0700, Nathan Whitehorn wrote: >>=20 >> On 05/18/16 08:50, Justin Hibbits wrote: >>> On Wed, 18 May 2016 15:45:12 +0000 (UTC) >>> Scott Long wrote: >>>=20 >>>> Author: scottl >>>> Date: Wed May 18 15:45:12 2016 >>>> New Revision: 300154 >>>> URL: https://svnweb.freebsd.org/changeset/base/300154 >>>>=20 >>>> Log: >>>> Activate the NO_64BIT_ATOMICS code for mips and powerpc >>>>=20 >>>> Modified: >>>> head/sys/net/mp_ring.c >>>>=20 >>>> Modified: head/sys/net/mp_ring.c >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>> --- head/sys/net/mp_ring.c Wed May 18 15:44:45 2016 >>>> (r300153) +++ head/sys/net/mp_ring.c Wed May 18 15:45:12 >>>> 2016 (r300154) @@ -37,15 +37,17 @@ __FBSDID("$FreeBSD$"); >>>> #include >>>> #include >>>>=20 >>>> - >>>> - >>>> -#include >>>> +#if defined(__powerpc__) || defined(__mips__) >>>> +#define NO_64BIT_ATOMICS >>>> +#endif >>>>=20 >>>> #if defined(__i386__) >>>> #define atomic_cmpset_acq_64 atomic_cmpset_64 >>>> #define atomic_cmpset_rel_64 atomic_cmpset_64 >>>> #endif >>>>=20 >>>> +#include >>>> + >>>> union ring_state { >>>> struct { >>>> uint16_t pidx_head; >>>>=20 >>> powerpc64 defines both __powerpc__ and __powerpc64__, so you're >>> killing >>> atomics on powerpc64 with this. >>>=20 >>> - Justin >>>=20 >>=20 >> Don't all of our 64-bit platforms have 64-bit atomics? So you could >> just=20 >> #if defined(__LP64__) || defined(__i386__) ||=20 >> defined(__whatever_the_thing_is_for_mips_n32__) >> -Nathan >>=20 >=20 > It may be more complicated than that, though. armv6 can do 64-bit > atomics even tho it's 32-bit. armv4, also 32-bit, can do 64-bit > atomics in the kernel but not in userland. >=20 > Maybe machine/atomic.h needs a #define that says whether 64-bit ops = are > available in the current compilation unit. (And likewise for other = bit > sizes if we have arches that have other limitations.) Question because I didn=E2=80=99t follow the details, but how was this = solved for the COUNTERS framework? /bz=