From patchwork Thu Nov 14 14:09:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13875142 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2068.outbound.protection.outlook.com [40.107.244.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14A6D381C4 for ; Thu, 14 Nov 2024 14:12:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.68 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731593550; cv=fail; b=joBDnPtlfPBlCedtB22AmSBXyEvtu8Xe8U1scw99MpIXFVEVrGQnW4hIaHIqI8r2yeyZfCMiNrd5Ht7yWWNzD7/ZmRE8HZtW87NiNYvK+ZE+TxsxKo3J7k8y/HGisPv45CvhMwZtltrcT9XKUhfQwP60s329ausvt8aQU43QxD0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731593550; c=relaxed/simple; bh=aCqKkU8VPBSIcEz/qRYI+7VTRGA/KgrupGHr5ivPGi4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=E15j9vYpLct8jJjMP4jH98/WDcmKPdxdYD9aLhyW4vLX14Bk4+ThjeHNiyyqoE/QEOs1sPAf1+7rHsIx3ZDowfLNVghwnNr9MIyiRmhVPWRYM+KYPameLhM4QeFqDT6ib94Hc2O8lxsDPAsFJcbkGmGQ46qVyg4Twengq41RJ2U= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=speYvi+e; arc=fail smtp.client-ip=40.107.244.68 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) header.d=Nvidia.com header.i=@Nvidia.com header.b="speYvi+e" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uHfld3ZvofgjLpAF0u+F5pLtvbw+5J8W+S7gQSrP0jX7rTtNfDOhHf1I2O22tTHK+WO7cBdsDudZDRjdgtzNQ87z7+mi4r0GPnSchd330hJbPQTGGt1AD1nKnwk7YHawQp/qtxkco40Zzax9dKxeV3r+Wxem4hrHIhAMfaRKux+HhJjeiP2KYvXIfKzZV0FjgwyGEK8YGUlBVaC64vmLORynT9+vfbC/PYIqsppUBgeBmmmX0ahOA3PdbDJsu6mFyFit78bgddaVGR0bu689NKTh31dj0sk2tTxQcz0QWHY1DxGhvNBawQcFdlJZ5lkNb/OfuxXV8FtxLJOUpAerMA== 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=NwY7H7wbLDRBQoPdoxvLNc4yqPbJeK2DnAdyRGvD5fc=; b=gHISWa2ptEHkJRXFlviAlDcXOvWVZ5CErHnNGclPXLu1BDymLe3Lo39z8wPghCRX+rZhk047frLhZR9YL3vK1g4ESf024votbNWlnzNKxQ2jLB+7NQ1vob4+l2zEDUeFVRk9caaezDN9gMDFCP2qohVsSANWj7giavS+75+HJl6b1c824FicnK7xL/Dc7osCSqcOUrrpKjbgtb1mMnEZTrUBGJieorfxQ+r4NE9J9ozBZloeufq2mQcntDoF2ztHMyJrSfIyiIl2kJsZH3msDuyFwuvJr6iOQWV3egP/AMgdR9AI2umRM/lVEpna6Wb8++gxH8G4+MLSp0H3qD8uyA== 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 (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=NwY7H7wbLDRBQoPdoxvLNc4yqPbJeK2DnAdyRGvD5fc=; b=speYvi+esYcu/grUl0Qi9NSAD7mjijECYzNSs99bXYAzRSi5d7yqjf5B68LkZ76noz5HKBYIZKX5kJF49NO4BvgHN0Zvbv2aqTc2bhlQFPVD78V6sCmqbWO0rDVrCSErg2lRa1jD4mwVeILXvJ2nvWJeIEyJ4fQUQKF75LJT+IMaigh2j3I4K5rO6gLa52mjHxVNkiTTWnJILyF5aGea92hoivMjf05+8GPg3Lf/vLb4oQgiQNQl2Pbj2WWauKlIAxzWNUjbppVhkQbxSVvPky4ivdkb+OOaHD+Ke+bG+15//pWy9V54NYBcIkeE/bT9M9lpd+o2YZ3Hp+zOrAVF9Q== Received: from CH5P222CA0009.NAMP222.PROD.OUTLOOK.COM (2603:10b6:610:1ee::25) by CH2PR12MB4037.namprd12.prod.outlook.com (2603:10b6:610:7a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.18; Thu, 14 Nov 2024 14:12:21 +0000 Received: from DS3PEPF000099D6.namprd04.prod.outlook.com (2603:10b6:610:1ee:cafe::49) by CH5P222CA0009.outlook.office365.com (2603:10b6:610:1ee::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17 via Frontend Transport; Thu, 14 Nov 2024 14:12:21 +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 DS3PEPF000099D6.mail.protection.outlook.com (10.167.17.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.14 via Frontend Transport; Thu, 14 Nov 2024 14:12:20 +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.1544.4; Thu, 14 Nov 2024 06:12:07 -0800 Received: from fedora.mtl.com (10.126.231.35) 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.1544.4; Thu, 14 Nov 2024 06:11:58 -0800 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Simon Horman , Ido Schimmel , "Petr Machata" , Amit Cohen , Vladimir Oltean , Andy Roulin , , Nikolay Aleksandrov , "Przemek Kitszel" , , , Manish Chopra , , Kuniyuki Iwashima , "Andrew Lunn" , Subject: [PATCH net-next v4 2/7] ndo_fdb_del: Add a parameter to report whether notification was sent Date: Thu, 14 Nov 2024 15:09:54 +0100 Message-ID: <06b1acf4953ef0a5ed153ef1f32d7292044f2be6.1731589511.git.petrm@nvidia.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D6:EE_|CH2PR12MB4037:EE_ X-MS-Office365-Filtering-Correlation-Id: ee566b62-3097-42ce-c485-08dd04b65ad5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|7416014|376014; X-Microsoft-Antispam-Message-Info: 01pKrL+gDD6iq2BwrVYT0V499t5F0Wx3XrzoH8tJpRzwL7o+wUczF0DRO4MRXpo4Fs+P0lIs8fYm4vhDXvd/jux++GYP6DylVa0zAQw/+/fpaajdaRIdkJIe6ahVeu9jrltN//0HSf5yBKw1A5Ww6Qr+nylgN77cZQNVDpLcaig+Vr/Tfr6qLolDoYtsJY5H9Iw1dBlAKPFUxVewzk0/1vpY187hkxoXcBc2hkCjCelETmYHpr7CMlZGazKx7ffRyUlyic/bCaPI+w1tBtlq+bXO4BhDHbDvdv67CPzz1RdMqlFK9JTBzTwZXzN8QvaJ1gajaZUtzEhUWfwR8JDVYV4L2crVddQDvTYWX4521nEwcIA7VVjBeom3psnPMHJV0sdmSf6WrWXW+SFfcOm6AS5eecCUNY5yxa9Gf0NusZHFCilf6sIHGlFGBoX5in1SA2ucwnHuijdz06bc8JZcVKu+aG4c8ZsTRmu/7klZz+Klm36ir9+Wd6QrCi/1NvoHYad1GSdEh27HxfVKKVOqxCMdrDYHQVi8yDczwenidBHZrAKR41Kp3EA7W3voyhVl5WP4kDeQUS0E1SXxDupz8dsoiB5JmfhBrlgmgIjHYW5JDdBVxy/u9cMxDcPiy9/f8l+c/I2+ghm7lb1R4FIA+bEm5aTmCMKQnsOhwGPsfgFOu48fxzdumYcXLPxsB4iQMxA3BfaufT7B6Fb6XnCx/vyFewnitl8XaMWxXQ5vbpDtW53qcbQUZjmQxViBrrEBGDof3d5iF1xEyczhk2CGTwmQ+zbd8INoIDcagTa0bD6qZWdR3vYvn+0yyePmRYIrINRxtEwbV01l6kR35BW9xA9/OtuhrhbaArUko5SjsOc5cdnVQ7l8d6pNuzRFCcizt1kzwumUIvfXE/M8YC6xx0294uBkJ4Drxq7hfJWHXb049AAlswZsAqvWUloZLxoOigzvvEFMldpf67W0OaejpUF9Br5Q0S9ca27nOg/Emjlr1OGQaR3lDsDjB/aMmYJJF4ISQn3Tzatw/lAW1ybAmBhZomPzRySOuzABDexFV7cmoIT+gIMKoVBvNkG7nNqvnQkhMY+Uzd32Iyegd+96dPz2Jr5C+WswSgL3NSFAJkP4225S3MhYIBk4DEMp9+j8AzZHsFDzxG8GDOoAcxW2yiAlntVZwV4DnP6YxM1mklng9MVOf/Q/YUkWdgpaifD/roe6Vt6ro2MRmQfd2G04nynG4Zo34npVPJA/tOLpJydloYOeQ552TDLP8rxW2RvK/zSVMpeiKuu3yLTwtLKpPRSm0ez70cQ0/ITz2DM8qcZ0iPGzz+fS8O8JJ0gSK5U4Llgl8vHI3bfGxb/AReFW2nHjzIkaaP1ZIf1jMAONphQ9/Rgwx8r6y6qLDRnFBCM4FGzeB/Lq+akT4kNBnNGS9Q== 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:(13230040)(1800799024)(82310400026)(36860700013)(7416014)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 14:12:20.9590 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee566b62-3097-42ce-c485-08dd04b65ad5 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: DS3PEPF000099D6.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4037 X-Patchwork-Delegate: kuba@kernel.org In a similar fashion to ndo_fdb_add, which was covered in the previous patch, add the bool *notified argument to ndo_fdb_del. Callees that send a notification on their own set the flag to true. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Reviewed-by: Nikolay Aleksandrov --- Notes: CC: Przemek Kitszel CC: intel-wired-lan@lists.osuosl.org CC: UNGLinuxDriver@microchip.com CC: Manish Chopra CC: GR-Linux-NIC-Dev@marvell.com CC: Kuniyuki Iwashima CC: Andrew Lunn CC: Nikolay Aleksandrov CC: bridge@lists.linux.dev drivers/net/ethernet/intel/ice/ice_main.c | 4 +++- drivers/net/ethernet/mscc/ocelot_net.c | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 2 +- drivers/net/macvlan.c | 2 +- drivers/net/vxlan/vxlan_core.c | 5 ++++- include/linux/netdevice.h | 9 +++++++-- net/bridge/br_fdb.c | 15 ++++++++------- net/bridge/br_private.h | 2 +- net/core/rtnetlink.c | 11 ++++++++--- 9 files changed, 34 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index c875036f654b..b79848fe2a9e 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -6166,12 +6166,14 @@ ice_fdb_add(struct ndmsg *ndm, struct nlattr __always_unused *tb[], * @dev: the net device pointer * @addr: the MAC address entry being added * @vid: VLAN ID + * @notified: whether notification was emitted * @extack: netlink extended ack */ static int ice_fdb_del(struct ndmsg *ndm, __always_unused struct nlattr *tb[], struct net_device *dev, const unsigned char *addr, - __always_unused u16 vid, struct netlink_ext_ack *extack) + __always_unused u16 vid, bool *notified, + struct netlink_ext_ack *extack) { int err; diff --git a/drivers/net/ethernet/mscc/ocelot_net.c b/drivers/net/ethernet/mscc/ocelot_net.c index 4f15ba2c5525..558e03301aa8 100644 --- a/drivers/net/ethernet/mscc/ocelot_net.c +++ b/drivers/net/ethernet/mscc/ocelot_net.c @@ -744,7 +744,7 @@ static int ocelot_port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], static int ocelot_port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, const unsigned char *addr, u16 vid, - struct netlink_ext_ack *extack) + bool *notified, struct netlink_ext_ack *extack) { struct ocelot_port_private *priv = netdev_priv(dev); struct ocelot_port *ocelot_port = &priv->port; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 2484cebd97d4..eb69121df726 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c @@ -367,7 +367,7 @@ static int qlcnic_set_mac(struct net_device *netdev, void *p) static int qlcnic_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *netdev, - const unsigned char *addr, u16 vid, + const unsigned char *addr, u16 vid, bool *notified, struct netlink_ext_ack *extack) { struct qlcnic_adapter *adapter = netdev_priv(netdev); diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index dfb462e63248..fed4fe2a4748 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -1049,7 +1049,7 @@ static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], static int macvlan_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, - const unsigned char *addr, u16 vid, + const unsigned char *addr, u16 vid, bool *notified, struct netlink_ext_ack *extack) { struct macvlan_dev *vlan = netdev_priv(dev); diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index 09c1d27e11d3..edef32a593c3 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -1319,7 +1319,7 @@ int __vxlan_fdb_delete(struct vxlan_dev *vxlan, /* Delete entry (via netlink) */ static int vxlan_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, - const unsigned char *addr, u16 vid, + const unsigned char *addr, u16 vid, bool *notified, struct netlink_ext_ack *extack) { struct vxlan_dev *vxlan = netdev_priv(dev); @@ -1341,6 +1341,9 @@ static int vxlan_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], true); spin_unlock_bh(&vxlan->hash_lock[hash_index]); + if (!err) + *notified = true; + return err; } diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 6a7fd191e1ee..ecc686409161 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1254,8 +1254,11 @@ struct netdev_net_notifier { * notification(s). Otherwise core will send a generic one. * int (*ndo_fdb_del)(struct ndmsg *ndm, struct nlattr *tb[], * struct net_device *dev, - * const unsigned char *addr, u16 vid) + * const unsigned char *addr, u16 vid + * bool *notified, struct netlink_ext_ack *extack); * Deletes the FDB entry from dev corresponding to addr. + * Callee shall set *notified to true if it sent any appropriate + * notification(s). Otherwise core will send a generic one. * int (*ndo_fdb_del_bulk)(struct nlmsghdr *nlh, struct net_device *dev, * struct netlink_ext_ack *extack); * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb, @@ -1533,7 +1536,9 @@ struct net_device_ops { struct nlattr *tb[], struct net_device *dev, const unsigned char *addr, - u16 vid, struct netlink_ext_ack *extack); + u16 vid, + bool *notified, + struct netlink_ext_ack *extack); int (*ndo_fdb_del_bulk)(struct nlmsghdr *nlh, struct net_device *dev, struct netlink_ext_ack *extack); diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index 5f29958f3ddd..82bac2426631 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c @@ -1287,7 +1287,7 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], static int fdb_delete_by_addr_and_port(struct net_bridge *br, const struct net_bridge_port *p, - const u8 *addr, u16 vlan) + const u8 *addr, u16 vlan, bool *notified) { struct net_bridge_fdb_entry *fdb; @@ -1296,18 +1296,19 @@ static int fdb_delete_by_addr_and_port(struct net_bridge *br, return -ENOENT; fdb_delete(br, fdb, true); + *notified = true; return 0; } static int __br_fdb_delete(struct net_bridge *br, const struct net_bridge_port *p, - const unsigned char *addr, u16 vid) + const unsigned char *addr, u16 vid, bool *notified) { int err; spin_lock_bh(&br->hash_lock); - err = fdb_delete_by_addr_and_port(br, p, addr, vid); + err = fdb_delete_by_addr_and_port(br, p, addr, vid, notified); spin_unlock_bh(&br->hash_lock); return err; @@ -1316,7 +1317,7 @@ static int __br_fdb_delete(struct net_bridge *br, /* Remove neighbor entry with RTM_DELNEIGH */ int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, - const unsigned char *addr, u16 vid, + const unsigned char *addr, u16 vid, bool *notified, struct netlink_ext_ack *extack) { struct net_bridge_vlan_group *vg; @@ -1339,19 +1340,19 @@ int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], } if (vid) { - err = __br_fdb_delete(br, p, addr, vid); + err = __br_fdb_delete(br, p, addr, vid, notified); } else { struct net_bridge_vlan *v; err = -ENOENT; - err &= __br_fdb_delete(br, p, addr, 0); + err &= __br_fdb_delete(br, p, addr, 0, notified); if (!vg || !vg->num_vlans) return err; list_for_each_entry(v, &vg->vlan_list, vlist) { if (!br_vlan_should_use(v)) continue; - err &= __br_fdb_delete(br, p, addr, v->vid); + err &= __br_fdb_delete(br, p, addr, v->vid, notified); } } diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index ebfc59049ec1..9853cfbb9d14 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h @@ -853,7 +853,7 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, const unsigned char *addr, u16 vid, - struct netlink_ext_ack *extack); + bool *notified, struct netlink_ext_ack *extack); int br_fdb_delete_bulk(struct nlmsghdr *nlh, struct net_device *dev, struct netlink_ext_ack *extack); int br_fdb_add(struct ndmsg *nlh, struct nlattr *tb[], struct net_device *dev, diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index f31b2436cde5..dd142f444659 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -4701,11 +4701,13 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh, if ((!ndm->ndm_flags || ndm->ndm_flags & NTF_MASTER) && netif_is_bridge_port(dev)) { struct net_device *br_dev = netdev_master_upper_dev_get(dev); + bool notified = false; ops = br_dev->netdev_ops; if (!del_bulk) { if (ops->ndo_fdb_del) - err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid, extack); + err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid, + ¬ified, extack); } else { if (ops->ndo_fdb_del_bulk) err = ops->ndo_fdb_del_bulk(nlh, dev, extack); @@ -4719,10 +4721,13 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh, /* Embedded bridge, macvlan, and any other device support */ if (ndm->ndm_flags & NTF_SELF) { + bool notified = false; + ops = dev->netdev_ops; if (!del_bulk) { if (ops->ndo_fdb_del) - err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid, extack); + err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid, + ¬ified, extack); else err = ndo_dflt_fdb_del(ndm, tb, dev, addr, vid); } else { @@ -4733,7 +4738,7 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh, } if (!err) { - if (!del_bulk) + if (!del_bulk && !notified) rtnl_fdb_notify(dev, addr, vid, RTM_DELNEIGH, ndm->ndm_state); ndm->ndm_flags &= ~NTF_SELF;