From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 9D78C2C01 for ; Sat, 10 Mar 2018 16:49:52 +0100 (CET) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1-us3.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 95968600056; Sat, 10 Mar 2018 15:49:50 +0000 (UTC) Received: from [192.168.38.17] (84.52.114.114) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Sat, 10 Mar 2018 15:49:45 +0000 To: santosh , dev CC: Olivier MATZ , Jerin Jacob References: <1511539591-20966-1-git-send-email-arybchenko@solarflare.com> <1516713372-10572-1-git-send-email-arybchenko@solarflare.com> <1516713372-10572-4-git-send-email-arybchenko@solarflare.com> From: Andrew Rybchenko Message-ID: <6f42aa65-e214-0bab-6b9d-09a5c2f4f171@solarflare.com> Date: Sat, 10 Mar 2018 18:49:41 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-Originating-IP: [84.52.114.114] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-11.0.0.1191-8.100.1062-23710.002 X-TM-AS-Result: No--15.627800-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-MDID: 1520696991-fh0TqvCGqaPs Subject: Re: [dpdk-dev] [RFC v2 03/17] mempool/octeontx: add callback to calculate memory size 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: Sat, 10 Mar 2018 15:49:53 -0000 Hi Santosh, On 02/01/2018 04:40 PM, santosh wrote: > On Thursday 01 February 2018 03:31 PM, santosh wrote: >> Hi Andrew, >> >> >> On Thursday 01 February 2018 11:48 AM, Jacob, Jerin wrote: >>> The driver requires one and only one physically contiguous >>> memory chunk for all objects. >>> >>> Signed-off-by: Andrew Rybchenko >>> --- >>> drivers/mempool/octeontx/rte_mempool_octeontx.c | 25 +++++++++++++++++++++++++ >>> 1 file changed, 25 insertions(+) >>> >>> diff --git a/drivers/mempool/octeontx/rte_mempool_octeontx.c >>> b/drivers/mempool/octeontx/rte_mempool_octeontx.c >>> index d143d05..4ec5efe 100644 >>> --- a/drivers/mempool/octeontx/rte_mempool_octeontx.c >>> +++ b/drivers/mempool/octeontx/rte_mempool_octeontx.c >>> @@ -136,6 +136,30 @@ octeontx_fpavf_get_capabilities(const struct rte_mempool *mp, >>> return 0; >>> } >>> >>> +static ssize_t >>> +octeontx_fpavf_calc_mem_size(const struct rte_mempool *mp, >>> + uint32_t obj_num, uint32_t pg_shift, >>> + size_t *min_chunk_size, size_t *align) >>> +{ >>> + ssize_t mem_size; >>> + >>> + /* >>> + * Simply need space for one more object to be able to >>> + * fullfil alignment requirements. >>> + */ >>> + mem_size = rte_mempool_calc_mem_size_def(mp, obj_num + 1, pg_shift, >>> + >> I think, you don't need that (obj_num + 1) as because >> rte_xmem_calc_int() will be checking flags for >> _ALIGNED + _CAPA_PHYS_CONFIG i.e.. >> >> mask = MEMPOOL_F_CAPA_BLK_ALIGNED_OBJECTS | MEMPOOL_F_CAPA_PHYS_CONTIG; >> if ((flags & mask) == mask) >> /* alignment need one additional object */ >> elt_num += 1; > ok, You are removing above check in v2- 06/17, so ignore above comment. > I suggest to move this patch and keep it after 06/17. Or perhaps keep > common mempool changes first then followed by driver specifics changes in your > v3 series. Finally I've decided to include these changes into the patch which removes get_capabilities [1]. Please, take a look at suggested version. I think it is the most transparent solution. Otherwise it is hard to avoid the issue found by you above. I'm sorry, I've forgot to include you in CC. [1] https://dpdk.org/dev/patchwork/patch/35934/ Thanks, Andrew.