From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.52.55 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796043923; b=KC4ioFfjRYKv3M1dBq2OlaxLDMee5c2S1F8ycukj0mSo4AsOiwmBZQU4PQVh+Ag+q/ek c3OB8ttLEHctCalurl96rMMuDYwbssDWVLSAfej960ZBT7/gSXMGQCtFXsRLo7F5Snfxs jhQaAqn+UuXqUOhZTLfoMBQgA1MgVBJFGz3BZupxkkyP68pL0JUt9NBhE/+O2N9LXOoRL hY4oYFPAQkO353sNGp6mkKBLavqAxK4GUOlBTgCakHCxypk5jBP1AXbFmbfYD86gr1usI TSBbW3ii/+vFTM4rzPH8cac/grcLUqKgIzH/EC2KTUm/12wfREauzNkMcghX3+AvvDw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796043923; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: Received:From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:Content-Type: X-Originating-IP:X-ClientProxiedBy:X-EOPAttributedMessage: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=JxU7bfYo4smasjd3tVKCtffoKnD1bBSRJfOZ931HlY0=; b=0QQEt0pWf1X4W0glCB7jQvltmSMyLUGdrV6hv4IZ46GbUEZ2dfbakDr8mxGjHIb5AMVx Vcv7lY2dTbxaGhOCV3Obqb1kfq3HPnDroh7MB2nTzHegW+i1S/3a5NGYdENLjGYe9Ae9H /V5pIopXAzxZMpeVqb7Qn+KEEB89Zy5DBas0NhMOW9tmtCf8zq2dZlZVshBUlDbDRgQmj pQPc9cdRiiWtykG6xoI0dvR/CMMgfPs+w8KjtQ7Opo9VTMGdgV0pxlVYW/rVWh6+EKxhF n8A1T6khw89xO+kSPqpxcc0RiC7em+lg+5ILA4P++h+z2GA8v23eHq9dWK3WUgC7gfA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=TtD341IA; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.52.55 Received: from BL2PR02CU003.outbound.protection.outlook.com (mail-eastusazon11011055.outbound.protection.outlook.com [52.101.52.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47652606A331 for ; Mon, 30 Nov 2026 13:05:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 47652606A331 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=TtD341IA ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hvNyPWGsSsI7Cv12L7xUT/ULotesyDyo9c2j+KWR88xwIh6tWLbEJgQHC+ZP6AMu0g/Sn7EDgtl44bM6+9d4PuNxz/RRF3TtwfdpOGU+xpkcEeZKgNv/nXC4FFRBfzDn7OsZSfCxtHoCzAxspy7kYg12gX3gcD51oL6CeKjU08B8w1wMRaM//aXTM5BndgkNn5QArdCVc7e0swLKLHbchKPC+ACYYzgfuR/94t+9d1ojNEdt9VWqWzZ+WO2u4Q+rxKzN5zE33shFybgDITaKY+w9MTJ7+iQrixcDrsmNDTjELj/TW+Bw+i1hFrA7M1iyDPH4XSqunXy2XI/DO6ZVYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=JxU7bfYo4smasjd3tVKCtffoKnD1bBSRJfOZ931HlY0=; b=ykzYSYrkevIEZRGZVECD8H+/CJFqEMPUbWrJSrVbC9V+xVRFVzOn1ds14meCXaBoe9rX1zXV/gSX8+oh6T1oGalgWz8X0lz5f/o/Vmm/Ug275/yaYuWa9uP6pGkm82X/V1S2qR0oFsAWsXX/oln0tdjFS2DCAY54khsGqFXOxAtOPsNmoXFeKfT2eQ5d8ulc1iInNB4hEELHoL7nG0p4wik0NcfC2Zz8Q/U8QaMdHKzXGex5zt4alhNgqJB7mfYpGh8ouiEnGYVy7/SMJbGO4bZXZ0085sfMFCx4Gt7JCHnEhbMtvgceLhHLDxCPpOPtHcotxmdO7RsiPuU3on3pWg== 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 (0) 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=JxU7bfYo4smasjd3tVKCtffoKnD1bBSRJfOZ931HlY0=; b=TtD341IAXgP7OUJjwKdwV09iQap/TEqOGCEVprpIV4Wygn1KRi+upTlToLGxMpNl3xSpLwZ9rmnGKMz9O9vK3VfiyVv7vXYhklxVIurjpQyWvrWIFLGxMB1MJugz4n99mjDPg68J8vQ2T1JvfLpgQJFGJ7n/6pJIbxdjzQ9O66681ML2mJ8d5XZS7wxUHdCKoDGg01ilOyaJrRH4eBWs6Xz0/bHN2NmAfVjXtfgBMCzOhW6DUg4AGoNZvuDswu3F1YFT2c5ewEHGOIkETKl+Yvq8T0N7Ww1Go9/fPyy7yrDL/5gYeM8YfGpV8pzUkQp7j/2G7iQYKK8XUmFoYXO/sA== Received: from MW4P222CA0022.NAMP222.PROD.OUTLOOK.COM (2603:10b6:303:114::27) by DS2PR12MB880722.namprd12.prod.outlook.com (2603:10b6:8:404::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.13; Mon, 30 Nov 2026 13:05:16 +0000 Received: from CO1PEPF0001886A.namprd03.prod.outlook.com (2603:10b6:303:114:cafe::1a) by MW4P222CA0022.outlook.office365.com (2603:10b6:303:114::27) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.662.13 via Frontend Transport; Mon, 30 Nov 2026 13:05:16 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; 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 CO1PEPF0001886A.mail.protection.outlook.com (10.167.249.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Mon, 30 Nov 2026 13:05:15 +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.2562.57; Mon, 30 Nov 2026 05:04:49 -0800 Received: from tuxedo.docsis.vodafone.cz (10.126.230.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.2562.57; Mon, 30 Nov 2026 05:04:43 -0800 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , CC: Andrew Lunn , Nikolay Aleksandrov , , Ido Schimmel , Petr Machata , Andy Roulin , Subject: [PATCH net-next v2 06/13] net: vxlan: Pass portid through FDB notifications Date: Mon, 30 Nov 2026 14:03:22 +0100 Message-ID: X-Mailer: git-send-email 2.56.1 In-Reply-To: References: X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF0001886A:EE_|DS2PR12MB880722:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d75e6a5-b47b-41bf-15c7-08df4ee293b4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700016|1800799024|23010399003|11063799006|261009223027099003|22082099003|18002099003|3023799007|10067099003|56012099006|261028144727099003|261026135527099003|261026130827099003|261026121527099003|261026140227099003|261022113327099003|261022105027099003|261022075727099003|261102123227099003|261021121427099003|261021135927099003|261021133027099003|261021130227099003|261021123027099003|261022115727099003; X-Microsoft-Antispam-Message-Info: DozfZtqcL6jt3BY9Rn3FUc/3E2+qDGo6haqtFLnOjrejGaT0bzaXJukqoJ9NoAJ5INnvtem7jj2JjJg/sJJ86MkYB+TVkdBVu9JDX7R+W/dkgUHwbBnzUdHyFKdi7Y/IPlhBtuGcPL/bAqChIb+92A4XAbh4LuO7u4xrV3h1NWhpD8LJPrqga2PBn145my2HwYJhZMFMmK4U7Mqm9S9CXRkoPHjmgXPU9sOfA/kISJbLimJfGNRw+HChlssnTa+YXyT6tKollsu3LlWqNsH/STBK57koIfwSOa/GqjcvlzEOrCNyyIXYjyTJ0aLbHwxXd+xNHZ74Nn3PEZjBf6k0I2xJXE82chpSNBGAPUQ92utL2tztuKHm4m0YRHc/GuHMMa2kdL2So3ml3jsaGlaxTHkGFCMZPR5fTK2aZqRXxiXm2xTPYob7aD1vaaql+HOXRI+7Tbto3nrif1wlwGwAQTU+Nc6F+Ik9dN+lAWg+nEAWwhecYFPJqwNBGqZ+0fvvf5TmED+skozUo5YgovXDEEk3TYa9z9MeYxDxNQpRXTLbFDD4GaXtMBeokdV4iSyLq/o3hAOnttI/95BzCqwIAshY5RskIWpXzicEFuIIaJJDLRUy1LcDpITKRgMCAVil2u296yOfVxhM+PnpnSe6JjbNMjA8Nu7hdJ3Maph3NpsV1e7bQUsFZK7OplY1e/qa4hY71aFC/0UKItfamegcbA== 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:(13230040)(376014)(82310400026)(36860700016)(1800799024)(23010399003)(11063799006)(261009223027099003)(22082099003)(18002099003)(3023799007)(10067099003)(56012099006)(261028144727099003)(261026135527099003)(261026130827099003)(261026121527099003)(261026140227099003)(261022113327099003)(261022105027099003)(261022075727099003)(261102123227099003)(261021121427099003)(261021135927099003)(261021133027099003)(261021130227099003)(261021123027099003)(261022115727099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: D3JuUuFZoqAX0bSScvZ0SvszPZwgAt89yQKTi2qtzilfhqG/oIdcxxoNZsVsNojSxLCIrGD+d5sLtT4GipngAVlYpCBu7By1G82Lq+U288INpE4CaN3ZCk8mKjMHS1OQDikIO6DDSvFXSmiXib2Yjzhoa7j+iY9hwkEvw0n4FIfKISd6FuWGNV7C0kh3zdldvjqvCJU8Tg06ZUvxq5AUNfSiAxWeOvIcs97QBEw7IpBQXIZiIEKXnm2S0yWVeOu5iuBarwHEbOCD1F143y/300JyEnqigpT8GZZNAGBRLAElqCdbKL5PIioF8js7qLl6TgsTanp5/EdJXp9Fu/4pwHsaEhggzauLjW/ClkgedKK5dShCfy9ZuI34xD+GPLkbMFxhaeiT/fllB0klNknE3bokY2Cl1vdF6WGiLtsp8PZJV6ZB2Ev1xFewY7J26sE7 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2026 13:05:15.6546 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1d75e6a5-b47b-41bf-15c7-08df4ee293b4 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: CO1PEPF0001886A.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS2PR12MB880722 Add a portid argument to __vxlan_fdb_notify(), vxlan_fdb_notify(), vxlan_fdb_destroy(), vxlan_fdb_dst_destroy(), vxlan_fdb_update() and its _existing() and _create() helpers, __vxlan_fdb_delete(), vxlan_flush() and vxlan_fdb_flush_match_remotes(), and use it as the netlink port ID of the resulting RTM_NEWNEIGH / RTM_DELNEIGH notifications. Where both portid and swdev_notify are passed, portid comes first: it is part of the message metadata, similarly to the message type, whereas swdev_notify merely toggles whether the switchdev notifiers are called. vxlan_fdb_add() and vxlan_fdb_delete() pass on the port ID of the requester. All other callers (snooping, device stop, changelink, VNI filtering, switchdev events, as well as vxlan_fdb_delete_bulk()) pass zero, as before. As rtnl_fdb_add() and rtnl_fdb_del() do not yet fill in the port ID in struct ndo_fdb_parms, all notifications are still sent with zero. No functional change intended. I considered passing struct ndo_fdb_parms down to vxlan_fdb_update() instead of the individual address and flags, but eventually decided against that. Only vxlan_fdb_add() has the structure at hand, whereas the other callers would have to construct a throwaway one just to pass the address and flags. This makes them longer, not shorter, and the callee would still need most of the VXLAN-specific arguments separately. Packing the VXLAN-specific parameters (remote IP, port, VNI, ifindex, ...) into a dedicated VXLAN-specific structure might benefit the VXLAN driver in a similar way to how it cleaned up the NDO interface. However this was left out for potential future patchset. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Reviewed-by: Nikolay Aleksandrov --- drivers/net/vxlan/vxlan_core.c | 89 +++++++++++++++-------------- drivers/net/vxlan/vxlan_private.h | 5 +- drivers/net/vxlan/vxlan_vnifilter.c | 6 +- 3 files changed, 52 insertions(+), 48 deletions(-) diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index c014307a693b..9df9f7a8cde7 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -265,7 +265,7 @@ static inline size_t vxlan_nlmsg_size(void) } static void __vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb, - struct vxlan_rdst *rd, int type) + struct vxlan_rdst *rd, int type, u32 portid) { struct net *net = dev_net(vxlan->dev); struct sk_buff *skb; @@ -275,7 +275,7 @@ static void __vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb, if (skb == NULL) goto errout; - err = vxlan_fdb_info(skb, vxlan, fdb, 0, 0, type, 0, rd); + err = vxlan_fdb_info(skb, vxlan, fdb, portid, 0, type, 0, rd); if (err < 0) { /* -EMSGSIZE implies BUG in vxlan_nlmsg_size() */ WARN_ON(err == -EMSGSIZE); @@ -329,8 +329,8 @@ static int vxlan_fdb_switchdev_call_notifiers(struct vxlan_dev *vxlan, } static int vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb, - struct vxlan_rdst *rd, int type, bool swdev_notify, - struct netlink_ext_ack *extack) + struct vxlan_rdst *rd, int type, u32 portid, + bool swdev_notify, struct netlink_ext_ack *extack) { int err; @@ -349,7 +349,7 @@ static int vxlan_fdb_notify(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb, } } - __vxlan_fdb_notify(vxlan, fdb, rd, type); + __vxlan_fdb_notify(vxlan, fdb, rd, type, portid); return 0; } @@ -364,7 +364,7 @@ static void vxlan_ip_miss(struct net_device *dev, union vxlan_addr *ipa) .remote_vni = cpu_to_be32(VXLAN_N_VID), }; - vxlan_fdb_notify(vxlan, &f, &remote, RTM_GETNEIGH, true, NULL); + vxlan_fdb_notify(vxlan, &f, &remote, RTM_GETNEIGH, 0, true, NULL); } static void vxlan_fdb_miss(struct vxlan_dev *vxlan, const u8 eth_addr[ETH_ALEN]) @@ -376,7 +376,7 @@ static void vxlan_fdb_miss(struct vxlan_dev *vxlan, const u8 eth_addr[ETH_ALEN]) memcpy(f.key.eth_addr, eth_addr, ETH_ALEN); - vxlan_fdb_notify(vxlan, &f, &remote, RTM_GETNEIGH, true, NULL); + vxlan_fdb_notify(vxlan, &f, &remote, RTM_GETNEIGH, 0, true, NULL); } /* Look up Ethernet address in forwarding table */ @@ -945,7 +945,7 @@ static void vxlan_fdb_free(struct rcu_head *head) } static void vxlan_fdb_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f, - bool do_notify, bool swdev_notify) + bool do_notify, u32 portid, bool swdev_notify) { struct vxlan_rdst *rd; @@ -955,11 +955,11 @@ static void vxlan_fdb_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f, if (do_notify) { if (rcu_access_pointer(f->nh)) vxlan_fdb_notify(vxlan, f, NULL, RTM_DELNEIGH, - swdev_notify, NULL); + portid, swdev_notify, NULL); else list_for_each_entry(rd, &f->remotes, list) vxlan_fdb_notify(vxlan, f, rd, RTM_DELNEIGH, - swdev_notify, NULL); + portid, swdev_notify, NULL); } hlist_del_init_rcu(&f->fdb_node); @@ -983,7 +983,7 @@ static int vxlan_fdb_update_existing(struct vxlan_dev *vxlan, __be16 port, __be32 vni, __u32 ifindex, __u16 ndm_flags, struct vxlan_fdb *f, u32 nhid, - bool swdev_notify, + u32 portid, bool swdev_notify, struct netlink_ext_ack *extack) { __u16 fdb_flags = (ndm_flags & ~NTF_USE); @@ -1057,7 +1057,7 @@ static int vxlan_fdb_update_existing(struct vxlan_dev *vxlan, WRITE_ONCE(f->updated, jiffies); err = vxlan_fdb_notify(vxlan, f, rd, RTM_NEWNEIGH, - swdev_notify, extack); + portid, swdev_notify, extack); if (err) goto err_notify; } @@ -1081,7 +1081,7 @@ static int vxlan_fdb_update_create(struct vxlan_dev *vxlan, __u16 state, __u16 flags, __be16 port, __be32 src_vni, __be32 vni, __u32 ifindex, __u16 ndm_flags, u32 nhid, - bool swdev_notify, + u32 portid, bool swdev_notify, struct netlink_ext_ack *extack) { __u16 fdb_flags = (ndm_flags & ~NTF_USE); @@ -1100,14 +1100,14 @@ static int vxlan_fdb_update_create(struct vxlan_dev *vxlan, return rc; rc = vxlan_fdb_notify(vxlan, f, first_remote_rtnl(f), RTM_NEWNEIGH, - swdev_notify, extack); + portid, swdev_notify, extack); if (rc) goto err_notify; return 0; err_notify: - vxlan_fdb_destroy(vxlan, f, false, false); + vxlan_fdb_destroy(vxlan, f, false, 0, false); return rc; } @@ -1117,7 +1117,7 @@ int vxlan_fdb_update(struct vxlan_dev *vxlan, __u16 state, __u16 flags, __be16 port, __be32 src_vni, __be32 vni, __u32 ifindex, __u16 ndm_flags, u32 nhid, - bool swdev_notify, + u32 portid, bool swdev_notify, struct netlink_ext_ack *extack) { struct vxlan_fdb *f; @@ -1132,23 +1132,26 @@ int vxlan_fdb_update(struct vxlan_dev *vxlan, return vxlan_fdb_update_existing(vxlan, ip, state, flags, port, vni, ifindex, ndm_flags, f, - nhid, swdev_notify, extack); + nhid, portid, swdev_notify, + extack); } else { if (!(flags & NLM_F_CREATE)) return -ENOENT; return vxlan_fdb_update_create(vxlan, mac, ip, state, flags, port, src_vni, vni, ifindex, - ndm_flags, nhid, swdev_notify, - extack); + ndm_flags, nhid, portid, + swdev_notify, extack); } } static void vxlan_fdb_dst_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f, - struct vxlan_rdst *rd, bool swdev_notify) + struct vxlan_rdst *rd, u32 portid, + bool swdev_notify) { list_del_rcu(&rd->list); - vxlan_fdb_notify(vxlan, f, rd, RTM_DELNEIGH, swdev_notify, NULL); + vxlan_fdb_notify(vxlan, f, rd, RTM_DELNEIGH, portid, swdev_notify, + NULL); call_rcu(&rd->rcu, vxlan_dst_free); } @@ -1276,7 +1279,7 @@ static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], parms->flags, port, src_vni, vni, ifindex, ndm->ndm_flags | NTF_VXLAN_ADDED_BY_USER, - nhid, true, extack); + nhid, parms->portid, true, extack); spin_unlock_bh(&vxlan->hash_lock); if (!err) @@ -1288,7 +1291,7 @@ static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], int __vxlan_fdb_delete(struct vxlan_dev *vxlan, const unsigned char *addr, union vxlan_addr ip, __be16 port, __be32 src_vni, __be32 vni, - u32 ifindex, bool swdev_notify) + u32 ifindex, u32 portid, bool swdev_notify) { struct vxlan_rdst *rd = NULL; struct vxlan_fdb *f; @@ -1308,11 +1311,11 @@ int __vxlan_fdb_delete(struct vxlan_dev *vxlan, * otherwise destroy the fdb entry */ if (rd && !list_is_singular(&f->remotes)) { - vxlan_fdb_dst_destroy(vxlan, f, rd, swdev_notify); + vxlan_fdb_dst_destroy(vxlan, f, rd, portid, swdev_notify); goto out; } - vxlan_fdb_destroy(vxlan, f, true, swdev_notify); + vxlan_fdb_destroy(vxlan, f, true, portid, swdev_notify); out: return 0; @@ -1337,7 +1340,7 @@ static int vxlan_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], spin_lock_bh(&vxlan->hash_lock); err = __vxlan_fdb_delete(vxlan, parms->addr, ip, port, src_vni, vni, - ifindex, true); + ifindex, parms->portid, true); spin_unlock_bh(&vxlan->hash_lock); if (!err) @@ -1480,7 +1483,7 @@ static enum skb_drop_reason vxlan_snoop(struct net_device *dev, src_mac, &rdst->remote_ip.sa, &src_ip->sa); rdst->remote_ip = *src_ip; - vxlan_fdb_notify(vxlan, f, rdst, RTM_NEWNEIGH, true, NULL); + vxlan_fdb_notify(vxlan, f, rdst, RTM_NEWNEIGH, 0, true, NULL); } else { /* learned new entry */ spin_lock(&vxlan->hash_lock); @@ -1493,7 +1496,7 @@ static enum skb_drop_reason vxlan_snoop(struct net_device *dev, cfg->dst_port, vni, cfg->vni, - ifindex, NTF_SELF, 0, true, NULL); + ifindex, NTF_SELF, 0, 0, true, NULL); spin_unlock(&vxlan->hash_lock); } @@ -2943,7 +2946,7 @@ static void vxlan_cleanup(struct timer_list *t) netdev_dbg(vxlan->dev, "garbage collect %pM\n", f->key.eth_addr); f->state = NUD_STALE; - vxlan_fdb_destroy(vxlan, f, true, true); + vxlan_fdb_destroy(vxlan, f, true, 0, true); } spin_unlock(&vxlan->hash_lock); } else if (time_before(timeout, next_timer)) { @@ -3138,7 +3141,7 @@ vxlan_fdb_flush_remote_matches(const struct vxlan_fdb_flush_desc *desc, static void vxlan_fdb_flush_match_remotes(struct vxlan_fdb *f, struct vxlan_dev *vxlan, const struct vxlan_fdb_flush_desc *desc, - bool *p_destroy_fdb) + u32 portid, bool *p_destroy_fdb) { struct vxlan_rdst *rd, *tmp; @@ -3151,13 +3154,13 @@ vxlan_fdb_flush_match_remotes(struct vxlan_fdb *f, struct vxlan_dev *vxlan, return; } - vxlan_fdb_dst_destroy(vxlan, f, rd, true); + vxlan_fdb_dst_destroy(vxlan, f, rd, portid, true); } } /* Purge the forwarding table */ static void vxlan_flush(struct vxlan_dev *vxlan, - const struct vxlan_fdb_flush_desc *desc) + const struct vxlan_fdb_flush_desc *desc, u32 portid) { bool match_remotes = vxlan_fdb_flush_should_match_remotes(desc); struct vxlan_fdb *f; @@ -3174,14 +3177,14 @@ static void vxlan_flush(struct vxlan_dev *vxlan, if (match_remotes) { bool destroy_fdb = false; - vxlan_fdb_flush_match_remotes(f, vxlan, desc, + vxlan_fdb_flush_match_remotes(f, vxlan, desc, portid, &destroy_fdb); if (!destroy_fdb) goto unlock; } - vxlan_fdb_destroy(vxlan, f, true, true); + vxlan_fdb_destroy(vxlan, f, true, portid, true); unlock: spin_unlock_bh(&vxlan->hash_lock); } @@ -3263,7 +3266,7 @@ static int vxlan_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev, desc.dst_ip = ip; } - vxlan_flush(vxlan, &desc); + vxlan_flush(vxlan, &desc, 0); return 0; } @@ -3283,7 +3286,7 @@ static int vxlan_stop(struct net_device *dev) timer_delete_sync(&vxlan->age_timer); - vxlan_flush(vxlan, &desc); + vxlan_flush(vxlan, &desc, 0); vxlan_sock_release(vxlan); return 0; @@ -4143,7 +4146,7 @@ static int vxlan_dev_create(struct net *net, struct net_device *dev, cfg->vni, cfg->vni, cfg->remote_ifindex, - NTF_SELF, 0, true, extack); + NTF_SELF, 0, 0, true, extack); spin_unlock_bh(&vxlan->hash_lock); if (err) goto unlink; @@ -4606,7 +4609,7 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[], cfg->dst_port, conf.vni, conf.vni, conf.remote_ifindex, - NTF_SELF, 0, true, extack); + NTF_SELF, 0, 0, true, extack); if (err) { spin_unlock_bh(&vxlan->hash_lock); if (lowerdev_changed) @@ -4623,7 +4626,7 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[], cfg->vni, cfg->vni, cfg->remote_ifindex, - true); + 0, true); spin_unlock_bh(&vxlan->hash_lock); /* If vni filtering device, also update default fdb entries of @@ -4687,7 +4690,7 @@ static void vxlan_dellink(struct net_device *dev, struct list_head *head) struct vxlan_dev *vxlan = netdev_priv(dev); struct vxlan_fdb_flush_desc desc = {}; - vxlan_flush(vxlan, &desc); + vxlan_flush(vxlan, &desc, 0); list_del(&vxlan->next); unregister_netdevice_queue(dev, head); @@ -4960,7 +4963,7 @@ vxlan_fdb_external_learn_add(struct net_device *dev, fdb_info->remote_vni, fdb_info->remote_ifindex, NTF_USE | NTF_SELF | NTF_EXT_LEARNED, - 0, false, extack); + 0, 0, false, extack); spin_unlock_bh(&vxlan->hash_lock); return err; @@ -4986,7 +4989,7 @@ vxlan_fdb_external_learn_del(struct net_device *dev, fdb_info->vni, fdb_info->remote_vni, fdb_info->remote_ifindex, - false); + 0, false); spin_unlock_bh(&vxlan->hash_lock); @@ -5044,7 +5047,7 @@ static void vxlan_fdb_nh_flush(struct nexthop *nh) WARN_ON(!vxlan); spin_lock_bh(&vxlan->hash_lock); if (!hlist_unhashed(&fdb->fdb_node)) - vxlan_fdb_destroy(vxlan, fdb, false, false); + vxlan_fdb_destroy(vxlan, fdb, false, 0, false); spin_unlock_bh(&vxlan->hash_lock); } rcu_read_unlock(); diff --git a/drivers/net/vxlan/vxlan_private.h b/drivers/net/vxlan/vxlan_private.h index f0ee85f83732..632e1880c0b9 100644 --- a/drivers/net/vxlan/vxlan_private.h +++ b/drivers/net/vxlan/vxlan_private.h @@ -196,13 +196,14 @@ int vxlan_fdb_create(struct vxlan_dev *vxlan, int __vxlan_fdb_delete(struct vxlan_dev *vxlan, const unsigned char *addr, union vxlan_addr ip, __be16 port, __be32 src_vni, __be32 vni, - u32 ifindex, bool swdev_notify); + u32 ifindex, u32 portid, bool swdev_notify); int vxlan_fdb_update(struct vxlan_dev *vxlan, const u8 *mac, union vxlan_addr *ip, __u16 state, __u16 flags, __be16 port, __be32 src_vni, __be32 vni, __u32 ifindex, __u16 ndm_flags, u32 nhid, - bool swdev_notify, struct netlink_ext_ack *extack); + u32 portid, bool swdev_notify, + struct netlink_ext_ack *extack); void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, const struct vxlan_config *cfg, __be32 default_vni, struct vxlan_rdst *rdst, bool did_rsc); diff --git a/drivers/net/vxlan/vxlan_vnifilter.c b/drivers/net/vxlan/vxlan_vnifilter.c index c5cc6cd08545..927b63db3b5b 100644 --- a/drivers/net/vxlan/vxlan_vnifilter.c +++ b/drivers/net/vxlan/vxlan_vnifilter.c @@ -550,7 +550,7 @@ int vxlan_update_default_fdb_entry(struct vxlan_dev *vxlan, __be32 vni, vni, vni, new_ifindex, - NTF_SELF, 0, true, extack); + NTF_SELF, 0, 0, true, extack); if (err && extack) { spin_unlock_bh(&vxlan->hash_lock); return err; @@ -563,7 +563,7 @@ int vxlan_update_default_fdb_entry(struct vxlan_dev *vxlan, __be32 vni, cfg->dst_port, vni, vni, old_ifindex, - true); + 0, true); } spin_unlock_bh(&vxlan->hash_lock); @@ -727,7 +727,7 @@ static void vxlan_vni_delete_group(struct vxlan_dev *vxlan, cfg->dst_port, vninode->vni, vninode->vni, cfg->remote_ifindex, - true); + 0, true); spin_unlock_bh(&vxlan->hash_lock); } -- 2.56.1