From nobody Thu Sep 11 18:26:02 2025 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 883B5C6379F for ; Fri, 17 Feb 2023 03:40:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230231AbjBQDkD (ORCPT ); Thu, 16 Feb 2023 22:40:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbjBQDkB (ORCPT ); Thu, 16 Feb 2023 22:40:01 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2050.outbound.protection.outlook.com [40.107.223.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C8C13B3E9; Thu, 16 Feb 2023 19:40:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HSGF5eVU0gmW50uZBYL5e8spfnHO68uW94YlCYXNl4zF6lHgg8zTmGs/r2suErSoxwYd3QyNNclNAu4eFOqpHoEPiwSdB8TV8uc8oNrYSpa9DGErP/u5+klPKNCl+mwIT2lmbblpUkuwiKG4rmEM/zTmeG0GYb9YjCvRkiVvw3Hh33gFB6VXvMgfASSxirZO/l+/FKjflbXM8XJtqLoAdYhrEgRNGQkX+oai0c5PLus66xKC4nI7wGang3s4NnxK4bqtjjekUWCZ0F6zYIINeNhfu8PWsHOITlvuZFIo5aBF7nagNzYGDLngbXfMLkUtSne+bCK+l9q6Y4Drbf+Xiw== 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=RINZz/xH9T6HMe50zjnVWntOeXzKKmq93VvSIXSHb0Q=; b=ZCuQPE49F/EAWgfCz5Mf8bTjmP2Gyh+NfCkj9JKHGa1goIPC5NFb4IHHOxdZPr0Bj7jajuvkAEbWfhVd0tVAkA6d8Ue1yGaTvg03rB2PmlrO0GYWGBnoxA+MPKHRRSOAOXUBIYyX7A+ieW5bBgYhj8IH8fDb7NlRMsW1xfpgorMb64PZaCNeNRQhQxcwoRA4CaWbC5LbXjiXbBywaGGdFuVALTxwWLGdZ57vFpG+9jK9TH5yV5Xuykz4zOl9sbqGTU8DDlFCnQ8l7rJpotjz2SF6qMR4RBiNnU7KdO03AyscB5cShJijXn7vuzLSPip7DVFFJzZTHTqrTuL3igdzLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=RINZz/xH9T6HMe50zjnVWntOeXzKKmq93VvSIXSHb0Q=; b=DmfAdzV1GcCCwpXMqMdfXBFTvPF3spDGNiiaK+j0Oc+0ggWqhm6lgSYsKG/r7E6TWs12Msrnswe6HlUkrBMwtmQ6N2ABxVdOs3BlmF32QmeK5u3ZAEVW78GOH7K2WJYbM78Fcag10voladB6wHENlNPxAu6+Nmp9qrxsi5fIKHISGh2h9dWT0z2fSmWmqOIMOug5vE1C8OeJuTRZ4ol+KElkweoOPDMX0Xzs+sWkn8uxTNrEfTcJrKDYPgR27Ip1+58U7pwBcPEEv1rbzWR5lqZx86JxCiLy6K0qfmEymLk4IxEByI8KQds7+t/v9aF/K73g8sr+svb/Uzi602/jsQ== Received: from MW4PR04CA0117.namprd04.prod.outlook.com (2603:10b6:303:83::32) by BY1PR12MB8447.namprd12.prod.outlook.com (2603:10b6:a03:525::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Fri, 17 Feb 2023 03:39:56 +0000 Received: from CO1NAM11FT084.eop-nam11.prod.protection.outlook.com (2603:10b6:303:83:cafe::5a) by MW4PR04CA0117.outlook.office365.com (2603:10b6:303:83::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.13 via Frontend Transport; Fri, 17 Feb 2023 03:39:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT084.mail.protection.outlook.com (10.13.174.194) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.13 via Frontend Transport; Fri, 17 Feb 2023 03:39:55 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Thu, 16 Feb 2023 19:39:48 -0800 Received: from nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Thu, 16 Feb 2023 19:39:45 -0800 From: Gavin Li To: , , , , , , CC: , , , , , Subject: [PATCH net-next v3 1/5] vxlan: Remove unused argument from vxlan_build_gbp_hdr( ) and vxlan_build_gpe_hdr( ) Date: Fri, 17 Feb 2023 05:39:21 +0200 Message-ID: <20230217033925.160195-2-gavinl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230217033925.160195-1-gavinl@nvidia.com> References: <20230217033925.160195-1-gavinl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT084:EE_|BY1PR12MB8447:EE_ X-MS-Office365-Filtering-Correlation-Id: d6a75b6c-ab22-4d43-92a0-08db1098a2d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FW7cEsqB1qJU6qc/jdbyQ7DuJgGq2znfU04EI5cz2rODtiJgiqwTpH96AqKST2H+LEPueIXdOX+DFYA46q5evvcYVWWeXwX4hjz6c+/DIqhSQ30Qfipp9EALGrIfhP/Eq4dd73vJSZKzLv9fjhDmrpCFTRoaO6P7bdriiR6Biw6jOkJcTFRoNxn5pzqqL5o1rM+6KjnOBIrW+6R2DXhzTvQm5Eqmz7A6p1Jl5BeYdqbNFkVxBlfMcHFAPyrkvtPuAe4x+ORYjCGDOsiAFay+r9oe/jJEiNSsyomKaNzpz6y042x4mBbnBlQs2xQccg2tEyEr48HL8SiQC4iSUN+aUHrKqD1LEklF4xaDtxsxesT4HXhnbSJ+dyuJRBOz/ZUBbvCmhrIalXT7NklcinnCDIf5D8Dux63oQbysEWKzgzIt0n/xXM27kSGrylZGL5Y6v7J5KI10aJuulKmoP5lB7G/mNqJjycCal8Aw9ZejpaUYCR/BAeGpDimXDSKkmL8UIVl5h566/vD4aPHCa75q/y5b5E9DKspdBT2HJEW44CYmw51Ngz1pboQziH0cHJiNG1jTBIaamtkNgnNfzwuEFiCUIdblcOI96XqEG5DrMpfwzJ5j2+Ukwpu06KeZKwmKK+efpM87/rLxo9sd4RMp96QMUMFm1OPVDdjN/ZzqZjRYZRUU+e6VDPnx8BTjUoIh3i5cH3bvMZ1y757UBZ6jtw== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230025)(4636009)(396003)(136003)(39860400002)(346002)(376002)(451199018)(46966006)(40470700004)(36840700001)(316002)(8676002)(4326008)(8936002)(70586007)(70206006)(54906003)(110136005)(5660300002)(2906002)(41300700001)(7696005)(55016003)(478600001)(16526019)(186003)(2616005)(26005)(6286002)(107886003)(1076003)(336012)(6666004)(40460700003)(36756003)(83380400001)(40480700001)(47076005)(426003)(7636003)(36860700001)(82310400005)(356005)(82740400003)(86362001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2023 03:39:55.5164 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6a75b6c-ab22-4d43-92a0-08db1098a2d6 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT084.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR12MB8447 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Remove unused argument (i.e. u32 vxflags) in vxlan_build_gbp_hdr( ) and vxlan_build_gpe_hdr( ) function arguments. Signed-off-by: Gavin Li Reviewed-by: Simon Horman --- drivers/net/vxlan/vxlan_core.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index b1b179effe2a..86967277ab97 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -2140,8 +2140,7 @@ static bool route_shortcircuit(struct net_device *dev= , struct sk_buff *skb) return false; } =20 -static void vxlan_build_gbp_hdr(struct vxlanhdr *vxh, u32 vxflags, - struct vxlan_metadata *md) +static void vxlan_build_gbp_hdr(struct vxlanhdr *vxh, struct vxlan_metadat= a *md) { struct vxlanhdr_gbp *gbp; =20 @@ -2160,8 +2159,7 @@ static void vxlan_build_gbp_hdr(struct vxlanhdr *vxh,= u32 vxflags, gbp->policy_id =3D htons(md->gbp & VXLAN_GBP_ID_MASK); } =20 -static int vxlan_build_gpe_hdr(struct vxlanhdr *vxh, u32 vxflags, - __be16 protocol) +static int vxlan_build_gpe_hdr(struct vxlanhdr *vxh, __be16 protocol) { struct vxlanhdr_gpe *gpe =3D (struct vxlanhdr_gpe *)vxh; =20 @@ -2224,9 +2222,9 @@ static int vxlan_build_skb(struct sk_buff *skb, struc= t dst_entry *dst, } =20 if (vxflags & VXLAN_F_GBP) - vxlan_build_gbp_hdr(vxh, vxflags, md); + vxlan_build_gbp_hdr(vxh, md); if (vxflags & VXLAN_F_GPE) { - err =3D vxlan_build_gpe_hdr(vxh, vxflags, skb->protocol); + err =3D vxlan_build_gpe_hdr(vxh, skb->protocol); if (err < 0) return err; inner_protocol =3D skb->protocol; --=20 2.31.1 From nobody Thu Sep 11 18:26:02 2025 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 9AACCC05027 for ; Fri, 17 Feb 2023 03:40:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230292AbjBQDkJ (ORCPT ); Thu, 16 Feb 2023 22:40:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229759AbjBQDkB (ORCPT ); Thu, 16 Feb 2023 22:40:01 -0500 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2070.outbound.protection.outlook.com [40.107.94.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D56083B857; Thu, 16 Feb 2023 19:40:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JidHVTilbipzgri+4b94ACMPKfvTLRPwNMkSkG1dwC73HC/Q8A/PC6GOjcDs/uY95FzoO5hKydcVGBtmPJt4GqRkZvX0f2l5P63Xs8fJ6JpL4g/hAGj+nM+IeWSCkrbXm+azpIUMh2jdj0BdH7lJg8TIAKxWXGQOSD9VQqm49GQH0X4G2TiaRtSaUX3GA0FaQgZFzIY8QyMmfMmaRJN/zIczcdPgNIDIouJma3HAFXyFEIZY+PkITO+rHLyDXlN6wcWstPYJjGfimqX5j5Mk8dX+sYPQCkpqr/CWBIG17mwQAhOXT7XnkCT9M/Ojn+pxQ0+gPt1aUFs7JP9xKuFkXw== 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=DP6KBrTCW9IDFLyQlWF4wk7iQ5RxjbmtDNxyDYA5wjw=; b=eicg4OBZ3Ax2U7TK/OkfB66LFxerzeoNKxPbnC3F9+O4Ot/wp5GrUjM2RXmN4JKp0XkcBhZiRrmo72zWLhHgse/3KB39/FGeXu/0vamXmsWPQCkmhnTEvnrvkVpRBM11LOTBGwmgSLqwe1AqyY3HytBUXmy1r6U1uzUuReVMtNco7NyuwMnW9CmtM1kUAnQBoNoBkCPsbNwJdMlgXzNWQVOWt8+82yJXpgb1+3vONTpY/9PDLyy8758oa/9MbrAbr6ZsF/z/eXwvfZQ4LbNZNrwXkaEjV6pP73y7t4hD+JXQJrh7vjihovaWWBA5vXoX5G7YVQR5YjNY4y+ksJejpw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=DP6KBrTCW9IDFLyQlWF4wk7iQ5RxjbmtDNxyDYA5wjw=; b=IHz4PltutqPF5z+aCwOmEsZ0y6fERkpw/zwN5F8cRBjMspr++z86KJIBtx/zOMYfE3QuAhYyzMuZ61fcRpT5e1fhc3krvoelYXg8wXkP6apY25IooG+oUL0ZeicQgJr8mJAXzWRBjAw5PwuAstExuHfdjNGBAl+LfyQljT4l4apWb8M70U+aOXAGr0ZaW+4GLYPbRQN3sU9T/OILPOeRsUTtadv447Jmdok0SORhVsowjm659/nT3fMOHRKtUF62HheyR1FDPku/wX4+WRXQ43dwGl8C5A9EzCClvQkS2T6Bs1IrUpaba2zcFXiA2OfeN24aasiour9Cj1WnMgnUVA== Received: from MW4PR04CA0119.namprd04.prod.outlook.com (2603:10b6:303:83::34) by IA0PR12MB7724.namprd12.prod.outlook.com (2603:10b6:208:430::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Fri, 17 Feb 2023 03:39:58 +0000 Received: from CO1NAM11FT084.eop-nam11.prod.protection.outlook.com (2603:10b6:303:83:cafe::f2) by MW4PR04CA0119.outlook.office365.com (2603:10b6:303:83::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.13 via Frontend Transport; Fri, 17 Feb 2023 03:39:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT084.mail.protection.outlook.com (10.13.174.194) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.13 via Frontend Transport; Fri, 17 Feb 2023 03:39:57 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Thu, 16 Feb 2023 19:39:52 -0800 Received: from nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Thu, 16 Feb 2023 19:39:48 -0800 From: Gavin Li To: , , , , , , CC: , , , , , Subject: [PATCH net-next v3 2/5] vxlan: Expose helper vxlan_build_gbp_hdr Date: Fri, 17 Feb 2023 05:39:22 +0200 Message-ID: <20230217033925.160195-3-gavinl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230217033925.160195-1-gavinl@nvidia.com> References: <20230217033925.160195-1-gavinl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT084:EE_|IA0PR12MB7724:EE_ X-MS-Office365-Filtering-Correlation-Id: a91eb9c2-064d-4c2d-6826-08db1098a437 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Hq+Z86nQ7zBpxJsIOpBMdqFEuXwrJBtHYCBCMTLgNWxpAtOLpA9netv0bbgkU0+iL2WZ+l7vV9ZtJGsbfBi99EPFn5TPnOsUZyDY71hQJfIeNoHnknyr63btnGVlEqz06NVwrDWpF2II5jjqZJulttbKkzqRfI4aQUgpr72TUCHC354ENXO9DbdKapjfDi/2+uIzXbL84gwkM57niEuIzIohWf4kR8PXLq56+su09aRYTAHIUDvlGPmeGBJfGSEOb9/ZHsaBbNUl4Rrb9LgYvWkhp+YVzoIfJLpm7gr5dSM6/eETZ9xlJGFkJzKEjMDFm55IpvBbU4eZWdxrOnV+iwyDO0/DrYiU2/qYe+qoQz56r6xI63GfQG26UzNV2gGH7uealAsw3o54F+/cMsH0Pe9SVEmVenWJH34ry227vyfcZebCE12MLEkdoxOv+fQ3Q8j4jyYiVXlnPCmA86dsg3KGNomMxPvi0jSvuX4kZ1OlpOukv3UYsD3KkvnwyPnRt4NQbuz7pxKC8dVN9NobsvaskAnq/lrbHsAkwr+MzCrBUdl7Dvzd9KAuwezDCT9AZelpyn8rvz5RFptyW4/mGL7rcLWh8nvaEQ98TF1itrV6F2k+t9zOdmY77C8BMq5qnflvVcAzKjHLBA7Kco2tny2CKKEREhTtqV5/l/c2PGizN1OjTAAeHzR3ZjJbha1gCjupsg1p5g8SiLkGxvrdYw== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(136003)(396003)(376002)(346002)(451199018)(36840700001)(46966006)(40470700004)(36860700001)(7636003)(82740400003)(2906002)(82310400005)(47076005)(83380400001)(426003)(336012)(2616005)(86362001)(478600001)(107886003)(36756003)(6666004)(5660300002)(356005)(6286002)(41300700001)(186003)(55016003)(7696005)(4326008)(70206006)(110136005)(70586007)(1076003)(54906003)(316002)(40480700001)(40460700003)(8676002)(26005)(8936002)(16526019);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2023 03:39:57.8287 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a91eb9c2-064d-4c2d-6826-08db1098a437 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT084.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7724 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" vxlan_build_gbp_hdr will be used by other modules to build gbp option in vxlan header according to gbp flags. Signed-off-by: Gavin Li Reviewed-by: Gavi Teitz Reviewed-by: Roi Dayan Reviewed-by: Maor Dickman Acked-by: Saeed Mahameed Reviewed-by: Simon Horman --- drivers/net/vxlan/vxlan_core.c | 19 ------------------- include/net/vxlan.h | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index 86967277ab97..13faab36b3e1 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -2140,25 +2140,6 @@ static bool route_shortcircuit(struct net_device *de= v, struct sk_buff *skb) return false; } =20 -static void vxlan_build_gbp_hdr(struct vxlanhdr *vxh, struct vxlan_metadat= a *md) -{ - struct vxlanhdr_gbp *gbp; - - if (!md->gbp) - return; - - gbp =3D (struct vxlanhdr_gbp *)vxh; - vxh->vx_flags |=3D VXLAN_HF_GBP; - - if (md->gbp & VXLAN_GBP_DONT_LEARN) - gbp->dont_learn =3D 1; - - if (md->gbp & VXLAN_GBP_POLICY_APPLIED) - gbp->policy_applied =3D 1; - - gbp->policy_id =3D htons(md->gbp & VXLAN_GBP_ID_MASK); -} - static int vxlan_build_gpe_hdr(struct vxlanhdr *vxh, __be16 protocol) { struct vxlanhdr_gpe *gpe =3D (struct vxlanhdr_gpe *)vxh; diff --git a/include/net/vxlan.h b/include/net/vxlan.h index bca5b01af247..b6d419fa7ab1 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h @@ -566,4 +566,23 @@ static inline bool vxlan_fdb_nh_path_select(struct nex= thop *nh, return true; } =20 +static inline void vxlan_build_gbp_hdr(struct vxlanhdr *vxh, const struct = vxlan_metadata *md) +{ + struct vxlanhdr_gbp *gbp; + + if (!md->gbp) + return; + + gbp =3D (struct vxlanhdr_gbp *)vxh; + vxh->vx_flags |=3D VXLAN_HF_GBP; + + if (md->gbp & VXLAN_GBP_DONT_LEARN) + gbp->dont_learn =3D 1; + + if (md->gbp & VXLAN_GBP_POLICY_APPLIED) + gbp->policy_applied =3D 1; + + gbp->policy_id =3D htons(md->gbp & VXLAN_GBP_ID_MASK); +} + #endif --=20 2.31.1 From nobody Thu Sep 11 18:26:02 2025 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 C949EC6379F for ; Fri, 17 Feb 2023 03:40:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230271AbjBQDk1 (ORCPT ); Thu, 16 Feb 2023 22:40:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbjBQDkW (ORCPT ); Thu, 16 Feb 2023 22:40:22 -0500 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2084.outbound.protection.outlook.com [40.107.94.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A1985B2FD; Thu, 16 Feb 2023 19:40:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zl66N/9pq1X3UrY12n3g/guyjEUUha7+w27RO6fpwaEpsnZ0WkGSD+VoekgohQDX7UBUy5XZX/ngTSTtVDh37krfXsYDvh4BVQKZMOOx+U8IMa/intXWL17laY9KQ1VKjePY0CIKgTbv77xjREbjiGHal4nSgEQGq8sypUuHXOijvsVG6vcUR6boOpjlF6VeLlu3XC2HKhXt6SmlG6sp/wq4dDpYKsORSO9M4ptjtI5Ij7q+M/xS3Xk3inN34MAVZHyxmX6V6FPS/pyhB6Zo7kS4PkGHLOqRax8HwlCh8rTwRqe/Z6mzXdBvzzuHTnFEgA0BzlnYtWJR/7JVn80Eqw== 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=IzVsdjsnF/Vm2FAg37jtKuyrnIPpmX5DxdStb0gHxSs=; b=LrHDXNuEPB9GfUObYlSwZZ4tkkxo9JK+zwi/93+6iK0zh7JWZ7WtPMSQpVf3cWzgmTYTtFzF5Eix3rEGPPk4M6kjFp3SX1vF+n+GpJ30kzcjadMZmTZKOy33rgRD73stbgYbdk0cnt4/y8SuZuDcjsPBwZSWYBYQbmawCwOEka9tSH1jQGWrXVXnIAUaxcKVAEH2O1bgAqQEEc5TCA1VD9N8Scg039YyuDIK0SphJeXw8Ui2X/0vRZbd7WHjcPXKNhVlTSNHUZpTlaIi5xXs86nErzVEFrqqveHyD64TrdYE0zOT16t//gSSeQzhw2aF59CWk1tEsf6SLflgecuTCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=IzVsdjsnF/Vm2FAg37jtKuyrnIPpmX5DxdStb0gHxSs=; b=nh2Zdtv9d9w+O2d6W3mIx2+HYzXHA0AY/BgDN9aton82PNpAngrMM9fz3RanQ/iJYJWz9zF6RaxjSuu0I7ogt9ha8SaCCQkWfFQzjW4xZrilKx2B/4N1Eri7HPsEr7vSyR8RlmLrUOlh40f68mWqYBKV5VGxr76AbAF3B4Q7z3UK/gdNNKP6JE/Qq5sKqpqUm0d+trvZp/GSNR4znHS3rhiP0HeGMD0HXMzarBbaptw+fu3SSXg5L1v/5snOR8op03/gMHetB/6NhBYuvfKQdqokSEKnKdQaEWqZn7rQEQP6ca6c/bKD5Twz2xHdMmXZECqFPXjOcvjVbe6TVCyuHA== Received: from BN9PR03CA0325.namprd03.prod.outlook.com (2603:10b6:408:112::30) by CY8PR12MB7098.namprd12.prod.outlook.com (2603:10b6:930:62::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Fri, 17 Feb 2023 03:40:10 +0000 Received: from BN8NAM11FT004.eop-nam11.prod.protection.outlook.com (2603:10b6:408:112:cafe::7d) by BN9PR03CA0325.outlook.office365.com (2603:10b6:408:112::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.13 via Frontend Transport; Fri, 17 Feb 2023 03:40:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN8NAM11FT004.mail.protection.outlook.com (10.13.176.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.15 via Frontend Transport; Fri, 17 Feb 2023 03:40:09 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Thu, 16 Feb 2023 19:39:56 -0800 Received: from nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Thu, 16 Feb 2023 19:39:52 -0800 From: Gavin Li To: , , , , , , CC: , , , , , Subject: [PATCH net-next v3 3/5] net/mlx5e: Add helper for encap_info_equal for tunnels with options Date: Fri, 17 Feb 2023 05:39:23 +0200 Message-ID: <20230217033925.160195-4-gavinl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230217033925.160195-1-gavinl@nvidia.com> References: <20230217033925.160195-1-gavinl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT004:EE_|CY8PR12MB7098:EE_ X-MS-Office365-Filtering-Correlation-Id: 9be4f839-690e-48b1-1470-08db1098ab41 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZEAaFke8IJFbufryPilSM+T5xEldchVT7UIYQJkL8JxYUTZv6vjfx30UmFZkMrpKK2szMjMm2C9AHTk/ET2AoE4E2FPmEG6UjpEHuupnO3sV3UD1aDQOooSdEnXbTMwZMhbOilYExcMeTEwtw4MP5/56b5Cj8u+pQ72cSE6OuSHIjK4SrwEqnGpc3Kdrzcr2c8IsoAyjTdjChCzRG8itRf8lcUwql4kU+1/OAmmE32NUSt2Pr7p2+wr/Jy+MRGLv3PyJ6loRBtc0K2jQwAnB0pOOCfc7pztWt4LOGGlA09ayibRymY+15tae3xQIB2+K9gn3mWgGMpVdTtn26Khn776iWSbInfCR7439VvDXcdtp4D6Ce4wjUO2oBeX1YlS+s7YnR6fjTf9sFPaWqOUEiLoDEhC/RNswvXCSI8g2pS1ok3axdSi4YSr/F3w70IF5bxkDlItIO2w5MmkZM3u0/csQJqb6PuF0XUyk/GRtw5LO7ebYTg/cVh80+10iXVcc/Wq1ICA+mhBrdlPU6fnUvr30doxyNMdu5P4BxV9tKVt2R1Va04uBap2gd1P+NHIJ7f6Teey7LQ6snTY0vJpwPCMpopMHn+z2iQ+905wbsNUzjonhchRbG4JK8LWxFojH3y5vZO8Yl6MROnIA0o7kEM6xCP9+E6kIY5Q6GPTz6dWDk3JQpihFQhNYHzQjR4OBlNOwHpee2rE3vnuno7De+w== X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230025)(4636009)(136003)(346002)(376002)(39860400002)(396003)(451199018)(46966006)(36840700001)(40470700004)(8676002)(83380400001)(8936002)(54906003)(110136005)(5660300002)(7636003)(107886003)(41300700001)(82740400003)(4326008)(70586007)(40480700001)(316002)(55016003)(86362001)(1076003)(6666004)(478600001)(36756003)(82310400005)(26005)(16526019)(6286002)(186003)(36860700001)(70206006)(2906002)(356005)(336012)(40460700003)(7696005)(426003)(47076005)(2616005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2023 03:40:09.5268 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9be4f839-690e-48b1-1470-08db1098ab41 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT004.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7098 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" For tunnels with options, eg, geneve and vxlan with gbp, they share the same way to compare the headers and options. Extract the code as a common function for them. Signed-off-by: Gavin Li Reviewed-by: Gavi Teitz Reviewed-by: Roi Dayan Reviewed-by: Maor Dickman Acked-by: Saeed Mahameed Reviewed-by: Simon Horman --- .../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 +------------- 3 files changed, 36 insertions(+), 23 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h b/drivers/= net/ethernet/mellanox/mlx5/core/en/tc_tun.h index b38f693bbb52..92065568bb19 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h @@ -115,6 +115,9 @@ int mlx5e_tc_tun_parse_udp_ports(struct mlx5e_priv *pri= v, bool mlx5e_tc_tun_encap_info_equal_generic(struct mlx5e_encap_key *a, struct mlx5e_encap_key *b); =20 +bool mlx5e_tc_tun_encap_info_equal_options(struct mlx5e_encap_key *a, + struct mlx5e_encap_key *b, + __be16 tun_flags); #endif /* CONFIG_MLX5_ESWITCH */ =20 #endif //__MLX5_EN_TC_TUNNEL_H__ diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c b/dr= ivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c index 780224fd67a1..f1d132f16fcc 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c @@ -3,6 +3,7 @@ =20 #include #include +#include #include "tc_tun_encap.h" #include "en_tc.h" #include "tc_tun.h" @@ -571,6 +572,37 @@ bool mlx5e_tc_tun_encap_info_equal_generic(struct mlx5= e_encap_key *a, a->tc_tunnel->tunnel_type =3D=3D b->tc_tunnel->tunnel_type; } =20 +bool mlx5e_tc_tun_encap_info_equal_options(struct mlx5e_encap_key *a, + struct mlx5e_encap_key *b, + __be16 tun_flags) +{ + struct ip_tunnel_info *a_info; + struct ip_tunnel_info *b_info; + bool a_has_opts, b_has_opts; + + if (!mlx5e_tc_tun_encap_info_equal_generic(a, b)) + return false; + + a_has_opts =3D !!(a->ip_tun_key->tun_flags & tun_flags); + b_has_opts =3D !!(b->ip_tun_key->tun_flags & tun_flags); + + /* keys are equal when both don't have any options attached */ + if (!a_has_opts && !b_has_opts) + return true; + + if (a_has_opts !=3D b_has_opts) + return false; + + /* options stored in memory next to ip_tunnel_info struct */ + a_info =3D container_of(a->ip_tun_key, struct ip_tunnel_info, key); + b_info =3D container_of(b->ip_tun_key, struct ip_tunnel_info, key); + + return a_info->options_len =3D=3D b_info->options_len && + !memcmp(ip_tunnel_info_opts(a_info), + ip_tunnel_info_opts(b_info), + a_info->options_len); +} + static int cmp_decap_info(struct mlx5e_decap_key *a, struct mlx5e_decap_key *b) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c b/d= rivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c index 054d80c4e65c..2bcd10b6d653 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c @@ -337,29 +337,7 @@ static int mlx5e_tc_tun_parse_geneve(struct mlx5e_priv= *priv, static bool mlx5e_tc_tun_encap_info_equal_geneve(struct mlx5e_encap_key *a, struct mlx5e_encap_key *b) { - struct ip_tunnel_info *a_info; - struct ip_tunnel_info *b_info; - bool a_has_opts, b_has_opts; - - if (!mlx5e_tc_tun_encap_info_equal_generic(a, b)) - return false; - - a_has_opts =3D !!(a->ip_tun_key->tun_flags & TUNNEL_GENEVE_OPT); - b_has_opts =3D !!(b->ip_tun_key->tun_flags & TUNNEL_GENEVE_OPT); - - /* keys are equal when both don't have any options attached */ - if (!a_has_opts && !b_has_opts) - return true; - - if (a_has_opts !=3D b_has_opts) - return false; - - /* geneve options stored in memory next to ip_tunnel_info struct */ - a_info =3D container_of(a->ip_tun_key, struct ip_tunnel_info, key); - b_info =3D container_of(b->ip_tun_key, struct ip_tunnel_info, key); - - return a_info->options_len =3D=3D b_info->options_len && - memcmp(a_info + 1, b_info + 1, a_info->options_len) =3D=3D 0; + return mlx5e_tc_tun_encap_info_equal_options(a, b, TUNNEL_GENEVE_OPT); } =20 struct mlx5e_tc_tunnel geneve_tunnel =3D { --=20 2.31.1 From nobody Thu Sep 11 18:26:02 2025 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 74CE4C05027 for ; Fri, 17 Feb 2023 03:40:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230029AbjBQDkh (ORCPT ); Thu, 16 Feb 2023 22:40:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230322AbjBQDke (ORCPT ); Thu, 16 Feb 2023 22:40:34 -0500 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2083.outbound.protection.outlook.com [40.107.93.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 174675A3BB; Thu, 16 Feb 2023 19:40:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CNc70lBjObwrHClsugHqEXhkQ/1ojDy6HpgNc6y/eK21BAPB1R1OAq/dKORuF12nyCws3arUTtskKL6xbV5VipWJMsLSL20/nZzW+6yFyrxtV/xwwntBJGWexnLpMjzaoJFAuEQwJctWSokQfpRRybrmUOq3h9zWkmM9SxjXeC11Xt6aQSsdY3/EXt0kbA9OO71vuLlMcSECWfv90EInQvb5ZVLCZK7YKW7SllSwCzg0Ne7906CSSrMe5glhas5GLr1fzxG9bknW6pSPz6Ts9Ljmiaer9AmyZ+Otb90kr38KviANXJhk7I17OzngxpRtB9v71JLOJehnpSAkp7lacQ== 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=tNd/dIDKoKVCD3o5IohXcdjlWz7WYrM+V+H2uF4eJ0w=; b=ZbZs7sxZ/FJ617QaYuvUrkwr5QqdSG6zStH4vpDtoxokVsTp1o0AQoQFIxYW23OXpFucDqot1twXKHwfUwAZi4jIcICRysDcgu/QNLvFLI95WQf9/ITfxDoCPnUzYlxt9KgYuP9Dn9F7yFN8ZCOnjwbsDWE+mV9j1cmfcxHnHXJeInF/c1UCa0U0gH5XAc4F1gteVK19t4iqgWius4kZAR/PCz2hniAh1bTBvIsjUcX2mvd+eI6asJUXn8uhrkqNr/UVTi9yCr8XaDg7KnPoklD8DFyIUIhBkWx6Lz/h1aSFmcIHfix1JZvzUODbXe3xqc9V56j3TLaOQf4DgHd0bw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=tNd/dIDKoKVCD3o5IohXcdjlWz7WYrM+V+H2uF4eJ0w=; b=F317JgZj0inefoIwcxDAKZMgDwkSZZxB10IwVshh5b6MJLV0I01yne9ZjAnDIeZqY1DJbsPxmIT062l3wzquyNs6sAd5PluYkrsqMPT51T/viqsAX8KKeMMI5V6+UYPfgGFiMZEsRO3x54t6vrVeo0RGfZ1AgFRosfp1rQ6VYdLmwnXRG1SfEYoz10+yyuUZicx5TTGpxPEOwk+q/gj/oTmsLgMZLsKI4j1UUB7eCRovAfkdnkFAF1KZQHNODiFmA41f6tRnoqPaFOVMiiWYF2FtF3U9GpDnGoQndmzJ2nI1xVVxdHgrdBPykR5Ke5kyABG4ztZnX8kULb5+PuNGiw== Received: from BN9PR03CA0871.namprd03.prod.outlook.com (2603:10b6:408:13c::6) by SN7PR12MB7249.namprd12.prod.outlook.com (2603:10b6:806:2a9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.12; Fri, 17 Feb 2023 03:40:13 +0000 Received: from BN8NAM11FT052.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13c:cafe::4f) by BN9PR03CA0871.outlook.office365.com (2603:10b6:408:13c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.13 via Frontend Transport; Fri, 17 Feb 2023 03:40:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN8NAM11FT052.mail.protection.outlook.com (10.13.177.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.13 via Frontend Transport; Fri, 17 Feb 2023 03:40:12 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Thu, 16 Feb 2023 19:40:00 -0800 Received: from nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Thu, 16 Feb 2023 19:39:56 -0800 From: Gavin Li To: , , , , , , CC: , , , , , Subject: [PATCH net-next v3 4/5] ip_tunnel: constify input argument of ip_tunnel_info_opts( ) Date: Fri, 17 Feb 2023 05:39:24 +0200 Message-ID: <20230217033925.160195-5-gavinl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230217033925.160195-1-gavinl@nvidia.com> References: <20230217033925.160195-1-gavinl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT052:EE_|SN7PR12MB7249:EE_ X-MS-Office365-Filtering-Correlation-Id: e0035b2a-c0a1-4dc7-f748-08db1098ad01 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7dGltD49d1u0u9joPJuK1GeKViHqC0caFuq7ThSfUgJWqSh3aFVGt0iiRht+fcGeUENlsn3+FHOPcGfxcYu3DuSzTmQSMwE8O+A95ul2jAeArqrma961Y22NYaB7b3cY5ZfXI1jDN6QGrdrQy6Y34h42cigmheCDD4bsf+T4bPxHz2AfVvyxWcUDHTHw8Vlb5e6StfOM7RXX31EfmMqqrZEtD2uIR89FxHHEkQCvQLBADq52+3XzzfvVjAywku072n8c8IDFsuocFbxU9Qdn4Y51Hv9Rn4Hw/F7HOyj5c5tLiyzpiE3p1pjPBJohaWbmS/aGOatG0HbECiMJpopbBy/auGg/b+vucg+8e7OyQq53N4snxufWVZ/6qKXZjERrr/Z+ISC/YmgJW/1iA0ntdNFsM+zX1SL0HusDFTZf5xc1/izn+lSXwLcFk6YuxGe+cmLq6jmHjS7bXZed2Wgeuzqdej+t6Ydh1y88luQl87TjOJWst1vMBHh8GIgDnpuN8sP5ZSks9UhE2F9DKjCRk3Ip1D/kmOj/g9pR20JC85zDoVDCX4PivmOZ9HdyTasqtQ1h928TKn/JPZ6xm7gozdLF5mokc9HwfsftmCGVv4dag9BL56q7hKzDLZ9Vs08Sza2rpAuMgLYTx3e32Ia9lLbdWiemiQYtaKwGIylCglPqmnRUnR/j83/6zsQuuLTy4tuQ9fbe2cOKuQerf5GYQQ== X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230025)(4636009)(136003)(39860400002)(376002)(396003)(346002)(451199018)(36840700001)(46966006)(40470700004)(86362001)(36860700001)(356005)(82740400003)(7636003)(82310400005)(55016003)(40480700001)(36756003)(316002)(70586007)(4326008)(40460700003)(41300700001)(70206006)(8676002)(54906003)(110136005)(7696005)(8936002)(5660300002)(4744005)(336012)(83380400001)(2616005)(478600001)(426003)(47076005)(16526019)(6666004)(186003)(26005)(107886003)(1076003)(2906002)(6286002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2023 03:40:12.4686 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0035b2a-c0a1-4dc7-f748-08db1098ad01 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT052.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7249 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Constify input argument(i.e. struct ip_tunnel_info *info) of ip_tunnel_info_opts( ) so that it wouldn't be needed to W/A it each time in each driver. Signed-off-by: Gavin Li --- include/net/ip_tunnels.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h index fca357679816..32c77f149c6e 100644 --- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h @@ -485,9 +485,9 @@ static inline void iptunnel_xmit_stats(struct net_devic= e *dev, int pkt_len) } } =20 -static inline void *ip_tunnel_info_opts(struct ip_tunnel_info *info) +static inline void *ip_tunnel_info_opts(const struct ip_tunnel_info *info) { - return info + 1; + return (void *)(info + 1); } =20 static inline void ip_tunnel_info_opts_get(void *to, --=20 2.31.1 From nobody Thu Sep 11 18:26:02 2025 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 A3151C05027 for ; Fri, 17 Feb 2023 03:41:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230312AbjBQDlB (ORCPT ); Thu, 16 Feb 2023 22:41:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbjBQDk6 (ORCPT ); Thu, 16 Feb 2023 22:40:58 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2070.outbound.protection.outlook.com [40.107.220.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 644335A391; Thu, 16 Feb 2023 19:40:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XYOIuBJK1ClpgZjt5RfIG0FVSgyLg6RFzDhHzHMPlwZdSq+oO4tNpXeL2gaf8TGSwjQ7NsukQbg9Q3nOTze7tjBdHdmSSzWL5gg9DXEB3Y4Hgv3cyg94FKoxNJM77YCED1O1ue5Py7OfsBiqhwtHW9vVopo4TgNP/asq1AbQmNJzHUQXdVWZF+LPexnn8nR9EnP6cpT94MlOLFn3XCRQu62e1+0yBkI/zwk9x5yPgFK2YqZ4uYBg/dLG9vFCULZPQbaPZalS3EcY9z4DlpeOPyg/0MqWKTNX3UyoQPjDD9LUUfOCquD0AukrcfnhtzZl681OlscnlnmGpdnxOnfQVg== 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=OHdutjr3Ry7qO4Ua4HQOdXZW4TTDPZlm+PQ81DQP29U=; b=gvklkYkCe/PwZqiJJ2HO+uq486rY2EBoCmfW1bfAb6o7eQUmmTgap0mJ5cYC/eSypW0IEYHlg1WIpOEmoi3EITQ3fp+7vqk4fj4KagpkBf54YBDK1mdb/G/HH4eBMdhfvnnoJ7MeVLG+f24ls80jM1BhM6JXAX2tAnSQ145WXBrssEusKbJCdpAsq9caSU7MY5j89VJZLrEFEL2U1uxMSKl2768qE657heu357aK9UpOd8mojJ46lik12q2SFzrgpUJ60G9ak9Z5Q9xD5B/+V40sbygZAjWB3OWP9gQ6DNpRu0nbKkVQx5zQ46OGmkA57OCZELBN4ORYR9VlG+Hmeg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=OHdutjr3Ry7qO4Ua4HQOdXZW4TTDPZlm+PQ81DQP29U=; b=bnkngb1dSVW67vzcp2HPu5shYWcdDkD+Evgf+OcxjaKXAjZJPzzdcOXEJKkgi5z8Y88LsCN6vhhQgWxHXiBdKyWOD4j1kVmoJ0lUY2woU19Sc/fNRIRYxGqYt0q1bET7byVqpPgIOQxIlklpnpQfEbDrt6lIGmHvxXSS35JknYHiUsxHFDMD/nVCvtt8vcC8rIvIrlm8PAvxlJGQbeK+ZdPMLE1dwFuLckWgkwDPd/BELaPHJJ3NbccFhOk6thKfyOTkVOwdzT4C0R4gVaJC2h2QPG1CbWGLEmGXWo34EwKP+GuxPrizK6ZmgoKZXpajKJzbHQEhrmbtVhAViAoUbA== Received: from BN9PR03CA0897.namprd03.prod.outlook.com (2603:10b6:408:13c::32) by DS0PR12MB6584.namprd12.prod.outlook.com (2603:10b6:8:d0::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.21; Fri, 17 Feb 2023 03:40:17 +0000 Received: from BN8NAM11FT052.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13c:cafe::80) by BN9PR03CA0897.outlook.office365.com (2603:10b6:408:13c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.15 via Frontend Transport; Fri, 17 Feb 2023 03:40:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN8NAM11FT052.mail.protection.outlook.com (10.13.177.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.13 via Frontend Transport; Fri, 17 Feb 2023 03:40:17 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Thu, 16 Feb 2023 19:40:04 -0800 Received: from nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Thu, 16 Feb 2023 19:40:00 -0800 From: Gavin Li To: , , , , , , CC: , , , , , Subject: [PATCH net-next v3 5/5] net/mlx5e: TC, Add support for VxLAN GBP encap/decap flows offload Date: Fri, 17 Feb 2023 05:39:25 +0200 Message-ID: <20230217033925.160195-6-gavinl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230217033925.160195-1-gavinl@nvidia.com> References: <20230217033925.160195-1-gavinl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT052:EE_|DS0PR12MB6584:EE_ X-MS-Office365-Filtering-Correlation-Id: aa5eb4af-372c-4f6b-8d85-08db1098b00d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EzYGJ+2mhDFTkj5xGJetraKOAN68Vxfs/fgowPDMXJ6v9PfYIdsCeQTNQo0isyrt1fxuxd1UrGS6vR069gJXN7q5oA4jjBKYh4U9PEPVs7NaFIHP3nCBlg8otmN++4ARq0N/ORRLVe3POhp6IofIHAYUzXAdZ/JQjfiE2F3XprSc1mCPyGFPztCU8FZNjijIcR92S02Gs3bJXUaKWVMLMLVMlss/GBXnLEZJ83hziMzQHcgf8iBD4QivgIHWpXe4J9Fqr+yH4DDuc+lGEkZhsQFIVYthpO6Osfdlz+3MtBCCwhcsKzJrCPkCmP6pA070XEq/vlXed7SjMpRx9SFfUjy94PTQcUUuNGgGzYHQIpG9PG15+fvcoaR8D8VMSmMrgtdGwNrAolZJFcewdmDmGjIOifxn+DDLRO+b1N3U5jGXdk66qnIDHtYlOKNL/4Ul0aV76P/hCoYb3zuytQaeh1PZhd6zWgD03gjCo1Gnwx41OebJg9Eofo+jCPuhce9S9O985+k2QolZg1vyfao0R7w5lcigBZJflolc7HmtBiXLMXYWcOxCwKDEt5wqf6SlenXbuNEgb5raeTcAs9QOZCUHlzgHqbMKHylLsd2/dhyow90vbOnha1cTCwtjUsM4UNQG3bA1rhCkD2Tft9yiZwLMAFUMR2Niascod5scNPuJy1d+iG4e/0xyksl7k0BPUZVSFaH/HWs06CKmX7RtCQ== X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230025)(4636009)(136003)(39860400002)(346002)(396003)(376002)(451199018)(40470700004)(46966006)(36840700001)(107886003)(1076003)(8936002)(16526019)(186003)(6286002)(41300700001)(6666004)(5660300002)(26005)(8676002)(2906002)(4326008)(70206006)(2616005)(70586007)(83380400001)(47076005)(426003)(7636003)(336012)(40460700003)(478600001)(82740400003)(36756003)(54906003)(82310400005)(55016003)(316002)(86362001)(40480700001)(36860700001)(356005)(7696005)(110136005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2023 03:40:17.5777 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa5eb4af-372c-4f6b-8d85-08db1098b00d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT052.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6584 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add HW offloading support for TC flows with VxLAN GBP encap/decap. Example of encap rule: tc filter add dev eth0 protocol ip ingress flower \ action tunnel_key set id 42 vxlan_opts 512 \ action mirred egress redirect dev vxlan1 Example of decap rule: tc filter add dev vxlan1 protocol ip ingress flower \ enc_key_id 42 enc_dst_port 4789 vxlan_opts 1024 \ action tunnel_key unset action mirred egress redirect dev eth0 Signed-off-by: Gavin Li Reviewed-by: Gavi Teitz Reviewed-by: Roi Dayan Reviewed-by: Maor Dickman Acked-by: Saeed Mahameed --- .../mellanox/mlx5/core/en/tc_tun_vxlan.c | 76 ++++++++++++++++++- include/linux/mlx5/device.h | 6 ++ include/linux/mlx5/mlx5_ifc.h | 13 +++- 3 files changed, 91 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c b/dr= ivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c index 1f62c702b625..381b6090b759 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_vxlan.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB /* Copyright (c) 2018 Mellanox Technologies. */ =20 +#include #include #include "lib/vxlan.h" #include "en/tc_tun.h" @@ -86,9 +87,11 @@ static int mlx5e_gen_ip_tunnel_header_vxlan(char buf[], const struct ip_tunnel_key *tun_key =3D &e->tun_info->key; __be32 tun_id =3D tunnel_id_to_key32(tun_key->tun_id); struct udphdr *udp =3D (struct udphdr *)(buf); + struct vxlan_metadata *md; struct vxlanhdr *vxh; =20 - if (tun_key->tun_flags & TUNNEL_VXLAN_OPT) + if ((tun_key->tun_flags & TUNNEL_VXLAN_OPT) && + e->tun_info->options_len !=3D sizeof(*md)) return -EOPNOTSUPP; vxh =3D (struct vxlanhdr *)((char *)udp + sizeof(struct udphdr)); *ip_proto =3D IPPROTO_UDP; @@ -96,6 +99,61 @@ static int mlx5e_gen_ip_tunnel_header_vxlan(char buf[], udp->dest =3D tun_key->tp_dst; vxh->vx_flags =3D VXLAN_HF_VNI; vxh->vx_vni =3D vxlan_vni_field(tun_id); + if (tun_key->tun_flags & TUNNEL_VXLAN_OPT) { + md =3D ip_tunnel_info_opts(e->tun_info); + vxlan_build_gbp_hdr(vxh, md); + } + + return 0; +} + +static int mlx5e_tc_tun_parse_vxlan_gbp_option(struct mlx5e_priv *priv, + struct mlx5_flow_spec *spec, + struct flow_cls_offload *f) +{ + struct flow_rule *rule =3D flow_cls_offload_flow_rule(f); + struct netlink_ext_ack *extack =3D f->common.extack; + struct flow_match_enc_opts enc_opts; + void *misc5_c, *misc5_v; + u32 *gbp, *gbp_mask; + + flow_rule_match_enc_opts(rule, &enc_opts); + + if (memchr_inv(&enc_opts.mask->data, 0, sizeof(enc_opts.mask->data)) && + !MLX5_CAP_ESW_FT_FIELD_SUPPORT_2(priv->mdev, tunnel_header_0_1)) { + NL_SET_ERR_MSG_MOD(extack, "Matching on VxLAN GBP is not supported"); + netdev_warn(priv->netdev, "Matching on VxLAN GBP is not supported\n"); + return -EOPNOTSUPP; + } + + if (enc_opts.key->dst_opt_type !=3D TUNNEL_VXLAN_OPT) { + NL_SET_ERR_MSG_MOD(extack, "Wrong VxLAN option type: not GBP"); + netdev_warn(priv->netdev, "Wrong VxLAN option type: not GBP\n"); + return -EOPNOTSUPP; + } + + if (enc_opts.key->len !=3D sizeof(*gbp) || + enc_opts.mask->len !=3D sizeof(*gbp_mask)) { + NL_SET_ERR_MSG_MOD(extack, "VxLAN GBP option/mask len is not 32 bits"); + netdev_warn(priv->netdev, "VxLAN GBP option/mask len is not 32 bits\n"); + return -EINVAL; + } + + gbp =3D (u32 *)&enc_opts.key->data[0]; + gbp_mask =3D (u32 *)&enc_opts.mask->data[0]; + + if (*gbp_mask & ~VXLAN_GBP_MASK) { + NL_SET_ERR_MSG_FMT_MOD(extack, "Wrong VxLAN GBP mask(0x%08X)\n", *gbp_ma= sk); + netdev_warn(priv->netdev, "Wrong VxLAN GBP mask(0x%08X)\n", *gbp_mask); + return -EINVAL; + } + + misc5_c =3D MLX5_ADDR_OF(fte_match_param, spec->match_criteria, misc_para= meters_5); + misc5_v =3D MLX5_ADDR_OF(fte_match_param, spec->match_value, misc_paramet= ers_5); + MLX5_SET(fte_match_set_misc5, misc5_c, tunnel_header_0, *gbp_mask); + MLX5_SET(fte_match_set_misc5, misc5_v, tunnel_header_0, *gbp); + + spec->match_criteria_enable |=3D MLX5_MATCH_MISC_PARAMETERS_5; =20 return 0; } @@ -122,6 +180,14 @@ static int mlx5e_tc_tun_parse_vxlan(struct mlx5e_priv = *priv, if (!enc_keyid.mask->keyid) return 0; =20 + if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_OPTS)) { + int err; + + err =3D mlx5e_tc_tun_parse_vxlan_gbp_option(priv, spec, f); + if (err) + return err; + } + /* match on VNI is required */ =20 if (!MLX5_CAP_ESW_FLOWTABLE_FDB(priv->mdev, @@ -143,6 +209,12 @@ static int mlx5e_tc_tun_parse_vxlan(struct mlx5e_priv = *priv, return 0; } =20 +static bool mlx5e_tc_tun_encap_info_equal_vxlan(struct mlx5e_encap_key *a, + struct mlx5e_encap_key *b) +{ + return mlx5e_tc_tun_encap_info_equal_options(a, b, TUNNEL_VXLAN_OPT); +} + static int mlx5e_tc_tun_get_remote_ifindex(struct net_device *mirred_dev) { const struct vxlan_dev *vxlan =3D netdev_priv(mirred_dev); @@ -160,6 +232,6 @@ struct mlx5e_tc_tunnel vxlan_tunnel =3D { .generate_ip_tun_hdr =3D mlx5e_gen_ip_tunnel_header_vxlan, .parse_udp_ports =3D mlx5e_tc_tun_parse_udp_ports_vxlan, .parse_tunnel =3D mlx5e_tc_tun_parse_vxlan, - .encap_info_equal =3D mlx5e_tc_tun_encap_info_equal_generic, + .encap_info_equal =3D mlx5e_tc_tun_encap_info_equal_vxlan, .get_remote_ifindex =3D mlx5e_tc_tun_get_remote_ifindex, }; diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index 71b06ebad402..af4dd536a52c 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h @@ -1357,6 +1357,12 @@ enum mlx5_qcam_feature_groups { #define MLX5_CAP_ESW_INGRESS_ACL_MAX(mdev, cap) \ MLX5_CAP_ESW_FLOWTABLE_MAX(mdev, flow_table_properties_esw_acl_ingress.ca= p) =20 +#define MLX5_CAP_ESW_FT_FIELD_SUPPORT_2(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE(mdev, ft_field_support_2_esw_fdb.cap) + +#define MLX5_CAP_ESW_FT_FIELD_SUPPORT_2_MAX(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE_MAX(mdev, ft_field_support_2_esw_fdb.cap) + #define MLX5_CAP_ESW(mdev, cap) \ MLX5_GET(e_switch_cap, \ mdev->caps.hca[MLX5_CAP_ESWITCH]->cur, cap) diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 1e530a8a2cf5..caef6aa20454 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -399,10 +399,13 @@ struct mlx5_ifc_flow_table_fields_supported_bits { u8 metadata_reg_c_0[0x1]; }; =20 +/* Table 2170 - Flow Table Fields Supported 2 Format */ struct mlx5_ifc_flow_table_fields_supported_2_bits { u8 reserved_at_0[0xe]; u8 bth_opcode[0x1]; - u8 reserved_at_f[0x11]; + u8 reserved_at_f[0x1]; + u8 tunnel_header_0_1[0x1]; + u8 reserved_at_11[0xf]; =20 u8 reserved_at_20[0x60]; }; @@ -890,7 +893,13 @@ struct mlx5_ifc_flow_table_eswitch_cap_bits { =20 struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_esw_acl= _egress; =20 - u8 reserved_at_800[0x1000]; + u8 reserved_at_800[0xC00]; + + struct mlx5_ifc_flow_table_fields_supported_2_bits ft_field_support_2_esw= _fdb; + + struct mlx5_ifc_flow_table_fields_supported_2_bits ft_field_bitmask_suppo= rt_2_esw_fdb; + + u8 reserved_at_1500[0x300]; =20 u8 sw_steering_fdb_action_drop_icm_address_rx[0x40]; =20 --=20 2.31.1