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 B81CE2B83 for ; Wed, 1 Jun 2016 17:09:46 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 01 Jun 2016 08:09:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,401,1459839600"; d="scan'208";a="712287003" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by FMSMGA003.fm.intel.com with ESMTP; 01 Jun 2016 08:09:45 -0700 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.193]) by IRSMSX102.ger.corp.intel.com ([169.254.2.10]) with mapi id 14.03.0248.002; Wed, 1 Jun 2016 16:07:55 +0100 From: "Burakov, Anatoly" To: "Yigit, Ferruh" , "dev@dpdk.org" CC: Olivier Matz Thread-Topic: [PATCH] ivshmem: add all memzones of mempool to metada Thread-Index: AQHRvAgdgbD2Zio2pEe4jgddRfJmvZ/UtZ2Q Date: Wed, 1 Jun 2016 15:07:55 +0000 Message-ID: References: <1464787086-29555-1-git-send-email-ferruh.yigit@intel.com> In-Reply-To: <1464787086-29555-1-git-send-email-ferruh.yigit@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmY1YWQ1ZmQtOTFhMS00MDVmLWJmMjYtNzQ5ZGVlNTUyYzI1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IklDc2Y0XC9BVEpOQVZaWWlSUkVmTFdkek1qZEZVQkJJNFBYT1R3WEpMUGRzPSJ9 x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] ivshmem: add all memzones of mempool to metada 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: Wed, 01 Jun 2016 15:09:47 -0000 > From: Yigit, Ferruh > Sent: Wednesday, June 1, 2016 2:18 PM > To: dev@dpdk.org > Cc: Burakov, Anatoly ; Olivier Matz > ; Yigit, Ferruh > Subject: [PATCH] ivshmem: add all memzones of mempool to metada >=20 > Mempool consist of multiple memzones, at least from two of them. > ivshmem assumes mempool and elements are all in same memzone. >=20 > Updating code to add all memzones when a mempool added. >=20 > Fixes: d1d914ebbc25 ("mempool: allocate in several memory chunks by > default") >=20 > Signed-off-by: Ferruh Yigit > --- > lib/librte_ivshmem/rte_ivshmem.c | 30 ++++++++++++++++++++++-------- > 1 file changed, 22 insertions(+), 8 deletions(-) >=20 > diff --git a/lib/librte_ivshmem/rte_ivshmem.c > b/lib/librte_ivshmem/rte_ivshmem.c > index c8b332c..5c83920 100644 > --- a/lib/librte_ivshmem/rte_ivshmem.c > +++ b/lib/librte_ivshmem/rte_ivshmem.c > @@ -548,25 +548,39 @@ add_ring_to_metadata(const struct rte_ring * r, > } >=20 > static int > -add_mempool_to_metadata(const struct rte_mempool * mp, > - struct ivshmem_config * config) > +add_mempool_memzone_to_metadata(const void *addr, > + struct ivshmem_config *config) > { > - struct rte_memzone * mz; > - int ret; > + struct rte_memzone *mz; >=20 > - mz =3D get_memzone_by_addr(mp); > - ret =3D 0; > + mz =3D get_memzone_by_addr(addr); >=20 > if (!mz) { > RTE_LOG(ERR, EAL, "Cannot find memzone for > mempool!\n"); > return -1; > } >=20 > - /* mempool consists of memzone and ring */ > - ret =3D add_memzone_to_metadata(mz, config); > + return add_memzone_to_metadata(mz, config); > +} > + > +static int > +add_mempool_to_metadata(const struct rte_mempool *mp, > + struct ivshmem_config *config) > +{ > + struct rte_mempool_memhdr *memhdr; > + int ret; > + > + ret =3D add_mempool_memzone_to_metadata(mp, config); > if (ret < 0) > return -1; >=20 > + STAILQ_FOREACH(memhdr, &mp->mem_list, next) { > + ret =3D add_mempool_memzone_to_metadata(memhdr- > >addr, config); > + if (ret < 0) > + return -1; > + } > + > + /* mempool consists of memzone and ring */ > return add_ring_to_metadata(mp->ring, config); > } >=20 > -- > 2.5.5 Acked-by: Anatoly Burakov