From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id DED247D26 for ; Fri, 2 Jun 2017 22:52:01 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jun 2017 13:52:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,286,1493708400"; d="scan'208";a="269577010" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by fmsmga004.fm.intel.com with ESMTP; 02 Jun 2017 13:52:00 -0700 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.250]) by IRSMSX107.ger.corp.intel.com ([169.254.10.129]) with mapi id 14.03.0319.002; Fri, 2 Jun 2017 21:51:59 +0100 From: "Ananyev, Konstantin" To: "Verkamp, Daniel" , "dev@dpdk.org" CC: "Verkamp, Daniel" Thread-Topic: [dpdk-dev] [PATCH v2] ring: use aligned memzone allocation Thread-Index: AQHS29yUGhSpppN6a069aA11FRzec6ISDAhw Date: Fri, 2 Jun 2017 20:51:59 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772583FB05190@IRSMSX109.ger.corp.intel.com> References: <20170602200337.50743-1-daniel.verkamp@intel.com> <20170602201213.51143-1-daniel.verkamp@intel.com> In-Reply-To: <20170602201213.51143-1-daniel.verkamp@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] ring: use aligned memzone allocation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 20:52:02 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Daniel Verkamp > Sent: Friday, June 2, 2017 9:12 PM > To: dev@dpdk.org > Cc: Verkamp, Daniel > Subject: [dpdk-dev] [PATCH v2] ring: use aligned memzone allocation >=20 > rte_memzone_reserve() provides cache line alignment, but > struct rte_ring may require more than cache line alignment: on x86-64, > it needs 128-byte alignment due to PROD_ALIGN and CONS_ALIGN, which are > 128 bytes, but cache line size is 64 bytes. Hmm but what for? I understand we need our rte_ring cche-line aligned, but why do you want it 2 cache-line aligned? Konstantin=20 >=20 > Fixes runtime warnings with UBSan enabled. >=20 > Fixes: d9f0d3a1ffd4 ("ring: remove split cacheline build setting") >=20 > Signed-off-by: Daniel Verkamp > --- >=20 > v2: fixed checkpatch warnings >=20 > lib/librte_ring/rte_ring.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/librte_ring/rte_ring.c b/lib/librte_ring/rte_ring.c > index 5f98c33..6f58faf 100644 > --- a/lib/librte_ring/rte_ring.c > +++ b/lib/librte_ring/rte_ring.c > @@ -189,7 +189,8 @@ rte_ring_create(const char *name, unsigned count, int= socket_id, > /* reserve a memory zone for this ring. If we can't get rte_config or > * we are secondary process, the memzone_reserve function will set > * rte_errno for us appropriately - hence no check in this this functio= n */ > - mz =3D rte_memzone_reserve(mz_name, ring_size, socket_id, mz_flags); > + mz =3D rte_memzone_reserve_aligned(mz_name, ring_size, socket_id, > + mz_flags, __alignof__(*r)); > if (mz !=3D NULL) { > r =3D mz->addr; > /* no need to check return value here, we already checked the > -- > 2.9.4