Subject: Re: vxlan_asymmetric.sh test failed every time

From: Ido Schimmel <[email-masked]>
Date: Tue, 13 Oct 2020 10:49:30 +0300

On Tue, Oct 13, 2020 at 12:39:43PM +0800, Hangbin Liu wrote:
> Hi Ido,
> 
> When run vxlan_asymmetric.sh on RHEL8, It failed every time. I though that
> it may failed because the kernel version is too old. But today I tried with
> latest kernel, it still failed. Would you please help check if I missed
> any configuration?

Works OK for me:

$ sudo ./vxlan_asymmetric.sh veth0 veth1 veth2 veth3 veth4 veth5
TEST: ping: local->local vid 10->vid 20                             [ OK ]
TEST: ping: local->remote vid 10->vid 10                            [ OK ]
TEST: ping: local->remote vid 20->vid 20                            [ OK ]
TEST: ping: local->remote vid 10->vid 20                            [ OK ]
TEST: ping: local->remote vid 20->vid 10                            [ OK ]
INFO: deleting neighbours from vlan interfaces
TEST: ping: local->local vid 10->vid 20                             [ OK ]
TEST: ping: local->remote vid 10->vid 10                            [ OK ]
TEST: ping: local->remote vid 20->vid 20                            [ OK ]
TEST: ping: local->remote vid 10->vid 20                            [ OK ]
TEST: ping: local->remote vid 20->vid 10                            [ OK ]
TEST: neigh_suppress: on / neigh exists: yes                        [ OK ]
TEST: neigh_suppress: on / neigh exists: no                         [ OK ]
TEST: neigh_suppress: off / neigh exists: no                        [ OK ]
TEST: neigh_suppress: off / neigh exists: yes                       [ OK ]

# uname -r
5.9.0-rc8-custom-36808-gccdf7fae3afa

# ip -V
ip utility, iproute2-5.8.0

# netsniff-ng -v
netsniff-ng 0.6.7 (Polygon Window), Git id: (none)

The first failure might be related to your rp_filter settings. Can you
please try with this patch?

diff --git a/tools/testing/selftests/net/forwarding/vxlan_asymmetric.sh b/tools/testing/selftests/net/forwarding/vxlan_asymmetric.sh
index a0b5f57d6bd3..0727e2012b68 100755
--- a/tools/testing/selftests/net/forwarding/vxlan_asymmetric.sh
+++ b/tools/testing/selftests/net/forwarding/vxlan_asymmetric.sh
@@ -215,10 +215,16 @@ switch_create()
 
        bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 10
        bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 20
+
+       sysctl_set net.ipv4.conf.all.rp_filter 0
+       sysctl_set net.ipv4.conf.vlan10-v.rp_filter 0
+       sysctl_set net.ipv4.conf.vlan20-v.rp_filter 0
 }
 
 switch_destroy()
 {
+       sysctl_restore net.ipv4.conf.all.rp_filter
+
        bridge fdb del 00:00:5e:00:01:01 dev br1 self local vlan 20
        bridge fdb del 00:00:5e:00:01:01 dev br1 self local vlan 10
 
@@ -359,6 +365,10 @@ ns_switch_create()
 
        bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 10
        bridge fdb add 00:00:5e:00:01:01 dev br1 self local vlan 20
+
+       sysctl_set net.ipv4.conf.all.rp_filter 0
+       sysctl_set net.ipv4.conf.vlan10-v.rp_filter 0
+       sysctl_set net.ipv4.conf.vlan20-v.rp_filter 0
 }
 export -f ns_switch_create

> 
> # uname -r
> 5.9.0
> # ip -V
> ip utility, iproute2-ss200602
> # netsniff-ng -v
> netsniff-ng 0.6.6 (Syro), Git id: (none)
> # cp forwarding.config.sample forwarding.config
> 
> # ./vxlan_asymmetric.sh
> RTNETLINK answers: File exists
> TEST: ping: local->local vid 10->vid 20                             [FAIL]
> TEST: ping: local->remote vid 10->vid 10                            [ OK ]
> TEST: ping: local->remote vid 20->vid 20                            [ OK ]
> TEST: ping: local->remote vid 10->vid 20                            [FAIL]
> TEST: ping: local->remote vid 20->vid 10                            [FAIL]
> INFO: deleting neighbours from vlan interfaces
> TEST: ping: local->local vid 10->vid 20                             [FAIL]
> TEST: ping: local->remote vid 10->vid 10                            [ OK ]
> TEST: ping: local->remote vid 20->vid 20                            [ OK ]
> TEST: ping: local->remote vid 10->vid 20                            [FAIL]
> TEST: ping: local->remote vid 20->vid 10                            [FAIL]
> TEST: neigh_suppress: on / neigh exists: yes                        [ OK ]
> TEST: neigh_suppress: on / neigh exists: no                         [ OK ]
> TEST: neigh_suppress: off / neigh exists: no                        [ OK ]
> TEST: neigh_suppress: off / neigh exists: yes                       [ OK ]
> 
> # dmesg
> [...snip...]
> [ 1518.885526] device br1 entered promiscuous mode
> [ 1518.886211] device br1 left promiscuous mode
> [ 1518.890637] device br1 entered promiscuous mode
> [ 1518.941524] br1: received packet on vx10 with own address as source address (addr:00:00:5e:00:01:01, vlan:10)
> [ 1518.949522] br1: received packet on vx10 with own address as source address (addr:00:00:5e:00:01:01, vlan:10)
> [ 1519.165569] br1: received packet on vx10 with own address as source address (addr:00:00:5e:00:01:01, vlan:10)
> [ 1519.166900] IPv6: vlan10-v: IPv6 duplicate address fe80::200:5eff:fe00:101 used by 00:00:5e:00:01:01 detected!
> [ 1519.392633] br1: received packet on vx20 with own address as source address (addr:00:00:5e:00:01:01, vlan:20)
> [ 1519.741559] br1: received packet on vx20 with own address as source address (addr:00:00:5e:00:01:01, vlan:20)
> [ 1519.861641] br1: received packet on vx20 with own address as source address (addr:00:00:5e:00:01:01, vlan:20)
> [ 1519.862993] IPv6: vlan20-v: IPv6 duplicate address fe80::200:5eff:fe00:101 used by 00:00:5e:00:01:01 detected!
> [ 1520.181565] br1: received packet on vx10 with own address as source address (addr:00:00:5e:00:01:01, vlan:10)
> [ 1520.182739] br1: received packet on vx10 with own address as source address (addr:00:00:5e:00:01:01, vlan:10)
> [ 1524.853572] net_ratelimit: 4 callbacks suppressed
> [ 1524.854346] br1: received packet on vx10 with own address as source address (addr:00:00:5e:00:01:01, vlan:10)
> [ 1525.365565] br1: received packet on vx20 with own address as source address (addr:00:00:5e:00:01:01, vlan:20)
> [ 1533.557792] br1: received packet on vx10 with own address as source address (addr:00:00:5e:00:01:01, vlan:10)
> [ 1534.069921] br1: received packet on vx20 with own address as source address (addr:00:00:5e:00:01:01, vlan:20)
> [ 1550.965225] br1: received packet on vx20 with own address as source address (addr:00:00:5e:00:01:01, vlan:20)
> [ 1551.477294] br1: received packet on vx10 with own address as source address (addr:00:00:5e:00:01:01, vlan:10)
> [ 1558.064257] device w3 left promiscuous mode
> [ 1558.073279] br1: port 4(w3) entered disabled state
> [...snip...]
> 
> Thanks
> Hangbin