From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0070.outbound.protection.outlook.com [104.47.33.70]) by dpdk.org (Postfix) with ESMTP id 2E3568DA1 for ; Wed, 25 Apr 2018 17:52:19 +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=TUHf8fGKjb3q8GFvypQgzaIyh2q2gJf0L7ix6rWvpeo=; b=IWbb8ukjQjJQwomXtFLdIjhJ5fIB2BjtV0FgalQ3c7VA8DJXhZo81DICPyoAb0JlQqZwCw4QzdCJ9UPGwTfmg+MZQIHTyv6vLu9rZKmkw6uxkS+j9ieD0axm+VVxkTYfWTB1MOmIqISWjHOnB0ya21KOiUJW+sHMO+ZnewWcVE4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from ltp-pvn (111.93.218.67) by CY4PR07MB3464.namprd07.prod.outlook.com (2603:10b6:910:75::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Wed, 25 Apr 2018 15:52:14 +0000 Date: Wed, 25 Apr 2018 21:22:00 +0530 From: Pavan Nikhilesh To: Olivier Matz , thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, beilei.xing@intel.com, rasesh.mody@cavium.com, harish.patil@cavium.com, jianbo.liu@arm.com Cc: dev@dpdk.org Message-ID: <20180425155158.GA14975@ltp-pvn> References: <20180419185159.11266-1-pbhagavatula@caviumnetworks.com> <20180423090009.vpzv74r3uknh4jnx@platinum> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180423090009.vpzv74r3uknh4jnx@platinum> User-Agent: Mutt/1.9.5 (2018-04-13) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: CO2PR06CA0057.namprd06.prod.outlook.com (2603:10b6:104:3::15) To CY4PR07MB3464.namprd07.prod.outlook.com (2603:10b6:910:75::17) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:ALYpFb/O4VyCkwoOBGhKIM9pRXv1OZYL7KelQ7Ui3AGQqOYKgTxPOvF08k+JZJ460up298HfyAV4H2TwAF/AXyT/pUYC/OFuSv+12E//xjE4hYmiBlFynTkwIagaq9wNAxFekoksK5l87GHjllrJf/j40dB6o9pdTVG+ozrPyuCxiNU4jp5Di3GT+zQKugySLLwGp5sDotyq/mrN3VbdEpPf78kU1OkxSbTrHPECYWygXtGp4t85qwz2snlga9CS; 25:RqNZ6/bt7cUbL0Qo0GzPkcutjtcOZBV2sOLlDr6nCjb4eAzfB+QceSoc+tLXpnj8w1Ja9zJ4NsGsbThSW4CCb7pyHAo0/sJgV5lTUAPWrgsUsgxGp3+tZq4aQeFa2onqkGsYyJ3jXUMiOa/WrFpFx+yTmXHE+i6qZrqz1FKqyKBEZiCZT2POoKlQtoXea4EAcbcjdw+bB8p1vuSazhZ8qmD+KCd5v6LmVJnvqYSWy7AHBmjCk/COlh4UESarEPTK0CuaKVvjHBqESHGNkqqlIynw1iGQXpfVDOY0Tf8LxiUgkORw0yZsBiLH10QJm+r8a0TAbWYQcw9l5GA+QAKwFQ==; 31:fIXoPB029iAWcmsrE3LtYUFI7YCQfTor3eqDdhV+FqxKMOZhZ/aOZ78WMoVkb3/fdpx1CXOQzJrkPl5rkovmiVHbukxT+u4AF6rs/YdA05USxHWFGQCsaPxB/40aDhu1Bg/xbLlW8Aatwbx8O5QM02JCxZrcQd2tTMdQUSDy1pA0+cGOx+wyjmW+/7dR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X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(3231232)(944501410)(52105095)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB3464; X-Forefront-PRVS: 06530126A4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(396003)(376002)(346002)(39860400002)(366004)(51914003)(51444003)(199004)(189003)(5009440100003)(3846002)(23726003)(55016002)(8936002)(53936002)(575784001)(6116002)(8676002)(9686003)(106356001)(1076002)(33656002)(105586002)(81156014)(81166006)(316002)(50466002)(7736002)(97736004)(68736007)(305945005)(5660300001)(2906002)(6496006)(8656006)(72206003)(58126008)(52116002)(16586007)(229853002)(66066001)(478600001)(6246003)(4326008)(6666003)(47776003)(26005)(33716001)(33896004)(486006)(386003)(25786009)(476003)(446003)(956004)(16526019)(186003)(42882007)(76176011)(11346002)(18370500001)(107986001)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; H:ltp-pvn; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3464; 23:n3Vj4eByUjCUdURwctSsFK+mQnUMtaa2JOaT7T6Up?= =?us-ascii?Q?Pmo6V2GaGEcG/FMJzGa/RRdF6h6+f0z9X9JPWEfSW/N+jQBMxzYIKLs6j6Nh?= =?us-ascii?Q?m695JEDjafcYGytGWzuk9AeIgjOXvRuiLmce8W+f4R0jLCc9jZUANGh3nN/o?= =?us-ascii?Q?U8j4f43wAZx/gfF8OkScN2yxS3woEmOjz3tSkhnO7wgXk19f0JmNuf3mSka7?= =?us-ascii?Q?9v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=?us-ascii?Q?K3W4bed4laJNgU0+zY8NzDFH/5mM/KUa69XGWdEudLqEXewf2DM3S+oa7fTn?= =?us-ascii?Q?LPlhMrXhhS7t3ZctYE5olVeTJwbmrJbryN9QZufdLS1iI1W7NlEilbwmN3cc?= =?us-ascii?Q?r8i2GWUnjQdgxDoPrqKtx9T2toDGDZHNTVXdRSt4WrnPliEpZgVPJX3YXdo0?= =?us-ascii?Q?HzOakao6evw2+YOf6oNd5Eydjo43xeP/lNAhvIDyNJiIsKVfvSbeH8lLLA0Y?= =?us-ascii?Q?s0Ud2Mc+hNzzHXL/llkVWg4MLYhr0PqRc564eZYLv0LMDu4RlkxDSYMeRfDt?= =?us-ascii?Q?oZtmYeZGWtmC/eBOFMdXG+IMxAzoF8=3D?= X-Microsoft-Antispam-Message-Info: R036ECESP5iHkY24L6GDgZK+TU9v5OxrDMNChYb/NSI8UWnMNCdCCJEVqbnKRJfcynKNUrc8ZFlkqopQarZBlvmmIJAjf5sP7T/ogo6gSESrH6M3NHyyz740fnGSTaCDw1iVW8WqpzH6ixwsCjXibv2k/crEBwbrQSnpgrm6EACECXfoMeN+LiAl/m/NajJP X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 6:z/ibs3pvQqjUQ5haIhzYltfh9O1MtRfY5LfCt/MCUgFeauxYH47Gf2j2m6CFOptTT7ZpqL8RN68We7R8+cdRLokYXkXqJDeOOQYh6zJg+JaGpygaRD8WYaNFYZalftC4Weyf/3mDq5U+Wkwjp/h+AlzNNLpHuT2X1CwCDayllNHpz+Jhn2OG+6+1C8f9yuTwhXjqKmYL2YbTwhJJIDSIPAx557QN6zuEi5pwvZGMXuFCrLFFx2YNMvChUizogjwyH1z2aUmxrXEhwQSFZceBDDG1GygdYxI7jPs9nAgx84YiPBtHuuz+69o2MsZtOf79AEw7e6b4lXzil1GjBG+wjz+AnM+TL7NkFi1D2Ns0eleGhXlI5wLoXb1RkHOWHzK0QBmctsCAry/I0Edry6fu3nYWLrEt7tVwd36qRvchjBNHwcQCWhXvc3nk2s4Sz7t2p+wJd00OSfbnjMkRC0PqLg==; 5:RVnwcKsSSyuALY2Kr6ve2s+UK+aiJh7429wXoz67tY5GSVeypBDNsuUnQOd5iP66bR1v/XP3RYmbooF28LvU4xCK+LeK1dNr/TbjZaNIZjRXWYkRM87z/Ors5RHHtygjIqSJKS+Z7fKUIN9i15HpB8wG542I61p/zQsGjWRA5mI=; 24:z73mHn/mdrgKtZ6S81HyJT5qWD0sb+fLrIf/wSDZRCcZGGunhGby8Ls9L9L4Wqtc3QPBmh6af0B37XufQXpyDkGjGNKwwb6wrlYRTEbaa58= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 7:G7XzARcxsCvpQY38nnhmU1V58/ZxBXuodIURsqgcURNudI10E3vdzpaEgsDqY8stBWE1MvrvUZCwYkyDbWuQF+7wGMnLF/XnOuW/Blwz2VCiMuNMbzi4czclI/C/U0gaW7Sa9V+oyrn6Ir1+aHalcKGJZ2qDjHciT/T/XpKjwaUvFN9Bl2IHSOMtO4QsD8GJlPQKN7vpdvZ4IVGN+9r8Uw1yW8fKffGHA/0G6R7Rf8CtCyQj50UGmr2dG7ZhcldD X-MS-Office365-Filtering-Correlation-Id: 34fcc77f-01a7-494d-ddfe-08d5aac4857c X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2018 15:52:14.4533 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34fcc77f-01a7-494d-ddfe-08d5aac4857c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3464 Subject: Re: [dpdk-dev] [PATCH] drivers: cleanup unnecessary global variables 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: Wed, 25 Apr 2018 15:52:19 -0000 On Mon, Apr 23, 2018 at 11:00:09AM +0200, Olivier Matz wrote: > On Fri, Apr 20, 2018 at 12:21:59AM +0530, Pavan Nikhilesh wrote: > > Signed-off-by: Pavan Nikhilesh > > --- > > drivers/bus/dpaa/base/fman/netcfg_layer.c | 5 ----- > > drivers/bus/dpaa/base/qbman/bman_driver.c | 4 ++-- > > drivers/bus/dpaa/base/qbman/qman.c | 2 +- > > drivers/bus/dpaa/base/qbman/qman_driver.c | 4 ++-- > > drivers/bus/dpaa/base/qbman/qman_priv.h | 1 - > > drivers/bus/dpaa/dpaa_bus.c | 2 +- > > drivers/bus/fslmc/qbman/qbman_portal.c | 3 +-- > > drivers/bus/fslmc/qbman/qbman_portal.h | 1 - > > drivers/net/i40e/i40e_flow.c | 2 +- > > drivers/net/qede/base/bcm_osal.c | 2 +- > > drivers/raw/skeleton_rawdev/skeleton_rawdev.c | 2 +- > > lib/librte_net/net_crc_neon.h | 4 ++-- > > 12 files changed, 12 insertions(+), 20 deletions(-) > > [...] > > > diff --git a/lib/librte_net/net_crc_neon.h b/lib/librte_net/net_crc_neon.h > > index 63fa1d4a1..cb3da72ed 100644 > > --- a/lib/librte_net/net_crc_neon.h > > +++ b/lib/librte_net/net_crc_neon.h > > @@ -21,8 +21,8 @@ struct crc_pmull_ctx { > > uint64x2_t rk7_rk8; > > }; > > > > -struct crc_pmull_ctx crc32_eth_pmull __rte_aligned(16); > > -struct crc_pmull_ctx crc16_ccitt_pmull __rte_aligned(16); > > +static struct crc_pmull_ctx crc32_eth_pmull __rte_aligned(16); > > +static struct crc_pmull_ctx crc16_ccitt_pmull __rte_aligned(16); > > > > /** > > Not sure it will still work after that. > > From what I see, these global variables are initialized once in > rte_net_crc_neon_init, and used as a const parameter in > crc32_eth_calc_pmull(). > > Changing them to static will create an instance of these variables for > each included file, which is not what we want. > > I think that the proper way to solve it would be to add the definition > in a new .c file, and only have a declaration in the .h. > > Hi Olivier, Thanks for the heads up, the second solution seems more viable and while implementing it I faced few Issues. GCC doesnt suport const vector instructions i.e. the following assignment throw as compiler error. static const struct crc_pmull_ctx crc32_eth_pmull = { .rk1_rk2 = vld1q_u64((uint64_t[2]){0xccaa009eLLU, 0x1751997d0LLU}), .rk5_rk6 = vld1q_u64((uint64_t[2]){0xccaa009eLLU, 0x163cd6124LLU}), .rk7_rk8 = vld1q_u64((uint64_t[2]){0x1f7011640LLU, 0x1db710641LLU}), } __rte_aligned(16); I have gotten path the error by modifying struct crc_pmull_ctx as follows: struct crc_pmull_ctx { union { uint64_t rk12[2]; uint64x2_t rk1_rk2; }; union { uint64_t rk56[2]; uint64x2_t rk5_rk6; }; union { uint64_t rk78[2]; uint64x2_t rk7_rk8; }; }; static const struct crc_pmull_ctx crc32_eth_pmull __rte_aligned(16) = { .rk12 = {0xccaa009eLLU, 0x1751997d0LLU}, .rk56 = {0xccaa009eLLU, 0x163cd6124LLU}, .rk78 = {0x1f7011640LLU, 0x1db710641LLU}, }; static const struct crc_pmull_ctx crc16_ccitt_pmull __rte_aligned(16) = { .rk12 = {0x189aeLLU, 0x8e10LLU}, .rk56 = {0x189aeLLU, 0x114aaLLU}, .rk78 = {0x11c581910LLU, 0x10811LLU}, }; I have checked the hex dump of the assignment with the current code and the above piece of code and they are similar. Let me know if my solution seems viable I will send the v2. > An even better way would be to make variable const and initialize it > with its content. It could even enhance performance. Something like: > > net_crc_neon.h: > > static const struct crc_pmull_ctx crc32_eth_pmull = { > > } __rte_aligned(16); > > static const struct crc_pmull_ctx crc16_ccitt_pmull = { > > } __rte_aligned(16); > Thanks, Pavan.