From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0060.outbound.protection.outlook.com [104.47.34.60]) by dpdk.org (Postfix) with ESMTP id ED6C0160 for ; Tue, 19 Dec 2017 11:46:39 +0100 (CET) Received: from BN3PR03CA0066.namprd03.prod.outlook.com (10.167.1.154) by DM5PR03MB2698.namprd03.prod.outlook.com (10.168.197.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Tue, 19 Dec 2017 10:46:38 +0000 Received: from BY2FFO11OLC013.protection.gbl (2a01:111:f400:7c0c::190) by BN3PR03CA0066.outlook.office365.com (2a01:111:e400:7a4d::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.323.15 via Frontend Transport; Tue, 19 Dec 2017 10:46:38 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11OLC013.mail.protection.outlook.com (10.1.15.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.302.6 via Frontend Transport; Tue, 19 Dec 2017 10:46:25 +0000 Received: from [10.232.133.65] ([10.232.133.65]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBJAkXso004490; Tue, 19 Dec 2017 03:46:34 -0700 To: Olivier MATZ References: <1512563473-19969-1-git-send-email-hemant.agrawal@nxp.com> <20171219102456.ghipiyb2ig43d4nk@glumotte.dev.6wind.com> CC: From: Hemant Agrawal Message-ID: <830d3e36-921b-ef7a-51a4-6d135b15e973@nxp.com> Date: Tue, 19 Dec 2017 16:16:33 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20171219102456.ghipiyb2ig43d4nk@glumotte.dev.6wind.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131581539856900001; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(7966004)(336005)(376002)(346002)(39380400002)(396003)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(76104003)(24454002)(67846002)(498600001)(83506002)(6306002)(77096006)(23746002)(8676002)(53546011)(76176011)(305945005)(85426001)(81156014)(356003)(50466002)(59450400001)(58126008)(316002)(8936002)(6246003)(47776003)(65956001)(53376002)(31686004)(105606002)(106466001)(53936002)(966005)(81166006)(97736004)(4326008)(65806001)(230700001)(86362001)(36756003)(68736007)(104016004)(229853002)(31696002)(2906002)(64126003)(2950100002)(65826007)(5660300001)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2698; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC013; 1:s2yo0s5OaitMdejvPtIgqY0qDMbuYWdZyVIvzTNVdtjc56gnwRSlQyw96JlpgVrtGRY8v7OSbOjTpoFOriyCNgVijUIotKiQA5xyk7wqlVw3o/kH4oBiz25QIRQSPCUD X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 31817001-2e85-4da6-5fa1-08d546cdc0a2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:DM5PR03MB2698; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2698; 3:NUByyV5ff6R0qZ+VdWJUkOMW4Pqrca288uOuyA9MLFMGwb3AzN7B/aoWOqnuszaVNKJ2enYamn/FG+Ne1cBz61J6iUbYotiVBrCc3fUcdmdkvaA/C/3n/Pic+Y9NDCy7NgASlHFwpe1PKeHHpxl9/M03OW4cnrgCGWzcpAJCiuyJdaBzncbv95+jMuCDfNUVcuiEc8d5rLEyFA0LTIgztTS5ijDkWYSnmiUaFPBLSj5CB2Vb1uCSFBzx2WPhzz/fs5vtUcyI+y6p8SvhUsN7sp/MikTNV5UJlrtjixFpuxGHOgyYmktNBHxbLC7oXZgQSoJclSUw47wPf+6mJBJHF2G2EIZ4FT+/wws0nUZxhIo=; 25:hphQdkJ8W57sZDR+1wh5ULZSVYyw12H0rdtV7AX2XM5XRaNVU4bpzICgLG5+xpeguShqxuCYaYZZc84c56rvo497i5QkdaLTjBgH9361cKPycJHffqtOI0HIz5iz2VyRExfcDCUeGd03ciPXeuqWnx05lL3lEn2TIjEM9edODs8lH6FO9eiIPYCTR+SvYoVwS4O9BaEo4wTUaMvCTdPvy/VSa0V6LvVY0BqvQprJ9j5/InR6FJ9PU5e0AcrW33/0ATZ5Z51g59qnpkmz2vzhNWFqdYS6BahDCAZUzHyAtzoUCv+cngC4f1QXD5In15u2IO3blUue0LVI9mAcIXNC9PYC7bjr8iAjOpiRLfED+Ec= X-MS-TrafficTypeDiagnostic: DM5PR03MB2698: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2698; 31:6505ll+0owqmTiEdor1hFpFB7biiTRcW/S/oChhXMOvnn0IeMMcmnJ6i+FDSqjLf3ReSg8q+GHiS2YaAJEuvNDHSomA2AYCC/Akh1O61s3x6TQbVHJgd+QUVkkx6X/WCuoDO0ebPlltAVlLkGbNrSzk7RsolQ0B7Whb1hi0wRBWKvGxAnPZTxQC3Rt26LL0ipKjsK8JyNn2NXmgnJzFHMXYsJChIuktFB2Lb7t6iYAI=; 4:G5K+jTKPXFJA1gY0vY4Mx6fCfJqrHCIDFHJL5Sg4r9psZQYd2dDWsk1mqOkrJf0uIfJBJoxQ8izkVCIW/PcTetJPvdni2MINrA5lJm/ZnABgx6aJCNN0K9d7OyMTupY4PkkmAADm9av/Ja2fn/IAGFuaneGm9VaM2WCgGRLGnJZFVba2Tar0L+RAm93vo/w2hPZFoDdoJmTxoO+KbKs3KvujRp0DvlxWRNYuXburdVjh0WfHNibqjsKdk87hMw0ynaVAg+ydPy24epF3gth3M3Nz+CQQB6ZZV7MCig48bilikjykK03hXI4AaeALq5G7g/A+Lf7C7fQxE2tF567xm60B5hGeL+jUw4nZYGmUS2I= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(131327999870524)(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(6055026)(6096035)(20161123556025)(20161123565025)(20161123559100)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123563025)(20161123561025)(201708071742011); SRVR:DM5PR03MB2698; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:DM5PR03MB2698; X-Forefront-PRVS: 052670E5A4 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; DM5PR03MB2698; 23:djCMoULFJpkn9My4guVsYm4YSvb/Mflh/CnoO?= =?Windows-1252?Q?rLUFgeMzRWxo20DqtTgZ/s3BJXak15IgpshFzJ5A1GlLHe5s9ACc9FnF?= =?Windows-1252?Q?6bIZeBHpWnUOn2YSyT/plYTOrJv04yaic7zOu/m5cqwcFQQOoSe2fT29?= =?Windows-1252?Q?gFxaevlYBlBpTARyzLrAFYFP6NaHf84ct+qazZKpFiccPUdMPIQd7ylJ?= =?Windows-1252?Q?pyelL2FyAKdGItGC10uj+xxRjHIPGtmcoO9qrVCajh1VL7t1Y9Dl1aqs?= =?Windows-1252?Q?4BzNqwoAaMfgUTI3JNu91h99Ervr56U7PloKtxRiWKdZLJpvDMMyyIXb?= =?Windows-1252?Q?4y9/MaxsBtbVopEsYvvrmBOta1DRfza4JnXZ9V8qON4ElolsPz36PhDo?= =?Windows-1252?Q?aB80hoYNo5SPJOlMFiq5D+/1vObjv+bEfuIFIeCKP6ns92doMJr3JbaY?= =?Windows-1252?Q?8UQQd96R3VnT1v24lyP1VbXuyIkgLCvgG+NkpSzct5yoLinYe9bZvCVV?= =?Windows-1252?Q?5msF7/u+9Dtb+CSBzSZ1EsK9+aPyOvb9VY0CXnKSOCIzGcuadTQMm6iF?= =?Windows-1252?Q?yG+tg2XeZfJGynmbC8fQMsRDFjCe1ywBCTfYzXrgW45Au0i/R65lkOLU?= =?Windows-1252?Q?yYBWjVPk+/Wp36Gyjql6wYmf8wInye8LaK9g+3uGuj/CuhNFyxu0CN9p?= =?Windows-1252?Q?Iy4I9+/6iJ9D/MPPDZL/Vsyjwc00ufB+sXCj0cqy8YNcAf75HPkDLk20?= =?Windows-1252?Q?CgCjJ2h8FleEcMiXvkd8lTFFp06gJEgawP8R11g6XsWe7OLwhjqFfW2F?= =?Windows-1252?Q?KBr5bZvKqIZu5x1rWJfFl5gANEiIyaKHHvPr0pmLBQDjaj9UK8H4+A5p?= =?Windows-1252?Q?mQzxLS70RnyCJBNfD/ixPCZO/hj+gsVOyjzGxJ6ibF1UdrOtIce8NPt3?= =?Windows-1252?Q?jPzhyXGQ2q8/NvX2gh89G2JakfKAjMN4dnu3JvMZD5+TG3X/JEH5nWmD?= =?Windows-1252?Q?a7aO7yQFZFmj+HiMgq/wcrRVgEQJrSJl+1ikz5nQfRe6C4B6MdN2dVQw?= =?Windows-1252?Q?98c7lK3jC5KwRqipnCgnXfJSAmawBKvHlFGoWKN0kOSfaW0rZkqUfd8+?= =?Windows-1252?Q?H1eDQsxs5lS9rCMWC1CP4YMt5vUMlZhnCCQvMLzhiupj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Mbh8=; 7:a4RcSFsJaHa58QUzBHNJY5fswCBSfy7wuTc2ODwoyXGkqP1sYEysPRYFIz2tyXprj8f6oaqQcr5f4z5Lk1uztHC3KoysDheVtwYZSG1TNFYewYO9Z70rrc25lRdVbswXDZEbXa0aB+CyKRxKwkLLaoa3K+8l+uNy7Eok6VTuTYcNUG97rV3uw8YAfrem8PxpDK8MZsmqOUl4vby8sJ7cgSXg0cYW8OBXt2ez3nrvuUGTccEbHjH6R77z3FbnBsRi SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 10:46:25.5028 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 31817001-2e85-4da6-5fa1-08d546cdc0a2 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2698 Subject: Re: [dpdk-dev] [PATCH 1/2] mempool: indicate the usages of multi memzones 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: Tue, 19 Dec 2017 10:46:40 -0000 Hi Olivier, On 12/19/2017 3:54 PM, Olivier MATZ wrote: > Hi Hemant, > > On Wed, Dec 06, 2017 at 06:01:12PM +0530, Hemant Agrawal wrote: >> This is required for the optimizations w.r.t hw mempools. >> They will use different kind of optimizations if the buffers >> are from single contiguous memzone. >> >> Signed-off-by: Hemant Agrawal >> --- >> lib/librte_mempool/rte_mempool.c | 7 +++++-- >> lib/librte_mempool/rte_mempool.h | 5 +++++ >> 2 files changed, 10 insertions(+), 2 deletions(-) >> >> diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c >> index d50dba4..9d3737c 100644 >> --- a/lib/librte_mempool/rte_mempool.c >> +++ b/lib/librte_mempool/rte_mempool.c >> @@ -387,13 +387,16 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr, >> total_elt_sz = mp->header_size + mp->elt_size + mp->trailer_size; >> >> /* Detect pool area has sufficient space for elements */ >> - if (mp->flags & MEMPOOL_F_CAPA_PHYS_CONTIG) { >> - if (len < total_elt_sz * mp->size) { >> + if (len < total_elt_sz * mp->size) { >> + if (mp->flags & MEMPOOL_F_CAPA_PHYS_CONTIG) { >> RTE_LOG(ERR, MEMPOOL, >> "pool area %" PRIx64 " not enough\n", >> (uint64_t)len); >> return -ENOSPC; >> } >> + } else { >> + /* Memory will be allocated from multiple memzones */ >> + mp->flags |= MEMPOOL_F_MULTI_MEMZONE; >> } >> >> memhdr = rte_zmalloc("MEMPOOL_MEMHDR", sizeof(*memhdr), 0); >> diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h >> index 721227f..394a4fe 100644 >> --- a/lib/librte_mempool/rte_mempool.h >> +++ b/lib/librte_mempool/rte_mempool.h >> @@ -292,6 +292,11 @@ struct rte_mempool { >> */ >> #define MEMPOOL_F_CAPA_BLK_ALIGNED_OBJECTS 0x0080 >> >> +/* Indicates that the mempool buffers are allocated from multiple memzones >> + * the buffer may or may not be physically contiguous. >> + */ >> +#define MEMPOOL_F_MULTI_MEMZONE 0x0100 >> + >> /** >> * @internal When debug is enabled, store some statistics. >> * >> -- >> 2.7.4 >> > > I'm not confortable with adding more and more flags, as I explained > here: http://dpdk.org/ml/archives/dev/2017-December/083909.html This particular flag is not about how to populate mempool. This is just indicating how the mempool was populated - a status flag. This information is just helpful for the PMDs. At least I am not able to see that this particular flag is being very driver specific. > > It makes the generic code very complex, and probably buggy (many > flags are incompatible with other flags). > > I'm thinking about moving the populate_* functions in the drivers > (this is described a bit more in the link above). What do you think > about this approach? > The idea is good and it will give fine control to the individual mempools to populate the memory the way they want. However, on the downside, it will also lead to lot of duplicate code or similar code. It may also lead to a maintenance issue for the mempool PMD owner. > Thanks, > Olivier >