From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ido Schimmel Subject: [PATCH net-next v2 15/18] vxlan: Notify for each remote of a removed FDB entry Date: Wed, 17 Oct 2018 08:53:27 +0000 Message-ID: <20181017085215.26607-16-idosch@mellanox.com> References: <20181017085215.26607-1-idosch@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "davem@davemloft.net" , Jiri Pirko , Petr Machata , "jakub.kicinski@netronome.com" , "ivecera@redhat.com" , "roopa@cumulusnetworks.com" , "nikolay@cumulusnetworks.com" , "andrew@lunn.ch" , "vivien.didelot@savoirfairelinux.com" , "f.fainelli@gmail.com" , "stephen@networkplumber.org" , "bridge@lists.linux-foundation.org" , mlxsw , Ido Schimmel To: "netdev@vger.kernel.org" Return-path: Received: from mail-db5eur01on0079.outbound.protection.outlook.com ([104.47.2.79]:57120 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726691AbeJQQsN (ORCPT ); Wed, 17 Oct 2018 12:48:13 -0400 In-Reply-To: <20181017085215.26607-1-idosch@mellanox.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: From: Petr Machata When notifications are sent about FDB activity, and an FDB entry with several remotes is removed, the notification is sent only for the first destination. That makes it impossible to distinguish between the case where only this first remote is removed, and the one where the FDB entry is removed as a whole. Therefore send one notification for each remote of a removed FDB entry. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel --- drivers/net/vxlan.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index e98fc54379f8..1d74f90d6f5d 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -843,12 +843,15 @@ 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) { + struct vxlan_rdst *rd; + netdev_dbg(vxlan->dev, "delete %pM\n", f->eth_addr); =20 --vxlan->addrcnt; if (do_notify) - vxlan_fdb_notify(vxlan, f, first_remote_rtnl(f), RTM_DELNEIGH); + list_for_each_entry(rd, &f->remotes, list) + vxlan_fdb_notify(vxlan, f, rd, RTM_DELNEIGH); =20 hlist_del_rcu(&f->hlist); call_rcu(&f->rcu, vxlan_fdb_free); --=20 2.17.2