From patchwork Tue Jan 23 12:27:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 125511 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1743743ljf; Tue, 23 Jan 2018 05:04:54 -0800 (PST) X-Google-Smtp-Source: AH8x224Pu3thuv4nHmQZ0l3rSjp+H4IerjCF3Rcvb06+LqXQDcYszbRaRhetl335mKMOW6PG77JG X-Received: by 10.28.86.131 with SMTP id k125mr1845519wmb.83.1516712694293; Tue, 23 Jan 2018 05:04:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516712694; cv=none; d=google.com; s=arc-20160816; b=f9SUU/iFZBy+Axomlrt5JgeqPqdnQytPeGxX2n+j2frxgtwHhFr88I1yDGrnCUGHhM 0XKaIM+XMYCk66rQUomvk6Vo5hJ+yOAy1mbDhUG8crS36cg7sZLHYKleaUBs8W+1dvnr DrGcr9BUUtwUCF2A7EXR8YW/8zqCTFFxry4XE9w83fR4DJ6CGss2sFyehxOPWUsJIkog TbnvUHyi/CX1ZkFCsW2vtNFn2B43xaVg0Ei3YwW41MxpSGtT/6DZaah3VUAoAL5EjC2L vL9KOzOl0HS/QFV93LsoR9pGiBTyDHFPTxf+64ieGZj8T5hXayy9AAOOJAgir516QdRG 9jrA== 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=wiSeTocCH8JSNttifUB4WUivdQJrbSIGUQ2maMCUTHOuCRy/KywQIANdURZ/X1S+Rt VjSvTUgi+KCRd0EppGu9nfs0oV4W/nBZPonQduRnaHVrQIQ7ZI3IolEE6Ds2AkY5mgea nV3AIPD7SPBQZsx2ZTcfQPFpI977fxWwaHsSEdnTPn6Z2s0qccVfYq9kp8kL86LBqU7i +DP6d3S97j4vavjwxMPdc8tobNQN8LzfF0H7df8ZaCHg+pVEu0ucF2+cJ2LtOsRL+iNk AXHe/HEEAQPUjYuEOz1s4erIbCOpt1RCbENgXPKiyYo14T3meIyP/j+ByAZifH+5Koyd so+A== 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 x9si253596wrx.97.2018.01.23.05.04.54; Tue, 23 Jan 2018 05:04:54 -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 9B6F41B1BD; Tue, 23 Jan 2018 14:03:41 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0067.outbound.protection.outlook.com [104.47.36.67]) by dpdk.org (Postfix) with ESMTP id E1DCB1B1B3; Tue, 23 Jan 2018 14:03:26 +0100 (CET) Received: from BN6PR03CA0016.namprd03.prod.outlook.com (10.168.230.154) by BN3PR03MB1414.namprd03.prod.outlook.com (10.163.34.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Tue, 23 Jan 2018 13:03:25 +0000 Received: from BL2FFO11FD005.protection.gbl (2a01:111:f400:7c09::193) by BN6PR03CA0016.outlook.office365.com (2603:10b6:404:23::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.428.17 via Frontend Transport; Tue, 23 Jan 2018 13:03:19 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) 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.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD005.mail.protection.outlook.com (10.173.161.1) 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 13:03:19 +0000 Received: from b27504-OptiPlex-790.ap.freescale.net (b27504-OptiPlex-790.ap.freescale.net [10.232.132.60]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id w0NCR9X2020973; Tue, 23 Jan 2018 05:27:23 -0700 From: Nipun Gupta To: CC: , , , Date: Tue, 23 Jan 2018 17:57:03 +0530 Message-ID: <1516710427-22843-4-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516710427-22843-1-git-send-email-nipun.gupta@nxp.com> References: <1516710671-13897-1-git-send-email-nipun.gupta@nxp.com> <1516710427-22843-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131611861993757072; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(396003)(346002)(376002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(2351001)(106466001)(6862004)(97736004)(2950100002)(5660300001)(450100002)(4326008)(356003)(104016004)(305945005)(26005)(76176011)(59450400001)(316002)(16586007)(54906003)(47776003)(69596002)(36756003)(51416003)(53936002)(105606002)(48376002)(50466002)(498600001)(2906002)(68736007)(6666003)(77096007)(81166006)(8936002)(8676002)(86362001)(336011)(85426001)(81156014)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB1414; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD005; 1:zSYv39uraHV+xWEP72wMRs/G2CUlA/sADWf4TlP0ZXhndmInmevI/yB/2gaX1Wxh7jTxJd8EMpz33sI7SbjRr9SgHtSsPNkn7L4j9LF3alCcNicj5+c9xYdyFwz7O20I MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b8c2e3c6-aa9a-4976-9990-08d56261acd4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:BN3PR03MB1414; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB1414; 3:DSeXEOJ35SKxjqs680vSwhQjqOc6RwsNhNrDar4uzlGqR/O6YwY2H7fypyZi5/NpoXP3goUh6tu2g66Bt24GRmsm7NgE4LASlXEejaXI6+FYZdeZCAwDdAjxR/ZWSgBztkJjWoMZgjPVlXzNNntpGtEr7Ua9bbEjCiMvuF2de2RQXIGE27wroya9lVcfdFitx60dJ/nrVVPxDabx8M/OKpf5t+IHVhWA9HMUEo9zdbZF9wXOY4228zYsNaVbxS7Nxj4zquydltPWobZeb9MbNSs8gsf53uOwaLqAipsaYq1MEXHTIjnCHxO/0sc2QjSI+OFJqV1k9ZNZAeuP9EHh0r1UwfEIaIfTHgY8EKJ+Ntw=; 25:cyIQrSPuy8ry81UxXWrBxbTmTMHNA/31t19aVKeZnUS/ec2qQObTWVdsXGhIDJeuQ/SrQqshmx5G09XDY6CAC9xBDQTwN3xwruc6H0Km3+7nMKT9nAjBa9DcSb7Frg4HVHy6QUxvKOoAlf1+T9ojRWL2PKfVPk9h2qOBqURBKDaqCmqRqBQ6aQ7nqFCMag3eJrntSJs7aI1QKAB1DPZ1EsHCrlN47tMss0gCSc4KzMtVjI6APBHLszixyQS/bzvDdKFqct6EY+tA/LHRT4YOIw0k9ipuHKCw+Hc3uPskhEbUfMAtX5a3HGkDi69t8+wQH1AZzwySzXdxuxIt/AHy+A== X-MS-TrafficTypeDiagnostic: BN3PR03MB1414: X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB1414; 31:x+8MH/w11Umm1b+a51FLo98VWAQq8fS4sAPfJUiztLwssM4AnWnWMytBsoyZfu05xI8VfK/h1miAvfSU+erLEPe3yAEMWEe8UnhGQGInks0KfzK5r9PU/EWCAC72jIcr9iRPrmyZaBKuYcu3Pms62zRvWPf/nGlILrC2btaWaRkrD1UaHsLA2QN+YJ+6TQHmCnrQJ/AzCH5HN7KgRPr5BSJDwwy91CDT8/qNBiFdnEI=; 4:ZM9T321uUESy97/ngs3dNLViV8o/Y1ZayUVeHoHC5441ZHqHAqvo3Bpi6SwwcneA0zNjAIOvxnL5U6GYb2V1H1p7ohpUDeUN/mEQ96YupLuFBbfX4roTM7kcyjBL365iYoi63GliJayMS5iT+M++I7yCmnfxkcedLXFQMCS6BnIf+IAyq2N+fxkpmt2DC8uLsl5/KJffZDonTFAiL0eBsyxxIBrIwljuqZcpfcTYwzrGu0b6I5EOTXc/WgzJ3r75vGTcYt7EVy1OMUinFDEz5s9y7ZKXtu8UoM3Or5O3eT0AC6MA1Q6R1TDWcweBT6rqWNXqQ1OuMiU3vIVjb61A1LkKVpOUY94af4m6EZVQxpw= 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)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(201703151042153)(20161123556025)(20161123561025)(20161123565025)(20161123563025)(201708071742011); SRVR:BN3PR03MB1414; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN3PR03MB1414; X-Forefront-PRVS: 05610E64EE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB1414; 23:UmxJkR9oLoFH/T0DBpskRS/+qZMZ6hFhqZf399dHd?= ydaAgVfjrgzJpnJFecaXnsUk+Z/Jvu0u/l5tqyLKwc0oYqOVcXttIYmf+27Ypr1qDKinTHuI++FRT/eeg7l7nD+/+P2I/qTgA44AmAtqnuvnykfcUqRj+gLCn9Y/661psoKR4RjAngNQKkgjMQ2sxkdKY1m1YUnZMsm9lGIo0PBNPYFZ7+J4k0Tn7pPH6Et/oBD7LcxCB/vxGZz8VQY/TyY1iNEdaAzwmcwf9qNKmI1MKFavdBqUs9nx/frlHBuxe56wvjyPwjbsTvS/9qmqtHkP4quBfeoOZODSy+T7rk6DtTmFGKeCk8pgwfUwZQg1Nya8iga//5k/LH4cWWx/Z7qVWXFaDmqT1ZwX8nM8B+JkK7S9SmaWQQM33DU1JAfrfMDnM0B1aklqEX+WOJ+Rfvn23/O2aykjBPr409SaK3KQ5qMBHiPiB4GsMOIlPpSCre1bNF231cnDHhOqJ7DYDqGseyYWaC7FcIbKsFPLOQJaUOflZJUzyJux6/f18cdY1Cpq39we+6FDihvDWuEtQ5uQxl5ZcpapWc0L2fJA+uMYBDpLN1DsYppgckZJa9ow41c82qdPmF/Un+Sm3Iul0TrQ8fyny32XBOjMcMh0jmEKCsFCSr9C4kKZXyAVEwWgaHWWnPUXOqfmyuV1uR5bGyptcSbnobFp+3xBVGXM/F3BZl3NdtJYj8es8fxtIOch6ZlIaLCmWL9Kkizr09rI2z/J2Byr/X5Tt9SgC35D8cHH/xQwJcQ4j5h6/vmmMAcNJCETJ5eZQ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0duHGb0bYCKYl3kJXLmh4lyoqeHanu4FgcBzWzjTfIQF+RN7tL+SMCcsWPGx/fSKDBVMRmYhwCWoPPmpeLH1l5eAutlouyZlU7HtuIYiRHuyLsOE8/26wjJTdPSA0aqW2hLI/y8QnQmDs4D0XCaezi3UEsGwVwP+7PR0FAUaMqLWgnqQ2zD3X1dYYRl/aunhqGfHaltG1BZIGGl+Ll SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2018 13:03:19.1573 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b8c2e3c6-aa9a-4976-9990-08d56261acd4 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB1414 Subject: [dpdk-dev] [PATCH 3/7 v2] 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; From patchwork Tue Jan 23 12:27:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 125510 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1742963ljf; Tue, 23 Jan 2018 05:03:41 -0800 (PST) X-Google-Smtp-Source: AH8x2271gM0Sb6R+1bvjbDeNd5sfq3cd+jyBNSgKNMpqh4gOY0EE1lVHcZlH7icqJs2SIBFnb0kx X-Received: by 10.223.129.33 with SMTP id 30mr2116114wrm.255.1516712621500; Tue, 23 Jan 2018 05:03:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516712621; cv=none; d=google.com; s=arc-20160816; b=UsfWYwalCOH4j9bzyhLTltf1PIe76MPwBM4TQs6FcCVaiCcD9aVR1vm+bv45fEmRmd 3dSFDOgwesPj7wqz92Xi+QJIm3ojh0GhB+RNIKBr93aPdbSveuTqKIRInXbglneYeYUx nntYQWqOMx6EMtnpDUxFtc7g040VO4UTjHGz1ovaQbE+Xol2Z9e1GiRt/B29twreC9Hj Bhdvml7EsINtl4TpLsjj+b7oJIQCidJsDcU6mFLY9zeZotPyUkvymmCHvVqFHagBasn7 pVHPPg3aBfXoSJ78XmJomhfmQV+LdMKuMZfsNzhsVRTu0M0m9L8zCzToh2AoEf9Myq4J NXKg== 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=AYGslKJ2EM6biIvJZiwc5yWqdV2LChLTxIXCjrhcXAs=; b=Gz8EYkNnxAqDJmUQDsfAg4/Gqf0WH5H8A3K2BKUMLXz6p9Ih/Lkn36kdP52ExI3UqS uYIVeZ5AWwbvrRn5VQucGNlYIjkBpIKbS8y59PMyxU0b/je8NWaZHkyvGmE2bwl5OzsH EK5c9K6bBm0BEtMgusLWGLTEPBfdeUOoB8TWhn/64f79NtbnfFFOC0JVfxkGH47s3gJD FcZHjhZHLp6ipMJm/35vwAl/DJYrf5AUyAMYITcg1VSiNYABEHjiVZxex9xTIF/m0aGb 4d7ZVgwppt5E1aNeniKdh41MPqfNwgJEfiIB/1B9slRTKpllNSWvgMzsuSLQJ7+bgkGJ BZkw== 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 64si260479wrk.4.2018.01.23.05.03.41; Tue, 23 Jan 2018 05:03:41 -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 9EA051B1A2; Tue, 23 Jan 2018 14:03:25 +0100 (CET) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0041.outbound.protection.outlook.com [104.47.32.41]) by dpdk.org (Postfix) with ESMTP id 65EC71B025 for ; Tue, 23 Jan 2018 14:03:21 +0100 (CET) Received: from BN6PR03CA0010.namprd03.prod.outlook.com (10.168.230.148) by BY2PR03MB476.namprd03.prod.outlook.com (10.141.141.153) 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 13:03:19 +0000 Received: from BN1BFFO11FD048.protection.gbl (2a01:111:f400:7c10::1:187) by BN6PR03CA0010.outlook.office365.com (2603:10b6:404:23::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.428.17 via Frontend Transport; Tue, 23 Jan 2018 13:03:19 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) 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.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD048.mail.protection.outlook.com (10.58.145.3) 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 13:03:19 +0000 Received: from b27504-OptiPlex-790.ap.freescale.net (b27504-OptiPlex-790.ap.freescale.net [10.232.132.60]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id w0NCR9X4020973; Tue, 23 Jan 2018 05:27:31 -0700 From: Nipun Gupta To: CC: , , Date: Tue, 23 Jan 2018 17:57:05 +0530 Message-ID: <1516710427-22843-6-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516710427-22843-1-git-send-email-nipun.gupta@nxp.com> References: <1516710671-13897-1-git-send-email-nipun.gupta@nxp.com> <1516710427-22843-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131611861995157099; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(346002)(376002)(39380400002)(396003)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(68736007)(105606002)(47776003)(2906002)(69596002)(54906003)(106466001)(53936002)(2351001)(97736004)(81166006)(16586007)(2950100002)(6666003)(5660300001)(498600001)(81156014)(8676002)(8936002)(356003)(86362001)(26005)(50226002)(36756003)(316002)(48376002)(50466002)(6862004)(77096007)(51416003)(104016004)(305945005)(336011)(4326008)(76176011)(85426001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB476; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD048; 1:nEtVQ5cPKJFAEPGtvmuFnd8/Jquhp7jUoedO2l1Y5LCZb1d3Sxzht2H7ODfXhtLDbZT8+5QLA1+0HW5b+GuUNf1HA9kBOaeoIfatEZQNHjdfU6DBbyYDzcjNEfzCgzvQ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 21d4e3e8-f9e2-4ff4-950d-08d56261ace7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:BY2PR03MB476; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB476; 3:XzyE0bf2Iih3oHeHeSyHYNgNchdP0PUrWXWPDhYGCPywSRcOeO6TX/zVISTj6E8PxgKHRzZe263S03laLNHO4hBRNIUeujiiYoy6DeAE+UOs+fafo5/LKqn+FaK2fdMZ7iwqzxQiKLWBJSP3xeiaWmBUuHK5oTkMMKTrnxyqsT6QjliDPsLrO3DP2hLmsCUJBLasSRUJeZXLZCGRK8fgKLw0wQUOqp9eEXTKVf2hoxMj+SyExuDycKInhKkmViGgoo/cRaVw69SWD+xg8zvDikDrqwE33wYg73vs33rHQ9vVN43mDd2XPwAvyoHSSQNhsbKAnUdwhuLW/s0zxFy/r6FbgPTqJpVCa+m8lHijo/A=; 25:147D3LtKqz0MzU/MZDm+6exCIyKV6KZxtSfEh2lwuyrM3dKrEJmiP4sFZey9tjUHRI0LSj/ESOp/K91nyxg1fmA9wq0Td25Yn00HpHuWWGbq9VoRr003GdxCS2M10+8NmFu7XQ4i77BC815/8Q2J5Hpcr3qvRkmEXdfdTk2e1Iw3PrAS7BK1/TVgsI4MYXflnrL6sRbwoFiniXcPtCGxhECTmiichwyY8JQu+pFdShBbJ9iWFavA4SELBoKdXebdUf01wZZXCYR0zQeqLKdo3uLF5TSlBZM7x68Z21v1/vL1TB5u9MyYpk+wHeRgQ3/xU5Jm0tRMzkm2iUpNCKHzMA== X-MS-TrafficTypeDiagnostic: BY2PR03MB476: X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB476; 31:wyiIOybCOKb+Y7vYvQ89VBMQ1cWuIVNoYDE96H/8fQVxf4qPhM9COa3l3pAx4Mvy9Qu+cAS6uI/bAc0m9vEm+ltbfGau59RRx1yxsMXC0M1TpMNQKfISzafe6Z/D6aqDBCv8GQCgvEIoH6x2iuwim5fawkm4rF+slcGyP00WbpoGa4DiRsqf/T2gb5Nu7uoim9fqr7N6HjtDhs123sWFkuVUCferJGbFSeCgxMdgAZ4=; 4:VU3184o20WlziFYeYwmVXm3X4m26856FACbnOXNFYr4cdPxyrrttLYvGxQ9tq7vvfp6sI4Et3kOxPrs6TkBPEe7pwQ5w62JSLs2pNh24DaLZMc4jy28e/HrYw+q4bvlqJUYcfAspYA+RC21sT1NXxFPPWhiPlw2YD8O8zSYbp74AC7LBdLb4rMsbOgvTVJX7bFpKaodtEj8yA5Lsm0tYNA3eNVHGXKZ28w4h3d3/QkD0oDvsVADJVqnIto9AbqQ9RAWsM9FsnJZvndLSh8M9NsPV2D8Zc16GZp2h1UfcEg6wnVqfEeC01x6NxxPBaZUw 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)(3002001)(10201501046)(93006095)(93001095)(3231023)(2400081)(944501161)(6055026)(6096035)(20161123556025)(20161123559100)(201703131430075)(201703131433075)(201703131448075)(201703151042153)(20161123561025)(20161123565025)(20161123563025)(201708071742011); SRVR:BY2PR03MB476; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BY2PR03MB476; X-Forefront-PRVS: 05610E64EE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR03MB476; 23:MVQ2mIO7uxxDyuHR2eIFdJU177AwUG+WZEe8ljY2sj?= wix8Z9hf4JOX3k5grM9+6StAfxaGbXt8wejm8ZUbFv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ZryFoAd5pYHuvIEi3DAG9vVKpy/HA7CKPCFYBM7RUyctnm6Fxon7NYU2aSfNh9loLVQpLOqrNHcu8JS24ozws7ytivygwpGZGHOaKvAXm0CwsIoIrknVjartrmoY2EZ34cY6Ux5PmcNdSbm1PSkAiuGzjkUxNh3NUTrKVnTeywaiUbXUh30K0O+ghsijuNe4PHgO9s3cy4BSp1z1VZagnsjLBBxKSM2qBpKxypr3uIEv0tBqqbL9K6RbOQ+b36AxMAvqlpnhgo6Ql0sv6fWPPl95zCI/gDORhDcgopvkXFMMT19K4jtz5q8bnEPS0BjwZxXzyg6AgMMAsM=; 5:lkyC0dnZAKalu5nUr6tWFeA8udMygIYEM/Kr97F2WbF1P+7bIEVj6ti9dwv0RQBl16IQoxBa3kXX1KeI0rrE8l8p1FlJNs10+zZGfs1UaDINssihRASwg9RdNHNqaQkoBZi5jBBJOM6lyFe1whzeUurOiMhJLJHunqVGMz9SUeI=; 24:cf/yT2r4O6fXTUOvi4CYgkJwRhKatJ1OX5F4w2XpkibAQDhGAzlU/FAPFd2QQhEJ34kYlM2mQJLb6XL+rvilEFq9S/Eudj42BLXv5GU8VWs=; 7:di74flQ3YoEpUKi4BInsu0WscH8+LArPTbvXXHII5gBoibSP4dyqfRva+5g0sfNVA3qIMWHfEFCLpY3xmut2Fz+/nChJvqCL2Rzm4ydcWCylqg0rrhVz4ao79EbFJuAz7JgCrVeR2ikv5dXVRF5pKMszHFZnKZNj15434Op5dNPIkDBrsDfjwgySLZJe0kNenbsbJGzg3e4rcUt01ytImZl44FqQkOpMprOSmYsCMRaTbfjE9ER7pD06pdYBhZA1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2018 13:03:19.2505 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 21d4e3e8-f9e2-4ff4-950d-08d56261ace7 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB476 Subject: [dpdk-dev] [PATCH 5/7 v2] net/dpaa: use phy to virt optimizations 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 Use the optimized routine for phy to virt conversion, when the mempool is allocated from physical contiguous memory. Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_rxtx.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) -- 1.9.1 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index ab23352..b889d03 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -309,7 +309,7 @@ struct rte_mbuf * DPAA_DP_LOG(DEBUG, "Received an SG frame"); - vaddr = rte_dpaa_mem_ptov(qm_fd_addr(fd)); + vaddr = DPAA_MEMPOOL_PTOV(bp_info, qm_fd_addr(fd)); if (!vaddr) { DPAA_PMD_ERR("unable to convert physical address"); return NULL; @@ -318,7 +318,7 @@ struct rte_mbuf * sg_temp = &sgt[i++]; hw_sg_to_cpu(sg_temp); temp = (struct rte_mbuf *)((char *)vaddr - bp_info->meta_data_size); - sg_vaddr = rte_dpaa_mem_ptov(qm_sg_entry_get64(sg_temp)); + sg_vaddr = DPAA_MEMPOOL_PTOV(bp_info, qm_sg_entry_get64(sg_temp)); first_seg = (struct rte_mbuf *)((char *)sg_vaddr - bp_info->meta_data_size); @@ -334,7 +334,8 @@ struct rte_mbuf * while (i < DPAA_SGT_MAX_ENTRIES) { sg_temp = &sgt[i++]; hw_sg_to_cpu(sg_temp); - sg_vaddr = rte_dpaa_mem_ptov(qm_sg_entry_get64(sg_temp)); + sg_vaddr = DPAA_MEMPOOL_PTOV(bp_info, + qm_sg_entry_get64(sg_temp)); cur_seg = (struct rte_mbuf *)((char *)sg_vaddr - bp_info->meta_data_size); cur_seg->data_off = sg_temp->offset; @@ -361,7 +362,7 @@ struct rte_mbuf * { struct rte_mbuf *mbuf; struct dpaa_bp_info *bp_info = DPAA_BPID_TO_POOL_INFO(fd->bpid); - void *ptr = rte_dpaa_mem_ptov(qm_fd_addr(fd)); + void *ptr; uint8_t format = (fd->opaque & DPAA_FD_FORMAT_MASK) >> DPAA_FD_FORMAT_SHIFT; uint16_t offset; @@ -372,6 +373,8 @@ struct rte_mbuf * if (unlikely(format == qm_fd_sg)) return dpaa_eth_sg_to_mbuf(fd, ifid); + ptr = DPAA_MEMPOOL_PTOV(bp_info, qm_fd_addr(fd)); + rte_prefetch0((void *)((uint8_t *)ptr + DEFAULT_RX_ICEOF)); offset = (fd->opaque & DPAA_FD_OFFSET_MASK) >> DPAA_FD_OFFSET_SHIFT; @@ -537,7 +540,8 @@ static void *dpaa_get_pktbuf(struct dpaa_bp_info *bp_info) DPAA_DP_LOG(DEBUG, "got buffer 0x%lx from pool %d", (uint64_t)bufs.addr, bufs.bpid); - buf = (uint64_t)rte_dpaa_mem_ptov(bufs.addr) - bp_info->meta_data_size; + buf = (uint64_t)DPAA_MEMPOOL_PTOV(bp_info, bufs.addr) + - bp_info->meta_data_size; if (!buf) goto out;