Skip to content

Commit

Permalink
system-traffic: Add a test with many vxlan tunnels.
Browse files Browse the repository at this point in the history
The goal is to stress DPDK dp-packet wrt headroom.

Signed-off-by: David Marchand <[email protected]>
  • Loading branch information
david-marchand committed Mar 8, 2024
1 parent 6c082a8 commit 25a02ea
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .ci/dpdk-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ function build_dpdk()
# Install DPDK using prefix.
DPDK_OPTS="$DPDK_OPTS --prefix=$DPDK_INSTALL_DIR"

# Disable net/af_xdp zero copy support so that this driver places data at
# RTE_PKTMBUF_HEADROOM.
mkdir -p drivers/net/af_xdp/linux
cat > drivers/net/af_xdp/linux/if_xdp.h <<-EOF
#include_next <linux/if_xdp.h>
#undef XDP_UMEM_UNALIGNED_CHUNK_FLAG
EOF

meson $DPDK_OPTS build
ninja -C build
ninja -C build install
Expand Down
104 changes: 104 additions & 0 deletions tests/system-traffic.at
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,110 @@ NS_CHECK_EXEC([at_ns0], [ping -s 3200 -q -c 3 -i 0.3 -W 2 10.1.1.100 | FORMAT_PI
OVS_TRAFFIC_VSWITCHD_STOP
AT_CLEANUP

AT_SETUP([datapath - ping over many vxlan tunnels])
OVS_CHECK_TUNNEL_TSO()
OVS_CHECK_VXLAN()

OVS_TRAFFIC_VSWITCHD_START()
ADD_BR([br-underlay0])
ADD_BR([br-underlay1])
ADD_BR([br-underlay2])

##############################################################
#
# at_ns0 . init_net
# .
# at_vxlan1 (10.1.1.1/24) . br0 (10.1.1.100/24)
# (remote 172.31.1.100) . |
# . at_vxlan0
# . (remote 172.31.1.1)
# .
# at_vxlan3 (172.31.1.1/24) . br-underlay0 (172.31.1.100/24)
# (remote 172.31.2.100) . |
# . at_vxlan2
# . (remote 172.31.2.1)
# .
# at_vxlan5 (172.31.2.1/24) . br-underlay1 (172.31.2.100/24)
# (remote 172.31.3.100) . |
# . at_vxlan4
# . (remote 172.31.3.1)
# .
# p0 (172.31.3.1/24) . br-underlay2 (172.31.3.100/24)
# | . |
# \-------------------------.-ovs-p0
#
##############################################################
#
# Fully encapsulated traffic icmp request over p0 -> ovs-p0 should be like:
#
# <Ether type=IPv4 |
# <IP version=4 proto=udp src=172.31.3.1 dst=172.31.3.100 |
# <UDP dport=vxlan |
# <VXLAN flags=Instance vni=0x0 |
# <Ether type=IPv4 |
# <IP version=4 proto=udp src=172.31.2.1 dst=172.31.2.100 |
# <UDP dport=vxlan |
# <VXLAN flags=Instance vni=0x1 |
# <Ether type=IPv4 |
# <IP version=4 proto=udp src=172.31.1.1 dst=172.31.1.100 |
# <UDP dport=vxlan |
# <VXLAN flags=Instance vni=0x2 |
# <Ether type=IPv4 |
# <IP version=4 proto=icmp src=10.1.1.1 dst=10.1.1.100 |
# <ICMP type=echo-request code=0 |
# ...
#
AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"])
AT_CHECK([ovs-ofctl add-flow br-underlay0 "actions=normal"])
AT_CHECK([ovs-ofctl add-flow br-underlay1 "actions=normal"])
AT_CHECK([ovs-ofctl add-flow br-underlay2 "actions=normal"])

ADD_NAMESPACES(at_ns0, at_ns1)

AT_CHECK([ip link set dev br-underlay2 up])
AT_CHECK([ip link set dev br-underlay1 up])
AT_CHECK([ip link set dev br-underlay0 up])

ADD_VETH(p0, at_ns0, br-underlay2, "172.31.3.1/24")
AT_CHECK([ip addr add dev br-underlay2 "172.31.3.100/24"])

ADD_OVS_TUNNEL([vxlan], [br-underlay1], [at_vxlan4], [172.31.3.1], [172.31.2.100/24], [options:key=0])
ADD_NATIVE_TUNNEL([vxlan], [at_vxlan5], [at_ns0], [172.31.3.100], [172.31.2.1/24],
[id 0 dstport 4789])

ADD_OVS_TUNNEL([vxlan], [br-underlay0], [at_vxlan2], [172.31.2.1], [172.31.1.100/24], [options:key=1])
ADD_NATIVE_TUNNEL([vxlan], [at_vxlan3], [at_ns0], [172.31.2.100], [172.31.1.1/24],
[id 1 dstport 4789])

ADD_VETH(p1, at_ns1, br0, "10.1.1.200/24")
ADD_OVS_TUNNEL([vxlan], [br0], [at_vxlan0], [172.31.1.1], [10.1.1.100/24], [options:key=2])
ADD_NATIVE_TUNNEL([vxlan], [at_vxlan1], [at_ns0], [172.31.1.100], [10.1.1.1/24],
[id 2 dstport 4789])

NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 172.31.3.100 | FORMAT_PING], [0], [dnl
3 packets transmitted, 3 received, 0% packet loss, time 0ms
])
NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 172.31.2.100 | FORMAT_PING], [0], [dnl
3 packets transmitted, 3 received, 0% packet loss, time 0ms
])
NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 172.31.1.100 | FORMAT_PING], [0], [dnl
3 packets transmitted, 3 received, 0% packet loss, time 0ms
])

NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 10.1.1.100 | FORMAT_PING], [0], [dnl
3 packets transmitted, 3 received, 0% packet loss, time 0ms
])
NS_CHECK_EXEC([at_ns0], [ping -s 1000 -q -c 3 -i 0.3 -w 2 10.1.1.100 | FORMAT_PING], [0], [dnl
3 packets transmitted, 3 received, 0% packet loss, time 0ms
])

NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 10.1.1.200 | FORMAT_PING], [0], [dnl
3 packets transmitted, 3 received, 0% packet loss, time 0ms
])

OVS_TRAFFIC_VSWITCHD_STOP
AT_CLEANUP

AT_SETUP([datapath - ping over vxlan6 tunnel])
AT_SKIP_IF([test $HAVE_NC = no])
OVS_CHECK_VXLAN_UDP6ZEROCSUM()
Expand Down

0 comments on commit 25a02ea

Please sign in to comment.