From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0049.outbound.protection.outlook.com [104.47.2.49]) by dpdk.org (Postfix) with ESMTP id 69F9E5B32 for ; Mon, 14 May 2018 12:07:48 +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=8taOTo/XEmT1RHb4zIUwWSImK7SnPfrmukcssWAt5QA=; b=GAsLNUSSAhCV5U5K9PEP6Iyc/IcbQH/4l68pCNSOOywkxE/mm5RkKj6sy4FhUAgfrXRuQOsei3AfVr8AGexPuWlivJo515in/jcXWzNHyDlO/dwzzM4YBzcW3fjrx6hUPCc+4KFGMCUBa6PtsXJxt8TIN9GEkx9LSMPI6KE5CyQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; Received: from mellanox.com (37.142.13.130) by VI1PR0501MB2317.eurprd05.prod.outlook.com (2603:10a6:800:2c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Mon, 14 May 2018 10:07:46 +0000 From: Ophir Munk To: dev@dpdk.org, Adrien Mazarguil Cc: Thomas Monjalon , Olga Shern , Ophir Munk , Shahaf Shuler Date: Mon, 14 May 2018 10:07:31 +0000 Message-Id: <1526292452-30482-1-git-send-email-ophirmu@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1526230217-21180-1-git-send-email-ophirmu@mellanox.com> References: <1526230217-21180-1-git-send-email-ophirmu@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR10CA0111.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:28::40) To VI1PR0501MB2317.eurprd05.prod.outlook.com (2603:10a6:800:2c::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603328)(7153060)(7193020); SRVR:VI1PR0501MB2317; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2317; 3:s+LnfrAJgDG4ASbdXhuGlC5h83i0jjWBMjYOk6LoVjAcpPp+xgn65B+CnNXP6qfElg2KcizLvc2QgyhbJoVr/sGZ3KZI3ZUSwr/pa2efGOpblJpJfNvhUE+huRPgmcZ8TnrbG/7puBR58dnBVxsSxsZ5o4G1H1QwEF5XwpyvBEP1XwTgY8FKwjvn/Pefwf3+EZ2Z49KAoPHnasdFMKRCvBmNlGmVm5yVhZGLNiKEZk2a/EMcZoxOX8+7MbpCP0hc; 25:aMmJm8K+o29pM4BCzuSaIfjGkgrCgAcr3ljhAgKxQlFDq238YALERLTox6bKfyv5nH9Kod3F/pLjzilprBoGaahI+vlWBcWYx/vwRAO0Ty1PXeOlGZvW2lzY29sL+mHxIZ+in3jYbFMk86ArdVsIf7dMyJcDteAy+Ws7ua6PKHFsSLU/10/tsWld5f4uzvI1MR340C//YmwZDMapA4KaqSPZI3cJ2RhJce8w62p+oWRsVlWrLCsIO9qaTlc64OMhxcmz19cmE0zaP5iUVKGqgqh7KSk+EiCmMbV2EX/yV08uoZJKjQ+xRiQuzow/gIzhUXlZr5V4rh+wQP8G+wqmmg==; 31:pUboLFGPzLwDZs60Ele3z294UNzOw4stagZxA23raN28shua9rF1UOH7msXzm6+RtCnixKU81p7ueEiyLJ2aO2q61RWvx4tnFbkk04NlQprYi80BNieXb8+A2JzIhEQyx3uXCbECK+eT39OpFOoM8hTEbQ6xGCh+t8q1X6ZgDfS9tFZH+vhE3+pXedxWmNZGT6uXZxy9OCb8xWSKiVvDHOEbw0NbbHLV5o1HLaorGF4= X-MS-TrafficTypeDiagnostic: VI1PR0501MB2317: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2317; 20:Jf32738LmhKpX3CBNLzfScVW4f177PNMJeS4ebKr2zynjcFYwGXbnSYMZLJjfQ/q0+rk75uxtRNe57R15QoN5PHFT2gUVu3V0U9o0pwhctVOoFjnFkgvoLraI2ih7838hdwImXOjp6CqmKzb7/z7SYv03wvsoZffChahkhFsN1U6CaY6UKvxbE/VarHY/Mmemqsa64DpZWpz5cENaFJtCgWKvKF1wx6x5pZT3/csXkrlGBRqhv1j870v7oZQtNDQjMmPOirdUHAyQUxFYehUN50hn2U6ADXIzxxlNT8DBBm+VTR9yJSBZHizWgbHowT4mmsmTiNEGALmz4Ly4WqyzItO9uMQXZSkafTYuAq09pDRQPcqD0swjUTMmHbbx5IWJ+EXiea3wz+ZZHzBmkkorTtrEfRh53FHie8wyibFFhRkzEwU3oilxLjkRsoo6DbVBpOryvDWBaVSiKxd2SfK80gscRFJP1FYUR2Etp8cvCmUrWmEQ9f3fyUrlxsCfNZ/; 4:SxZFetOKW2MOFstw7t+ZDrFySm+I5l6ZfC7AuZe7jdhn9y6sATyMGq7FCiG+aF+8VFec+RQ+6rUS6izf931tSHNUTDlz+slgo42hohtfmp8Y0BkiL+XFtwiX95FEk1dAUskk8JSZi8WTDW6rlhM+8qhnpl0vTT+94qHHrPfvM4qwffThZSnqxqt0mYXjGmyhEcu9yKkhEo+vrSi+DR3oivGPDpWhJ4Btz/7UM2Wr9x0WhzBF0zM08xU56kHZPAskiYf2/xxy5Uerja+UuNnVNQ== 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)(20161123560045)(20161123562045)(20161123564045)(6072148)(201708071742011); SRVR:VI1PR0501MB2317; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2317; X-Forefront-PRVS: 067270ECAF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(39860400002)(39380400002)(396003)(346002)(376002)(366004)(199004)(189003)(486006)(36756003)(4720700003)(6916009)(6666003)(5660300001)(21086003)(11346002)(476003)(54906003)(386003)(16586007)(68736007)(16526019)(2616005)(446003)(956004)(186003)(6116002)(3846002)(55016002)(2906002)(66066001)(7736002)(53936002)(47776003)(26005)(105586002)(305945005)(107886003)(50466002)(33026002)(86362001)(52116002)(106356001)(69596002)(8936002)(50226002)(59450400001)(478600001)(81156014)(25786009)(81166006)(97736004)(316002)(76176011)(51416003)(7696005)(8676002)(4326008)(48376002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2317; 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; VI1PR0501MB2317; 23:A6L3eY03W+73djaJLx6xAdZLPk1UcxFHCqYX6nI?= =?us-ascii?Q?NDh+gNMaxmoGVpQdiQW7STs4hSGL8A97aRGR8NIiUpD6Z0KaZLEeEtyBuVXr?= =?us-ascii?Q?k6drL3qVB5cqypgiQvXtVnhyh14Yjg2r6XXRTSJR3aBYRnk8ds1+a/3OajvL?= =?us-ascii?Q?F8uhTJAsXACgtLOyoIZx9vk0Tm8n79szvWeSdpRwGonqgKVJuwg2sL0Gh9M5?= =?us-ascii?Q?KS2aO1ODpR9hgDFPVzWvcSdBe+UQoOwNPZI++q5hqKeuTZoqfjRLeuFmIZNz?= =?us-ascii?Q?E9do4OC2tqPGZmSB6Lr3Rw7DfIuTu7PNCOXQCvbAXUi5aarWrIWRA2tdtqcK?= =?us-ascii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9B+8/+7CkL4hzD8FhuYxrqgGc4oiP5COzZXk6i7l4m/R8vfvW4Tjml3EHW5hRlA0Pjk+15wPyIOPmUZy7nhOOfF7onpUyoI=; 24:Rls71wrECZn5ZlCvo39Jkym5lskcRj/v7o1I3Dm5gJhh/SFwEkLMtgr8+noz5r9bGyofP/NnTiTB7WaZ0LIunBZXCdrmFY9oY0cg3KhjTTE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2317; 7:kXMYXvEn7wZi2vUHRUov74u7aiTP9cOaBkt38CdGcACYQh0GpmdN5uWyka4OVHA/3hw/ixxBRe2GgxSGj8Cl93YYeArQaKRB0/gGg0eV2Q1J6mGmC++2yRi6Oqzd3RCufVPF+9aPix0mFBfm/dOhGYJNXbfPbPouq2bsfX6shDbLizIRfr64AvmC3EmhCl4b+5HaBslkYKAsm5mTOAIijflOREToIW9Y00ljjCwPvb8OjgblOBMvxdJaOraK059e X-MS-Office365-Filtering-Correlation-Id: 558fe939-4cc4-4564-7169-08d5b9828ae5 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 May 2018 10:07:46.1066 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 558fe939-4cc4-4564-7169-08d5b9828ae5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2317 Subject: [dpdk-dev] [PATCH v6 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: Mon, 14 May 2018 10:07:48 -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, v5 More updates based on reviews v6 Following review comments: prefix with MLX4_ all constants 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