Skip to content

Commit 4c2438b

Browse files
roopa-prabhudavem330
authored andcommitted
vxlan: make netlink notify in vxlan_fdb_destroy optional
Add a new option do_notify to vxlan_fdb_destroy to make sending netlink notify optional. Used by a later patch. Signed-off-by: Roopa Prabhu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 25e20e7 commit 4c2438b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

drivers/net/vxlan.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -775,13 +775,15 @@ static void vxlan_fdb_free(struct rcu_head *head)
775775
kfree(f);
776776
}
777777

778-
static void vxlan_fdb_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f)
778+
static void vxlan_fdb_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f,
779+
bool do_notify)
779780
{
780781
netdev_dbg(vxlan->dev,
781782
"delete %pM\n", f->eth_addr);
782783

783784
--vxlan->addrcnt;
784-
vxlan_fdb_notify(vxlan, f, first_remote_rtnl(f), RTM_DELNEIGH);
785+
if (do_notify)
786+
vxlan_fdb_notify(vxlan, f, first_remote_rtnl(f), RTM_DELNEIGH);
785787

786788
hlist_del_rcu(&f->hlist);
787789
call_rcu(&f->rcu, vxlan_fdb_free);
@@ -931,7 +933,7 @@ static int __vxlan_fdb_delete(struct vxlan_dev *vxlan,
931933
goto out;
932934
}
933935

934-
vxlan_fdb_destroy(vxlan, f);
936+
vxlan_fdb_destroy(vxlan, f, true);
935937

936938
out:
937939
return 0;
@@ -2399,7 +2401,7 @@ static void vxlan_cleanup(struct timer_list *t)
23992401
"garbage collect %pM\n",
24002402
f->eth_addr);
24012403
f->state = NUD_STALE;
2402-
vxlan_fdb_destroy(vxlan, f);
2404+
vxlan_fdb_destroy(vxlan, f, true);
24032405
} else if (time_before(timeout, next_timer))
24042406
next_timer = timeout;
24052407
}
@@ -2450,7 +2452,7 @@ static void vxlan_fdb_delete_default(struct vxlan_dev *vxlan, __be32 vni)
24502452
spin_lock_bh(&vxlan->hash_lock);
24512453
f = __vxlan_find_mac(vxlan, all_zeros_mac, vni);
24522454
if (f)
2453-
vxlan_fdb_destroy(vxlan, f);
2455+
vxlan_fdb_destroy(vxlan, f, true);
24542456
spin_unlock_bh(&vxlan->hash_lock);
24552457
}
24562458

@@ -2504,7 +2506,7 @@ static void vxlan_flush(struct vxlan_dev *vxlan, bool do_all)
25042506
continue;
25052507
/* the all_zeros_mac entry is deleted at vxlan_uninit */
25062508
if (!is_zero_ether_addr(f->eth_addr))
2507-
vxlan_fdb_destroy(vxlan, f);
2509+
vxlan_fdb_destroy(vxlan, f, true);
25082510
}
25092511
}
25102512
spin_unlock_bh(&vxlan->hash_lock);

0 commit comments

Comments
 (0)