From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0058.outbound.protection.outlook.com [104.47.0.58]) by dpdk.org (Postfix) with ESMTP id C16CC7CFF for ; Thu, 10 May 2018 00:27:15 +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=T/V3ZPr0PqxbykkrF2uUXdB0GYgUSRts+sW0tng4g5E=; b=i6n8W1Ykh5IHAQzvn+x77TI89H1eMqe9n+muc+tzsFs2gxd3725eSepiB5I5eR3K5M4L8ZTvSBZ1QKB1GvIFoBW2sV0+/ceIMvPHCRQrWflCUSm8HFRhYp18ks8qZdJjRRr75fXUvNY3xVPF3kfzYK99TH6PHlSnhyhansbcEg0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; Received: from mellanox.com (37.142.13.130) by VI1PR0501MB2320.eurprd05.prod.outlook.com (2603:10a6:800:2c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.18; Wed, 9 May 2018 22:27:13 +0000 From: Ophir Munk To: dev@dpdk.org, Adrien Mazarguil Cc: Thomas Monjalon , Olga Shern , Ophir Munk , Shahaf Shuler Date: Wed, 9 May 2018 22:27:01 +0000 Message-Id: <1525904821-17728-2-git-send-email-ophirmu@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1525904821-17728-1-git-send-email-ophirmu@mellanox.com> References: <1525794195-25082-1-git-send-email-ophirmu@mellanox.com> <1525904821-17728-1-git-send-email-ophirmu@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1P194CA0028.EURP194.PROD.OUTLOOK.COM (2603:10a6:803:3c::17) To VI1PR0501MB2320.eurprd05.prod.outlook.com (2603:10a6:800:2c::21) 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:VI1PR0501MB2320; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2320; 3:Wziz7fZE+XbiKVhZSXvwzptngCFGtwhUQKoe7JWjEKPV8Hxem7+s1QEY07ltbfkmCSy5CDgg69VY9f7rPQHrYflOZ355UnCV8Q7le6hFfFyyVZRBb3SatVUYEbojg/kCIMyvgWn8SYd09Y3C93FbftZGet02eb7RuwIY6SNxGlu5EYIFb3MElaH+QgS31DFPmmGbdCd1r/ubhIUhXTghWzmKhw0VlhulznSQjHKBkfeJzxXZ+beQY1nbpncS1yYm; 25:CHe+swfo3pnrDj4emzta8+E5ypzEfK1WhM1LbpvvB7h5QF0gmjwKWOB3Fa5vMbgRHgmgTFLclN9RenVzd/iQ0fJR9XX/3VXx0T0kR67rDlRRBfp4sbkUKYLQap79oQuPSmQhqfSCV8YxpKyPXzQrOUD0R89WicloyGdcex141Nd00cI+kmDr/huzEmjeRYuFO8jSATGvZUT2s8QxqQ1zDXxsEIMqzfGUpJLokdBZPZfz23DmbpkiRFoLi2Uv62cgLxkbmXVnRNnru7Kb7F+UfLdn/gCK6kecAuuMOhM/21OpSB/rUNaW3OTCnEGRjFW42Tpi2k8bMXYxT5FwuJ9GNA==; 31:x+AlThRDPNYPlyv6duigIm0hOfaS387Jaxztv5eJ8Rr2XkNevrrz34JJcT2iUbGRRSuA4UqjQ3FSwm8wI7ZhrjRWAMfcLaX1199d0/9aKZg2zMS9dhAkSdFpjLKHon3vaIMtvdMXf3zqywBFQQzdrD5VjxIEK8mRwcsHCPHytj2bQtdm4ZtakUSLpKlv6ErbTjWo6aOEqov+7MBQb8Z4t9IM0Shx88LkTYzG3Xcql6A= X-MS-TrafficTypeDiagnostic: VI1PR0501MB2320: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2320; 20:P8yGyL0m8HB4zmGO+ZamOyPmuRf372US+rdYA4G5CP0sDAVmScyIRo8XEDHLPpZ/fwgXm86BYoP/FusuRPQRlEgxM/GH4sMb/xeIyFbYEYjHAzZWprG1rW3oqlcNPUotnm2oX4UNlJ4PJjuCXhKWIJImPAyQVWfHKJSfLcsdIUTHmRgSIB9Eh0HtnTtI3cAIGqUKY00KSrP0x8t5bkgTbFkDqBVCu+Pqik0B1SWUpSywbUk9ROHFzYEYhLAXheeES7DwZfn3zHPKS180SAdePOGjGB846mg+gFmhsn/OXnF6v9sN//Xz+UiprFN+rNwDD/ejLo/FQRFqj3pW1lANeMzEuX18FuTUrMWyQedRmb49QJuw8O0ML4Rv19KAxvFo3zp2lvuHCOQgggHI9d16uRDECKSy5ZioFX9cK6heTa3v8ogyPuA+DtnL6MRtRChuMJdTSymSMfEbnv5xUxCpnnAYd7wcllW9Wc7PWc6YKiLcCDLm9Do0bUsJESaiiQ3h; 4:EptPJtpaIqmuVlWJRPCl+nUZgLZskYZU+rShH2I1ag3mHO7F3Iysjx9f2dXaPI7iXvXeHnDbxH6N4JyVx3QN3R/sYDjwI4GsT9bsj+cXgCuWDDvc6EQ4E5RBKZdqZRlfRTipd8KLMdG1oD/sYu5oOffvJF7lM5+5LNlO5RKT4a5+01bWYe1nFD29rrRtapF9WnEY+z83aIJ2mphlh+p/JccvjyHrcNBD3sKjTMHKA0nrMaOFX1YPOxWPCNkAo/K3zorafvGN8ARCoJvhqEl1GQ== 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)(10201501046)(93006095)(93001095)(3002001)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:VI1PR0501MB2320; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2320; X-Forefront-PRVS: 0667289FF8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(346002)(376002)(39380400002)(366004)(39860400002)(396003)(199004)(189003)(51416003)(25786009)(21086003)(47776003)(69596002)(76176011)(97736004)(52116002)(7696005)(956004)(105586002)(26005)(66066001)(2616005)(106356001)(486006)(386003)(16526019)(6116002)(55016002)(446003)(4326008)(186003)(476003)(107886003)(11346002)(68736007)(86362001)(53936002)(3846002)(81156014)(81166006)(8676002)(36756003)(16586007)(316002)(50226002)(478600001)(2906002)(50466002)(54906003)(8936002)(48376002)(4720700003)(305945005)(33026002)(5660300001)(6916009)(6666003)(7736002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2320; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0501MB2320; 23:m/2Gg+/h9jLj6jkNj2Ff6oEPU/Tvs6mWsXuutpo?= =?us-ascii?Q?HGyw//Iy3jBzBgaSkXv8qJqxsqo2QjBceEV/Lh7b0o2Fhb9YHJdlQvAuuys6?= =?us-ascii?Q?tPfzV6F2mDFfsZucJNFgyB+Czj0MJiob7fjudA4H0kjpMARf1h7IAf36fW4C?= =?us-ascii?Q?WbFB8C/MxLpbv/bXdyXBnnUqLfayR8vqjHoBEAu9mPhntloFirxUw7vRYCpN?= =?us-ascii?Q?jmR8VpXeL8bmu1GCPVOZntnA0OM53L0o1C8dY3D2Np9tDUkIdPCt1yRL4aoH?= =?us-ascii?Q?jYlTK63KmDi13PjDP8hSHwwtpfwyhIHv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NdZuXfe+oRb/9WF/7hhnCavpkqa1CP6FvAM0GDIH9JD3kmESSptzyhQ7EcojnmVpzRZzmQCDslC3cCFQqyJmA=; 24:TOSpIWISVnJq6wW+xZZk2vk8AvWLRWnTNiQ0pMCA4nLgJPdopuBGf4XCei1s6CldvVolshVF75GxhlHYv3QPyd0fBkdGQTfCCvpi6zqI48M= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2320; 7:Ei5wFtkwkM4GpEJ01vLKHqo0mgdemanGTDg05iWQGPoWJPBfTALvfuGT38pn9CuPzYjcn7sn9sx7CaY9T523oPF7i82/2bhjbd1+k2H+eh65mi9Mi8seeoOorySRTJeoss/SJjkorLvOd3rB8PViWq62voEWERTN+hqfZBTwXclvNs6PsPcH4FokRJGLManVwHGQdUgXUYvfbQXh90P71eKNVu3/W+s1Rqf8CwOdgkJy8QYJkPRAQRGbnl9JdjtQ X-MS-Office365-Filtering-Correlation-Id: 239b5392-6012-4645-1bd9-08d5b5fc03e7 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2018 22:27:13.6063 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 239b5392-6012-4645-1bd9-08d5b5fc03e7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2320 Subject: [dpdk-dev] [PATCH v2 2/2] net/mlx4: avoid constant recreations in functions 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, 09 May 2018 22:27:16 -0000 Functions mlx4_ibv_to_dpdk_rss_types() and mlx4_conv_rss_types() contain constant arrays variables which are recreated with every call to the functions. By changing the arrays definitions from "const" to "static const" these recreations can be saved. Signed-off-by: Ophir Munk --- drivers/net/mlx4/mlx4_flow.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index 41dac16..47d0403 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -91,7 +91,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 | @@ -112,7 +112,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, @@ -152,13 +152,13 @@ uint64_t mlx4_ibv_to_dpdk_rss_types(uint64_t types) { enum { IPV4, IPV6, TCP, UDP, }; - const uint64_t in[] = { + static const uint64_t 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, [UDP] = IBV_RX_HASH_SRC_PORT_UDP | IBV_RX_HASH_DST_PORT_UDP, }; - const uint64_t out[RTE_DIM(in)] = { + static const uint64_t out[RTE_DIM(in)] = { [IPV4] = (ETH_RSS_IPV4 | ETH_RSS_FRAG_IPV4 | ETH_RSS_NONFRAG_IPV4_OTHER), -- 2.7.4