From patchwork Tue Jan 23 12:31:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 125476 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1593105ljf; Mon, 22 Jan 2018 23:24:57 -0800 (PST) X-Google-Smtp-Source: AH8x225VLqc5XOuMGFlOmIUGx0HawaR5ZGS9XSuHXzXTBS1mHe1k5Bab3Z1K6d4iS9XNd26W3ai3 X-Received: by 10.223.163.91 with SMTP id d27mr1210034wrb.18.1516692297130; Mon, 22 Jan 2018 23:24:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516692297; cv=none; d=google.com; s=arc-20160816; b=Y+/iTxOfx80+Lmnem4lHzaE7WHEkMoo+OQhgHkhkQA4HDHzz1+mTbe0GUkvvlbzoCP qqxATnkZ6zvH1u3dx/y71jODrnzNWq2R/Y0ITaa4BzRdrsEm0fldQ//DQYLJ6JR+EU3U n7aZ/yC/1cuK77RPx+nJABWhsyts5UvQgfBm7Ohmb3R/4WQ7Womg6zBd/cAZ7NtNAKUq kmn2R9R0vcf8OPrQyHoL4Oldq/YZi24Vkm41fMwlTpuoUuf6Nwv650XplC3eJDOHMZPp ZWqOFjWiP92ghrdRONqjuASlvjupEUITodE1FpmI6mXHbMofFxrr8nyPi5tp+n/uq6Cc ZqPg== 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=e23Al//LRR0EMDIEq1aDtPKTXaisn8aKm0wTkh+L/UY=; b=up1nPj1qJdVoYHm34VJQCdFLVGKMUh2AwQOZn0eopJw/1C53L+Vmb5kpFuZ1P6aQJg D1K4hmoDQs1kwwzTvj35jpDIIoKlqtRMi2DSJifSdnBw+bftdKVG3moLB1CCzKnYhpiq esAhX0kvta6LDHgAucAKQGvh+223HwwDZ2Q3LCO33J7KQz+tFAPdE70cgcla2MPw1SPf 2CzRQ89xvJa80nnX3PStHZWnx6mM2Li7IcnOXbIg+yvnNEOjEZGNknb8NC3kbk5RgoTz atTEBFmLYvba2jWCObtpxjdlOeWnN5YggTMeLCFV8shSXHr9RiVE+ywLUwJuS52NTU5+ JvtA== 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 i11si6448730wmh.112.2018.01.22.23.24.56; Mon, 22 Jan 2018 23:24:57 -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 DF828324D; Tue, 23 Jan 2018 08:24:55 +0100 (CET) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0076.outbound.protection.outlook.com [104.47.33.76]) by dpdk.org (Postfix) with ESMTP id 42DD8324D; Tue, 23 Jan 2018 08:24:54 +0100 (CET) Received: from MWHPR03CA0015.namprd03.prod.outlook.com (10.175.133.153) by CY1PR03MB1421.namprd03.prod.outlook.com (10.163.17.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Tue, 23 Jan 2018 07:24:52 +0000 Received: from BN1AFFO11FD005.protection.gbl (2a01:111:f400:7c10::103) by MWHPR03CA0015.outlook.office365.com (2603:10b6:300:117::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.444.14 via Frontend Transport; Tue, 23 Jan 2018 07:24:52 +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 BN1AFFO11FD005.mail.protection.outlook.com (10.58.52.65) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.428.12 via Frontend Transport; Tue, 23 Jan 2018 07:24:50 +0000 Received: from b27504-OptiPlex-790.ap.freescale.net (b27504-OptiPlex-790.ap.freescale.net [10.232.132.60]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w0N6G0dv023569; Mon, 22 Jan 2018 23:16:12 -0700 From: Nipun Gupta To: CC: , , , Date: Tue, 23 Jan 2018 18:01:07 +0530 Message-ID: <1516710671-13897-4-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516710671-13897-1-git-send-email-nipun.gupta@nxp.com> References: <1516710671-13897-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131611658919587465; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(346002)(376002)(396003)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(498600001)(51416003)(86362001)(50226002)(8676002)(356003)(81166006)(81156014)(6862004)(76176011)(450100002)(26005)(68736007)(105606002)(8936002)(59450400001)(305945005)(2906002)(77096007)(4326008)(47776003)(2950100002)(104016004)(5660300001)(16586007)(6666003)(54906003)(336011)(2351001)(36756003)(53936002)(106466001)(48376002)(50466002)(97736004)(85426001)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB1421; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD005; 1:ow6JHbFN1AQRLGgEeuTOzbRMS4J5SAXQ8RKWVBQ1ShaiJxeRKrQBmGhHfa/McZ7I+APXmD/2/ZQKc0H+eL/8lXdYpxBEAR11G0mBJM+MfS1vhErPc6vomJ8L2s8eQxPr MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15c7e481-3ed2-409a-4d28-08d5623264a8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:CY1PR03MB1421; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB1421; 3:eR1c2PLKaCsKU+f3MtVlPjeM+QzV73rt6gBo+6qqwmzPO6FAk522H9sGPn1kOSE67DqFdIAJMEYi7kJYiaSco8BYFBTEcqPeXNj+IoZN1bD/eCQCFsDudiB7dGjzNOrkL1/FLqTc2sI4FyP8fWiqgggO2kRANygNsnl7JpFrjHyMk8CWtJj4bORXZ94eUk2KxvcFzcjVg4DG2qvG9EHTrNdPxGJAYrs0p1eQEmH/ZsdC8/TXqAwNIIMNAe2linRlHuk7Mx7JMGOiFDr3AQTx2q6cuoMaJ08sYRalC2fShuO3mNUsyU5mRfRI8+UukOzAbgo61tyd5EydZTBbaLGO+eVBCQyhHQvbNMxF9YCIvyU=; 25:xx/AOmyr3U09P3siePKfo4vbUX5cI8ta+Anu/jkOMFVdmOTzasak9WvSpeoUjT6IGcf6gQL2ZE4zRI92Dh076hthIGMH5MG3kBHPClHHfUBtbxq9CLtC/OrgzLXpwGi/4WY+3IBlAuuzg9K0wBzhFv+OJ41gGRMoK2pW+LS03Hc0+i/RJLn7c8ScaCbbtz6y80JkJ3TOwBn+qRNGN1rvB3253day4LP++CoKcpAFA7OQBHkDczyYsh1WAhw9QqX1to6I62aDx9v+I3UU5eN76U/C93LmITYIuDVd9EdUXeFX4RYavirSqokKfuQwimjK7eJUBc/CYakfoJ0murPwsA== X-MS-TrafficTypeDiagnostic: CY1PR03MB1421: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB1421; 31:3QiHud5k1g3AghZLTccIsNj5A/CcQqusP6fiTytDxnPg2S1x7XQR7l6zgMc/2ZAZ0sua0OrNUC2Gw5ZntLwdCzLhDNOmXJ1GxT/n01lgRta+KwoJltxoCRRAazhsP5Ce5wKpNWsnxzw9oSo03oJOK5roXccwefWgyas4bki7+4CihEACEH1D3qG5Np9OWnlOwkd3GJslGyXdp1vjGv+pV3tudyZWLsT4lPEOzhjmPJw=; 4:R/rYDPomrvy4bbJfwkOo5NN6/gS09qFQVHHRyIw71ZT561xo/dWq2jsvQ8Z5jZID5KF2ondI4hzhTR2AtHPlDOGLpJFjFMvozBNsU72a0rrB6NvkkKMcfkQ/XoEl2iQ35zYOGmXKdxNoVTo3VvtPZHJovrlFDys54cjrhIZcDZdEfZNOMw4OU81EqXiII7MQ4LdPIMyA2uHCI8AP6xYmidbqHFFc9ay8OrQtw5qSPhHyUD6dya0Hk9yC4mrDD2zs6cjU5SR+mJzSlZxumdUy0tfhKtv1XhFOJSFPZmzld9Q0G/Pet/NiY8kZKS26if/0tetXiVUGb+MfAjfEKYvd4njRbyRpXM5d8eGu9JBC1eg= 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)(3231023)(2400081)(944501161)(93006095)(93001095)(10201501046)(3002001)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703151042153)(20161123556025)(20161123561025)(20161123565025)(20161123559100)(20161123563025)(201708071742011); SRVR:CY1PR03MB1421; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB1421; X-Forefront-PRVS: 05610E64EE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB1421; 23:KPlhs8zy2Ooc0N0dNfUyNWtGhcJ7M5ipIz2wcjCi9?= 47jzbADQWGZ56pOxvwnpeLzNw5Qip2XLCKHTQYRjKLw0NH/EMY3wZpmNRZY1y4OU926MwuOxkcffsGKYAZl99isjPQniiAjAQfv97DLxVWFF808kFin1W83FT1ifwfulMPpjS85PoxHEfscg96JKlnKIT7Aqy4S1UJ8kjZB4O6eSRPk7xDLGsVFgpFoShiwxBqeU8ky1u1R+fW+r5E7wcOcL9hOBCer28pqTKMPBZlcI893XVDXvPIW8r4+eEq9Zid+iCiDnhCX5ut/A8+YrNSkWgtkm/eBCb1rJnbwIvpcKcN9Bp+OXZOo/FakgQ10HY9sex5fwOmxbentPWNU7yA4KRcMvS8f5V8ig12gQRnyyKW2yhhWqQADIWWsL0BQmOiT+6L8Q1xvVU8djaoUvHKKXtGXQnLb/VtOngBbFGTXmZftmcouqxoDnKY8GiupFpii7OoQsEfnQgv4+F+AjLCs0Rm8VVHCxmxi5Q30JJWUia99epbTy/mQCB85SLxH8BoTe0sHMVnVen283m1Oy1b8QZzn7gBGT7bpOw8bryq2SL8HQoA5QqBoSwmSLxuHT9CCRFvWmKnaie8A8eRjNqLVvzIZJVXWBLDL4g3/R/jDsOMdEwrH2FGii7m9tG4Z3T179u6TSY8edLKzuHqSB8dSuWOChop+H6NvKpEtDLpOYCrGhA/bb90ZlqzUP7sLk3llBqkB7FqRPf7vqoDqBozKzgonjlyNDixE6vX9VfmLIijovBjLCU+duokDc+BKCYbXxmBNKeLGJwJoOAQ32n4cZEeiFadYy+/NpTxzkt/D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0N0HaQU+JltbP5MOagzUcgTC6orGg5QqWkUdwNPrKxOV27POwEcxcOdrGXps/zQgY665aP7vY16ovQ6UIHb809KTitCBpgD6NdWPuLcAS63zcDqAHwI2Nymrg3lN0paOLiLATbRe8Eehm+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2018 07:24:50.0867 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15c7e481-3ed2-409a-4d28-08d5623264a8 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: CY1PR03MB1421 Subject: [dpdk-dev] [PATCH 3/7] mempool/dpaa: fix the phy to virt optimization 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" From: Hemant Agrawal Fixes: 83a4f267f2e3 ("mempool/dpaa: optimize phy to virt conversion") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/mempool/dpaa/dpaa_mempool.c | 9 ++++----- drivers/mempool/dpaa/dpaa_mempool.h | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) -- 1.9.1 diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c index ddc4e47..fe22519 100644 --- a/drivers/mempool/dpaa/dpaa_mempool.c +++ b/drivers/mempool/dpaa/dpaa_mempool.c @@ -150,8 +150,8 @@ uint64_t phy = rte_mempool_virt2iova(obj_table[i]); if (unlikely(!bp_info->ptov_off)) { - /* buffers are not from multiple memzones */ - if (!(bp_info->flags & DPAA_MPOOL_MULTI_MEMZONE)) { + /* buffers are from single mem segment */ + if (bp_info->flags & DPAA_MPOOL_SINGLE_SEGMENT) { bp_info->ptov_off = (uint64_t)obj_table[i] - phy; rte_dpaa_bpid_info[bp_info->bpid].ptov_off @@ -282,9 +282,8 @@ len, total_elt_sz * mp->size); /* Detect pool area has sufficient space for elements in this memzone */ - if (len < total_elt_sz * mp->size) - /* Else, Memory will be allocated from multiple memzones */ - bp_info->flags |= DPAA_MPOOL_MULTI_MEMZONE; + if (len >= total_elt_sz * mp->size) + bp_info->flags |= DPAA_MPOOL_SINGLE_SEGMENT; return 0; } diff --git a/drivers/mempool/dpaa/dpaa_mempool.h b/drivers/mempool/dpaa/dpaa_mempool.h index 02aa513..9435dd2 100644 --- a/drivers/mempool/dpaa/dpaa_mempool.h +++ b/drivers/mempool/dpaa/dpaa_mempool.h @@ -28,8 +28,8 @@ /* Maximum release/acquire from BMAN */ #define DPAA_MBUF_MAX_ACQ_REL 8 -/* Buffers are allocated from multiple memzones i.e. non phys contiguous */ -#define DPAA_MPOOL_MULTI_MEMZONE 0x01 +/* Buffers are allocated from single mem segment i.e. phys contiguous */ +#define DPAA_MPOOL_SINGLE_SEGMENT 0x01 struct dpaa_bp_info { struct rte_mempool *mp;