From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0075.outbound.protection.outlook.com [104.47.42.75]) by dpdk.org (Postfix) with ESMTP id AC73A1B263 for ; Fri, 20 Oct 2017 14:32:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Y5dbmZyXAr0w6glKwD875BVe7j2UtSOJTzWQ1Fqyzlw=; b=eL3vUpvkgU5YQ5NoUnTWluy7z556E5LrJPTce7oVGsWF4Y6SdWDekedUza0lWFzilZ4oo8MgnYC1Ao3NP+NPyT/KjMIrGJ1HlF40UzAXkm9NQTBqEbTxtHB54MW4Q6bP7NBhp0jniDEe3tcMko3ht4oSEOdIx4e3SQOyrgBDIQc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from localhost.localdomain (14.140.2.178) by DM5PR07MB3100.namprd07.prod.outlook.com (10.172.85.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Fri, 20 Oct 2017 12:32:31 +0000 From: Santosh Shukla To: dev@dpdk.org Cc: olivier.matz@6wind.com, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, anatoly.burakov@intel.com, Santosh Shukla Date: Fri, 20 Oct 2017 18:01:36 +0530 Message-Id: <20171020123136.10557-7-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171020123136.10557-1-santosh.shukla@caviumnetworks.com> References: <20170905103119.20511-1-santosh.shukla@caviumnetworks.com> <20171020123136.10557-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BM1PR01CA0110.INDPRD01.PROD.OUTLOOK.COM (10.174.208.26) To DM5PR07MB3100.namprd07.prod.outlook.com (10.172.85.10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7baa4e65-c927-4022-8eb0-08d517b6a3eb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199); SRVR:DM5PR07MB3100; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3100; 3:G/se/HC0tjCrFCGM/x5+5SeYbwyGUZEf83YRRYKOZ+sKTtzaDrQhLrQhk1OTEknx/FnGAj/tKVAik6G/MqQdmddsT0RkojuJu4Ooxhxn2/sSng9KRmKBXmZdYRdtppEIEEn44o8fSM4qXVbsLH9HMDMF9pAUsgsZ/6g7Puuy7s1dqveQyTeV6YvRT0Mw4s98HdLg7VMLinaqllK1Z+hA5+4ob58WhV3QUPqVH2EAB4MPIhIU0zW1zVO7iaJ88rRS; 25:+Bo/UiYL0lm9oZCNa42Q0wRHE/fOryigaNTq6c0G6NbfW0eG3cUlaOPB3Tel7JagxuSCrPtyb3aiRxKewHBayEo7cwoMLp1guQ8FoJIBdGatUd6YfFdDpzJNoY6NDehl1V+oAQ8yG91h33Iy9MuszIN3YHK25F6cWXESmoyiDeO2VvJjijYN45YSlL6o633WmwS72V+uTQiZZnHJOgu5QQRZ2/xoPBCma9B9p+7LEqqn3LvPp9cFQmO71tmdMJvKc3nWHNbLn+WkYpadO8sFP1PsWNO6pTJQRAEzvoOJpeyJue27ZMJgA4n5kCKq9uCHKqTv+ks8D9uNBaArK+JQ2w==; 31:VgqSZwpYc/L3GytDsaFmiazGbajwdoFMtQXEm/2laM4Kq0loA3r79F33eZ3WEXsloJPwBevcQBYuEbR9ykSJ7eTM9bnuL3OCqDEv3HYbnbHN+j+CYy7I4K/G+oOjJcj4SWYWilbJz45+9YsXBfqbg3FOtk37NH4CXpHULXFrQzvh3qjzcwwAmagFoZ6F4ZQwVe/IL7X/o1GSM4XuJ4GdlUJ0CBswMUbysrnbeaI2pUQ= X-MS-TrafficTypeDiagnostic: DM5PR07MB3100: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3100; 20:q1KPfwvZo5B9TpkNM+zRKT0v+WnFLPmn6aXRBR/SPlJB+wDi2SXKj95Ngt2JDDuztSxavAPzLKDJnrJEo4Gv1i+MZy4yllQNIiNqLvJu4+z3WfCH4NXQQoaEAQp3lraI3ms2zg6i5EC0/Lr+rM5JcGppArxsURXk6AkeLZabX1ku/TURFFqSuC9738raUBiZ4dDg3pp4QDntz4EEIeitLN/mtGYhuX1AHVLSHJ/R9v2lD90AKpM/v6wOSxPpTDZtFM7l+5gtD1+Lg1izghnTFCMV4qWB4Warqmmp8jrupMtWXDm7+7dY/gaJbF2TuNdkk+LhtGVp9e5kxOmt9pS7quffecW5SWyFxAuMfqY2iPZK4qSEhYZ0SxLUSHPYZsDFenulyuyxDQJf0xqYwxEGZBJsXI1Z4dMMNGFrcxvpC2W5+IgHJ6b8xtuS+HU2jCgsrgVGZpTlAiVm95xQFNiBCJTKSedSO5Sk+MkgD5J9Kft6mf8977ikBB4cpeaOsAwysoOXhW79uaA/V9w6fK78Xf4cwVdZKIWCJuQuXlxPBhkl7vKvDwh9Bql+bHDMF4LIs5Rr6SuxCCsEcoA1Cp/jCFJPDDhI1+JyM3t0rMcUGdg=; 4:VtNFUbewqNkbM7nVzexNmSN9T6GgZOIcnsXnfWbWixBY3SVHnoWZgQ86gSq014bauzx8jsnqufJM6/oXU+mkfhOZy1D6KnbR/5e5WdfWnYW0RpsEAc5NREJTTPky15H46YGVM4hwoHPagdNMPtvYEFJn7Su22bkdU5a0lCokOO4/DgV5HX7Vls/cKlp+1ttJSpKCzG1KDe9XYv9c13FG+GE8bC6t8x7sdu3F6aFl5hf4J3XEcsiFgzi3LgFYeFkabymopE2gLX41ioEin20YAjs+m0bTzIZcugDOtrWZ3qU= X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(3231020)(93006095)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123560025)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR07MB3100; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR07MB3100; X-Forefront-PRVS: 0466CA5A45 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(376002)(346002)(189002)(199003)(81156014)(81166006)(2351001)(2361001)(66066001)(105586002)(47776003)(5003940100001)(16586007)(97736004)(107886003)(6916009)(42882006)(72206003)(478600001)(5660300001)(33646002)(2950100002)(16526018)(106356001)(53936002)(8656005)(8656005)(6486002)(6506006)(50226002)(36756003)(189998001)(5009440100003)(50466002)(4326008)(6512007)(68736007)(25786009)(8936002)(8676002)(316002)(76176999)(101416001)(3846002)(1076002)(48376002)(50986999)(6116002)(305945005)(7736002)(2906002)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3100; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3100; 23:5xYvMjPUvz6CLZZDaTMNss/z2IYsWBJtUYSrGbqEI?= =?us-ascii?Q?Nd1ac4TYKhV4Y/zmJZJd0/IcA6+tuRTUeE8qHaVqi8GDnxzxq9rfALJ2Is5E?= =?us-ascii?Q?X14yGhpncrzQB/qi5LovuITUTcCxJDB7hMgM8ycWf2huuUYc3Xrsw8ayMoce?= =?us-ascii?Q?wOnKNtt5jzn472CbRk4OW1LOk9jDkAl9glnRcsLJOi7CyFjC1l0CozwwJDv5?= =?us-ascii?Q?fjzALga4brD9mmioNPTqIeulX+6sM6XKEq7wEEsF4uIjFNy4Fqpcbc9gITmY?= =?us-ascii?Q?91Fq7/PlplpEZ4BChTrkWl4+mHHI5iLsakb06Z5wGcchR3kwttbLjtPf48RQ?= =?us-ascii?Q?D2qvxO+lySd2zeiKU7PnqlQtd6lSxzqRU1VutrZYClCxX6STHcyviMcBXRmr?= =?us-ascii?Q?O35x+/PhAYyLAq5j28YupXdTWrOS6VD5WC9jnG9YSDLJ3etQLBe4pfRYW/Ij?= =?us-ascii?Q?+3KY56CFzGEkNToLXm296offs9GMbITlOpuRr7w5ftubh/IrkUXed1jU8/4l?= =?us-ascii?Q?QEsV/SlKNb00E7t0cYn/8jW3VdaCuXGIL0MNnKImOdd80SNMBg7qiacQBKUT?= =?us-ascii?Q?YccyZltZBLN79JUQ5RjckqgeBMh6NkXULPxxL2a98RbNjWfPhVQKY4tP4QYp?= =?us-ascii?Q?idoJgBBeaM2+dH+iGDde1JYREiziwjToX1I6em7CALrRaMyk67FG/GQ6272m?= =?us-ascii?Q?h0I2Kj6OmA2WL58jVWabzdpBUMR6GdkBlmPKU+0MZYNPNO3fq7J6zpKftI51?= =?us-ascii?Q?31doxHRKxiUCJw4KxxJcbrtNKMmCa1xuenSnirOmLPwSWnTbopR2jfDy9f+a?= =?us-ascii?Q?SLe424JNB3lCKtdX/jq4FJtjeOQRh80iIFidfmsyFaYRAIsVl1RHBl7j4jsd?= =?us-ascii?Q?Eq/nHQxxbcaLa6Rvm4O2Y1uPervQtAfLZ+88OBv0NYHVYhO5TzQ9XQ5QOeel?= =?us-ascii?Q?AMAj76DdnxBvMG/0zKq0exCyaCnQbI7D2zR6iZWm6C/oAM2ZRuXvPhms7CyM?= =?us-ascii?Q?rJZr+nrpPj8u/ieifEBPKDLGFA0x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CJQUzzIxlU1bqmirFfjPLB/zEGwyOHnJW27G+se2evZao8jhGLrg3BgAQAbPMXAM+a3Y1SVB3FzRq9jS0QUbflI/EoCV5srIkcSUAKyLI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2017 12:32:31.7684 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7baa4e65-c927-4022-8eb0-08d517b6a3eb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3100 Subject: [dpdk-dev] [PATCH v3 6/6] eal/common/rte_malloc: use pointer diff in virt2iova 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: Fri, 20 Oct 2017 12:32:36 -0000 Use RTE_PTR_DIFF macro in rte_mem_virt2iova api. Suggested-by: Anatoly Burakov Signed-off-by: Santosh Shukla --- lib/librte_eal/common/rte_malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c index f8473832a..aa3bd5687 100644 --- a/lib/librte_eal/common/rte_malloc.c +++ b/lib/librte_eal/common/rte_malloc.c @@ -262,6 +262,6 @@ rte_malloc_virt2iova(const void *addr) paddr = (uintptr_t)addr; else paddr = elem->ms->iova_addr + - ((uintptr_t)addr - (uintptr_t)elem->ms->addr); + RTE_PTR_DIFF(addr, elem->ms->addr); return paddr; } -- 2.14.1