diff options
author | Roopa Prabhu <roopa@cumulusnetworks.com> | 2018-07-20 16:21:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-22 13:52:37 -0400 |
commit | f6e053858671bb156b6e44ad66418acc8c7f4e77 (patch) | |
tree | 6cdf9b1c1ec8da68ee5f4e3457b413e2f7ae8ddc | |
parent | 7431016b107c95cb5b2014aa1901fcb115f746bc (diff) |
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 <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/vxlan.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index c8d5bfffadef..a7e9a4dc0636 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -774,13 +774,15 @@ static void vxlan_fdb_free(struct rcu_head *head) | |||
774 | kfree(f); | 774 | kfree(f); |
775 | } | 775 | } |
776 | 776 | ||
777 | static void vxlan_fdb_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f) | 777 | static void vxlan_fdb_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f, |
778 | bool do_notify) | ||
778 | { | 779 | { |
779 | netdev_dbg(vxlan->dev, | 780 | netdev_dbg(vxlan->dev, |
780 | "delete %pM\n", f->eth_addr); | 781 | "delete %pM\n", f->eth_addr); |
781 | 782 | ||
782 | --vxlan->addrcnt; | 783 | --vxlan->addrcnt; |
783 | vxlan_fdb_notify(vxlan, f, first_remote_rtnl(f), RTM_DELNEIGH); | 784 | if (do_notify) |
785 | vxlan_fdb_notify(vxlan, f, first_remote_rtnl(f), RTM_DELNEIGH); | ||
784 | 786 | ||
785 | hlist_del_rcu(&f->hlist); | 787 | hlist_del_rcu(&f->hlist); |
786 | call_rcu(&f->rcu, vxlan_fdb_free); | 788 | call_rcu(&f->rcu, vxlan_fdb_free); |
@@ -930,7 +932,7 @@ static int __vxlan_fdb_delete(struct vxlan_dev *vxlan, | |||
930 | goto out; | 932 | goto out; |
931 | } | 933 | } |
932 | 934 | ||
933 | vxlan_fdb_destroy(vxlan, f); | 935 | vxlan_fdb_destroy(vxlan, f, true); |
934 | 936 | ||
935 | out: | 937 | out: |
936 | return 0; | 938 | return 0; |
@@ -2397,7 +2399,7 @@ static void vxlan_cleanup(struct timer_list *t) | |||
2397 | "garbage collect %pM\n", | 2399 | "garbage collect %pM\n", |
2398 | f->eth_addr); | 2400 | f->eth_addr); |
2399 | f->state = NUD_STALE; | 2401 | f->state = NUD_STALE; |
2400 | vxlan_fdb_destroy(vxlan, f); | 2402 | vxlan_fdb_destroy(vxlan, f, true); |
2401 | } else if (time_before(timeout, next_timer)) | 2403 | } else if (time_before(timeout, next_timer)) |
2402 | next_timer = timeout; | 2404 | next_timer = timeout; |
2403 | } | 2405 | } |
@@ -2448,7 +2450,7 @@ static void vxlan_fdb_delete_default(struct vxlan_dev *vxlan, __be32 vni) | |||
2448 | spin_lock_bh(&vxlan->hash_lock); | 2450 | spin_lock_bh(&vxlan->hash_lock); |
2449 | f = __vxlan_find_mac(vxlan, all_zeros_mac, vni); | 2451 | f = __vxlan_find_mac(vxlan, all_zeros_mac, vni); |
2450 | if (f) | 2452 | if (f) |
2451 | vxlan_fdb_destroy(vxlan, f); | 2453 | vxlan_fdb_destroy(vxlan, f, true); |
2452 | spin_unlock_bh(&vxlan->hash_lock); | 2454 | spin_unlock_bh(&vxlan->hash_lock); |
2453 | } | 2455 | } |
2454 | 2456 | ||
@@ -2502,7 +2504,7 @@ static void vxlan_flush(struct vxlan_dev *vxlan, bool do_all) | |||
2502 | continue; | 2504 | continue; |
2503 | /* the all_zeros_mac entry is deleted at vxlan_uninit */ | 2505 | /* the all_zeros_mac entry is deleted at vxlan_uninit */ |
2504 | if (!is_zero_ether_addr(f->eth_addr)) | 2506 | if (!is_zero_ether_addr(f->eth_addr)) |
2505 | vxlan_fdb_destroy(vxlan, f); | 2507 | vxlan_fdb_destroy(vxlan, f, true); |
2506 | } | 2508 | } |
2507 | } | 2509 | } |
2508 | spin_unlock_bh(&vxlan->hash_lock); | 2510 | spin_unlock_bh(&vxlan->hash_lock); |