From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0076.outbound.protection.outlook.com [104.47.2.76]) by dpdk.org (Postfix) with ESMTP id 5A7F11CF71 for ; Sun, 13 May 2018 17:36:20 +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=WEQof5QHphGed7B26TEJmzsqK28mhLVw1CXcwLTTyeO+W1GXsxepqa7IGQ3F8vkk9MftkxaoAf/WknrrxdPAtMd3Gnz5F45AU0kfLfFPyOd5D3cJ5mbu+NW7zEIl0CvBH5qnKbY1qZ1SXWICaxWftML3dl+oz+cg5sX0hSTRpNg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; Received: from mellanox.com (37.142.13.130) by DB6PR0501MB2310.eurprd05.prod.outlook.com (2603:10a6:4:4c::21) 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 15:36:17 +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:36:07 +0000 Message-Id: <1526225768-31179-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: VI1PR0802CA0001.eurprd08.prod.outlook.com (2603:10a6:800:aa::11) To DB6PR0501MB2310.eurprd05.prod.outlook.com (2603:10a6:4:4c::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:DB6PR0501MB2310; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2310; 3:tGLZM8sZO35uaBkAIolXfLMuPPvyt+zxt6iC6oAB88JlxTOyMBpnzWJBsfcfJGPddRkNbxBbPeZmfSC2ONMSv5ByuAu2C6/EoeZtHtIlKz9/st7LDdxsJWZo9Aw7FSR5KcxI/XWxRIK6sAatpKjzUtcijXTnEYkI5IotZ/0vscmjl+UBx5wGinpnc7eI1FF0fTDdaBb4HUvkP/ipuWCztnZA+i8Vmev/zPJnRiDLH3+SgN22yumVcO4rgACoTt6O; 25:I4yziVBzD2zaIlW3OZavRTPgv9kSs6j1KNYBeW8FUlob/jDZW5i+/pGfqZ5LD5VuTprm3/fNLwgej/bAxtj6icGsZmGX9cH8fYsYKTPFA0pQXpmWDX+nHmf6U+0WQv74sgE5BbySWsxtjj78kbXKpn/CamBqc0ecA7YsJgfVpVwy3YdKDERsmI7yI4HJt+w78L38coGdA79aFhaWOT+q3eq0But3aR+DB2yAYU3Hj57kvtLs6UiPxGZbwKRjKGHZvJuvR5qOdpi/6sFCIcRlW8s/UNvyGcbO7wMDOYyi2SqEZGXj2N/0Veoq6b4/8cPq+4b6FSJmSHKxDMPCmbUHBg==; 31:v27dtRSRTdmp/VN9JW0d5f8ymULmqffH6IQn2S0mv+TQD3yI3jDywTwioveM95Q8CX7GshjSr7dx1rMNlkK0baMNa6/RRuUvPscwakuSWuQs8amjGaq1lgVwEELrPzZXIXEnUCty0IgRayJvIEoDYZzjSX83W1qo/h3TG4jWM0w8enEjT/+0hoUC6PfieZkunGJjdAFQHUwSXzZUN1zVP31nGqM+Qe364JPbHTpoRes= X-MS-TrafficTypeDiagnostic: DB6PR0501MB2310: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2310; 20:tTCVvfuj2+PurYpC5uagro0vgXeEZheU2vXeonwGtjXQK9mr40zgxHfAH2cDhK8682FD19wQ8Dcy89kpRT8TamwDq+uZ91oUb44zQHKbpsQOoL9ZuNS5QvXjmGN95JJcVrxYksBIWRA6nMGIUm0e9ZW2amw02xGh91NY7tLm380i/Tu/YciStfjv5dVzdXEe+zaBfX4uMhDaeo47Vzgu1pFsk+671G2IV6rgfID22FiLyVkzBGqbTWY9V7JAjoZ/6QBW+XhGtufPZf+V+5meDsiG/F0N6+0CB9ACxRfF5o6FeUoKV2+JxJXkZ7XC6K1/3QplHCuqXVsXbBMEfec2rCP8jCaJeSd8jPBvUgqhrOHdUvojBtKWdlGkPgRAueBhsjDdiZEVR4zDgn+GuVVGingo2DMpTIEHoykzMbTtNiTJC7MFYXhbDzbsmBvxuQvbvjBFXupdw+W+pvm104Q6sOooC1XKmKM7SgiF34xRYw8McGZZSVvAgwuBX/JSxzWu; 4:CSco7M8euq4G2/U/T8y/gmMQs8CNt/AjjfQvD2F7jvSSdhua9Ftaru2JYo0xUvHgW5T+2ebo0ICj5NXH5MqQR8FOaSZCuK84etno6twZlv8qeJr39SdJaEixp9Q664GeWhOs1ywTFdum2UhIdHYCI+AsQOlio5BlzQ8Oz51oKplL+vN9yVq3wl62q/q31XCwCEExUXFAUwIOPKo457zL9KB3Nv4p3YcPi1DQKx0KOOx9bihbjbZsJnUazwvyAMbuHq8V1ULZfLxQPoLRR71mQA== 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)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB6PR0501MB2310; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB2310; X-Forefront-PRVS: 0671F32598 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(376002)(346002)(366004)(39860400002)(39380400002)(189003)(199004)(97736004)(5660300001)(68736007)(16526019)(53936002)(48376002)(186003)(2906002)(305945005)(486006)(11346002)(66066001)(54906003)(86362001)(4326008)(21086003)(33026002)(446003)(47776003)(7736002)(476003)(386003)(4720700003)(8936002)(36756003)(478600001)(69596002)(956004)(2616005)(106356001)(51416003)(7696005)(105586002)(50226002)(81156014)(3846002)(76176011)(107886003)(50466002)(8676002)(55016002)(52116002)(26005)(316002)(16586007)(6666003)(81166006)(6916009)(25786009)(59450400001)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2310; 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; DB6PR0501MB2310; 23:GXSAUsFhVFQZuJxxO54Rgbpoj/9EU2/UfJS92OY?= =?us-ascii?Q?zJQhN2dbqcIo6S5Bpps4YUcDRxpVJ1lKNnRoigGrtjOYCJFebqMfds4cWnv3?= =?us-ascii?Q?zYmsGeywujMz/5J9iseEF5uXtX1t50XXmvH8C+0Od+3NjKsZIwNUNgF0L82g?= =?us-ascii?Q?pr2QPDepyWhBOPQOx9cW4v8QqI2h+5+DqyasMhBFJUCGtSkEodNI10IH+2if?= =?us-ascii?Q?vpFVPNjmmikSjpZWIYYDgEzzrFJHGgeTNjEmTcLdTUm/WXz1v17MEnLpJMKH?= =?us-ascii?Q?cQxiIzM6ebf1729/m6MM0/8uAo2pbTSu4Xra5eSq8oniqBynZ/WwLFQEwQMZ?= =?us-ascii?Q?K/fuIUwME8ptTS7jSrAWRu5K4DqOoENwo2Jo+94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Z7liqHZhRX2kEyM7MeVfSFVce4yV4UTJgmP5VxsZyCepa5HAEXhfpJiEBiHnsmFvnI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2310; 7:dLM5E/wKHxKFAB+QDyqbD19xMSEIZ3ny4uaJsqu31eFImvrfnE6clie3syYoxJR+eyIAKIIW1eG/hziSiPWclRq/5/b54T0ekNmij0J8i82qWTHe4ECQq4WnNT+hEJys+95Ml4Vv3Gy57f3FD/7XfN6PNbXh8ZOtg0j55VmR7n+Ft/CFvZDhbo33Dkx/tHZ/a9Cnf2YUm/5xDviCkC9pPU4OYmatyyWkpPcJlGzBSYQXmc7EGiMFPfY+2gNsgT29 X-MS-Office365-Filtering-Correlation-Id: dccd9273-4ce9-4ce1-3fbc-08d5b8e7456a X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 May 2018 15:36:17.2777 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dccd9273-4ce9-4ce1-3fbc-08d5b8e7456a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2310 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:36:20 -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