* [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down
@ 2017-01-21 7:40 Roopa Prabhu
2017-01-21 7:40 ` [PATCH cumulus-4.1.y 2/5] vxlan: don't replace fdb entry if nothing changed Roopa Prabhu
` (7 more replies)
0 siblings, 8 replies; 13+ messages in thread
From: Roopa Prabhu @ 2017-01-21 7:40 UTC (permalink / raw)
To: davem; +Cc: netdev, ramanb, stephen, jbenc, pshelar
From: Balakrishnan Raman <ramanb@cumulusnetworks.com>
Flush fdb entries of a vxlan device when its state
changes to oper down. vxlan_stop handles flush on
admin down.
Signed-off-by: Balakrishnan Raman <ramanb@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
drivers/net/vxlan.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 19b1653..15b1c23 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -3276,6 +3276,12 @@ static int vxlan_netdevice_event(struct notifier_block *unused,
vxlan_handle_lowerdev_unregister(vn, dev);
else if (event == NETDEV_UDP_TUNNEL_PUSH_INFO)
vxlan_push_rx_ports(dev);
+ else if (event == NETDEV_CHANGE) {
+ if (dev->netdev_ops == &vxlan_netdev_ops) {
+ if (netif_running(dev) && !netif_oper_up(dev))
+ vxlan_flush(netdev_priv(dev));
+ }
+ }
return NOTIFY_DONE;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH cumulus-4.1.y 2/5] vxlan: don't replace fdb entry if nothing changed
2017-01-21 7:40 [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down Roopa Prabhu
@ 2017-01-21 7:40 ` Roopa Prabhu
2017-01-23 17:02 ` Stephen Hemminger
2017-01-21 7:40 ` [PATCH cumulus-4.1.y 3/5] vxlan: enforce precedence for static over dynamic fdb entry Roopa Prabhu
` (6 subsequent siblings)
7 siblings, 1 reply; 13+ messages in thread
From: Roopa Prabhu @ 2017-01-21 7:40 UTC (permalink / raw)
To: davem; +Cc: netdev, ramanb, stephen, jbenc, pshelar
From: Balakrishnan Raman <ramanb@cumulusnetworks.com>
This will avoid unnecessary notifications to userspace.
Signed-off-by: Balakrishnan Raman <ramanb@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.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
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH cumulus-4.1.y 3/5] vxlan: enforce precedence for static over dynamic fdb entry
2017-01-21 7:40 [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down Roopa Prabhu
2017-01-21 7:40 ` [PATCH cumulus-4.1.y 2/5] vxlan: don't replace fdb entry if nothing changed Roopa Prabhu
@ 2017-01-21 7:40 ` Roopa Prabhu
2017-01-21 7:40 ` [PATCH cumulus-4.1.y 4/5] vxlan: don't flush static fdb entries on admin down Roopa Prabhu
` (5 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Roopa Prabhu @ 2017-01-21 7:40 UTC (permalink / raw)
To: davem; +Cc: netdev, ramanb, stephen, jbenc, pshelar
From: Wilson Kok <wkok@cumulusnetworks.com>
This patch enforces fdb state correctly when deciding
to add or update an existing fdb. It makes sure static fdb
entries are not replaced by dynamic fdb entries.
Signed-off-by: Wilson Kok <wkok@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
drivers/net/vxlan.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 72b99ff..7300586 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -628,6 +628,10 @@ static int vxlan_fdb_create(struct vxlan_dev *vxlan,
return -EEXIST;
}
if (f->state != state) {
+ if ((f->state & NUD_PERMANENT) &&
+ !(state & NUD_PERMANENT))
+ return -EINVAL;
+
f->state = state;
f->updated = jiffies;
notify = 1;
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH cumulus-4.1.y 4/5] vxlan: don't flush static fdb entries on admin down
2017-01-21 7:40 [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down Roopa Prabhu
2017-01-21 7:40 ` [PATCH cumulus-4.1.y 2/5] vxlan: don't replace fdb entry if nothing changed Roopa Prabhu
2017-01-21 7:40 ` [PATCH cumulus-4.1.y 3/5] vxlan: enforce precedence for static over dynamic fdb entry Roopa Prabhu
@ 2017-01-21 7:40 ` Roopa Prabhu
2017-01-21 9:25 ` kbuild test robot
2017-01-21 7:40 ` [PATCH cumulus-4.1.y 5/5] vxlan: do not age static remote mac entries Roopa Prabhu
` (4 subsequent siblings)
7 siblings, 1 reply; 13+ messages in thread
From: Roopa Prabhu @ 2017-01-21 7:40 UTC (permalink / raw)
To: davem; +Cc: netdev, ramanb, stephen, jbenc, pshelar
From: Roopa Prabhu <roopa@cumulusnetworks.com>
This patch skips flushing static fdb entries in
ndo_stop, but flushes all fdb entries during vxlan
device delete. This is consistent with the bridge
driver fdb
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
drivers/net/vxlan.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 7300586..3314090 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2365,7 +2365,7 @@ static int vxlan_open(struct net_device *dev)
}
/* Purge the forwarding table */
-static void vxlan_flush(struct vxlan_dev *vxlan)
+static void vxlan_flush(struct vxlan_dev *vxlan, int do_all)
{
unsigned int h;
@@ -2375,6 +2375,8 @@ static void vxlan_flush(struct vxlan_dev *vxlan)
hlist_for_each_safe(p, n, &vxlan->fdb_head[h]) {
struct vxlan_fdb *f
= container_of(p, struct vxlan_fdb, hlist);
+ if (!do_all && (f->state & (NUD_PERMANENT | NUD_NOARP)))
+ continue;
/* the all_zeros_mac entry is deleted at vxlan_uninit */
if (!is_zero_ether_addr(f->eth_addr))
vxlan_fdb_destroy(vxlan, f);
@@ -2396,7 +2398,7 @@ static int vxlan_stop(struct net_device *dev)
del_timer_sync(&vxlan->age_timer);
- vxlan_flush(vxlan);
+ vxlan_flush(vxlan, 0);
vxlan_sock_release(vxlan);
return ret;
@@ -3069,6 +3071,8 @@ static void vxlan_dellink(struct net_device *dev, struct list_head *head)
struct vxlan_dev *vxlan = netdev_priv(dev);
struct vxlan_net *vn = net_generic(vxlan->net, vxlan_net_id);
+ vxlan_flush(vxlan, 1);
+
spin_lock(&vn->sock_lock);
if (!hlist_unhashed(&vxlan->hlist))
hlist_del_rcu(&vxlan->hlist);
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH cumulus-4.1.y 5/5] vxlan: do not age static remote mac entries
2017-01-21 7:40 [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down Roopa Prabhu
` (2 preceding siblings ...)
2017-01-21 7:40 ` [PATCH cumulus-4.1.y 4/5] vxlan: don't flush static fdb entries on admin down Roopa Prabhu
@ 2017-01-21 7:40 ` Roopa Prabhu
2017-01-21 7:41 ` [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down Roopa Prabhu
` (3 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Roopa Prabhu @ 2017-01-21 7:40 UTC (permalink / raw)
To: davem; +Cc: netdev, ramanb, stephen, jbenc, pshelar
From: Balakrishnan Raman <ramanb@cumulusnetworks.com>
Mac aging is applicable only for dynamically learnt remote mac
entries. Check for user configured static remote mac entries
and skip aging.
Signed-off-by: Balakrishnan Raman <ramanb@cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
drivers/net/vxlan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 3314090..312240c 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2279,7 +2279,7 @@ static void vxlan_cleanup(unsigned long arg)
= container_of(p, struct vxlan_fdb, hlist);
unsigned long timeout;
- if (f->state & NUD_PERMANENT)
+ if (f->state & (NUD_PERMANENT | NUD_NOARP))
continue;
timeout = f->used + vxlan->cfg.age_interval * HZ;
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down
2017-01-21 7:40 [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down Roopa Prabhu
` (3 preceding siblings ...)
2017-01-21 7:40 ` [PATCH cumulus-4.1.y 5/5] vxlan: do not age static remote mac entries Roopa Prabhu
@ 2017-01-21 7:41 ` Roopa Prabhu
2017-01-21 8:54 ` kbuild test robot
` (2 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Roopa Prabhu @ 2017-01-21 7:41 UTC (permalink / raw)
To: davem; +Cc: netdev, ramanb, stephen, jbenc, pshelar
On 1/20/17, 11:40 PM, Roopa Prabhu wrote:
> From: Balakrishnan Raman <ramanb@cumulusnetworks.com>
>
> Flush fdb entries of a vxlan device when its state
> changes to oper down. vxlan_stop handles flush on
> admin down.
>
> Signed-off-by: Balakrishnan Raman <ramanb@cumulusnetworks.com>
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
> ---
>
pls ignore this series. Accidently hit send in the wrong folder :(
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down
2017-01-21 7:40 [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down Roopa Prabhu
` (4 preceding siblings ...)
2017-01-21 7:41 ` [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down Roopa Prabhu
@ 2017-01-21 8:54 ` kbuild test robot
2017-01-21 8:58 ` kbuild test robot
2017-01-23 16:59 ` Stephen Hemminger
7 siblings, 0 replies; 13+ messages in thread
From: kbuild test robot @ 2017-01-21 8:54 UTC (permalink / raw)
To: Roopa Prabhu; +Cc: kbuild-all, davem, netdev, ramanb, stephen, jbenc, pshelar
[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]
Hi Balakrishnan,
[auto build test ERROR on net-next/master]
[also build test ERROR on v4.10-rc4 next-20170120]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Roopa-Prabhu/vxlan-flush-fdb-entries-on-oper-down/20170121-163042
config: x86_64-randconfig-x017-201703 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
drivers/net/vxlan.c: In function 'vxlan_netdevice_event':
>> drivers/net/vxlan.c:3280:27: error: 'vxlan_netdev_ops' undeclared (first use in this function)
if (dev->netdev_ops == &vxlan_netdev_ops) {
^~~~~~~~~~~~~~~~
drivers/net/vxlan.c:3280:27: note: each undeclared identifier is reported only once for each function it appears in
vim +/vxlan_netdev_ops +3280 drivers/net/vxlan.c
3274
3275 if (event == NETDEV_UNREGISTER)
3276 vxlan_handle_lowerdev_unregister(vn, dev);
3277 else if (event == NETDEV_UDP_TUNNEL_PUSH_INFO)
3278 vxlan_push_rx_ports(dev);
3279 else if (event == NETDEV_CHANGE) {
> 3280 if (dev->netdev_ops == &vxlan_netdev_ops) {
3281 if (netif_running(dev) && !netif_oper_up(dev))
3282 vxlan_flush(netdev_priv(dev));
3283 }
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27495 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down
2017-01-21 7:40 [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down Roopa Prabhu
` (5 preceding siblings ...)
2017-01-21 8:54 ` kbuild test robot
@ 2017-01-21 8:58 ` kbuild test robot
2017-01-23 16:59 ` Stephen Hemminger
7 siblings, 0 replies; 13+ messages in thread
From: kbuild test robot @ 2017-01-21 8:58 UTC (permalink / raw)
To: Roopa Prabhu; +Cc: kbuild-all, davem, netdev, ramanb, stephen, jbenc, pshelar
[-- Attachment #1: Type: text/plain, Size: 2760 bytes --]
Hi Balakrishnan,
[auto build test WARNING on net-next/master]
[also build test WARNING on v4.10-rc4 next-20170120]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Roopa-Prabhu/vxlan-flush-fdb-entries-on-oper-down/20170121-163042
config: i386-randconfig-x005-201703 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
In file included from include/linux/linkage.h:4:0,
from include/linux/kernel.h:6,
from drivers/net/vxlan.c:13:
drivers/net/vxlan.c: In function 'vxlan_netdevice_event':
drivers/net/vxlan.c:3280:27: error: 'vxlan_netdev_ops' undeclared (first use in this function)
if (dev->netdev_ops == &vxlan_netdev_ops) {
^
include/linux/compiler.h:149:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> drivers/net/vxlan.c:3280:3: note: in expansion of macro 'if'
if (dev->netdev_ops == &vxlan_netdev_ops) {
^~
drivers/net/vxlan.c:3280:27: note: each undeclared identifier is reported only once for each function it appears in
if (dev->netdev_ops == &vxlan_netdev_ops) {
^
include/linux/compiler.h:149:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> drivers/net/vxlan.c:3280:3: note: in expansion of macro 'if'
if (dev->netdev_ops == &vxlan_netdev_ops) {
^~
vim +/if +3280 drivers/net/vxlan.c
3264 }
3265
3266 unregister_netdevice_many(&list_kill);
3267 }
3268
3269 static int vxlan_netdevice_event(struct notifier_block *unused,
3270 unsigned long event, void *ptr)
3271 {
3272 struct net_device *dev = netdev_notifier_info_to_dev(ptr);
3273 struct vxlan_net *vn = net_generic(dev_net(dev), vxlan_net_id);
3274
3275 if (event == NETDEV_UNREGISTER)
3276 vxlan_handle_lowerdev_unregister(vn, dev);
3277 else if (event == NETDEV_UDP_TUNNEL_PUSH_INFO)
3278 vxlan_push_rx_ports(dev);
3279 else if (event == NETDEV_CHANGE) {
> 3280 if (dev->netdev_ops == &vxlan_netdev_ops) {
3281 if (netif_running(dev) && !netif_oper_up(dev))
3282 vxlan_flush(netdev_priv(dev));
3283 }
3284 }
3285
3286 return NOTIFY_DONE;
3287 }
3288
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29748 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH cumulus-4.1.y 4/5] vxlan: don't flush static fdb entries on admin down
2017-01-21 7:40 ` [PATCH cumulus-4.1.y 4/5] vxlan: don't flush static fdb entries on admin down Roopa Prabhu
@ 2017-01-21 9:25 ` kbuild test robot
0 siblings, 0 replies; 13+ messages in thread
From: kbuild test robot @ 2017-01-21 9:25 UTC (permalink / raw)
To: Roopa Prabhu; +Cc: kbuild-all, davem, netdev, ramanb, stephen, jbenc, pshelar
[-- Attachment #1: Type: text/plain, Size: 2613 bytes --]
Hi Roopa,
[auto build test ERROR on net-next/master]
[also build test ERROR on v4.10-rc4 next-20170120]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Roopa-Prabhu/vxlan-flush-fdb-entries-on-oper-down/20170121-163042
config: x86_64-randconfig-x017-201703 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
drivers/net/vxlan.c: In function 'vxlan_netdevice_event':
drivers/net/vxlan.c:3295:27: error: 'vxlan_netdev_ops' undeclared (first use in this function)
if (dev->netdev_ops == &vxlan_netdev_ops) {
^~~~~~~~~~~~~~~~
drivers/net/vxlan.c:3295:27: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/net/vxlan.c:3297:5: error: too few arguments to function 'vxlan_flush'
vxlan_flush(netdev_priv(dev));
^~~~~~~~~~~
drivers/net/vxlan.c:2368:13: note: declared here
static void vxlan_flush(struct vxlan_dev *vxlan, int do_all)
^~~~~~~~~~~
vim +/vxlan_flush +3297 drivers/net/vxlan.c
acaf4e7099 Daniel Borkmann 2014-01-13 3289
783c146335 Daniel Borkmann 2014-01-22 3290 if (event == NETDEV_UNREGISTER)
acaf4e7099 Daniel Borkmann 2014-01-13 3291 vxlan_handle_lowerdev_unregister(vn, dev);
7c46a640de Alexander Duyck 2016-06-16 3292 else if (event == NETDEV_UDP_TUNNEL_PUSH_INFO)
b7aade1548 Hannes Frederic Sowa 2016-04-18 3293 vxlan_push_rx_ports(dev);
d8ef10fd7d Balakrishnan Raman 2017-01-20 3294 else if (event == NETDEV_CHANGE) {
d8ef10fd7d Balakrishnan Raman 2017-01-20 @3295 if (dev->netdev_ops == &vxlan_netdev_ops) {
d8ef10fd7d Balakrishnan Raman 2017-01-20 3296 if (netif_running(dev) && !netif_oper_up(dev))
d8ef10fd7d Balakrishnan Raman 2017-01-20 @3297 vxlan_flush(netdev_priv(dev));
d8ef10fd7d Balakrishnan Raman 2017-01-20 3298 }
d8ef10fd7d Balakrishnan Raman 2017-01-20 3299 }
acaf4e7099 Daniel Borkmann 2014-01-13 3300
:::::: The code at line 3297 was first introduced by commit
:::::: d8ef10fd7d083cc5551d83db6317a692fee076ba vxlan: flush fdb entries on oper down
:::::: TO: Balakrishnan Raman <ramanb@cumulusnetworks.com>
:::::: CC: 0day robot <fengguang.wu@intel.com>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27495 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down
2017-01-21 7:40 [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down Roopa Prabhu
` (6 preceding siblings ...)
2017-01-21 8:58 ` kbuild test robot
@ 2017-01-23 16:59 ` Stephen Hemminger
2017-01-24 0:11 ` Roopa Prabhu
7 siblings, 1 reply; 13+ messages in thread
From: Stephen Hemminger @ 2017-01-23 16:59 UTC (permalink / raw)
To: Roopa Prabhu; +Cc: davem, netdev, ramanb, jbenc, pshelar
On Fri, 20 Jan 2017 23:40:06 -0800
Roopa Prabhu <roopa@cumulusnetworks.com> wrote:
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index 19b1653..15b1c23 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -3276,6 +3276,12 @@ static int vxlan_netdevice_event(struct notifier_block *unused,
> vxlan_handle_lowerdev_unregister(vn, dev);
> else if (event == NETDEV_UDP_TUNNEL_PUSH_INFO)
> vxlan_push_rx_ports(dev);
> + else if (event == NETDEV_CHANGE) {
> + if (dev->netdev_ops == &vxlan_netdev_ops) {
> + if (netif_running(dev) && !netif_oper_up(dev))
> + vxlan_flush(netdev_priv(dev));
> + }
> + }
Looks correct.
Maybe logic would be clearer with a switch() statement here.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH cumulus-4.1.y 2/5] vxlan: don't replace fdb entry if nothing changed
2017-01-21 7:40 ` [PATCH cumulus-4.1.y 2/5] vxlan: don't replace fdb entry if nothing changed Roopa Prabhu
@ 2017-01-23 17:02 ` Stephen Hemminger
2017-01-24 0:14 ` Roopa Prabhu
0 siblings, 1 reply; 13+ messages in thread
From: Stephen Hemminger @ 2017-01-23 17:02 UTC (permalink / raw)
To: Roopa Prabhu; +Cc: davem, netdev, ramanb, jbenc, pshelar
On Fri, 20 Jan 2017 23:40:07 -0800
Roopa Prabhu <roopa@cumulusnetworks.com> wrote:
> + 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;
> + }
> +
I think it would be clearer if negative logic was avoided.
if (vxlan_addr_equal(&rd->remote_ip, ip) &&
rd->remote_port == port &&
rd->remote_vni == vni &&
rd->ermote_ifindex == ifndex)
return 1;
dst_cache_reset ...
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down
2017-01-23 16:59 ` Stephen Hemminger
@ 2017-01-24 0:11 ` Roopa Prabhu
0 siblings, 0 replies; 13+ messages in thread
From: Roopa Prabhu @ 2017-01-24 0:11 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: davem, netdev, ramanb, jbenc, pshelar
On 1/23/17, 8:59 AM, Stephen Hemminger wrote:
> On Fri, 20 Jan 2017 23:40:06 -0800
> Roopa Prabhu <roopa@cumulusnetworks.com> wrote:
>
>> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
>> index 19b1653..15b1c23 100644
>> --- a/drivers/net/vxlan.c
>> +++ b/drivers/net/vxlan.c
>> @@ -3276,6 +3276,12 @@ static int vxlan_netdevice_event(struct notifier_block *unused,
>> vxlan_handle_lowerdev_unregister(vn, dev);
>> else if (event == NETDEV_UDP_TUNNEL_PUSH_INFO)
>> vxlan_push_rx_ports(dev);
>> + else if (event == NETDEV_CHANGE) {
>> + if (dev->netdev_ops == &vxlan_netdev_ops) {
>> + if (netif_running(dev) && !netif_oper_up(dev))
>> + vxlan_flush(netdev_priv(dev));
>> + }
>> + }
> Looks correct.
> Maybe logic would be clearer with a switch() statement here.
ack. this was an internal patch i accidentally sent. I have refined it a bit for upstream since then.
will post an update..
thanks
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH cumulus-4.1.y 2/5] vxlan: don't replace fdb entry if nothing changed
2017-01-23 17:02 ` Stephen Hemminger
@ 2017-01-24 0:14 ` Roopa Prabhu
0 siblings, 0 replies; 13+ messages in thread
From: Roopa Prabhu @ 2017-01-24 0:14 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: davem, netdev, ramanb, jbenc, pshelar
On 1/23/17, 9:02 AM, Stephen Hemminger wrote:
> On Fri, 20 Jan 2017 23:40:07 -0800
> Roopa Prabhu <roopa@cumulusnetworks.com> wrote:
>
>> + 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;
>> + }
>> +
> I think it would be clearer if negative logic was avoided.
>
> if (vxlan_addr_equal(&rd->remote_ip, ip) &&
> rd->remote_port == port &&
> rd->remote_vni == vni &&
> rd->ermote_ifindex == ifndex)
> return 1;
>
> dst_cache_reset ...
ack, this was an accidental hit on send as well.
It is on my upstream patch stack..but i think this patch is not really needed upstream because
a previous call to vxlan_fdb_find_rdst in vxlan_fdb_replace does the same thing.
I will test again and repost if needed, thanks.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2017-01-24 0:21 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-21 7:40 [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down Roopa Prabhu
2017-01-21 7:40 ` [PATCH cumulus-4.1.y 2/5] vxlan: don't replace fdb entry if nothing changed Roopa Prabhu
2017-01-23 17:02 ` Stephen Hemminger
2017-01-24 0:14 ` Roopa Prabhu
2017-01-21 7:40 ` [PATCH cumulus-4.1.y 3/5] vxlan: enforce precedence for static over dynamic fdb entry Roopa Prabhu
2017-01-21 7:40 ` [PATCH cumulus-4.1.y 4/5] vxlan: don't flush static fdb entries on admin down Roopa Prabhu
2017-01-21 9:25 ` kbuild test robot
2017-01-21 7:40 ` [PATCH cumulus-4.1.y 5/5] vxlan: do not age static remote mac entries Roopa Prabhu
2017-01-21 7:41 ` [PATCH cumulus-4.1.y 1/5] vxlan: flush fdb entries on oper down Roopa Prabhu
2017-01-21 8:54 ` kbuild test robot
2017-01-21 8:58 ` kbuild test robot
2017-01-23 16:59 ` Stephen Hemminger
2017-01-24 0:11 ` Roopa Prabhu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.