]> git.proxmox.com Git - mirror_ovs.git/blame - tests/system-afxdp-macros.at
tests: Log commands being executed for async message control test.
[mirror_ovs.git] / tests / system-afxdp-macros.at
CommitLineData
0de1b425
WT
1# Add port to ovs bridge by using afxdp mode.
2# This will use generic XDP support in the veth driver.
3m4_define([ADD_VETH],
4 [ AT_CHECK([ip link add $1 type veth peer name ovs-$1 || return 77])
5 CONFIGURE_VETH_OFFLOADS([$1])
6 AT_CHECK([ip link set $1 netns $2])
7 AT_CHECK([ip link set dev ovs-$1 up])
8 AT_CHECK([ovs-vsctl add-port $3 ovs-$1 -- \
9 set interface ovs-$1 external-ids:iface-id="$1" type="afxdp"])
10 NS_CHECK_EXEC([$2], [ip addr add $4 dev $1 $7])
11 NS_CHECK_EXEC([$2], [ip link set dev $1 up])
12 if test -n "$5"; then
13 NS_CHECK_EXEC([$2], [ip link set dev $1 address $5])
14 fi
15 if test -n "$6"; then
16 NS_CHECK_EXEC([$2], [ip route add default via $6])
17 fi
18 on_exit 'ip link del ovs-$1'
19 ]
20)
21
22m4_define([OVS_CHECK_8021AD],
23 [AT_SKIP_IF([:])])
24
25# CONFIGURE_VETH_OFFLOADS([VETH])
26#
27# Disable TX offloads and VLAN offloads for veths used in AF_XDP.
28m4_define([CONFIGURE_VETH_OFFLOADS],
29 [AT_CHECK([ethtool -K $1 tx off], [0], [ignore], [ignore])
30 AT_CHECK([ethtool -K $1 txvlan off], [0], [ignore], [ignore])
31 ]
32)