From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0050.outbound.protection.outlook.com [104.47.2.50]) by dpdk.org (Postfix) with ESMTP id 841BB1D0AE for ; Sun, 13 May 2018 18:50:32 +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=QVmBeaYIeIeVOzaNz3qAvyeF+Sy8wdhlyI+wKURiVXc=; b=dsXWXBGfIHp5O0KyVU7pSgX943loSW1Z31kqi4EHrS0H2I1Pt071nDo3tTSJn2/gmQD2YfvKl+tj7qIKmXqgG2Z/TBa0KjNzcsvbin8NU28zUmvVB9Q+IkNto0s9LjH6OOQRAmVpOgHZy6GZtu+9bI3z8AffndvfQ2+zJtWB5Ac= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; Received: from mellanox.com (37.142.13.130) by DB6PR0501MB2312.eurprd05.prod.outlook.com (2603:10a6:4:4c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Sun, 13 May 2018 16:50:29 +0000 From: Ophir Munk To: dev@dpdk.org, Adrien Mazarguil Cc: Thomas Monjalon , Olga Shern , Ophir Munk , Shahaf Shuler Date: Sun, 13 May 2018 16:50:16 +0000 Message-Id: <1526230217-21180-1-git-send-email-ophirmu@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1526225995-31378-1-git-send-email-ophirmu@mellanox.com> References: <1526225995-31378-1-git-send-email-ophirmu@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1P193CA0010.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:bd::20) To DB6PR0501MB2312.eurprd05.prod.outlook.com (2603:10a6:4:4c::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:DB6PR0501MB2312; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2312; 3:ug60Gks/s6itV/PT05TTq0VHdmVYAoyd/oT3g7f5MT3MdeE30S+C6wEZealG/KNWEftDHkAgWA2bvAMq2iNOz8FTzgchgTq17hFtja9QoogAbpZZpmJNgG78qUOHRcdr6y2lFwbxYXe50Fm2YZjRTCx4Lfk2rhrDZ3vYeRA67ClVhfKAdJwABvx46vcDTI5fLRijx0Os1BvIuzHceR3WwtERMmCY+3laCCCg52Z+YtdiqUbeLR8kfuZiiG7B141l; 25:ICGmWV4bY9Rp8wp/Jhv7YbMd6leiRZohhwRnDMbs/r59cyh+68KOLqhkTYa8tN57t7Y+A/yH6m4bWoHQZZPMXvU2ibx6NOIucyiiz3EPtCHStydN3vIRdz4cHMYSHcVnW1FjqMalid3k+p1hR/oJ5VEd+LRYvRZP+w+H80YUgaVXHGUePHhrYVstesDrZvqm5JAiUJPpgSxslaYswNe4JeACx3yW9p0SdgRPCouSLF1Ye+5CfmQDUh82rz0jQ2waj0J9AGNgRMKfRlvhC5ClN1YRXWEI7o6BNWmMauyfBNtqt5ivO5BO96f3aHqbguI/EvgoFTZQ78zcdcKXmFqHtQ==; 31:U7AhKve0HKTBbrYhl7NaF7M88YN4fACsYfyKk2+WvDKiXGM9B6/VjJWMQt+JBJwZjF5jFgN6bM3r3oJpuTNYDTH6YMT9KohSG84ozYxXFOVy3qH7tCupSxzv9sDJTH/wPqpjm2HkFWvhoymNf8gAzW6NMCEYXZcxppfPskOnIysF57EcFimv5ZHC14u8B7YZ8z6mEwPTA9e23Wb1tPl227wLlQPFll3pMaBbpYrcbPQ= X-MS-TrafficTypeDiagnostic: DB6PR0501MB2312: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2312; 20:IRwS0KEm9su8kkpqcZ1aoz8L9x0dZAK6PWwK3tdzsZFH3EINzdILFxRdspCcvmNTUJVUErRZIcyzSeetU5IHHZ83vWCmoU4CZUxTrvUeJuDGJZIK45El9k8a6TLwEjgIvzcJo5XYDJdY7y48puslG4GFh3w2srF5gduGKA/WKEFuvspoMdY1QizKXwXjolfG+UKW2NilrGhHOb+DYq9Bk2NnCi4KYPJGZPdaALmRUgwOSdOHJpvtA3QBkH19ZVvnj714xMXdZltFdC62kxIpRaxdfXccGtCrgjLd9ptKz5Hg94T44xSVtf7avwuFjh3tYNZuZaoS7Oiw2DO/lfaoB5OFe5UJemrdLHD3nQK/3P8VR3+7mGBaCMZmXW4aFspWg6OoueUK9Vi43Q2m2J+YQnQAvtmhhqbUHP4Unf/Gk4XBtSgaQ4uoWrEa+GObG5olyPR/5Q8cWnec3nl7TsDid8rrgaK/iJMFgAwC9JoGHsE9KFZXQHLrCWEOUWykV1E+; 4:UivYGG5qw+Udsf+lUKvb6DidU1RlG8UmgbPMrwvqPawB/FK3/8Z7MPxBru+obIR8JnRNtHZ0QmwvC+cFsxTiduoLAjcKhnOStnVe8JhaYrEA6B5dzFAe/gwomHiOeffsFRKK1473fQ254GB3YXe3jO/CsD78oA7xCMitq5nO0qB+KlqLItA5JfHp8QYS24tvH0I/0+C9fYj9oSTV9/83a9pN2gWQmB79t+2PPqL1BLtySDSpq/iTWUFY9+avoDx/8gYDjJi7UFfPfXWlY/1Rzw== 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)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:DB6PR0501MB2312; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB2312; X-Forefront-PRVS: 0671F32598 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(396003)(39860400002)(39380400002)(366004)(376002)(189003)(199004)(16586007)(81156014)(81166006)(305945005)(52116002)(33026002)(8676002)(4326008)(7736002)(69596002)(7696005)(68736007)(53936002)(54906003)(6916009)(4720700003)(6666003)(105586002)(59450400001)(51416003)(50226002)(76176011)(316002)(55016002)(106356001)(5660300001)(386003)(8936002)(48376002)(86362001)(66066001)(97736004)(16526019)(36756003)(21086003)(2616005)(50466002)(186003)(478600001)(6116002)(486006)(107886003)(25786009)(956004)(476003)(2906002)(446003)(26005)(11346002)(3846002)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2312; 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; DB6PR0501MB2312; 23:tsxO74alsR6mJ/+ednGPcBedscKfyndZZSCVTP9?= =?us-ascii?Q?FK7Hg/znQKeZ7OVyQox1cx4rXAIWRRBi2rknshMnV8MzkwznNWdRCWDYf4lk?= =?us-ascii?Q?4QOl4eOIrAJND8lsc8939pCJ0fIpeKoOuKkN4jRbQbn9GzuIGzYN8GWERHyS?= =?us-ascii?Q?m9KnsR41sgG/bskUYLZblze2nQnv14ZKjlvJdrhIxMEcNoQpteLUEOmhBh0h?= =?us-ascii?Q?YCxqlExzFayh19nZ5bhxgfER6lflz7PwVtDBjle7BaDxmM4nbyKuWBXHFUjd?= =?us-ascii?Q?8bqqBWHZkukrRhBBtVqrYShTwnC4TGy03Y2vlvBcKES653ZlxhZwABLw2m8x?= =?us-ascii?Q?ECnWPI+IQNwx3tWY0/Rt77fW4flFE2w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A3i+tTF82Ehzl2dQSqEaVW0So+KpRxQ/c= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2312; 7:8n0eQ87rT8a2sDgYlQJo9HxBmKumXFCpTb3IzoeaFquQJBFV0g9htAnFWhMqlPYvS66D+2Eo4jdMlRjGwY/wLAts/7DP0f7N26HLoptyhvxoNHAnxSO1ln9VK0Fm0+MfAYxew1O3GVXOUfjW+BSRdXZza6E/DE1Hljh600z+Co6sDYDSEoNxG73WcdXSFab6Mhimo6hOIUrQeksHUvqT9QEIKlU6aG8hgKlYKyGlyWTiqdLNl74qpL/nNKQV3cK/ X-MS-Office365-Filtering-Correlation-Id: 8eb69146-422a-4588-e2de-08d5b8f1a30a X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 May 2018 16:50:29.3884 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8eb69146-422a-4588-e2de-08d5b8f1a30a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2312 Subject: [dpdk-dev] [PATCH v5 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 16:50:32 -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 v3, v4, v5 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