From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0067.outbound.protection.outlook.com [104.47.2.67]) by dpdk.org (Postfix) with ESMTP id 501E11CF71 for ; Sun, 13 May 2018 17:40:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=SR0YICxN2V+4p8SbcLLEvGdo4d/RhPQkqVWoiXrdahc=; b=ozsSM8YbuYEOZyJumGuZSQkvhgtwvhpiVCP1aDIl4EhYOWJfAkbxwrgofY8L457cclh0Y99WKURwssxZoi/DNtGEmwDp56BH1X2cU5Nd35raDKoIo3AQm3HnbE3rb+O2ML8lwaUmASu7m5Gf9VQkSVJW0RaHiKxj5YmogDedQmY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM4PR0501MB2308.eurprd05.prod.outlook.com (2603:10a6:200:53::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.755.16; Sun, 13 May 2018 15:40:07 +0000 From: Ophir Munk To: dev@dpdk.org, Adrien Mazarguil Cc: Thomas Monjalon , Olga Shern , Ophir Munk , Shahaf Shuler Date: Sun, 13 May 2018 15:39:54 +0000 Message-Id: <1526225995-31378-1-git-send-email-ophirmu@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1525962108-15215-1-git-send-email-ophirmu@mellanox.com> References: <1525962108-15215-1-git-send-email-ophirmu@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0802CA0011.eurprd08.prod.outlook.com (2603:10a6:800:aa::21) To AM4PR0501MB2308.eurprd05.prod.outlook.com (2603:10a6:200:53::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM4PR0501MB2308; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2308; 3:M8NS+4r7dwRsGakt1AfuY4jw0hDDi4By7FCfEGwI7YhKO8T5Gcw+iNa1qJ0nfpQZIA2Lga+rl/ITrdjW7691PmUDo3o+8tgz6dFOYEwfdHL06qvbpi4jyqUfrNG+CUGpmUbuHPk4CDQslYFYCLxPnGs3vx4PcbYDgHIO9MFM66P/1vbyxuqXCjXD1GQkf7x2CzSAgtFo9b8Ei2IWsciKCMivx7rediITMJImPgNrXXkM+KlntnybmVwFuUWxb77i; 25:ZfDsZvqDftajUvpkkKh2HAikOMuNgLvdItL0DSjwLQXbwaGcu5Agzas8LQmTr65Cgx4nvsvpDg/o3fohUfsayNNk4wYtRICO3vgdLbty2XN+qZ+3Nf7WlURcglNe+APoreL55zCltDRWbfpT/Jeoz4Sfj1uqzH6G6tRqKbEMK/dhep9ubL5Lk1bBSpB5+k6XVVCDnwygHWHlonIZsF+9Mc/7UPEAnpuFhcOkaQi+bO/Kk1Szu5KJ2CIK/8rpz5mBZrNfacaiN0c6HjenAtrh52GSSonzSXLRAEpza2Mi2p8xtr4umCdySO0MQ4wrk8OoUL/SVJCcofKyAXV8onulkA==; 31:3nBCUKib2yZI6J86PWMqXt3zppZ6S5C1fdVDYman+CX3giDjIRwzb0WAcdy8RDg67kK1I2a4iOdxfm7acRz64GOVv60QkDlxeXAOxS7OdrmaWNspCxdU++v/c8TavXxwVynKzbB/pYLS4KvHINVRvC0GvqSw+FaP1+K0PW3vGKvoRpktkQQ6tJWzSJYIbmjppWpbQjLSS4y4tf/E/NYO90kabvD9jrQtij3/z2kRID4= X-MS-TrafficTypeDiagnostic: AM4PR0501MB2308: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2308; 20:CUFXBUBqz0vNN/yowEzz+Fu4AvyB6Z4vtT+EN0BPLdLbW3G3GaBa64b/w14gNcLpBuJbwdyzMV8tPeSbMyEQAM9X5YpVN4OUU1zh42z2RmI3nyX7bkv0CmjhoOtHCPvQwv97QluxaitTzQ7j8VNnoFbW5kgLUq62hZmTgyGkvR5TT/aUYVqRXNHk1jSUApcsV8Qa0SG2FXQrflMEuH/gEACejvLhWkbi04Os9JavGa0x5sUesHPChbB7oyNuFJgjmRBUNv+oX43VT8FYNj+b4b4txSfc9ssirtx9AL7WgkGMTl6WwlpwghclS/DL4N9K+p3Jl0FWkyU2hgdtS/V8R44iauk1BFvQnb+qqg2OEiA0UQl8vAvAyf+2eOWPUu/Bkba3vL0PR4JItissE/K7/il4jXl1UxbUFCkjawsQ2naZ5W8C7d1Xr5DUikcWKzNDtQ5uMfZSnihVsAa1icS4UXp7gMlqs94fDuuAJusaHynmqtKY126nzcqugnmdrKxh; 4:RQdYxNgc8Lo3x/+NR4JNtUphESIOnCbt7yJ5KESvhU0s2v237cj5sgMWCfMpyxo6HusBuICgBUQLwWZNkDWZzeSl7oqYSuaL7yi0lV9AHEUoZXpOLCoT4yXEbuZAJL8ZhUs75EDCDzzKTcNVZVDeGUHP5piwWuALTV3FGQAIhhKYDNlglkWcH+Tw4APdey4gvhWetehhcABek5nbgxEZv8qZ0QCvBzTuNIbD9N15rHlm0YxExY0aGqB1E4eiKCr9qKemtQcZ4GSku56h5NFuZA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:AM4PR0501MB2308; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB2308; X-Forefront-PRVS: 0671F32598 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(39380400002)(346002)(396003)(366004)(189003)(199004)(68736007)(386003)(47776003)(81156014)(81166006)(2906002)(305945005)(51416003)(8676002)(7696005)(52116002)(7736002)(21086003)(97736004)(50226002)(59450400001)(8936002)(76176011)(66066001)(106356001)(105586002)(69596002)(16586007)(5660300001)(53936002)(316002)(486006)(55016002)(26005)(86362001)(2616005)(956004)(4326008)(476003)(36756003)(446003)(11346002)(48376002)(4720700003)(6666003)(33026002)(478600001)(3846002)(186003)(6916009)(107886003)(50466002)(54906003)(6116002)(16526019)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB2308; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR0501MB2308; 23:peckJazojqH60zZvOwdl+cP8A+DxHkQxGCr4GRT?= =?us-ascii?Q?buNB1IIQvTQC6auSZIajalQxfB21XXrV1sSUOIfC+5mmtN2j8ZmG9M4fUoR6?= =?us-ascii?Q?PIPdl3E23h/iW8f2bk8lFnyTMd1rfZHwd0/tZWzn/YJAN/G+OEKUY0r/1wyx?= =?us-ascii?Q?BVWZ1po8kqHg5mUpiFcp1ra0b5TxAmcq2AlWoDECgdnvCbu/PNNAYxLprHYW?= =?us-ascii?Q?lBRDkbjn8I8+CGRKE7EQriQ++tNNEAXcnmSKyxd5P6LohgUD1rNZN1mjN2n/?= =?us-ascii?Q?DmzA+TVLrZBIETsNlRunhaCeoC/VfrWXfWlwvmTMiNQA8vVInx19EuiQn0AN?= =?us-ascii?Q?fXALzLZ7oqdhak2+T5y2c7Bp6lqOMBflQuUX8U899pkwl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kVrnEW3vXlZ0rNHc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2308; 7:ZpG/rz551k4koe+GMEndfK3/iFc6jrhQTiogOIW7j37G6WTAiOdKMgn5iN4Bfo+U0wl+imBSic2M13t4kD6kEt8CK/0YxBWvmpE4kERGcyPHwH7jb0d+xxD8TREo3rYFWL6STfrHRg0dO3j2pq/7kBWILB1vpUXSuvg62Dt6qmkTiej7D1o/SMOGL75CDhdU1gpzSWBMmHmvWNiC68HwlFCCkYvIiMUihjCmVd/NVGwWOuIruFSc7Y2QIcKHPlNT X-MS-Office365-Filtering-Correlation-Id: 441ad857-9033-4a08-d651-08d5b8e7ce7b X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 May 2018 15:40:07.3442 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 441ad857-9033-4a08-d651-08d5b8e7ce7b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2308 Subject: [dpdk-dev] [PATCH v4 1/2] net/mlx4: avoid constant recreations in function 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: Sun, 13 May 2018 15:40:09 -0000 Function mlx4_conv_rss_types() contains constant arrays variables which are recreated with every call to the function. By changing the arrays definitions from "const" to "static const" these recreations can be saved. Signed-off-by: Ophir Munk --- v1: Initial release v2: Update based on reviews (split into 2 commits) v3, v4 More updates based on reviews drivers/net/mlx4/mlx4_flow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index 37463b8..f117e2e 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -94,7 +94,7 @@ uint64_t mlx4_conv_rss_types(struct priv *priv, uint64_t types) { enum { IPV4, IPV6, TCP, UDP, }; - const uint64_t in[] = { + static const uint64_t in[] = { [IPV4] = (ETH_RSS_IPV4 | ETH_RSS_FRAG_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP | @@ -115,7 +115,7 @@ mlx4_conv_rss_types(struct priv *priv, uint64_t types) ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_IPV6_UDP_EX), }; - const uint64_t out[RTE_DIM(in)] = { + static const uint64_t out[RTE_DIM(in)] = { [IPV4] = IBV_RX_HASH_SRC_IPV4 | IBV_RX_HASH_DST_IPV4, [IPV6] = IBV_RX_HASH_SRC_IPV6 | IBV_RX_HASH_DST_IPV6, [TCP] = IBV_RX_HASH_SRC_PORT_TCP | IBV_RX_HASH_DST_PORT_TCP, -- 2.7.4