Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5ACD3C678D5 for ; Wed, 8 Mar 2023 02:23:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229845AbjCHCXJ (ORCPT ); Tue, 7 Mar 2023 21:23:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229548AbjCHCXD (ORCPT ); Tue, 7 Mar 2023 21:23:03 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2043.outbound.protection.outlook.com [40.107.223.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08638231C2; Tue, 7 Mar 2023 18:22:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fRqwW5tZmh/5JdwZCBbE+53X0IkvohwPVAQCcz50WAymbqV9bw51LcthbQwpP3WKOEaTjq+pzjxruxXyEWzm0NFG2v9u6s7nY3cPswBsK6qu4V+av31Ks+/Bk4tDlAbh/dL5yfU+xIhrMQq5YNMJIrxNYg7sLCo9MUi2iBExpKLajOtwATtZz6CNY+Ec2UkifAzNyKanZsur/yUhbBJD9tgsnWnw+ZSfKJ06Ef1HtIfYFEFe7E74Pb/V1zM5tDz9aZSZkupxRiaMojibk1D3amH1ucb7JM9ihtn8k7XN+BIEMkEYmIRk8x3N1PAyYVfrAz3KE+F6vmDbRoL66lpOsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uXQICaYbjVhSgwB3/rQW2VnA0rIBhMis7hWQzTnzXG4=; b=duwN0dj68ZTX2ouaS7qDa8wMYHY1QqaixsujRxXq21GyRkSeFBOeHenkWkIQ1/A/BpPTdA4UhDHcgsFBh4li8zdhnuToU6Hsg9iG/pCVpJIOhpYClnf725lE2U8LwPSEaN9OWW21X7Dhm7fxadufu1OrOtGL+wUxPKfr3SsptZmxf6VlstT2kWWhCXNS8hE6foslU0t1mzd/L94bnA7kZvYB8lK2AhGd9zTzcQnPRPGhT7DFaYDqvY1IkY+NeZjHHkxbsIiYop4JXOlYjjngwUs9fYlG6wmZCy5mm55XGa9rQjjgW4vjOrw8/ixutxWXAd0pQp7Xfd1BbN+7szYC/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uXQICaYbjVhSgwB3/rQW2VnA0rIBhMis7hWQzTnzXG4=; b=EC6iY1NqdJ3MwYfjYJmPG45skdkHJ06O8zyi2CXR4MLeG70V065RDr9qm/XIRJlFv93ekh1LlcH0f8TIRaA5y2GaKNMC17IHgr17A6vZvEJpdbzUHEdafs+3VX91RxY5v5gq20GbSro+E2rIRjPt7ucUpnkfB5/s9b1H79EcY6Quh8leUm9EYs1XnJ5V7SsuBKjTMzvMc33K6LBDNX50KD1mKgo5sypz38uMoQQP+Zn/JymC8ROZYWhdb1rg5DLX1EwwSyJRuyrhfoqCLoHwoEyllO2tSiUwAkAsGBjXtaWwQivnC++PiWaYWFoSwK7OFxP8Gf1xVcP5qhgqK6sIcQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB3835.namprd12.prod.outlook.com (2603:10b6:5:1c7::12) by MW4PR12MB7214.namprd12.prod.outlook.com (2603:10b6:303:229::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Wed, 8 Mar 2023 02:22:54 +0000 Received: from DM6PR12MB3835.namprd12.prod.outlook.com ([fe80::4963:ee4e:40e9:8a0b]) by DM6PR12MB3835.namprd12.prod.outlook.com ([fe80::4963:ee4e:40e9:8a0b%4]) with mapi id 15.20.6156.029; Wed, 8 Mar 2023 02:22:54 +0000 Message-ID: <3ed82f97-3f92-8f61-d297-8162aaf823c6@nvidia.com> Date: Wed, 8 Mar 2023 10:22:36 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH RESEND net-next v4 0/4] net/mlx5e: Add GBP VxLAN HW offload support Content-Language: en-US To: Alexander Lobakin , Simon Horman Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, roopa@nvidia.com, eng.alaamohamedsoliman.am@gmail.com, bigeasy@linutronix.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, gavi@nvidia.com, roid@nvidia.com, maord@nvidia.com, saeedm@nvidia.com References: <20230306030302.224414-1-gavinl@nvidia.com> <1abaf06a-83fb-8865-4a6e-c6a806cce421@nvidia.com> <7612377e-1dd0-1350-feb3-3a737710c261@intel.com> From: Gavin Li In-Reply-To: <7612377e-1dd0-1350-feb3-3a737710c261@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR01CA0172.apcprd01.prod.exchangelabs.com (2603:1096:4:28::28) To DM6PR12MB3835.namprd12.prod.outlook.com (2603:10b6:5:1c7::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB3835:EE_|MW4PR12MB7214:EE_ X-MS-Office365-Filtering-Correlation-Id: 79095150-0ff9-4064-2959-08db1f7c05fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mNkOFcAl6tTj1Rxlrwlr/tI4wRTmml5/PrpqFdcGz/vOAc+lGHvrYn/a/VNXffl37pBzE6Ia+sDk3LxlwTjI79A1gEXT0SMm2KIr2f7mNulYCvoQl97oYkIPi4m9xiq+15sN8rK2MhFthjq2mAhxVM3V0EHtNA5Cg6CLzPbhBu2/QHwN3a4MESlG96h2+p9eLwloLN2+rrQD6FGEgRyZx8/wo3UKXmy+9QieHJd0WQlXLklMssA/wJxU43u2oqhfLtPGMUs2wLiLxCv7OBGC3sbQXv8IoJoJ5L6aYTD/in3rJ1oIX20dOmJvgWuW7QnAvkLW/aR99o+g3phzSuO7koBDJxq/3oSEuYhP+KkM243EvpwhB5l0aCuWJKPMasrQOaMpWvTkOY/cfxceK0y2Pp1viHqhZGPeCTI7cPrjMAgCj+9Rd9aAeW4eDb0zpPsZgzRkuXbZHWrLf3/AUyD3WdqZ8QQoD2r3gaiyjnGdyMWYqDUtP3coWvNsVPR3CnUtl7DSpy3tgnQvHOGJmVRkPASsYa1Gl7pq0owGdjKal27w5HNBfHiV4e3ZDZosuI0116KJ3lYDB+LYZm8hveMEhpkCGLE4j7rR28tpJekvJD5/stZM4n+WZoyzTdH0jKDS7/tRxwkYktjXJfAlNrUhYbR3evKb97LYD7QBovECbSUs/dRPNIgA483tk437I9F1fYat1GXAJWu/YPPotlfT2zj7AqnMsG6Jvth7nH/ABvZKFZQiSmXX45+HBHvWYEah6WZP1Pd7ZHlqTvCJT3/xzKFQfHybdTc7cSYr+kUS5VB4xX4DZIpocjZ17ZAwrOuz X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3835.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(376002)(366004)(396003)(136003)(346002)(39860400002)(451199018)(66476007)(66556008)(66946007)(4326008)(8676002)(2616005)(107886003)(6666004)(6486002)(966005)(36756003)(7416002)(5660300002)(83380400001)(316002)(110136005)(86362001)(38100700002)(8936002)(478600001)(31696002)(186003)(2906002)(41300700001)(31686004)(26005)(6506007)(6512007)(53546011)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NVBiaFlON0ZtTmE1aHNmSjlJdS82TkZwdGgyRzdRKzI1TW41NkJaamdyNGcr?= =?utf-8?B?STFSY2lENGdLNlJTaFoyVDlXdlkzYWlrZnl3VWVQK1ZiMWVZWFFwL3p0QmV4?= =?utf-8?B?bm51N1VSN3BzL29zUElObjRvNllwRjYwQzJrZEdKa2l1NjBYbFA2ZCtmMVFv?= =?utf-8?B?aG9xTXRoSzhDb25uRFJJeHpuTU1SMDROaysvcmJuSWd0Z1JVZ3VXVFFPelV4?= =?utf-8?B?THg2Mk0yVmdxZEhXSklSUWEyNE9JR0ErK3c1cTJKY3RJTko3Z0d2eTJwTnEy?= =?utf-8?B?TkwzQ0p5V3pWdWZoZlErM0kyV2VvbWg3ZU0zNmtzTE5DYjQ1STV3TC85SXFz?= =?utf-8?B?RS96OXlMM0NDbUZMeU01dGxvQlhiQ25KTUtlOFZUOHBNd2tJVlV5Ym5lQ2dZ?= =?utf-8?B?THhjazhneW03UkgwQmlFdXBJbFZ4eHpJL3RPN2ZLYUVaSGNEVVVnTXIzdUdu?= =?utf-8?B?WjVhTGF3Q0ZvYm5aWUlSamMveVRrTW42VDdva1ppamErdWZoMlpTNXZOYnhI?= =?utf-8?B?MWlCQURscVFRVXhwRlZiYmt2dW9iOFNpUmdmQzJ0S0RnTU92ZmhnaEJqR3Qz?= =?utf-8?B?YTNacDJQQUp5a3l5LzN0dzE5MTFPeFNiaVVhNnR1Y05QTHFQVEJLU0Fx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2xPT1hFaG9MMnRSRUxUbkgw?= =?utf-8?B?eHRVM0NIWm9QQW5qVjVJSGcyNUh5ZEs4L3RKTWo5R1BnaEJlSE01OTN3TUta?= =?utf-8?B?VkNTT0RmcDNITDZGajM2Y2dFblIvcklDNVA2Q2cyQW9VWC8wcFdoejZ1Wlha?= =?utf-8?B?YXZFTEkzcmpPTUxlVUNEOVFCbDA5VTZDVnhQMjF1WFZDTDlpUGRkUlQvZkln?= =?utf-8?B?NmpuLzIrMmVvTVdEdmhESE1aQUttNVpMa25wWjVJMjl5QTRuVHBOWVJjZ05Q?= =?utf-8?B?cDZNdXVBR2luWWxCNWgvT1hxOUZxcVhaQTRteFFzdjRONnl4YU9DRU53Q2hK?= =?utf-8?B?OWh5eXNnRVFqRUs1ZWNCa1c2a2ZsTVpFYVRwVCtRaEk5RG8yUGE2VStrb011?= =?utf-8?B?QXdTMzBSV0N5TXpubWpxdSs0VUppQWpxOEs2QTdJd2xob1V0SHh1WDVNYW5z?= =?utf-8?B?cFhKb0EvaFdhalFJVHF3NjkvRStiV0l0RlNPdnEzYklMQ0dkVzhpVzJQbC94?= =?utf-8?B?eGJnWVFQMWJRMHFraXJqbGE5TE9LQU1WcGNlWGRlVHB3d080c1RJRHBOVGt2?= =?utf-8?Q?/sIh1dqacHU4aeYkhEkmPBYpf?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79095150-0ff9-4064-2959-08db1f7c05fa X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3835.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2023 02:22:54.4586 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4Jxn5mbq/hrXZIVo9mAQZPKX7+0ICP1Iyz7PuX3/GYbKG9mRaXPYkI8LK6qBLdYqI7djitHptgNsLvFDraMKcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7214 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/8/2023 12:58 AM, Alexander Lobakin wrote: > External email: Use caution opening links or attachments > > > From: Gavin Li > Date: Tue, 7 Mar 2023 17:19:35 +0800 > >> On 3/6/2023 10:47 PM, Alexander Lobakin wrote: >>> External email: Use caution opening links or attachments >>> >>> >>> From: Gavin Li >>> Date: Mon, 6 Mar 2023 05:02:58 +0200 >>> >>>> Patch-1: Remove unused argument from functions. >>>> Patch-2: Expose helper function vxlan_build_gbp_hdr. >>>> Patch-3: Add helper function for encap_info_equal for tunnels with >>>> options. >>>> Patch-4: Add HW offloading support for TC flows with VxLAN GBP >>>> encap/decap >>>> in mlx ethernet driver. >>>> >>>> Gavin Li (4): >>>> vxlan: Remove unused argument from vxlan_build_gbp_hdr( ) and >>>> vxlan_build_gpe_hdr( ) >>>> --- >>>> changelog: >>>> v2->v3 >>>> - Addressed comments from Paolo Abeni >>>> - Add new patch >>>> --- >>>> vxlan: Expose helper vxlan_build_gbp_hdr >>>> --- >>>> changelog: >>>> v1->v2 >>>> - Addressed comments from Alexander Lobakin >>>> - Use const to annotate read-only the pointer parameter >>>> --- >>>> net/mlx5e: Add helper for encap_info_equal for tunnels with options >>>> --- >>>> changelog: >>>> v3->v4 >>>> - Addressed comments from Alexander Lobakin >>>> - Fix vertical alignment issue >>>> v1->v2 >>>> - Addressed comments from Alexander Lobakin >>>> - Replace confusing pointer arithmetic with function call >>>> - Use boolean operator NOT to check if the function return value is >>>> not zero >>>> --- >>>> net/mlx5e: TC, Add support for VxLAN GBP encap/decap flows offload >>>> --- >>>> changelog: >>>> v3->v4 >>>> - Addressed comments from Simon Horman >>>> - Using cast in place instead of changing API >>> I don't remember me acking this. The last thing I said is that in order >>> to avoid cast-aways you need to use _Generic(). 2 times. IIRC you said >>> "Ack" and that was the last message in that thread. >>> Now this. Without me in CCs, so I noticed it accidentally. >>> ??? >> Not asked by you but you said you were OK if I used cast-aways. So I did >> the >> >> change in V3 and reverted back to using cast-away in V4. > My last reply was[0]: > > " > You wouldn't need to W/A it each time in each driver, just do it once in > the inline itself. > I did it once in __skb_header_pointer()[0] to be able to pass data > pointer as const to optimize code a bit and point out explicitly that > the function doesn't modify the packet anyhow, don't see any reason to > not do the same here. > Or, as I said, you can use macros + __builtin_choose_expr() or _Generic. > container_of_const() uses the latter[1]. A __builtin_choose_expr() > variant could rely on the __same_type() macro to check whether the > pointer passed from the driver const or not. > > [...] > > [0] > https://elixir.bootlin.com/linux/v6.2-rc8/source/include/linux/skbuff.h#L3992 > [1] > https://elixir.bootlin.com/linux/v6.2-rc8/source/include/linux/container_of.h#L33 > " > > Where did I say here I'm fine with W/As in the drivers? I mentioned two > options: cast-away in THE GENERIC INLINE, not the driver, or, more > preferred, following the way of container_of_const(). > Then your reply[1]: > > "ACK" > > What did you ack then if you picked neither of those 2 options? I had fixed it with "cast-away in THE GENERIC INLINE" in V3 and got comments and concern from Simon Horman. So, it was reverted. "But I really do wonder if this patch masks rather than fixes the problem."----From Simon. I thought you were OK to revert the changes based on the reply. From my understanding, the function always return a non-const pointer regardless the type of the  input one, which is slightly different from your examples. Any comments, Simon? If both or you are OK with option #1, I'll follow. >>>> v2->v3 >>>> - Addressed comments from Alexander Lobakin >>>> - Remove the WA by casting away >>>> v1->v2 >>>> - Addressed comments from Alexander Lobakin >>>> - Add a separate pair of braces around bitops >>>> - Remove the WA by casting away >>>> - Fit all log messages into one line >>>> - Use NL_SET_ERR_MSG_FMT_MOD to print the invalid value on error >>>> --- >>>> >>>> .../ethernet/mellanox/mlx5/core/en/tc_tun.h |  3 + >>>> .../mellanox/mlx5/core/en/tc_tun_encap.c | 32 ++++++++ >>>> .../mellanox/mlx5/core/en/tc_tun_geneve.c | 24 +----- >>>> .../mellanox/mlx5/core/en/tc_tun_vxlan.c | 76 ++++++++++++++++++- >>>> drivers/net/vxlan/vxlan_core.c | 27 +------ >>>> include/linux/mlx5/device.h |  6 ++ >>>> include/linux/mlx5/mlx5_ifc.h | 13 +++- >>>> include/net/vxlan.h | 19 +++++ >>>> 8 files changed, 149 insertions(+), 51 deletions(-) >>>> >>> Thanks, >>> Olek > [0] > https://lore.kernel.org/netdev/aefe00f0-2a15-9a43-2451-6d01e74cc48a@intel.com > [1] > https://lore.kernel.org/netdev/ca729a48-35a1-ef05-59d3-ef1539003051@nvidia.com > > Thanks, > Olek