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. * From patchwork Wed Dec 6 12:31:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 120821 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp6995379qgn; Wed, 6 Dec 2017 04:32:22 -0800 (PST) X-Google-Smtp-Source: AGs4zMZH+xDADvPhPTHV0vbgTij5+hQUea2r/mUUoFDcRVzDMdUuoLBJyPLmbWBxlqjFL0BA+JxM X-Received: by 10.28.131.73 with SMTP id f70mr8975059wmd.137.1512563542727; Wed, 06 Dec 2017 04:32:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512563542; cv=none; d=google.com; s=arc-20160816; b=Iqc9YmXVyffgvXzCeclINZEtjWQsWrtbGFodOlFth6CYK8ULXs5MQQZTpMnZu0wKTr W60+0KBMluosd1F7yICrYJ5j4GgGP+1gTL0NsiHuOTjSaVSC8waPB8Nk18U1G9jo9Jan 7BMIst5xKxNCFZ2ZG3Lrl+nun9FR2DUPF/nkb51U7IEqfz1ow3kAE0Ref8713ebyXIv7 com15WoO4lQem/dx0UF7QSkM/XjcV8N84kPEyq6YWlwVMtqoWcqnfrcqXmb9NAhA22/G unyU+Lr4OaVcjuv7So5GOhyFpNRp5M6rDXlDChW8JlyEZtDLQV7faW8lkWhtqCtSt0sJ BbEQ== 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:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=hEQ0l0QmeXtfXngzs8ddvfjnBX1RAvC/iOB0Ah4i4Bo=; b=B7sICm9WfAXTFwxztpPooHod6au6V/9cIQJ3TO+1DKE0IwG3GHm6Law4nvgu0YDx+I 85EriWLEjHCDgB/PP+fAI9cPU6AP+uny1Ji+LCAlFHZCRIgLVZRbczi3lgSjxqeam7j8 KUyxAX/K5uau9RJIrQN8j04wxNw0zUMIHd3HBf0iyEUQiS6hznfMw8BpfhN3D/6ouLU6 TEk06SZ4tesbBXSIaylW8xbymsQefl4LCMhqkoRNRFMfx5oLKNc3T1LLyRvdOzk5Ko1/ LMceKm+EF5NW21qH7kZqvlImPdKs/9i01fxpiZS4FzGKeR4WRNpMxkPqPMh/ltdVuEQZ 9bDg== 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 i11si1888303wmb.138.2017.12.06.04.32.22; Wed, 06 Dec 2017 04:32:22 -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 C4AA37CEA; Wed, 6 Dec 2017 13:32:17 +0100 (CET) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0086.outbound.protection.outlook.com [104.47.34.86]) by dpdk.org (Postfix) with ESMTP id 7A612E5D for ; Wed, 6 Dec 2017 13:32:14 +0100 (CET) Received: from CY4PR03CA0013.namprd03.prod.outlook.com (2603:10b6:903:33::23) by SN2PR03MB2365.namprd03.prod.outlook.com (2603:10b6:804:e::16) 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:13 +0000 Received: from BN1BFFO11FD045.protection.gbl (2a01:111:f400:7c10::1:173) by CY4PR03CA0013.outlook.office365.com (2603:10b6:903:33::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 6 Dec 2017 12:32:13 +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 BN1BFFO11FD045.mail.protection.outlook.com (10.58.145.0) 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:12 +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 vB6CW66D004419; Wed, 6 Dec 2017 05:32:09 -0700 From: Hemant Agrawal To: CC: Date: Wed, 6 Dec 2017 18:01:13 +0530 Message-ID: <1512563473-19969-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512563473-19969-1-git-send-email-hemant.agrawal@nxp.com> References: <1512563473-19969-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131570371336770757; (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)(39860400002)(376002)(346002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(8676002)(77096006)(8936002)(50226002)(68736007)(53936002)(47776003)(50466002)(16586007)(4326008)(48376002)(36756003)(5660300001)(498600001)(316002)(2950100002)(2351001)(356003)(6666003)(106466001)(33646002)(6916009)(81166006)(305945005)(105606002)(104016004)(85426001)(86362001)(97736004)(51416003)(76176011)(2906002)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2365; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD045; 1:NoDnmzGX0gaVefed3Q9O3WHQ1aQbRuMHMYvyGbFmVAXZD0SNX26ma/6ILUAuY/j/euEvAz2XR6d7ZsbKvWBX0EngCxapIsG88PB207SyiqN2cFoOu4uCBo60aSM4xzOP MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7e8d06aa-29c1-4a24-3366-08d53ca560f3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603286); SRVR:SN2PR03MB2365; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2365; 3:V6Y+ZyfR/z+kqmveh80EUm0Gy+SLfAqG4XpII8vD3ZDimN+gRKS6mTP+BMkIHzMpQgIfCpcc4QcYzmmWRuGv0hcDHkucxpHOuBN4uvgOpMeSg8Hp0+a3tSe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Nhac7qDdw7ct0n+DmN++cKbLj68niulGQGeLK/EEagdez2Gnl0TlSdU9vPFq+MLwe1ylxxPckMpXyuNNGj6lrxa1EauST/e6APP+y5sdB2vm4zDnKs26gGtiSm/GteOlPFYTe X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3231022)(10201501046)(3002001)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123563025)(20161123559100)(20161123565025)(20161123556025)(20161123561025)(201708071742011); SRVR:SN2PR03MB2365; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:SN2PR03MB2365; X-Forefront-PRVS: 05134F8B4F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2365; 23:tWV1cKtprbkkNJOo3gZ7Vwk8LOGpsWu/K0iH8sTAQ?= 5PJmMgCqxBi+MgsCqkwGR29VAsIKuLkdlz0jl0dA37Q7HrBIQaPq1BbVVT4c+SPqoMcfll5f97nx/5qqDoEFRx+CE+lJpLAC+pXdpVRZE1U2gNl+QIW+Qr5Eqx7X/kaS9crj2T0O1fYETnUeI5WAWew4guW+pApePeK7q3zBJMPnwhzW8e6cIdPJd84imTyrWgI4NUiDgcFHlxMu54aj/djoz/dkSSVDUo1UQkquGpfjsUHbR+Uoh3vNbPhpyeMDDB0DvU1mIzbAGl3cT6jcTjgmcHM6QzQtAbMMy5HS6OkFAukGezg4YNfLxmzmNkkWi1Hv0iYEzf2JRzJtwJgYL0Qt6twMbv08CVzhX9aHAadHoxu2LJCRfesmOGd0QPTUIfk3zJqUs/ZRNSK6zkjMt96RTfa45oYUHylzWfviBZJcz1ePyjRrji7o4YDRQags7YMD+09oqa9PYSC0B6q4yFihAsEXYWTJh+laUArzk7LNx2ReU+FmWS7G1Vc4vgt9PAJfxMcYPyvGUW0399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TTPGs=; 24:6dhL7oKZfarghPPD0tVTAHfeQubLiucb7jFPrXT3VFe3wXgOWlwvhRk+Aj9qyeYu6qoSvThQiKdKtGlAfJWWlPiagXbNx0cfzzB36kC55VA=; 7:L/qSch/QO9/dr2Z+t0c240IqjVfsTYW3tLocoVTLrKPAgvYn3rCJmFoxaGvBhJGzVzqdIdh7ZHvZewbjrRquuAbb9FqI+FXVauTPieGSdoIhgWi0fpDhhsf7qwR6b/j4H8od+4qMxU/76iabqN8BxNtHg6UvZ+cZ5P4r9wY3ist5zeo8EtVxkN17gAKm4AUK1DnK1mmquJESo9hazb8V2VrEvjDMXSIHKG148EP8/NxVWFFzMAERlLrzLs2EEDWD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2017 12:32:12.7254 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7e8d06aa-29c1-4a24-3366-08d53ca560f3 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: SN2PR03MB2365 Subject: [dpdk-dev] [PATCH 2/2] mempool/dpaa: optimize phy to virt conversion 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" If the allocation is from a single memzone, optimize the phy-virt address conversions. Signed-off-by: Hemant Agrawal --- drivers/mempool/dpaa/dpaa_mempool.c | 18 +++++++++++++++--- drivers/mempool/dpaa/dpaa_mempool.h | 9 +++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c index f5ee80f..ac3e4ac 100644 --- a/drivers/mempool/dpaa/dpaa_mempool.c +++ b/drivers/mempool/dpaa/dpaa_mempool.c @@ -99,6 +99,7 @@ dpaa_mbuf_create_pool(struct rte_mempool *mp) rte_dpaa_bpid_info[bpid].meta_data_size = sizeof(struct rte_mbuf) + rte_pktmbuf_priv_size(mp); rte_dpaa_bpid_info[bpid].dpaa_ops_index = mp->ops_index; + rte_dpaa_bpid_info[bpid].ptov_off = 0; bp_info = rte_malloc(NULL, sizeof(struct dpaa_bp_info), @@ -171,9 +172,20 @@ dpaa_mbuf_free_bulk(struct rte_mempool *pool, } while (i < n) { + uint64_t phy = rte_mempool_virt2iova(obj_table[i]); + + if (unlikely(!bp_info->ptov_off)) { + /* buffers are not from multiple memzones */ + if (!(bp_info->mp->flags & MEMPOOL_F_MULTI_MEMZONE)) { + bp_info->ptov_off + = (uint64_t)obj_table[i] - phy; + rte_dpaa_bpid_info[bp_info->bpid].ptov_off + = bp_info->ptov_off; + } + } + dpaa_buf_free(bp_info, - (uint64_t)rte_mempool_virt2iova(obj_table[i]) + - bp_info->meta_data_size); + (uint64_t)phy + bp_info->meta_data_size); i = i + 1; } @@ -241,7 +253,7 @@ dpaa_mbuf_alloc_bulk(struct rte_mempool *pool, * i.e. first buffer is valid, remaining 6 buffers * may be null. */ - bufaddr = (void *)rte_dpaa_mem_ptov(bufs[i].addr); + bufaddr = DPAA_MEMPOOL_PTOV(bp_info, bufs[i].addr); m[n] = (struct rte_mbuf *)((char *)bufaddr - bp_info->meta_data_size); DPAA_MEMPOOL_DPDEBUG("Paddr (%p), FD (%p) from BMAN", diff --git a/drivers/mempool/dpaa/dpaa_mempool.h b/drivers/mempool/dpaa/dpaa_mempool.h index 6795859..8160af6 100644 --- a/drivers/mempool/dpaa/dpaa_mempool.h +++ b/drivers/mempool/dpaa/dpaa_mempool.h @@ -61,8 +61,17 @@ struct dpaa_bp_info { uint32_t size; uint32_t meta_data_size; int32_t dpaa_ops_index; + int64_t ptov_off; }; +static inline void * +DPAA_MEMPOOL_PTOV(struct dpaa_bp_info *bp_info, uint64_t addr) +{ + if (bp_info->ptov_off) + return ((void *)(addr + bp_info->ptov_off)); + return rte_dpaa_mem_ptov(addr); +} + #define DPAA_MEMPOOL_TO_POOL_INFO(__mp) \ ((struct dpaa_bp_info *)__mp->pool_data)