From: Wilson Kok <redacted>
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 <redacted>
Signed-off-by: Roopa Prabhu <redacted>
---
drivers/net/vxlan.c | 4 ++++
1 file changed, 4 insertions(+)
From: Balakrishnan Raman <redacted>
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 <redacted>
Signed-off-by: Roopa Prabhu <redacted>
---
pls ignore this series. Accidently hit send in the wrong folder :(
From: kbuild test robot <hidden> Date: 2017-01-21 08:54:19
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':
quoted
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
From: kbuild test robot <hidden> Date: 2017-01-21 08:59:41
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) : \
^~~~
quoted
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) : \
^~~~
quoted
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
From: kbuild test robot <hidden> Date: 2017-01-21 09:26:20
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
quoted
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 [off-list ref]
:::::: CC: 0day robot [off-list ref]
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
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 ...
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.