[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1484984410-3304-2-git-send-email-roopa@cumulusnetworks.com>
Date: Fri, 20 Jan 2017 23:40:07 -0800
From: Roopa Prabhu <roopa@...ulusnetworks.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, ramanb@...ulusnetworks.com,
stephen@...workplumber.org, jbenc@...hat.com, pshelar@....org
Subject: [PATCH cumulus-4.1.y 2/5] vxlan: don't replace fdb entry if nothing changed
From: Balakrishnan Raman <ramanb@...ulusnetworks.com>
This will avoid unnecessary notifications to userspace.
Signed-off-by: Balakrishnan Raman <ramanb@...ulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@...ulusnetworks.com>
---
drivers/net/vxlan.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 15b1c23..72b99ff 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -467,12 +467,19 @@ static int vxlan_fdb_replace(struct vxlan_fdb *f,
if (!rd)
return 0;
- dst_cache_reset(&rd->dst_cache);
- rd->remote_ip = *ip;
- rd->remote_port = port;
- rd->remote_vni = vni;
- rd->remote_ifindex = ifindex;
- return 1;
+ if (!vxlan_addr_equal(&rd->remote_ip, ip) ||
+ rd->remote_port != port ||
+ rd->remote_vni != vni ||
+ rd->remote_ifindex != ifindex) {
+ dst_cache_reset(&rd->dst_cache);
+ rd->remote_ip = *ip;
+ rd->remote_port = port;
+ rd->remote_vni = vni;
+ rd->remote_ifindex = ifindex;
+ return 1;
+ }
+
+ return 0;
}
/* Add/update destinations for multicast */
--
1.9.1
Powered by blists - more mailing lists