From patchwork Wed Mar 15 13:11:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13175831 X-Patchwork-Delegate: kuba@kernel.org 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 00963C61DA4 for ; Wed, 15 Mar 2023 13:13:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231536AbjCONNy (ORCPT ); Wed, 15 Mar 2023 09:13:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231470AbjCONNt (ORCPT ); Wed, 15 Mar 2023 09:13:49 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2085.outbound.protection.outlook.com [40.107.243.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2803A0F05 for ; Wed, 15 Mar 2023 06:13:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I+Yc3JvfFOre8Qr7XukpUrGo6BecW6IUoPjTyqoIVJcSG4UYenxHZ9fRVEpxbmhAkg59NdcE7uoIgZYvnF3IPcUh162iOtEwu29cgB0x8KK950IlPZGHPP7YYsOGneglhhchbfK3XnpEBL/zI6s7rHwm8WiQA1KfpoERh5Yjsy8ljJasWohdcSGK+S42XorG+haDhEiZvNP4m55wDXG99nPM3aJGObILdULDCZcHpVLPC+J338kI06SMJ8mXiaxq/Aiqa0ZsHUO9wfQ63fdm6jRxqfE6zSO3Yt4bOodSNWT4yP08wvpvjZNFcnbE8XhrDaCiTxvq5H5lZ5ZSYepZHA== 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=M8xQD6wIXI7G9nlFvyc28CRTCwLnUV1tYLqhNK96CV4=; b=RZa4wmmSmzmHMwRgpIVz7K5qYFrXnR9GDa25JAhbvhpnlQRwqtbRsmp/y3BdnySegLHuQoHInyeXtqF5Z5RsK8b/gKDP+TUz3W2XeA8eep2vZf6V9YgjB2Z3vc4/7pPcH+3ziWUVJA+Y97eOmROJLpMpEwK3+NBSBy1iSWt77vU7dTIFwDdAOBGRDujRaFjDhvKJR4UXpJQPIbuS+XYRuUKqcPWvIuRBwFg2Gd7rhHRUFyPBvi7aD7fsP6Sy91TLoiJKIfKvO9q4JS/iGbVkYu9pZNaISvyIEyNvnHs70oIoHet4AaPzfFstymjhRaznnKk4dTqKr0j3z3KE6o6n1A== 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=M8xQD6wIXI7G9nlFvyc28CRTCwLnUV1tYLqhNK96CV4=; b=hz72DzRHHtHoVbX72g42rVRYpa1bhI9/vztycAm/n7I0tOvA0TTRpaS7KlnCk0O0+ytYWX0w3kMDzQGHPoeob6mvKqTT2QHK5fYuEV/qbLFosJsrCrgf2BSd1mYV/V51gs5F6yeLDGxc9WXyc4l6SJYj9ns97DCo0hSB8tESeyoJfAlHgsdJE1+uRirBoHiJ0r9SvzleOvg/XNDZKrIJ5vQX/B9MMvnb+dyHwobU6M0+Z9ZwgNyrHmarUhNyIDcFZxWcswO2j45HrRd/B9V5caXQ0OvEZlAfvRFtxFekQ5F5LymFD9khYnzL3Z7nVAl7zhC/aDlvtSet7GKAj5yaDA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) by DS7PR12MB6216.namprd12.prod.outlook.com (2603:10b6:8:94::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.29; Wed, 15 Mar 2023 13:13:39 +0000 Received: from CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3]) by CY5PR12MB6179.namprd12.prod.outlook.com ([fe80::d228:dfe5:a8a8:28b3%5]) with mapi id 15.20.6178.026; Wed, 15 Mar 2023 13:13:39 +0000 From: Ido Schimmel To: netdev@vger.kernel.org, bridge@lists.linux-foundation.org Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, roopa@nvidia.com, razor@blackwall.org, petrm@nvidia.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH net-next v2 06/11] vxlan: Expose vxlan_xmit_one() Date: Wed, 15 Mar 2023 15:11:50 +0200 Message-Id: <20230315131155.4071175-7-idosch@nvidia.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230315131155.4071175-1-idosch@nvidia.com> References: <20230315131155.4071175-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR08CA0197.eurprd08.prod.outlook.com (2603:10a6:800:d2::27) To CY5PR12MB6179.namprd12.prod.outlook.com (2603:10b6:930:24::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6179:EE_|DS7PR12MB6216:EE_ X-MS-Office365-Filtering-Correlation-Id: f6060c9e-b651-4539-180e-08db25571763 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9zcWY69FTo98TLmBMNNkw3nVD5qW7jj1Yv8LrYj3L1Ys8VUJVP0iDrTbe5hAv20P1aQMyUgxIq22sqFEEMSUGF5w2Qza3/qqeoQ61pLcunq4ChSWOxrhMtUHk3N0VqBct5QFv/SqLrJeyMVD3/3Tu/aWo9QLxWZ2cC6z+lKMp/iot4y80W1CnxdC3RHMy1oxYzomg8Rvfu9vWPVJeOZBFJe+IkaRQWudTcBiEFVxihHXj056ZjQz9LDRKWfwsOk2oBFKHJyEA5Z1f7cSAmm6Szerc+RaRL7Wo4yGoRrlhOPcU2w4GQJcnWhbWCsyuFeqySf37caA+3OHCNfKOqHFRnYyAb8u47o2zBZ40UDXb1Jf4phtp5JbVHTX8T1vs9ktZBCIm9nNgAGaTjzq8vlA0dezl/zGUDzhTqi/P63aHC/LJCFN5mqjZ5GV59EDVOw1nIyeoxwr1ODo7P5pPX75vM4MTJaMq97sE4zHCfu0FOTTlFBTWhVnieEIBWWSSnlbYqAlc3D/xu3LqHkPhoXJifhkA8hSidb1bPiN0woduoTKH+ZtkfVtDI+5HLGHRPBsiGSLSvwMlQ7kyfidKoxpUCOPoH2mQKhENGJCB9nvw4gQ1fGoDzHFHiVuX+A+B1qXlMlkBb5+5BEKy28LIh8y2A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR12MB6179.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(396003)(366004)(376002)(136003)(346002)(39860400002)(451199018)(86362001)(36756003)(38100700002)(2906002)(8936002)(5660300002)(41300700001)(4326008)(2616005)(1076003)(6512007)(186003)(6506007)(83380400001)(26005)(316002)(66476007)(8676002)(66946007)(66556008)(107886003)(6666004)(6486002)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WgGm6ML3QUHBD56yLKBKx7jBvFZJph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D37IX+ofcyE/EU1qN/ajZu2ZNXYdwjg4ECBYsiwo1MrrZOEfxVbOBzTPuvFReTbbt6+RzqSS5wGNZy+y/mteugzYsX9x582RePlAWllDPBx/JbGjQQRPz5hEiKF2u22AYQz+1u266vWL4BLy/G3K3PYPGGo13n19/irWHcQUDCyqbsaS6bcllxoGIti6GIJRvcKCvdhChRQM2nwgcofEwMSGEsqyU8pGuHNG8HOyL2sNIQu+V3kYG3+r6bG64UPtedbVjg+tIr7NB2f/p5sljyyCk/itdCIeegbLD9KMnBMkAQQC6dQpQRRj3c2t4NZVWUSQl4OahnA4zUPQQQbmQwnuuyyS0MU0KTLln4pWXLwQ1cxh7Sxqs9ipMFuONrETNj3Bvv32aApzrxKGyhMpIs1I8vHsAlEgSN4pj+6urY1FwAwOr/FpmjhGJIfajfAffFpFYkbIaVXrdrJMwFX21XR36OrpVIhvWglrJvUL+ZM6JZtwATEP X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f6060c9e-b651-4539-180e-08db25571763 X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6179.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2023 13:13:38.9215 (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: 56ltV577rrZiBjF8FMD7jxK9ZIgs9jmRTfbqgJU/XVoRhLt/2psStb62bEnk2QxzFwSNZF+o1prmMKnIf+LWPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6216 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Given a packet and a remote destination, the function will take care of encapsulating the packet and transmitting it to the destination. Expose it so that it could be used in subsequent patches by the MDB code to transmit a packet to the remote destination(s) stored in the MDB entry. It will allow us to keep the MDB code self-contained, not exposing its data structures to the rest of the VXLAN driver. Signed-off-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov --- drivers/net/vxlan/vxlan_core.c | 5 ++--- drivers/net/vxlan/vxlan_private.h | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index 2c65cc5dd55d..5de1a20497a6 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -2395,9 +2395,8 @@ static int encap_bypass_if_local(struct sk_buff *skb, struct net_device *dev, return 0; } -static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, - __be32 default_vni, struct vxlan_rdst *rdst, - bool did_rsc) +void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, + __be32 default_vni, struct vxlan_rdst *rdst, bool did_rsc) { struct dst_cache *dst_cache; struct ip_tunnel_info *info; diff --git a/drivers/net/vxlan/vxlan_private.h b/drivers/net/vxlan/vxlan_private.h index 038528f9684a..f4977925cb8a 100644 --- a/drivers/net/vxlan/vxlan_private.h +++ b/drivers/net/vxlan/vxlan_private.h @@ -172,6 +172,8 @@ int vxlan_fdb_update(struct vxlan_dev *vxlan, __be16 port, __be32 src_vni, __be32 vni, __u32 ifindex, __u16 ndm_flags, u32 nhid, bool swdev_notify, struct netlink_ext_ack *extack); +void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, + __be32 default_vni, struct vxlan_rdst *rdst, bool did_rsc); int vxlan_vni_in_use(struct net *src_net, struct vxlan_dev *vxlan, struct vxlan_config *conf, __be32 vni);