From owner-svn-src-all@freebsd.org Wed May 18 19:36:38 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 25E20B41516; Wed, 18 May 2016 19:36:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x241.google.com (mail-ig0-x241.google.com [IPv6:2607:f8b0:4001:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E427E1E0C; Wed, 18 May 2016 19:36:37 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x241.google.com with SMTP id rc4so5573070igc.0; Wed, 18 May 2016 12:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=VVNsqXooECiQw8HEt/xQ2fBJYWx2wp4eZIKEdUBZtts=; b=ZSyBjPhFOuEnFjutBitHRBzZgfF+V+Z7A7scCyAnW7Q64T5MMksheRDm2zcclo5ySq QV3SWE+NH/9eRXAKVQYs6+2k+PStLn7yxG33QykZXNYeRoHHvCncnKSPF3WL5FQGoEfN 7vAtmmJjvm8Ii6CaHelqvtgZbPyfXfSzY/RKdJDiDsf7UB5avmnTBw6c3/pvTRzok9ET 4PDMNNic3D3dbsO7XTa8H2jP8OsxYl98POCQDnm1DgSY4HngzHNPdwYRfhVOsh6D+Vfp aNdiJ47VbNjeLEz3Q0vMX+OFQuTVtBza+UV+Y9dIiPhl5zOSs/dlIvuJBdiPjzcuLEpX EoWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=VVNsqXooECiQw8HEt/xQ2fBJYWx2wp4eZIKEdUBZtts=; b=O/zZMVOigrl++3U67IT4AU5bTIDg/6XjNKzhhc4yJ1FMVYrsBYpsArdqTyy9dkRnf0 rFC78SoxPdfDHvBFwmJuosAb9pMHjCg/DKffmIdw8EKWIlsNTK4M1ik2LEXR/b9hUhJo UFE6WTOk9N4VWBMXrzEPxVLkbe5O1GvLWn2jhB8o66ohfQSyaEmSCnnz4le0aSru73Hg NlyB7IaYp51+5U2QDaV7Vc+0dmYcp36zlBiBNWkHKHO4isggQDQHUr9JYKC/0iNsPPWV T1wmGEqG/Ds48kZ0ASD0BMGtCxpFKj5G8HaGdqKxFI9ZIBaII+XVNrgt3rtK42grB9nM dkLw== X-Gm-Message-State: AOPr4FXQNjbSwIlGDr1nMO1PgZmZSKapTTZ7uo8wY1y1E6ZnbQ46qYXqQ/k1POUshmmgbuWINfnAxZcZyzMg2Q== MIME-Version: 1.0 X-Received: by 10.50.40.234 with SMTP id a10mr19755468igl.37.1463600197226; Wed, 18 May 2016 12:36:37 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Wed, 18 May 2016 12:36:37 -0700 (PDT) In-Reply-To: <1463592737.1180.294.camel@freebsd.org> References: <201605181545.u4IFjCKD030751@repo.freebsd.org> <20160518105033.1eae7432@zhabar.knownspace> <759d085c-a485-c2ed-5d70-26eb4d27cdc2@freebsd.org> <1463592737.1180.294.camel@freebsd.org> Date: Wed, 18 May 2016 12:36:37 -0700 Message-ID: Subject: Re: svn commit: r300154 - head/sys/net From: Adrian Chadd To: Ian Lepore Cc: Nathan Whitehorn , Justin Hibbits , Scott Long , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 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 19:36:38 -0000 On 18 May 2016 at 10:32, Ian Lepore wrote: > 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.) Please, please do this. Don't do a list of platforms, do a list of features. Pretty please. -adrian