From owner-svn-src-all@freebsd.org Wed May 18 17:32:25 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 DC96FB4184E for ; Wed, 18 May 2016 17:32:25 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (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 BADD31228 for ; Wed, 18 May 2016 17:32:25 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 5a858aa6-1d1e-11e6-896e-fd5016d7ee1b X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Wed, 18 May 2016 17:31:28 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u4IHWH3P053179; Wed, 18 May 2016 11:32:17 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1463592737.1180.294.camel@freebsd.org> Subject: Re: svn commit: r300154 - head/sys/net From: Ian Lepore To: Nathan Whitehorn , Justin Hibbits , Scott Long Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 18 May 2016 11:32:17 -0600 In-Reply-To: <759d085c-a485-c2ed-5d70-26eb4d27cdc2@freebsd.org> References: <201605181545.u4IFjCKD030751@repo.freebsd.org> <20160518105033.1eae7432@zhabar.knownspace> <759d085c-a485-c2ed-5d70-26eb4d27cdc2@freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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:32:26 -0000 On Wed, 2016-05-18 at 10:14 -0700, Nathan Whitehorn wrote: > > On 05/18/16 08:50, Justin Hibbits wrote: > > On Wed, 18 May 2016 15:45:12 +0000 (UTC) > > Scott Long wrote: > > > > > Author: scottl > > > Date: Wed May 18 15:45:12 2016 > > > New Revision: 300154 > > > URL: https://svnweb.freebsd.org/changeset/base/300154 > > > > > > Log: > > > Activate the NO_64BIT_ATOMICS code for mips and powerpc > > > > > > Modified: > > > head/sys/net/mp_ring.c > > > > > > Modified: head/sys/net/mp_ring.c > > > ================================================================= > > > ============= > > > --- 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 > > > > > > - > > > - > > > -#include > > > +#if defined(__powerpc__) || defined(__mips__) > > > +#define NO_64BIT_ATOMICS > > > +#endif > > > > > > #if defined(__i386__) > > > #define atomic_cmpset_acq_64 atomic_cmpset_64 > > > #define atomic_cmpset_rel_64 atomic_cmpset_64 > > > #endif > > > > > > +#include > > > + > > > union ring_state { > > > struct { > > > uint16_t pidx_head; > > > > > powerpc64 defines both __powerpc__ and __powerpc64__, so you're > > killing > > atomics on powerpc64 with this. > > > > - Justin > > > > Don't all of our 64-bit platforms have 64-bit atomics? So you could > just > #if defined(__LP64__) || defined(__i386__) || > defined(__whatever_the_thing_is_for_mips_n32__) > -Nathan > 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. 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.) -- Ian