aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vxlan.c
diff options
context:
space:
mode:
authorSridhar Samudrala <sri@us.ibm.com>2013-05-17 02:39:07 -0400
committerDavid S. Miller <davem@davemloft.net>2013-05-18 15:53:39 -0400
commit014be2c8eac3381e202f684c1f35ae184a8b152b (patch)
treeb1a278d085fac94a8ad56500309924bc3b448002 /drivers/net/vxlan.c
parente5f5e380e0f3bb11f04ca5bc66a551e58e0ad26e (diff)
vxlan: Update vxlan fdb 'used' field after each usage
Fix some instances where vxlan fdb 'used' field is not updated after the entry is used. v2: rename vxlan_find_mac() as __vxlan_find_mac() and create a new vxlan_find_mac() that also updates ->used field. Signed-off-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r--drivers/net/vxlan.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index ba81f3c39a83..3b1d2ee7156b 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -301,7 +301,7 @@ static inline struct hlist_head *vxlan_fdb_head(struct vxlan_dev *vxlan,
301} 301}
302 302
303/* Look up Ethernet address in forwarding table */ 303/* Look up Ethernet address in forwarding table */
304static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan, 304static struct vxlan_fdb *__vxlan_find_mac(struct vxlan_dev *vxlan,
305 const u8 *mac) 305 const u8 *mac)
306 306
307{ 307{
@@ -316,6 +316,18 @@ static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan,
316 return NULL; 316 return NULL;
317} 317}
318 318
319static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan,
320 const u8 *mac)
321{
322 struct vxlan_fdb *f;
323
324 f = __vxlan_find_mac(vxlan, mac);
325 if (f)
326 f->used = jiffies;
327
328 return f;
329}
330
319/* Add/update destinations for multicast */ 331/* Add/update destinations for multicast */
320static int vxlan_fdb_append(struct vxlan_fdb *f, 332static int vxlan_fdb_append(struct vxlan_fdb *f,
321 __be32 ip, __be16 port, __u32 vni, __u32 ifindex) 333 __be32 ip, __be16 port, __u32 vni, __u32 ifindex)
@@ -353,7 +365,7 @@ static int vxlan_fdb_create(struct vxlan_dev *vxlan,
353 struct vxlan_fdb *f; 365 struct vxlan_fdb *f;
354 int notify = 0; 366 int notify = 0;
355 367
356 f = vxlan_find_mac(vxlan, mac); 368 f = __vxlan_find_mac(vxlan, mac);
357 if (f) { 369 if (f) {
358 if (flags & NLM_F_EXCL) { 370 if (flags & NLM_F_EXCL) {
359 netdev_dbg(vxlan->dev, 371 netdev_dbg(vxlan->dev,
@@ -563,7 +575,6 @@ static void vxlan_snoop(struct net_device *dev,
563 575
564 f = vxlan_find_mac(vxlan, src_mac); 576 f = vxlan_find_mac(vxlan, src_mac);
565 if (likely(f)) { 577 if (likely(f)) {
566 f->used = jiffies;
567 if (likely(f->remote.remote_ip == src_ip)) 578 if (likely(f->remote.remote_ip == src_ip))
568 return; 579 return;
569 580