From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0088.outbound.protection.outlook.com [104.47.1.88]) by dpdk.org (Postfix) with ESMTP id 781271BB16 for ; Thu, 10 May 2018 16:22:08 +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=RbSJPx0EbvIl7iQnBdsWbT2XIrW0MRIl1K6kTdjd6r4=; b=vyrdI7akAk0K6yo/gwEITKC/iBZmyQI/qXkjUeeC/fkmbut2Gk4H9sko9CC/5QaK6a2AaSBa4NtWCetL3eyJy0XawAC/Fra/ewIIqCvSITX5Em2ckHco9TGe8r8wVNRP5qp7XxO7oji/ec6v/GPh2iv/D5x5C2OkCz6hrU3NSXw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ophirmu@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR0501MB2313.eurprd05.prod.outlook.com (2603:10a6:3:27::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.19; Thu, 10 May 2018 14:22:06 +0000 From: Ophir Munk To: dev@dpdk.org, Adrien Mazarguil Cc: Thomas Monjalon , Olga Shern , Ophir Munk , Shahaf Shuler Date: Thu, 10 May 2018 14:21:48 +0000 Message-Id: <1525962108-15215-2-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: <1525904821-17728-1-git-send-email-ophirmu@mellanox.com> <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: VI1PR0902CA0019.eurprd09.prod.outlook.com (2603:10a6:800:d7::29) To HE1PR0501MB2313.eurprd05.prod.outlook.com (2603:10a6:3:27::18) 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:HE1PR0501MB2313; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2313; 3:K9XCSBnGLRCx1z3Z8Qp3den+88s1CLLiFUyGOwhA1rJKfiX7vl2HJgMeLEhwEg3mcT0c3+zMaxDO/xZBQtPZYAhBOo1j/em1akF7CYiMtcySU1SXoh5febHvQcWx7x5R6SVQONm2A2mkxKQHjTEtqxIg4QDfXy8mdqZkiS6KO2FSktQcivNcDeWjBXGFXlL6Y0RiCCen0azeeTH7KBC4g94JFEW6Wdow3ramVd4kSg1pocyXL/x57t37XXvAg4Jn; 25:jcLoSwkDAEJ83YWV/ajw76v+JfSzdjbUvBRZyuUvpCsmtFTpqsgjdIKeaDW9tQckcQbRr0vrX91txWKE15rDMo8XnAAemSnKOzpWc3pvokKQ+C7Tr1cFqdwTYq2s//86zoqpSo+ZNRe5ztONhYnb87djYn06qPMwI6jT2RBVcMVP5Uq4DuDgguK/2RJzxPJOT1jG/67YjsH4VbPn1D3cB7w2ZuC/7HbQsd1L6vHpD9z4BvuZyP1m7KNiHQLolv3WUEg8IhJIXYBsx3OM2fE5my9SCgk2LbWd+eJCnnlyEVub8lpZ2wfIlmyA4NLwFuyQVd8t0AbkCEAgopOx1x7O2Q==; 31:+Z64bjq0F5msmp1zyOjLH+hM4soSjf0D2pa3fYQKyChpd8lNjgMKjF3Ph94Q8Fjw4jKl41KtNYbS9sWPOReiixRVqsw0eG78ZRkixOLY2l8LCeCcZFcxtT3BZLR62THLcwHlHdLixQHBW7Rzm1GSpVVGlO3IaSMxFyS9FuA/yBvolYJ25dIgnjgRprIChsGT/dxmFpv9wZ1uRs1rsXsBPubZGt5f+K172qqYaNRroyc= X-MS-TrafficTypeDiagnostic: HE1PR0501MB2313: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2313; 20:zJe9O/vhRspjVuyq2/vYxfAVG6Z7anqR3+XY6+zf4Gwe4iPLWbUBa9VU9dJPBQc9DXVAcO33L4WOk4LVRdTHBCiQ5VD93e2qT3YzFC1N57nNtoydxzyYhI4BsAgpKkX+zMVpfPySTr5oVfVM9Nl0DoNHEVGhpGck61SFYt+3CPzt1lTUKhgnZONvkoSjTqvrgjscs7P2Mw+YYMn9yasOJx05iR15sdI1h/3WMGSeJrDCMSS3XydBYmGIpFBX5kDtOVQANFmc/R8+unxaAhuUBkBxbPHU5g7oylvdiUlUICAnha6ov8h8MXw3ZUNRENCG9hEDlXzx4Uwr5vR4aZa9tQ1X/aTlqU1jN3wXghfHZ699PoVf1Xckbd3dQbgRPAXDYGH1ndOCBd66YMQitvK8G4ObK1TTj1O1aojdqMTy2I0mYlBqtDuxt9S1XMfueK4DJywUFK1vAjl50PMNT1VDwAy0bcmEXuRAXcobDtUpXw1Sz+vy+ZPVU2phoZKaYnlv; 4:c+0+XHp0oCSIyF3fD3N/yZQwc8qLl32Mbg6E7v+8OgLX4+ipoGaP4DKOpbOcu7ZKyLMzn4NijxYtg+mGRE2BzM0Pz6gRIvFVml6JsU9d1MoCpnX2uWgWtEwZqAFzlkACXH+khkpTcCjDf8iqFzC6RvNdpQbK+sNCThPXpQAG91MGO5B832b9tEmrc95WJf0/98c9Q1oaZjSNTZ/Em1UHetB28lo3Af3PYx/os8KOmGhC3TV4VAvqbzTCQGM3X5AtiQw+8/OoiC0xhJ1628RC2g== 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:HE1PR0501MB2313; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2313; X-Forefront-PRVS: 066898046A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(366004)(376002)(346002)(39380400002)(189003)(199004)(305945005)(956004)(11346002)(8936002)(21086003)(76176011)(7736002)(8676002)(69596002)(68736007)(2616005)(33026002)(81166006)(6666003)(54906003)(446003)(50226002)(4720700003)(51416003)(52116002)(53936002)(7696005)(6916009)(50466002)(48376002)(386003)(107886003)(4326008)(478600001)(47776003)(16526019)(6116002)(55016002)(316002)(66066001)(86362001)(5660300001)(105586002)(3846002)(26005)(476003)(186003)(106356001)(25786009)(97736004)(486006)(2906002)(36756003)(16586007)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2313; 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; HE1PR0501MB2313; 23:yfqAxu7rJNE+4E7YFPZ5QK7zGYoUMg9a+z+RiZk?= =?us-ascii?Q?U+NKX9Sqhsue3zyR+LfxgGe5NuEKDX17zSdV9s7twBrengrYpj0sbyfGLP2a?= =?us-ascii?Q?OZ7X1XK6DRSLp2vw2enUxxCZFyKNyQT15zx6oLQsuS2Z/szRcTPIz87b2CzK?= =?us-ascii?Q?JtevI5OfrkJVbAN1Bu9kArqU3FzxgC3qi1gaTjNg01wVxnjyaNQvpVRGPEbB?= =?us-ascii?Q?7iY8jNyeeL7cxqEil3Rg6EdYCdfwMzUPbKCc8/RgAHGkQXVHNSa0BIwm+QEz?= =?us-ascii?Q?F1wYsHx0yvxgCh4cv7UoS8xsEz3ldssNN7+018fMzUxjbS9mUPg31JB5ohml?= =?us-ascii?Q?/yrHQzDpulOh/z8kQKS15GsN+l6/JqzSNuqxMyON/8XtgH476ZkVwZY6ezkb?= =?us-ascii?Q?RQgIlugPFu77jfr3t/T2JE0KqG+RSup6Tuwc2JguJ/7idsb7hU5cmg8tNkYo?= =?us-ascii?Q?jCxTbugne9XkqTZJ6pFu36/GgjhD33KnJauI9M2mUNltMgySLacO/TU+GZc7?= =?us-ascii?Q?/06cqnFOtl37tjbnDOKqO/X4ZCgqkZed3IvQGUcEsyuiydC40W4m0JiZcVFn?= =?us-ascii?Q?cumKSafqqKbzqPCeskwfmPrYujIndUEo3vic4A2uCmz4IiSyOyiHj2s6IAQy?= =?us-ascii?Q?nyv+48g2g2xyDNo2tabUauyI+ilWecdY2Lv7unOB3osInNchoH29HOfzAfHj?= =?us-ascii?Q?w4A9KXoOBHgoZoH0LIZuk9tWZptKpNdKHqUpJ64LFlSkkmZZvVJtKJU9hso2?= =?us-ascii?Q?rCW50QHLrkpANqxE2aM34HsCEdVuPW1uNt7TCU817ZrViUZZX761BDw3cOfP?= =?us-ascii?Q?NGyZX0hkvHWGrib8XPmGurzBQ06YPIOreEk9d+YaF3KlA2kBVid+PsIlWm93?= =?us-ascii?Q?V2QY+SvhZr6JeVwv2ztE5bWmQi48qEeUfUV2tDTdCHBwr7MR+eW/ItgIJ9t8?= =?us-ascii?Q?MqWlevAjsR4jAoN5CT//J+CeeXE5PmHAP6dP9hd9XmaTM8ULB1fJCQCV/j9y?= =?us-ascii?Q?vYO9LNDlTkqPJQqNi7bMUAt1mOPkc+K/2t7x0is6GOg7aZlKV4N2xCiH7l7X?= =?us-ascii?Q?HtYpPQ4CGH6QpDE08rkQA+VTqpFSaSVlVdByCk94nZiJU1Ud64hWRzYdOQwI?= =?us-ascii?Q?GEuYG/KBYZvZ/5sElvQ9soaBphF/EoCqqK2w0IwIVvJO68p48fVUFmjXFVta?= =?us-ascii?Q?eiNsSA2bzApTmI/Y/IBQrWuRVCbfj044uBO9dkf3D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n1gfIJoQArCKYuvicjmPXSPgfAJsDSrTQJ4VbSdOfvA7Vq32+esDYo4O4TGVuj/85040= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2313; 7:Zk0jgYLVg8HoQPziBZajG0OOypa0zu3e1h4mxK4EzKNclCIfhmeGFhFwlaiwxfVK4SH7a+OlQejX8xnPr/ybblAso+fP3A1YoG81paDhtsMhU2suXMY3uosihg1SLBtH48A6MeYD0yVbylac573gDXWsBMzn/9QfaJykUJA6tgHO5oC1qg3EZhqksATgh6ARmm7rea9XS1ywiEysrkms+485hmbqy6Fz4roxKrUVtdlRjAkWiVCfu2LLDJSKil2i X-MS-Office365-Filtering-Correlation-Id: 998ef2f2-d1ca-4af1-8d29-08d5b6816957 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2018 14:22:06.4674 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 998ef2f2-d1ca-4af1-8d29-08d5b6816957 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2313 Subject: [dpdk-dev] [PATCH v3 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: Thu, 10 May 2018 14:22:09 -0000 Functions mlx4_ibv_to_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 baad299..6e9b81e 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, @@ -153,7 +153,7 @@ mlx4_ibv_to_rss_types(uint64_t types) { enum { IPV4, IPV6, IPV4_TCP, IPV6_TCP, IPV4_UDP, IPV6_UDP}; - const uint64_t in[] = { + static const uint64_t in[] = { [IPV4] = IPV4_IBV_HF, [IPV6] = IPV6_IBV_HF, [IPV4_TCP] = IPV4_IBV_HF | TCP_IBV_HF, @@ -161,7 +161,7 @@ mlx4_ibv_to_rss_types(uint64_t types) [IPV4_UDP] = IPV4_IBV_HF | UDP_IBV_HF, [IPV6_UDP] = IPV6_IBV_HF | UDP_IBV_HF, }; - const uint64_t out[RTE_DIM(in)] = { + static const uint64_t out[RTE_DIM(in)] = { [IPV4] = IPV4_RSS_HF, [IPV6] = IPV6_RSS_HF, [IPV4_TCP] = IPV4_RSS_HF | IPV4_TCP_RSS_HF, -- 2.7.4