From patchwork Wed Dec 6 12:31:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 120820 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp6995271qgn; Wed, 6 Dec 2017 04:32:16 -0800 (PST) X-Google-Smtp-Source: AGs4zMYRqkX4SmzJe09GdctIY5ywB1fu1avvSbr2tFeZV+PujTZlzyHybRgbb3VYubulLiXeehZA X-Received: by 10.223.188.81 with SMTP id a17mr20818894wrh.146.1512563536888; Wed, 06 Dec 2017 04:32:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512563536; cv=none; d=google.com; s=arc-20160816; b=adoe1NQ2RDb4cHu76Lk++i88CMkMCLEL7UIbU3xPHshxU6S7xy6gsZRdNwKvhwP7b7 ntBX7fyOFe/tQOLn1I2ByUIrrNDy9ADzupGrTMYyxGlF7WslIm/ZhYgbiSlmcg4yH2nw KEwHqQs7nqJy9WW2srfVG3ATOn0iIFd3JuJ29PPUUK1QbBE1dLOqGbadMGyPmM48aKCr 0BKBqvA94aA0rjGPM2KZPDclkYk7d4+nF5zaq+VUkgnm4/3IAR+yaJto5DO+e6pfRlUa 98HzZaixQcVCHw6EYHH5rnmyqAz6KSXYRW1hfNszmvjNXXZEUp/+ooqSSHj9QjMLIxXl o0hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:cc:to:from :arc-authentication-results; bh=Q7PtlOgOLp/KN4S13j62FmZQVNxTQFMJXaP5n15WfUg=; b=XFgT87RQV9HC/Gg3x+8WpN4wLru4/nRRd+8QseIlr0xiE/9SqA/jAEC+mdJr4N0Hoo yCB0i4YREtFFbvsEI8FSXsX7ldWQxs2NxZzO+0Z/NwtC7stTEpXuaeNhtCjs3g/yDKhz 4e9mr3rfDBGnET1yze8efD9wPnPGWsMrBH1LGK7m58Xu6nHBIMBVW2cnltsG4a6oPxDg jon5jKMG30JCu7HglKbCnSkH0e7judYiq63GWUyrjxQW3ATOCFmwI6Ll9lKZUDMaFz43 AfOLvmJ09r0PAj7mHuuWJ7AX2rBHleNm21XX8CzamtcynfMOzUpiqi48jagvmmwYvyqZ VUlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id s1si2029254wra.57.2017.12.06.04.32.16; Wed, 06 Dec 2017 04:32:16 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 93A4A1C00; Wed, 6 Dec 2017 13:32:15 +0100 (CET) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0085.outbound.protection.outlook.com [104.47.42.85]) by dpdk.org (Postfix) with ESMTP id 3A47DE5D for ; Wed, 6 Dec 2017 13:32:13 +0100 (CET) Received: from MWHPR03CA0050.namprd03.prod.outlook.com (2603:10b6:301:3b::39) by SN2PR03MB2366.namprd03.prod.outlook.com (2603:10b6:804:e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 6 Dec 2017 12:32:11 +0000 Received: from BY2FFO11FD028.protection.gbl (2a01:111:f400:7c0c::130) by MWHPR03CA0050.outlook.office365.com (2603:10b6:301:3b::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.282.5 via Frontend Transport; Wed, 6 Dec 2017 12:32:11 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; 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 BY2FFO11FD028.mail.protection.outlook.com (10.1.15.217) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.239.4 via Frontend Transport; Wed, 6 Dec 2017 12:32:10 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vB6CW66C004419; Wed, 6 Dec 2017 05:32:07 -0700 From: Hemant Agrawal To: CC: Date: Wed, 6 Dec 2017 18:01:12 +0530 Message-ID: <1512563473-19969-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131570371307971496; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(376002)(39380400002)(346002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(33646002)(316002)(2351001)(36756003)(106466001)(105606002)(16586007)(5660300001)(50226002)(68736007)(8936002)(104016004)(305945005)(356003)(6916009)(6666003)(2906002)(77096006)(4326008)(8676002)(53936002)(47776003)(97736004)(498600001)(51416003)(48376002)(50466002)(86362001)(85426001)(81156014)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2366; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD028; 1:SvSunpnlKglHk30Z9ShMATe+TI1U66xHEF6lBcvHaQzKdNzVhcRHpTZQVLJeguF3CVE5KNNWbR0/TaWxrJVV4eMr+OoaIm2AvZvUycbB9/2GMSbQkI+RgGK+kOQSvNnj MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d8b97034-f564-40cc-d05a-08d53ca55f1c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603286); SRVR:SN2PR03MB2366; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2366; 3:gb11tzKf0+hZOdU2ZhqhBorgpXJg9lVmN8PETaet6C6WY0vQonKG4DZUJ2Sgbp0U2IPfdkkfPZu5arBgePEUL2MZhT5D52fMS/oXFFXWj/O1+V7B68Nr0fE7aQ+8iPir8IO0k7QxlxTLZmFWNVl5pLTMwILQiIStj959jCLM9iWIy1yX0u2oGQUpedJnAKS7E+4Fft5b4g/WXaBA6rIxDVxbJQtwQcggyFbvAWra9XsPjD+sbmEYl0emW9i9SwU7tJRMBha7OCqpPk6K3RilmLdaBfr9eWWopraQ8hA5hoIBG5xJfpuSaJzMqHRnVqEhsf9Et7jFx5s7OocdEn2x9303Td5RbemeUsAEDoBFXk0=; 25:eIUN+Ss+b3Lt6KwEkhQW0YXctAhtaO/+5ankqEibkM9JQgKb0W2KlMy0IaWKIjiWsXNTXZEVtiYvklYSqYyyng5PGSpLj9D9RLjPXHZ5PfiT7VfkBiAzbCckpBTsQcYyLV7NJqeMUqqeAVW6XAepwHRmgLI9wIPfET5gnmpsrZCy2fzzGF3ObWmfRPJR5YKNJb0cMSqwCleCX5//rm5I/6x/xFgpsLXWcRKvCB0ilnSIoBl1YO5da6kYRdtgTFUjpKIfsIyh+fPJUV991ayjrJSS4v51WS1VUzZLIFKYLv84dBhLNP33kz0uoKT1GxQY66kmnvj8VLwUzREazdfy3g== X-MS-TrafficTypeDiagnostic: SN2PR03MB2366: X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2366; 31:OYWrsD1VJt4P545tvZ1TGJKiXt3PtG8mjJXMGa7pUiojkxiZrJv5m/ckHSb7ASVoTrX0sVqjq4wP487vBwtr6+T2WSRbLrQBQSfG6KgisCd2Li4jKb/Qk0aS+b0XEbqRRtV5i/zlRJFbzPz/i5CeAgOabi+rixzKAluz4QfcJGYxmiCN1adgHBbLZOvc/ENwUqFCXAU1hg2W9o31zSHllKtUeDOJzCVPjcrAAhEO18w=; 4:zVB5nXM7iyjHry4xiu/8dv6tTWoGZFroluowQ75+4piDzRR135hKXvUIRYvdc246g40zNXZeZyc/zMAgBhH1JFiHez6+CnYDtpRY5qrVyFTubBojULhCbDKJ6u//WVm4Fwpza9mKJ6O2Rv+0yv4PqK4mgBvqMZ2idG62w178ysQpxuvvvEh+t01owsp1etn+3lTF0w70UMHAaQm9I/WDj95Sncr1CHYk8YqPSnJWaM41LWEzHUGR1jPo7sn7ymU+Cn/9PaMhwmRHtmudPMvh5VUtuVfUoFMFYPXT5xhSaPAfY4Up2Q+ptLNE2umkxYC4e8qghV9BTny1G7Ch4aRKUCLMgT5S4l4okUA0bGpRfCQ= 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)(3002001)(3231022)(93006095)(93001095)(10201501046)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(20161123563025)(20161123559100)(20161123561025)(20161123565025)(201708071742011); SRVR:SN2PR03MB2366; BCL:0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k9t8Yh0nEdACvcElxktDug26b+T/wz0fHqw3czSgSBf85HTISuuInCJq+gKmW9P8fUgdbaDD X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2366; 6:9vWkHQBtlpwBhkFbJc4D147rPeqXf4C1k60LoK26fQfFgfD/xiDlzfRuttn2uQQEk+2H/6vq5NPL//b+gkSKW7whfywRXfh7O2FXJVwHc+s6rl1abc4TycgPi4wZgwuZcYidndTmgOwL9sRXa7TsD98slaH9+NBGhBB2Bkx8q+0fEbhF3d0mrdK8npmZiir1wKQXl1z1b+kHpMvum7XivdczNQa3jAZ55wFzsbr5cITiWf0opwxqSNKc/TIiZeMqUPjfrUI8vPxQNinX3WTNLk5BFjms13dB/ecvbxlK4onkusQehzjb1iS9KSVmeBGBaTFh8XpH0gndLMvrkje3biQUs5UgxPhzZ59NULE+YDE=; 5:DshEzCsyfL56EJnOufjn9x/gawB8lAUVFNzndx9gRYSAVNAMgLSOLOz7cFfI4uX4xZaKsJqy9eYJIQWHSG69B7PW5ctxBE2cds8lY1SfT5YyP74DJNtY4rm96M+kWegdBLrJSH4i7B62hNWkLvIEvGT82nstzo7tS0B5i+c7Kzo=; 24:CbhGyTVZZ/KjNn0gWIoIjie399Yc6Bw/D2WefxE82bFK7LY8Vx27uosgFC0KXJQhvIMjN2KGe6KPMTawslH2rsdLt5Y0i8JOSYx5GzfapSQ=; 7:qzRoDz2e9PEtEx9qZo52RRs3GOGQDQx71R1MPcY9UOfZ7o2tQvejTSewtXfb1pk+jT9fi+odSkKwDecDM/iy9JWa/mLiDMP0q0Jhl2/sENZq2k4mnbyja0YH2KvGpUBS0xXzLcicyEPzaRBPoHbyFaJlXu3cg+3LGWQU/6XjJ75djDHm+KZnZu6AZO/V/7BGC13baXRdGV0rNUnbrPuw2amHgjnze8AaCG0c0X3ZWdtfGK7XNZSYCcoAqEqvImgB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2017 12:32:10.2199 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d8b97034-f564-40cc-d05a-08d53ca55f1c 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: SN2PR03MB2366 Subject: [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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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(-) -- 2.7.4 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. *