From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 444EBB3BE for ; Thu, 18 Sep 2014 17:56:49 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 18 Sep 2014 08:55:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,548,1406617200"; d="scan'208";a="575159352" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by orsmga001.jf.intel.com with ESMTP; 18 Sep 2014 09:01:38 -0700 Received: from irsmsx105.ger.corp.intel.com (163.33.3.28) by IRSMSX103.ger.corp.intel.com (163.33.3.157) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 18 Sep 2014 17:01:33 +0100 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.112]) by IRSMSX105.ger.corp.intel.com ([169.254.7.158]) with mapi id 14.03.0195.001; Thu, 18 Sep 2014 17:01:32 +0100 From: "Richardson, Bruce" To: Neil Horman , Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH] ixgbe: fix compile error with gcc4.4 (used RHEL 6) Thread-Index: AQHP0y8i6ESf/18xKkWRib04BdvGMpwGqtYAgAAVSYCAABLtoIAAGSYAgAAJ/wCAAANJAIAAEwjg Date: Thu, 18 Sep 2014 16:01:32 +0000 Message-ID: <59AF69C657FD0841A61C55336867B5B0343F358D@IRSMSX103.ger.corp.intel.com> References: <1411037752-8000-1-git-send-email-bruce.richardson@intel.com> <59AF69C657FD0841A61C55336867B5B0343F3406@IRSMSX103.ger.corp.intel.com> <20140918150312.GF20389@hmsreliant.think-freely.org> <2042613.z76ONrFlF0@xps13> <20140918155044.GI20389@hmsreliant.think-freely.org> In-Reply-To: <20140918155044.GI20389@hmsreliant.think-freely.org> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] ixgbe: fix compile error with gcc4.4 (used RHEL 6) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2014 15:56:49 -0000 > -----Original Message----- > From: Neil Horman [mailto:nhorman@tuxdriver.com] > Sent: Thursday, September 18, 2014 4:51 PM > To: Thomas Monjalon > Cc: Richardson, Bruce; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] ixgbe: fix compile error with gcc4.4 (use= d RHEL > 6) >=20 > On Thu, Sep 18, 2014 at 05:38:58PM +0200, Thomas Monjalon wrote: > > Hi Neil, > > > > 2014-09-18 11:03, Neil Horman: > > > Thank you, I've reproduced the problem here, and you're right, it is = a > > > compiler bug, but I really hate the idea of just throwing braces arou= nd > > > something to shut the compiler up, especially when the compiler has s= ince > > > been fixed. Looking at it a bit more closely it seems like the the t= hing > > > to do is actually just consistently use rte_mbuf_refcnt_set, since th= ats > > > what the rte_mbuf header documentation says to do, and protects you i= f the > > > internal structure changes, as well as prevents you from having to sp= read > > > ifdef RTE_MBUF_REFCNT all over the place. > > > > > > This patch does a bit more than that too. With a little creative > > > typedef-ing we don't need the anonymous union at all, and lets us jus= t use > > > a single refcnt variable, and I think eliminate that odd refcnt_reser= ved > > > member of the union, that, as far as I can see, does nothing. > > > > > --- a/config/common_linuxapp > > > +++ b/config/common_linuxapp > > > @@ -123,7 +123,7 @@ CONFIG_RTE_LOG_HISTORY=3D256 > > > CONFIG_RTE_LIBEAL_USE_HPET=3Dn > > > CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=3Dn > > > CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=3Dn > > > -CONFIG_RTE_EAL_IGB_UIO=3Dy > > > +CONFIG_RTE_EAL_IGB_UIO=3Dn > > > CONFIG_RTE_EAL_VFIO=3Dy > > > > Hum, indeed this patch does a bit more ;) > > > Sorry, meant to clip that out, I was building without kernel headers, so = I had > to disable igb_uio and kni. I'll propose this patch properly if theres > consensus on the valid bits. > Neil If we get rid of the REFCNT compile-time option (but not the REFCNT_ATOMIC = one), then we should be able to get rid of the union, as we can do the atom= ic/non-atomic entirely inside the refcnt manipulation routines (since a reg= ular uint16_t can be typecast directly to an atomic form of the same). Once= we get rid of the union we can get rid of the extra braces that go along w= ith the union, and we can just have the static initialiser cleanly put in t= he code. Whaddaya think? /Bruce