2018-04-20 14:46:27 +01:00
|
|
|
AT_BANNER([OVS-DPDK unit tests])
|
|
|
|
|
2022-06-24 11:13:25 +01:00
|
|
|
dnl CHECK_MEMPOOL_PARAM([mtu], [numa], [+line])
|
|
|
|
dnl
|
|
|
|
dnl Waits for logs to indicate that the user has configured a mempool
|
|
|
|
dnl for 'mtu' on 'numa'. Checking starts from line number 'line' in
|
|
|
|
dnl ovs-vswitchd.log.
|
|
|
|
m4_define([CHECK_MEMPOOL_PARAM], [
|
|
|
|
line_st=$3
|
|
|
|
if [[ -z "$line_st" ]]
|
|
|
|
then
|
|
|
|
line_st="+0"
|
|
|
|
fi
|
|
|
|
OVS_WAIT_UNTIL([tail -n $line_st ovs-vswitchd.log dnl
|
|
|
|
| grep "User configured shared mempool set for: MTU $1, NUMA $2."])
|
|
|
|
])
|
|
|
|
|
2023-11-20 16:56:47 +01:00
|
|
|
dnl ADD_VHOST_USER_CLIENT_PORT([bridge], [port], [socket])
|
|
|
|
dnl Add a dpdk vhost-user client port to a bridge and check this port is ready
|
|
|
|
dnl to be used by looking at the logs.
|
|
|
|
m4_define([ADD_VHOST_USER_CLIENT_PORT], [
|
|
|
|
AT_CHECK([ovs-vsctl add-port $1 $2 -- \
|
|
|
|
set Interface $2 type=dpdkvhostuserclient options:vhost-server-path=$3],
|
|
|
|
[], [stdout], [stderr])
|
|
|
|
OVS_WAIT_UNTIL([grep "VHOST_CONFIG: ($3) vhost-user client: socket created" ovs-vswitchd.log])
|
|
|
|
OVS_WAIT_UNTIL([grep "vHost User device '$2' created in 'client' mode, using client socket" ovs-vswitchd.log])
|
|
|
|
OVS_WAIT_UNTIL([grep "VHOST_CONFIG: ($3) reconnecting..." ovs-vswitchd.log])
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl ADD_VHOST_USER_PORT([bridge], [port], [socket])
|
|
|
|
dnl Add a dpdk vhost-user port to a bridge and check this port is ready
|
|
|
|
dnl to be used by looking at the logs.
|
|
|
|
m4_define([ADD_VHOST_USER_PORT], [
|
|
|
|
AT_CHECK([ovs-vsctl add-port $1 $2 -- set Interface $2 type=dpdkvhostuser], [],
|
|
|
|
[stdout], [stderr])
|
|
|
|
OVS_WAIT_UNTIL([grep "VHOST_CONFIG: ($3) vhost-user server: socket created" ovs-vswitchd.log])
|
|
|
|
OVS_WAIT_UNTIL([grep "Socket $3 created for vhost-user port $2" ovs-vswitchd.log])
|
|
|
|
OVS_WAIT_UNTIL([grep "VHOST_CONFIG: ($3) binding succeeded" ovs-vswitchd.log])
|
|
|
|
])
|
|
|
|
|
2018-04-20 14:46:27 +01:00
|
|
|
dnl --------------------------------------------------------------------------
|
2018-09-14 10:12:02 -04:00
|
|
|
dnl Check if EAL init is successful
|
2019-10-23 10:19:39 -07:00
|
|
|
AT_SETUP([OVS-DPDK - EAL init])
|
2018-04-20 14:46:27 +01:00
|
|
|
AT_KEYWORDS([dpdk])
|
2018-09-14 10:11:57 -04:00
|
|
|
OVS_DPDK_PRE_CHECK()
|
2023-05-12 15:41:41 +02:00
|
|
|
OVS_DPDK_START([--no-pci])
|
2018-04-20 14:46:27 +01:00
|
|
|
AT_CHECK([grep "DPDK Enabled - initializing..." ovs-vswitchd.log], [], [stdout])
|
|
|
|
AT_CHECK([grep "EAL" ovs-vswitchd.log], [], [stdout])
|
|
|
|
AT_CHECK([grep "DPDK Enabled - initialized" ovs-vswitchd.log], [], [stdout])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD
|
2018-04-20 14:46:27 +01:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl Add standard DPDK PHY port
|
2019-10-23 10:19:39 -07:00
|
|
|
AT_SETUP([OVS-DPDK - add standard DPDK port])
|
2018-04-20 14:46:27 +01:00
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
2018-09-14 10:11:57 -04:00
|
|
|
OVS_DPDK_PRE_PHY_SKIP()
|
2018-04-20 14:46:27 +01:00
|
|
|
OVS_DPDK_START()
|
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2024-01-10 11:04:36 +01:00
|
|
|
AT_CHECK([ovs-vsctl add-port br10 phy0 -- set Interface phy0 type=dpdk options:dpdk-devargs=$(cat DPDK_PCI_ADDR)], [], [stdout], [stderr])
|
2018-04-20 14:46:27 +01:00
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD
|
2018-04-20 14:46:27 +01:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl Add vhost-user-client port
|
2019-10-23 10:19:39 -07:00
|
|
|
AT_SETUP([OVS-DPDK - add vhost-user-client port])
|
2018-04-20 14:46:27 +01:00
|
|
|
AT_KEYWORDS([dpdk])
|
2018-09-14 10:11:58 -04:00
|
|
|
OVS_DPDK_PRE_CHECK()
|
2023-05-12 15:41:41 +02:00
|
|
|
OVS_DPDK_START([--no-pci])
|
2018-04-20 14:46:27 +01:00
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2023-11-20 16:56:47 +01:00
|
|
|
ADD_VHOST_USER_CLIENT_PORT([br10], [dpdkvhostuserclient0], [$OVS_RUNDIR/dpdkvhostclient0])
|
2018-04-20 14:46:27 +01:00
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD(["dnl
|
|
|
|
/VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or directory/d"])
|
2018-04-20 14:46:27 +01:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
2018-09-14 10:12:02 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl Ping vhost-user port
|
2019-10-23 10:19:39 -07:00
|
|
|
AT_SETUP([OVS-DPDK - ping vhost-user ports])
|
2018-09-14 10:12:02 -04:00
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
OVS_DPDK_PRE_CHECK()
|
2023-11-20 16:56:39 +01:00
|
|
|
OVS_DPDK_CHECK_TESTPMD()
|
2023-05-12 15:41:41 +02:00
|
|
|
OVS_DPDK_START([--no-pci])
|
2018-09-14 10:12:02 -04:00
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2023-11-20 16:56:47 +01:00
|
|
|
ADD_VHOST_USER_PORT([br10], [dpdkvhostuser0], [$OVS_RUNDIR/dpdkvhostuser0])
|
2018-09-14 10:12:02 -04:00
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
|
|
|
|
|
|
|
dnl Set up namespaces
|
|
|
|
ADD_NAMESPACES(ns1, ns2)
|
|
|
|
|
|
|
|
dnl Add veth device
|
|
|
|
ADD_VETH(tap1, ns2, br10, "172.31.110.12/24")
|
|
|
|
|
2023-11-20 16:56:39 +01:00
|
|
|
OVS_DPDK_START_TESTPMD([--vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostuser0" \
|
|
|
|
--vdev="net_tap0,iface=tap0"])
|
2018-09-14 10:12:02 -04:00
|
|
|
|
2021-11-25 11:01:27 +01:00
|
|
|
OVS_WAIT_UNTIL([grep "virtio is now ready for processing" ovs-vswitchd.log])
|
2021-12-14 21:42:56 +01:00
|
|
|
OVS_WAIT_UNTIL([ip link show dev tap0 | grep -qw LOWER_UP])
|
2018-09-14 10:12:02 -04:00
|
|
|
|
|
|
|
dnl Move the tap devices to the namespaces
|
|
|
|
AT_CHECK([ps aux | grep testpmd], [], [stdout], [stderr])
|
|
|
|
AT_CHECK([ip link show], [], [stdout], [stderr])
|
|
|
|
AT_CHECK([ip link set tap0 netns ns1], [], [stdout], [stderr])
|
|
|
|
|
|
|
|
AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
|
|
|
|
AT_CHECK([ip netns exec ns1 ip link show | grep tap0], [], [stdout], [stderr])
|
|
|
|
AT_CHECK([ip netns exec ns1 ip link set tap0 up], [], [stdout], [stderr])
|
|
|
|
AT_CHECK([ip netns exec ns1 ip addr add 172.31.110.11/24 dev tap0], [],
|
|
|
|
[stdout], [stderr])
|
|
|
|
|
|
|
|
AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
|
|
|
|
AT_CHECK([ip netns exec ns2 ip link show], [], [stdout], [stderr])
|
|
|
|
AT_CHECK([ip netns exec ns1 ping -c 4 -I tap0 172.31.110.12], [], [stdout],
|
|
|
|
[stderr])
|
|
|
|
|
2023-11-20 16:56:39 +01:00
|
|
|
OVS_DPDK_STOP_TESTPMD()
|
2018-09-14 10:12:02 -04:00
|
|
|
|
2023-01-06 11:57:00 +01:00
|
|
|
dnl Wait for vhost-user handling the socket disconnect.
|
|
|
|
OVS_WAIT_UNTIL([grep "vHost Device '$OVS_RUNDIR/dpdkvhostuser0' has been removed" ovs-vswitchd.log])
|
|
|
|
|
2018-09-14 10:12:02 -04:00
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuser0], [], [stdout], [stderr])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD(["dnl
|
|
|
|
/VHOST_CONFIG: (.*dpdkvhostuser0) recvmsg failed/d
|
|
|
|
/VHOST_CONFIG: (.*dpdkvhostuser0) failed to connect: No such file or directory/d
|
|
|
|
/dpdkvhostuser ports are considered deprecated; please migrate to dpdkvhostuserclient ports./d
|
|
|
|
/failed to enumerate system datapaths: No such file or directory/d"])
|
2018-09-14 10:12:02 -04:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl Ping vhost-user-client port
|
2019-10-23 10:19:39 -07:00
|
|
|
AT_SETUP([OVS-DPDK - ping vhost-user-client ports])
|
2018-09-14 10:12:02 -04:00
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
OVS_DPDK_PRE_CHECK()
|
2023-11-20 16:56:39 +01:00
|
|
|
OVS_DPDK_CHECK_TESTPMD()
|
2023-05-12 15:41:41 +02:00
|
|
|
OVS_DPDK_START([--no-pci])
|
2018-09-14 10:12:02 -04:00
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2023-11-20 16:56:47 +01:00
|
|
|
ADD_VHOST_USER_CLIENT_PORT([br10], [dpdkvhostuserclient0], [$OVS_RUNDIR/dpdkvhostclient0])
|
2018-09-14 10:12:02 -04:00
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
|
|
|
|
|
|
|
dnl Set up namespaces
|
|
|
|
ADD_NAMESPACES(ns1, ns2)
|
|
|
|
|
|
|
|
dnl Add veth device
|
|
|
|
ADD_VETH(tap1, ns2, br10, "172.31.110.12/24")
|
|
|
|
|
2023-11-20 16:56:39 +01:00
|
|
|
OVS_DPDK_START_TESTPMD([--vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,queues=2,server=1" \
|
|
|
|
--vdev="net_tap0,iface=tap0" -- --nb-cores 2 --rxq 2 --txq 2])
|
2018-09-14 10:12:02 -04:00
|
|
|
|
2021-11-25 11:01:27 +01:00
|
|
|
OVS_WAIT_UNTIL([grep "virtio is now ready for processing" ovs-vswitchd.log])
|
2021-12-14 21:42:56 +01:00
|
|
|
OVS_WAIT_UNTIL([ip link show dev tap0 | grep -qw LOWER_UP])
|
2018-09-14 10:12:02 -04:00
|
|
|
|
|
|
|
dnl Move the tap devices to the namespaces
|
|
|
|
AT_CHECK([ps aux | grep testpmd], [], [stdout], [stderr])
|
|
|
|
AT_CHECK([ip link show], [], [stdout], [stderr])
|
|
|
|
AT_CHECK([ip link set tap0 netns ns1], [], [stdout], [stderr])
|
|
|
|
|
|
|
|
AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
|
|
|
|
AT_CHECK([ip netns exec ns1 ip link show | grep tap0], [], [stdout], [stderr])
|
|
|
|
AT_CHECK([ip netns exec ns1 ip link set tap0 up], [], [stdout], [stderr])
|
|
|
|
AT_CHECK([ip netns exec ns1 ip addr add 172.31.110.11/24 dev tap0], [],
|
|
|
|
[stdout], [stderr])
|
|
|
|
|
|
|
|
AT_CHECK([ip netns exec ns1 ip link show], [], [stdout], [stderr])
|
|
|
|
AT_CHECK([ip netns exec ns2 ip link show], [], [stdout], [stderr])
|
2023-01-06 16:58:55 +01:00
|
|
|
AT_CHECK([ip netns exec ns1 ping -i 0.1 -c 10 -I tap0 172.31.110.12], [], [stdout],
|
2018-09-14 10:12:02 -04:00
|
|
|
[stderr])
|
|
|
|
|
2023-01-06 16:58:55 +01:00
|
|
|
AT_CHECK([ip netns exec ns1 ip link set tap0 down], [], [stdout], [stderr])
|
|
|
|
|
|
|
|
# Wait for stats to be queried ("stats-update-interval")
|
|
|
|
sleep 5
|
|
|
|
AT_CHECK([ovs-vsctl get interface dpdkvhostuserclient0 statistics], [], [stdout], [stderr])
|
|
|
|
|
|
|
|
AT_CHECK([test `ovs-vsctl get interface dpdkvhostuserclient0 statistics:rx_packets` -gt 0 -a dnl
|
|
|
|
`ovs-vsctl get interface dpdkvhostuserclient0 statistics:rx_bytes` -gt 0])
|
|
|
|
AT_CHECK([test `ovs-vsctl get interface dpdkvhostuserclient0 statistics:rx_packets` -eq dnl
|
|
|
|
$((`ovs-vsctl get interface dpdkvhostuserclient0 statistics:rx_q0_good_packets` + dnl
|
|
|
|
`ovs-vsctl get interface dpdkvhostuserclient0 statistics:rx_q1_good_packets`))])
|
|
|
|
AT_CHECK([test `ovs-vsctl get interface dpdkvhostuserclient0 statistics:rx_bytes` -eq dnl
|
|
|
|
$((`ovs-vsctl get interface dpdkvhostuserclient0 statistics:rx_q0_good_bytes` + dnl
|
|
|
|
`ovs-vsctl get interface dpdkvhostuserclient0 statistics:rx_q1_good_bytes`))])
|
|
|
|
|
|
|
|
AT_CHECK([test `ovs-vsctl get interface dpdkvhostuserclient0 statistics:tx_packets` -gt 0 -a dnl
|
|
|
|
`ovs-vsctl get interface dpdkvhostuserclient0 statistics:tx_bytes` -gt 0])
|
|
|
|
AT_CHECK([test `ovs-vsctl get interface dpdkvhostuserclient0 statistics:tx_packets` -eq dnl
|
|
|
|
$((`ovs-vsctl get interface dpdkvhostuserclient0 statistics:tx_q0_good_packets` + dnl
|
|
|
|
`ovs-vsctl get interface dpdkvhostuserclient0 statistics:tx_q1_good_packets`))])
|
|
|
|
AT_CHECK([test `ovs-vsctl get interface dpdkvhostuserclient0 statistics:tx_bytes` -eq dnl
|
|
|
|
$((`ovs-vsctl get interface dpdkvhostuserclient0 statistics:tx_q0_good_bytes` + dnl
|
|
|
|
`ovs-vsctl get interface dpdkvhostuserclient0 statistics:tx_q1_good_bytes`))])
|
|
|
|
|
2018-09-14 10:12:02 -04:00
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
|
2023-11-20 16:56:48 +01:00
|
|
|
OVS_DPDK_STOP_TESTPMD()
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD(["dnl
|
|
|
|
/VHOST_CONFIG: (.*dpdkvhostclient0) recvmsg failed/d
|
|
|
|
/VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or directory/d
|
|
|
|
/failed to enumerate system datapaths: No such file or directory/d"])
|
2018-09-14 10:12:02 -04:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
2021-07-15 21:36:13 +05:30
|
|
|
|
2022-06-29 10:35:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl Ingress policing create delete phy port
|
|
|
|
AT_SETUP([OVS-DPDK - Ingress policing create delete phy port])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
|
|
|
OVS_DPDK_PRE_PHY_SKIP()
|
|
|
|
OVS_DPDK_START()
|
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS and add policer
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2024-01-10 11:04:36 +01:00
|
|
|
AT_CHECK([ovs-vsctl add-port br10 phy0 -- set Interface phy0 type=dpdk options:dpdk-devargs=$(cat DPDK_PCI_ADDR)], [], [stdout], [stderr])
|
2022-06-29 10:35:28 +00:00
|
|
|
AT_CHECK([ovs-vsctl set interface phy0 ingress_policing_rate=10000 ingress_policing_burst=1000])
|
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
dnl Fail if policer could not be created
|
|
|
|
AT_FAIL_IF([grep "Could not create rte meter for ingress policer" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
2022-07-09 10:20:34 +00:00
|
|
|
dnl Remove policer
|
2022-06-29 10:35:28 +00:00
|
|
|
AT_CHECK([ovs-vsctl set interface phy0 ingress_policing_rate=0 ingress_policing_burst=0])
|
|
|
|
|
2022-07-09 10:20:34 +00:00
|
|
|
dnl Check policer was removed correctly
|
2022-06-29 10:35:28 +00:00
|
|
|
AT_CHECK([ovs-vsctl list interface phy0], [], [stdout])
|
2022-09-12 21:38:46 +02:00
|
|
|
AT_CHECK([grep -E 'ingress_policing_burst: 0' stdout], [], [stdout])
|
2022-06-29 10:35:28 +00:00
|
|
|
|
|
|
|
AT_CHECK([ovs-vsctl list interface phy0], [], [stdout])
|
2022-09-12 21:38:46 +02:00
|
|
|
AT_CHECK([grep -E 'ingress_policing_rate: 0' stdout], [], [stdout])
|
2022-06-29 10:35:28 +00:00
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD
|
2022-06-29 10:35:28 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl Ingress policing create delete vport port
|
|
|
|
AT_SETUP([OVS-DPDK - Ingress policing create delete vport port])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
|
|
|
OVS_DPDK_PRE_CHECK()
|
2023-05-12 15:41:41 +02:00
|
|
|
OVS_DPDK_START([--no-pci])
|
2022-06-29 10:35:28 +00:00
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS and add ingress policer
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2023-11-20 16:56:47 +01:00
|
|
|
ADD_VHOST_USER_CLIENT_PORT([br10], [dpdkvhostuserclient0], [$OVS_RUNDIR/dpdkvhostclient0])
|
2022-06-29 10:35:28 +00:00
|
|
|
AT_CHECK([ovs-vsctl set interface dpdkvhostuserclient0 ingress_policing_rate=10000 ingress_policing_burst=1000])
|
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
dnl Fail if ingress policer could not be created
|
|
|
|
AT_FAIL_IF([grep "Could not create rte meter for ingress policer" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
2022-07-09 10:20:34 +00:00
|
|
|
dnl Remove ingress policer
|
2022-06-29 10:35:28 +00:00
|
|
|
AT_CHECK([ovs-vsctl set interface dpdkvhostuserclient0 ingress_policing_rate=0 ingress_policing_burst=0])
|
|
|
|
|
2022-07-09 10:20:34 +00:00
|
|
|
dnl Check ingress policer was removed correctly
|
2022-06-29 10:35:28 +00:00
|
|
|
AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout])
|
2022-09-12 21:38:46 +02:00
|
|
|
AT_CHECK([grep -E 'ingress_policing_burst: 0' stdout], [], [stdout])
|
2022-06-29 10:35:28 +00:00
|
|
|
|
|
|
|
AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout])
|
2022-09-12 21:38:46 +02:00
|
|
|
AT_CHECK([grep -E 'ingress_policing_rate: 0' stdout], [], [stdout])
|
2022-06-29 10:35:28 +00:00
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD(["dnl
|
|
|
|
/VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or directory/d"])
|
2022-06-29 10:35:28 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl Ingress policing no policing rate
|
|
|
|
AT_SETUP([OVS-DPDK - Ingress policing no policing rate])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
|
|
|
OVS_DPDK_PRE_CHECK()
|
2023-05-12 15:41:41 +02:00
|
|
|
OVS_DPDK_START([--no-pci])
|
2022-06-29 10:35:28 +00:00
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS and add ingress policer
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2023-11-20 16:56:47 +01:00
|
|
|
ADD_VHOST_USER_CLIENT_PORT([br10], [dpdkvhostuserclient0], [$OVS_RUNDIR/dpdkvhostclient0])
|
2022-06-29 10:35:28 +00:00
|
|
|
AT_CHECK([ovs-vsctl set interface dpdkvhostuserclient0 ingress_policing_burst=1000])
|
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
dnl Fail if ingress policer could not be created
|
|
|
|
AT_FAIL_IF([grep "Could not create rte meter for ingress policer" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
2022-07-09 10:20:34 +00:00
|
|
|
dnl Check ingress policer was created correctly
|
2022-06-29 10:35:28 +00:00
|
|
|
AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout])
|
2022-09-12 21:38:46 +02:00
|
|
|
AT_CHECK([grep -E 'ingress_policing_burst: 1000' stdout], [], [stdout])
|
2022-06-29 10:35:28 +00:00
|
|
|
|
|
|
|
AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout])
|
2022-09-12 21:38:46 +02:00
|
|
|
AT_CHECK([grep -E 'ingress_policing_rate: 0' stdout], [], [stdout])
|
2022-06-29 10:35:28 +00:00
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD(["dnl
|
|
|
|
/VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or directory/d"])
|
2022-06-29 10:35:28 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl Ingress policing no policing burst
|
|
|
|
AT_SETUP([OVS-DPDK - Ingress policing no policing burst])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
|
|
|
OVS_DPDK_PRE_CHECK()
|
2023-05-12 15:41:41 +02:00
|
|
|
OVS_DPDK_START([--no-pci])
|
2022-06-29 10:35:28 +00:00
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS and add ingress policer
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2023-11-20 16:56:47 +01:00
|
|
|
ADD_VHOST_USER_CLIENT_PORT([br10], [dpdkvhostuserclient0], [$OVS_RUNDIR/dpdkvhostclient0])
|
2022-06-29 10:35:28 +00:00
|
|
|
AT_CHECK([ovs-vsctl set interface dpdkvhostuserclient0 ingress_policing_rate=10000])
|
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
dnl Fail if ingress policer could not be created
|
|
|
|
AT_FAIL_IF([grep "Could not create rte meter for ingress policer" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
2022-07-09 10:20:34 +00:00
|
|
|
dnl Check ingress policer was created correctly
|
2022-06-29 10:35:28 +00:00
|
|
|
AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout])
|
2022-09-12 21:38:46 +02:00
|
|
|
AT_CHECK([grep -E 'ingress_policing_burst: 0' stdout], [], [stdout])
|
2022-06-29 10:35:28 +00:00
|
|
|
|
|
|
|
AT_CHECK([ovs-vsctl list interface dpdkvhostuserclient0], [], [stdout])
|
2022-09-12 21:38:46 +02:00
|
|
|
AT_CHECK([grep -E 'ingress_policing_rate: 10000' stdout], [], [stdout])
|
2022-06-29 10:35:28 +00:00
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD(["dnl
|
|
|
|
/VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or directory/d"])
|
2022-06-29 10:35:28 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
2022-07-15 13:25:47 +00:00
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl QoS create delete phy port
|
|
|
|
AT_SETUP([OVS-DPDK - QoS create delete phy port])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
|
|
|
OVS_DPDK_PRE_PHY_SKIP()
|
|
|
|
OVS_DPDK_START()
|
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS and add egress policer
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2024-01-10 11:04:36 +01:00
|
|
|
AT_CHECK([ovs-vsctl add-port br10 phy0 -- set Interface phy0 type=dpdk options:dpdk-devargs=$(cat DPDK_PCI_ADDR)], [], [stdout], [stderr])
|
2022-07-15 13:25:47 +00:00
|
|
|
OVS_WAIT_UNTIL([ovs-vsctl set port phy0 qos=@newqos -- --id=@newqos create qos type=egress-policer other-config:cir=1250000 other-config:cbs=2048])
|
|
|
|
AT_CHECK([ovs-appctl -t ovs-vswitchd qos/show phy0], [], [stdout])
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
dnl Fail if egress policer could not be created
|
|
|
|
AT_FAIL_IF([grep "Could not create rte meter for egress policer" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
|
|
|
dnl Remove egress policer
|
|
|
|
AT_CHECK([ovs-vsctl destroy QoS phy0 -- clear Port phy0 qos])
|
|
|
|
|
|
|
|
dnl Check egress policer was removed correctly
|
|
|
|
AT_CHECK([ovs-appctl -t ovs-vswitchd qos/show phy0], [], [stdout])
|
2022-09-12 21:38:46 +02:00
|
|
|
AT_CHECK([grep -E 'QoS not configured on phy0' stdout], [], [stdout])
|
2022-07-15 13:25:47 +00:00
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD
|
2022-07-15 13:25:47 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl QoS create delete vport port
|
|
|
|
AT_SETUP([OVS-DPDK - QoS create delete vport port])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
|
|
|
OVS_DPDK_PRE_CHECK()
|
2023-05-12 15:41:41 +02:00
|
|
|
OVS_DPDK_START([--no-pci])
|
2022-07-15 13:25:47 +00:00
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS and add egress policer
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2023-11-20 16:56:47 +01:00
|
|
|
ADD_VHOST_USER_CLIENT_PORT([br10], [dpdkvhostuserclient0], [$OVS_RUNDIR/dpdkvhostclient0])
|
2022-07-15 13:25:47 +00:00
|
|
|
OVS_WAIT_UNTIL([ovs-vsctl set port dpdkvhostuserclient0 qos=@newqos -- --id=@newqos create qos type=egress-policer other-config:cir=1250000 \
|
|
|
|
other-config:cbs=2048])
|
|
|
|
AT_CHECK([ovs-appctl -t ovs-vswitchd qos/show dpdkvhostuserclient0], [], [stdout])
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
dnl Fail if egress policer could not be created
|
|
|
|
AT_FAIL_IF([grep "Could not create rte meter for egress policer" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
|
|
|
dnl Remove egress policer
|
|
|
|
AT_CHECK([ovs-vsctl destroy QoS dpdkvhostuserclient0 -- clear Port dpdkvhostuserclient0 qos])
|
|
|
|
|
|
|
|
dnl Check egress policer was removed correctly
|
|
|
|
AT_CHECK([ovs-appctl -t ovs-vswitchd qos/show dpdkvhostuserclient0], [], [stdout])
|
2022-09-12 21:38:46 +02:00
|
|
|
AT_CHECK([grep -E 'QoS not configured on dpdkvhostuserclient0' stdout], [], [stdout])
|
2022-07-15 13:25:47 +00:00
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD(["dnl
|
|
|
|
/VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or directory/d"])
|
2022-07-15 13:25:47 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl QoS no cir
|
|
|
|
AT_SETUP([OVS-DPDK - QoS no cir])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
|
|
|
OVS_DPDK_PRE_CHECK()
|
2023-05-12 15:41:41 +02:00
|
|
|
OVS_DPDK_START([--no-pci])
|
2022-07-15 13:25:47 +00:00
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS and add egress policer
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2023-11-20 16:56:47 +01:00
|
|
|
ADD_VHOST_USER_CLIENT_PORT([br10], [dpdkvhostuserclient0], [$OVS_RUNDIR/dpdkvhostclient0])
|
2022-07-15 13:25:47 +00:00
|
|
|
OVS_WAIT_UNTIL([ovs-vsctl set port dpdkvhostuserclient0 qos=@newqos -- --id=@newqos create qos type=egress-policer other-config:cbs=2048])
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
dnl Check egress policer was not created
|
|
|
|
AT_CHECK([ovs-appctl -t ovs-vswitchd qos/show dpdkvhostuserclient0], [], [stdout])
|
2022-09-12 21:38:46 +02:00
|
|
|
AT_CHECK([grep -E 'QoS not configured on dpdkvhostuserclient0' stdout], [], [stdout])
|
2022-07-15 13:25:47 +00:00
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD(["dnl
|
|
|
|
/VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or directory/d
|
|
|
|
/Could not create rte meter for egress policer/d
|
|
|
|
/Failed to set QoS type egress-policer on port dpdkvhostuserclient0: Invalid argument/d"])
|
2022-07-15 13:25:47 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl QoS no cbs
|
|
|
|
AT_SETUP([OVS-DPDK - QoS no cbs])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
|
|
|
OVS_DPDK_PRE_CHECK()
|
2023-05-12 15:41:41 +02:00
|
|
|
OVS_DPDK_START([--no-pci])
|
2022-07-15 13:25:47 +00:00
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS and add egress policer
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2023-11-20 16:56:47 +01:00
|
|
|
ADD_VHOST_USER_CLIENT_PORT([br10], [dpdkvhostuserclient0], [$OVS_RUNDIR/dpdkvhostclient0])
|
2022-07-15 13:25:47 +00:00
|
|
|
OVS_WAIT_UNTIL([ovs-vsctl set port dpdkvhostuserclient0 qos=@newqos -- --id=@newqos create qos type=egress-policer other-config:cir=1250000])
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
dnl Check egress policer was not created
|
|
|
|
AT_CHECK([ovs-appctl -t ovs-vswitchd qos/show dpdkvhostuserclient0], [], [stdout])
|
2022-09-12 21:38:46 +02:00
|
|
|
AT_CHECK([grep -E 'QoS not configured on dpdkvhostuserclient0' stdout], [], [stdout])
|
2022-07-15 13:25:47 +00:00
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD(["dnl
|
|
|
|
/VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or directory/d
|
|
|
|
/Could not create rte meter for egress policer/d
|
|
|
|
/Failed to set QoS type egress-policer on port dpdkvhostuserclient0: Invalid argument/d"])
|
2022-07-15 13:25:47 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-29 10:35:28 +00:00
|
|
|
|
2022-07-15 13:51:34 +00:00
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl MTU increase phy port
|
|
|
|
AT_SETUP([OVS-DPDK - MTU increase phy port])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
|
|
|
OVS_DPDK_PRE_PHY_SKIP()
|
|
|
|
OVS_DPDK_START()
|
|
|
|
|
|
|
|
dnl First set MTU to its default value and confirm that value, then increase the MTU value and confirm the new value
|
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS with default MTU value
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2024-01-10 11:04:36 +01:00
|
|
|
AT_CHECK([ovs-vsctl add-port br10 phy0 -- set Interface phy0 type=dpdk options:dpdk-devargs=$(cat DPDK_PCI_ADDR)], [], [stdout], [stderr])
|
2022-07-15 13:51:34 +00:00
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
|
|
|
|
|
|
|
dnl Check default MTU value in the datapath
|
2023-12-01 15:29:31 +01:00
|
|
|
OVS_WAIT_UNTIL_EQUAL([ovs-vsctl get Interface phy0 mtu], [1500])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Increase MTU value and check in the datapath
|
|
|
|
AT_CHECK([ovs-vsctl set Interface phy0 mtu_request=9000])
|
2023-12-01 15:29:31 +01:00
|
|
|
OVS_WAIT_UNTIL_EQUAL([ovs-vsctl get Interface phy0 mtu], [9000])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Fail if MTU is not supported
|
|
|
|
AT_FAIL_IF([grep "Interface phy0 does not support MTU configuration" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
|
|
|
dnl Fail if error is encountered during MTU setup
|
|
|
|
AT_FAIL_IF([grep "Interface phy0 MTU (9000) setup error" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD
|
2022-07-15 13:51:34 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl MTU decrease phy port
|
|
|
|
AT_SETUP([OVS-DPDK - MTU decrease phy port])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
|
|
|
OVS_DPDK_PRE_PHY_SKIP()
|
|
|
|
OVS_DPDK_START()
|
|
|
|
|
|
|
|
dnl First set an increased MTU value and confirm that value, then decrease the MTU value and confirm the new value
|
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS and modify MTU value
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2024-01-10 11:04:36 +01:00
|
|
|
AT_CHECK([ovs-vsctl add-port br10 phy0 -- set Interface phy0 type=dpdk options:dpdk-devargs=$(cat DPDK_PCI_ADDR)], [], [stdout], [stderr])
|
2022-07-15 13:51:34 +00:00
|
|
|
AT_CHECK([ovs-vsctl set Interface phy0 mtu_request=9000])
|
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
2023-12-01 15:29:31 +01:00
|
|
|
|
|
|
|
dnl Check MTU value in the datapath
|
|
|
|
OVS_WAIT_UNTIL_EQUAL([ovs-vsctl get Interface phy0 mtu], [9000])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Fail if MTU is not supported
|
|
|
|
AT_FAIL_IF([grep "Interface phy0 does not support MTU configuration" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
|
|
|
dnl Fail if error is encountered during MTU setup
|
|
|
|
AT_FAIL_IF([grep "Interface phy0 MTU (9000) setup error" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
|
|
|
dnl Decrease MTU value and check in the datapath
|
|
|
|
AT_CHECK([ovs-vsctl set Interface phy0 mtu_request=2000])
|
2023-12-01 15:29:31 +01:00
|
|
|
OVS_WAIT_UNTIL_EQUAL([ovs-vsctl get Interface phy0 mtu], [2000])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD
|
2022-07-15 13:51:34 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl MTU increase vport port
|
|
|
|
AT_SETUP([OVS-DPDK - MTU increase vport port])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
2023-11-20 16:56:39 +01:00
|
|
|
OVS_DPDK_CHECK_TESTPMD()
|
2022-07-15 13:51:34 +00:00
|
|
|
OVS_DPDK_PRE_CHECK()
|
2023-05-12 15:41:41 +02:00
|
|
|
OVS_DPDK_START([--no-pci])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS with default MTU value
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2023-11-20 16:56:47 +01:00
|
|
|
ADD_VHOST_USER_CLIENT_PORT([br10], [dpdkvhostuserclient0], [$OVS_RUNDIR/dpdkvhostclient0])
|
2022-07-15 13:51:34 +00:00
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
|
|
|
sleep 2
|
|
|
|
|
2023-11-20 16:56:45 +01:00
|
|
|
OVS_DPDK_START_TESTPMD([--vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,server=1"])
|
2022-07-15 13:51:34 +00:00
|
|
|
OVS_WAIT_UNTIL([grep "virtio is now ready for processing" ovs-vswitchd.log])
|
netdev-dpdk: Sync and clean {get, set}_config() callbacks.
For better usability, the function pairs get_config() and
set_config() for netdevs should be symmetric: Options which are
accepted by set_config() should be returned by get_config() and the
latter should output valid options for set_config() only.
This patch moves key-value pairs which are not valid options from
get_config() to the get_status() callback. For example, get_config()
in lib/netdev-dpdk.c returned {configured,requested}_{rx,tx}_queues
previously. For requested rx queues the proper option name is n_rxq,
so requested_rx_queues has been renamed respectively. Tx queues
cannot be changed by the user, hence requested_tx_queues has been
dropped. Both configured_{rx,tx}_queues will be returned as
n_{r,t}xq in the get_status() callback.
The netdev dpdk classes no longer share a common get_config() callback,
instead both the dpdk_class and the dpdk_vhost_client_class define
their own callbacks. The get_config() callback for dpdk_vhost_class has
been dropped because it does not have a set_config() callback.
The documentation in vswitchd/vswitch.xml for status columns as well
as tests have been updated accordingly.
Reported-at: https://bugzilla.redhat.com/1949855
Signed-off-by: Jakob Meng <code@jakobmeng.de>
Reviewed-by: Robin Jarry <rjarry@redhat.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
2023-11-13 09:53:47 +01:00
|
|
|
OVS_WAIT_UNTIL([ovs-vsctl get Interface dpdkvhostuserclient0 link_state | grep -w up])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Check default MTU value in the datapath
|
netdev-dpdk: Sync and clean {get, set}_config() callbacks.
For better usability, the function pairs get_config() and
set_config() for netdevs should be symmetric: Options which are
accepted by set_config() should be returned by get_config() and the
latter should output valid options for set_config() only.
This patch moves key-value pairs which are not valid options from
get_config() to the get_status() callback. For example, get_config()
in lib/netdev-dpdk.c returned {configured,requested}_{rx,tx}_queues
previously. For requested rx queues the proper option name is n_rxq,
so requested_rx_queues has been renamed respectively. Tx queues
cannot be changed by the user, hence requested_tx_queues has been
dropped. Both configured_{rx,tx}_queues will be returned as
n_{r,t}xq in the get_status() callback.
The netdev dpdk classes no longer share a common get_config() callback,
instead both the dpdk_class and the dpdk_vhost_client_class define
their own callbacks. The get_config() callback for dpdk_vhost_class has
been dropped because it does not have a set_config() callback.
The documentation in vswitchd/vswitch.xml for status columns as well
as tests have been updated accordingly.
Reported-at: https://bugzilla.redhat.com/1949855
Signed-off-by: Jakob Meng <code@jakobmeng.de>
Reviewed-by: Robin Jarry <rjarry@redhat.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
2023-11-13 09:53:47 +01:00
|
|
|
AT_CHECK([ovs-vsctl get Interface dpdkvhostuserclient0 mtu], [0], [dnl
|
|
|
|
1500
|
|
|
|
])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Increase MTU value and check in the datapath
|
|
|
|
AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=9000])
|
|
|
|
|
netdev-dpdk: Sync and clean {get, set}_config() callbacks.
For better usability, the function pairs get_config() and
set_config() for netdevs should be symmetric: Options which are
accepted by set_config() should be returned by get_config() and the
latter should output valid options for set_config() only.
This patch moves key-value pairs which are not valid options from
get_config() to the get_status() callback. For example, get_config()
in lib/netdev-dpdk.c returned {configured,requested}_{rx,tx}_queues
previously. For requested rx queues the proper option name is n_rxq,
so requested_rx_queues has been renamed respectively. Tx queues
cannot be changed by the user, hence requested_tx_queues has been
dropped. Both configured_{rx,tx}_queues will be returned as
n_{r,t}xq in the get_status() callback.
The netdev dpdk classes no longer share a common get_config() callback,
instead both the dpdk_class and the dpdk_vhost_client_class define
their own callbacks. The get_config() callback for dpdk_vhost_class has
been dropped because it does not have a set_config() callback.
The documentation in vswitchd/vswitch.xml for status columns as well
as tests have been updated accordingly.
Reported-at: https://bugzilla.redhat.com/1949855
Signed-off-by: Jakob Meng <code@jakobmeng.de>
Reviewed-by: Robin Jarry <rjarry@redhat.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
2023-11-13 09:53:47 +01:00
|
|
|
AT_CHECK([ovs-vsctl get Interface dpdkvhostuserclient0 mtu], [0], [dnl
|
|
|
|
9000
|
|
|
|
])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
|
2023-11-20 16:56:48 +01:00
|
|
|
OVS_DPDK_STOP_TESTPMD()
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD(["dnl
|
|
|
|
/VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or directory/d"])
|
2022-07-15 13:51:34 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl MTU decrease vport port
|
|
|
|
AT_SETUP([OVS-DPDK - MTU decrease vport port])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
2023-11-20 16:56:39 +01:00
|
|
|
OVS_DPDK_CHECK_TESTPMD()
|
2022-07-15 13:51:34 +00:00
|
|
|
OVS_DPDK_PRE_CHECK()
|
2023-05-12 15:41:41 +02:00
|
|
|
OVS_DPDK_START([--no-pci])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS and modify MTU value
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2023-11-20 16:56:47 +01:00
|
|
|
ADD_VHOST_USER_CLIENT_PORT([br10], [dpdkvhostuserclient0], [$OVS_RUNDIR/dpdkvhostclient0])
|
2022-07-15 13:51:34 +00:00
|
|
|
AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=9000])
|
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
|
|
|
sleep 2
|
|
|
|
|
2023-11-20 16:56:45 +01:00
|
|
|
OVS_DPDK_START_TESTPMD([--vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,server=1"])
|
2022-07-15 13:51:34 +00:00
|
|
|
OVS_WAIT_UNTIL([grep "virtio is now ready for processing" ovs-vswitchd.log])
|
netdev-dpdk: Sync and clean {get, set}_config() callbacks.
For better usability, the function pairs get_config() and
set_config() for netdevs should be symmetric: Options which are
accepted by set_config() should be returned by get_config() and the
latter should output valid options for set_config() only.
This patch moves key-value pairs which are not valid options from
get_config() to the get_status() callback. For example, get_config()
in lib/netdev-dpdk.c returned {configured,requested}_{rx,tx}_queues
previously. For requested rx queues the proper option name is n_rxq,
so requested_rx_queues has been renamed respectively. Tx queues
cannot be changed by the user, hence requested_tx_queues has been
dropped. Both configured_{rx,tx}_queues will be returned as
n_{r,t}xq in the get_status() callback.
The netdev dpdk classes no longer share a common get_config() callback,
instead both the dpdk_class and the dpdk_vhost_client_class define
their own callbacks. The get_config() callback for dpdk_vhost_class has
been dropped because it does not have a set_config() callback.
The documentation in vswitchd/vswitch.xml for status columns as well
as tests have been updated accordingly.
Reported-at: https://bugzilla.redhat.com/1949855
Signed-off-by: Jakob Meng <code@jakobmeng.de>
Reviewed-by: Robin Jarry <rjarry@redhat.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
2023-11-13 09:53:47 +01:00
|
|
|
OVS_WAIT_UNTIL([ovs-vsctl get Interface dpdkvhostuserclient0 link_state | grep -w up])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Check MTU value in the datapath
|
netdev-dpdk: Sync and clean {get, set}_config() callbacks.
For better usability, the function pairs get_config() and
set_config() for netdevs should be symmetric: Options which are
accepted by set_config() should be returned by get_config() and the
latter should output valid options for set_config() only.
This patch moves key-value pairs which are not valid options from
get_config() to the get_status() callback. For example, get_config()
in lib/netdev-dpdk.c returned {configured,requested}_{rx,tx}_queues
previously. For requested rx queues the proper option name is n_rxq,
so requested_rx_queues has been renamed respectively. Tx queues
cannot be changed by the user, hence requested_tx_queues has been
dropped. Both configured_{rx,tx}_queues will be returned as
n_{r,t}xq in the get_status() callback.
The netdev dpdk classes no longer share a common get_config() callback,
instead both the dpdk_class and the dpdk_vhost_client_class define
their own callbacks. The get_config() callback for dpdk_vhost_class has
been dropped because it does not have a set_config() callback.
The documentation in vswitchd/vswitch.xml for status columns as well
as tests have been updated accordingly.
Reported-at: https://bugzilla.redhat.com/1949855
Signed-off-by: Jakob Meng <code@jakobmeng.de>
Reviewed-by: Robin Jarry <rjarry@redhat.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
2023-11-13 09:53:47 +01:00
|
|
|
AT_CHECK([ovs-vsctl get Interface dpdkvhostuserclient0 mtu], [0], [dnl
|
|
|
|
9000
|
|
|
|
])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Decrease MTU value and check in the datapath
|
|
|
|
AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=2000])
|
|
|
|
|
netdev-dpdk: Sync and clean {get, set}_config() callbacks.
For better usability, the function pairs get_config() and
set_config() for netdevs should be symmetric: Options which are
accepted by set_config() should be returned by get_config() and the
latter should output valid options for set_config() only.
This patch moves key-value pairs which are not valid options from
get_config() to the get_status() callback. For example, get_config()
in lib/netdev-dpdk.c returned {configured,requested}_{rx,tx}_queues
previously. For requested rx queues the proper option name is n_rxq,
so requested_rx_queues has been renamed respectively. Tx queues
cannot be changed by the user, hence requested_tx_queues has been
dropped. Both configured_{rx,tx}_queues will be returned as
n_{r,t}xq in the get_status() callback.
The netdev dpdk classes no longer share a common get_config() callback,
instead both the dpdk_class and the dpdk_vhost_client_class define
their own callbacks. The get_config() callback for dpdk_vhost_class has
been dropped because it does not have a set_config() callback.
The documentation in vswitchd/vswitch.xml for status columns as well
as tests have been updated accordingly.
Reported-at: https://bugzilla.redhat.com/1949855
Signed-off-by: Jakob Meng <code@jakobmeng.de>
Reviewed-by: Robin Jarry <rjarry@redhat.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
2023-11-13 09:53:47 +01:00
|
|
|
AT_CHECK([ovs-vsctl get Interface dpdkvhostuserclient0 mtu], [0], [dnl
|
|
|
|
2000
|
|
|
|
])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
|
2023-11-20 16:56:48 +01:00
|
|
|
OVS_DPDK_STOP_TESTPMD()
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD(["dnl
|
|
|
|
/VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or directory/d"])
|
2022-07-15 13:51:34 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl MTU upper bound phy port
|
|
|
|
AT_SETUP([OVS-DPDK - MTU upper bound phy port])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
|
|
|
OVS_DPDK_PRE_PHY_SKIP()
|
|
|
|
OVS_DPDK_START()
|
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS and set MTU value to max upper bound
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2024-01-10 11:04:36 +01:00
|
|
|
AT_CHECK([ovs-vsctl add-port br10 phy0 -- set Interface phy0 type=dpdk options:dpdk-devargs=$(cat DPDK_PCI_ADDR)], [], [stdout], [stderr])
|
2022-07-15 13:51:34 +00:00
|
|
|
AT_CHECK([ovs-vsctl set Interface phy0 mtu_request=9702])
|
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
2023-12-01 15:29:31 +01:00
|
|
|
|
|
|
|
dnl Check MTU value in the datapath
|
|
|
|
OVS_WAIT_UNTIL_EQUAL([ovs-vsctl get Interface phy0 mtu], [9702])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Fail if MTU is not supported
|
|
|
|
AT_FAIL_IF([grep "Interface phy0 does not support MTU configuration" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
|
|
|
dnl Fail if error is encountered during MTU setup
|
|
|
|
AT_FAIL_IF([grep "Interface phy0 MTU (9702) setup error" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
|
|
|
dnl Set MTU value above upper bound and check for error
|
|
|
|
AT_CHECK([ovs-vsctl set Interface phy0 mtu_request=9711])
|
|
|
|
AT_CHECK([grep "phy0: unsupported MTU 9711" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD(["dnl
|
|
|
|
/phy0: unsupported MTU 9711/d
|
|
|
|
/failed to set MTU for network device phy0: Invalid argument/d"])
|
2022-07-15 13:51:34 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl MTU lower bound phy port
|
|
|
|
AT_SETUP([OVS-DPDK - MTU lower bound phy port])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
|
|
|
OVS_DPDK_PRE_PHY_SKIP()
|
|
|
|
OVS_DPDK_START()
|
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS and set MTU value to min lower bound
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2024-01-10 11:04:36 +01:00
|
|
|
AT_CHECK([ovs-vsctl add-port br10 phy0 -- set Interface phy0 type=dpdk options:dpdk-devargs=$(cat DPDK_PCI_ADDR)], [], [stdout], [stderr])
|
2022-07-15 13:51:34 +00:00
|
|
|
AT_CHECK([ovs-vsctl set Interface phy0 mtu_request=68])
|
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
2023-12-01 15:29:31 +01:00
|
|
|
|
|
|
|
dnl Check MTU value in the datapath
|
|
|
|
OVS_WAIT_UNTIL_EQUAL([ovs-vsctl get Interface phy0 mtu], [68])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Fail if MTU is not supported
|
|
|
|
AT_FAIL_IF([grep "Interface phy0 does not support MTU configuration" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
|
|
|
dnl Fail if error is encountered during MTU setup
|
|
|
|
AT_FAIL_IF([grep "Interface phy0 MTU (68) setup error" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
|
|
|
dnl Set MTU value below lower bound and check for error
|
|
|
|
AT_CHECK([ovs-vsctl set Interface phy0 mtu_request=67])
|
|
|
|
AT_CHECK([grep "phy0: unsupported MTU 67" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 phy0], [], [stdout], [stderr])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD(["dnl
|
|
|
|
/phy0: unsupported MTU 67/d
|
|
|
|
/failed to set MTU for network device phy0: Invalid argument/d"])
|
2022-07-15 13:51:34 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl MTU upper bound vport port
|
|
|
|
AT_SETUP([OVS-DPDK - MTU upper bound vport port])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
2023-11-20 16:56:39 +01:00
|
|
|
OVS_DPDK_CHECK_TESTPMD()
|
2022-07-15 13:51:34 +00:00
|
|
|
OVS_DPDK_PRE_CHECK()
|
2023-05-12 15:41:41 +02:00
|
|
|
OVS_DPDK_START([--no-pci])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS and set MTU value to max upper bound
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2023-11-20 16:56:47 +01:00
|
|
|
ADD_VHOST_USER_CLIENT_PORT([br10], [dpdkvhostuserclient0], [$OVS_RUNDIR/dpdkvhostclient0])
|
2022-07-15 13:51:34 +00:00
|
|
|
AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=9702])
|
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
|
|
|
sleep 2
|
|
|
|
|
2023-11-20 16:56:45 +01:00
|
|
|
OVS_DPDK_START_TESTPMD([--vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,server=1"])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
OVS_WAIT_UNTIL([grep "virtio is now ready for processing" ovs-vswitchd.log])
|
netdev-dpdk: Sync and clean {get, set}_config() callbacks.
For better usability, the function pairs get_config() and
set_config() for netdevs should be symmetric: Options which are
accepted by set_config() should be returned by get_config() and the
latter should output valid options for set_config() only.
This patch moves key-value pairs which are not valid options from
get_config() to the get_status() callback. For example, get_config()
in lib/netdev-dpdk.c returned {configured,requested}_{rx,tx}_queues
previously. For requested rx queues the proper option name is n_rxq,
so requested_rx_queues has been renamed respectively. Tx queues
cannot be changed by the user, hence requested_tx_queues has been
dropped. Both configured_{rx,tx}_queues will be returned as
n_{r,t}xq in the get_status() callback.
The netdev dpdk classes no longer share a common get_config() callback,
instead both the dpdk_class and the dpdk_vhost_client_class define
their own callbacks. The get_config() callback for dpdk_vhost_class has
been dropped because it does not have a set_config() callback.
The documentation in vswitchd/vswitch.xml for status columns as well
as tests have been updated accordingly.
Reported-at: https://bugzilla.redhat.com/1949855
Signed-off-by: Jakob Meng <code@jakobmeng.de>
Reviewed-by: Robin Jarry <rjarry@redhat.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
2023-11-13 09:53:47 +01:00
|
|
|
OVS_WAIT_UNTIL([ovs-vsctl get Interface dpdkvhostuserclient0 link_state | grep -w up])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Check MTU value in the datapath
|
netdev-dpdk: Sync and clean {get, set}_config() callbacks.
For better usability, the function pairs get_config() and
set_config() for netdevs should be symmetric: Options which are
accepted by set_config() should be returned by get_config() and the
latter should output valid options for set_config() only.
This patch moves key-value pairs which are not valid options from
get_config() to the get_status() callback. For example, get_config()
in lib/netdev-dpdk.c returned {configured,requested}_{rx,tx}_queues
previously. For requested rx queues the proper option name is n_rxq,
so requested_rx_queues has been renamed respectively. Tx queues
cannot be changed by the user, hence requested_tx_queues has been
dropped. Both configured_{rx,tx}_queues will be returned as
n_{r,t}xq in the get_status() callback.
The netdev dpdk classes no longer share a common get_config() callback,
instead both the dpdk_class and the dpdk_vhost_client_class define
their own callbacks. The get_config() callback for dpdk_vhost_class has
been dropped because it does not have a set_config() callback.
The documentation in vswitchd/vswitch.xml for status columns as well
as tests have been updated accordingly.
Reported-at: https://bugzilla.redhat.com/1949855
Signed-off-by: Jakob Meng <code@jakobmeng.de>
Reviewed-by: Robin Jarry <rjarry@redhat.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
2023-11-13 09:53:47 +01:00
|
|
|
AT_CHECK([ovs-vsctl get Interface dpdkvhostuserclient0 mtu], [0], [dnl
|
|
|
|
9702
|
|
|
|
])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Set MTU value above upper bound and check for error
|
|
|
|
AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=9711])
|
|
|
|
AT_CHECK([grep "dpdkvhostuserclient0: unsupported MTU 9711" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
|
2023-11-20 16:56:48 +01:00
|
|
|
OVS_DPDK_STOP_TESTPMD()
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD(["dnl
|
|
|
|
/VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or directory/d
|
|
|
|
/dpdkvhostuserclient0: unsupported MTU 9711/d
|
|
|
|
/failed to set MTU for network device dpdkvhostuserclient0: Invalid argument/d"])
|
2022-07-15 13:51:34 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl MTU lower bound vport port
|
|
|
|
AT_SETUP([OVS-DPDK - MTU lower bound vport port])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
|
2023-11-20 16:56:39 +01:00
|
|
|
OVS_DPDK_CHECK_TESTPMD()
|
2022-07-15 13:51:34 +00:00
|
|
|
OVS_DPDK_PRE_CHECK()
|
2023-05-12 15:41:41 +02:00
|
|
|
OVS_DPDK_START([--no-pci])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Add userspace bridge and attach it to OVS and set MTU value to min lower bound
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
2023-11-20 16:56:47 +01:00
|
|
|
ADD_VHOST_USER_CLIENT_PORT([br10], [dpdkvhostuserclient0], [$OVS_RUNDIR/dpdkvhostclient0])
|
2022-07-15 13:51:34 +00:00
|
|
|
AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=68])
|
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
|
|
|
sleep 2
|
|
|
|
|
2023-11-20 16:56:45 +01:00
|
|
|
OVS_DPDK_START_TESTPMD([--vdev="net_virtio_user,path=$OVS_RUNDIR/dpdkvhostclient0,server=1"])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
OVS_WAIT_UNTIL([grep "virtio is now ready for processing" ovs-vswitchd.log])
|
netdev-dpdk: Sync and clean {get, set}_config() callbacks.
For better usability, the function pairs get_config() and
set_config() for netdevs should be symmetric: Options which are
accepted by set_config() should be returned by get_config() and the
latter should output valid options for set_config() only.
This patch moves key-value pairs which are not valid options from
get_config() to the get_status() callback. For example, get_config()
in lib/netdev-dpdk.c returned {configured,requested}_{rx,tx}_queues
previously. For requested rx queues the proper option name is n_rxq,
so requested_rx_queues has been renamed respectively. Tx queues
cannot be changed by the user, hence requested_tx_queues has been
dropped. Both configured_{rx,tx}_queues will be returned as
n_{r,t}xq in the get_status() callback.
The netdev dpdk classes no longer share a common get_config() callback,
instead both the dpdk_class and the dpdk_vhost_client_class define
their own callbacks. The get_config() callback for dpdk_vhost_class has
been dropped because it does not have a set_config() callback.
The documentation in vswitchd/vswitch.xml for status columns as well
as tests have been updated accordingly.
Reported-at: https://bugzilla.redhat.com/1949855
Signed-off-by: Jakob Meng <code@jakobmeng.de>
Reviewed-by: Robin Jarry <rjarry@redhat.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
2023-11-13 09:53:47 +01:00
|
|
|
OVS_WAIT_UNTIL([ovs-vsctl get Interface dpdkvhostuserclient0 link_state | grep -w up])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Check MTU value in the datapath
|
netdev-dpdk: Sync and clean {get, set}_config() callbacks.
For better usability, the function pairs get_config() and
set_config() for netdevs should be symmetric: Options which are
accepted by set_config() should be returned by get_config() and the
latter should output valid options for set_config() only.
This patch moves key-value pairs which are not valid options from
get_config() to the get_status() callback. For example, get_config()
in lib/netdev-dpdk.c returned {configured,requested}_{rx,tx}_queues
previously. For requested rx queues the proper option name is n_rxq,
so requested_rx_queues has been renamed respectively. Tx queues
cannot be changed by the user, hence requested_tx_queues has been
dropped. Both configured_{rx,tx}_queues will be returned as
n_{r,t}xq in the get_status() callback.
The netdev dpdk classes no longer share a common get_config() callback,
instead both the dpdk_class and the dpdk_vhost_client_class define
their own callbacks. The get_config() callback for dpdk_vhost_class has
been dropped because it does not have a set_config() callback.
The documentation in vswitchd/vswitch.xml for status columns as well
as tests have been updated accordingly.
Reported-at: https://bugzilla.redhat.com/1949855
Signed-off-by: Jakob Meng <code@jakobmeng.de>
Reviewed-by: Robin Jarry <rjarry@redhat.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
2023-11-13 09:53:47 +01:00
|
|
|
AT_CHECK([ovs-vsctl get Interface dpdkvhostuserclient0 mtu], [0], [dnl
|
|
|
|
68
|
|
|
|
])
|
2022-07-15 13:51:34 +00:00
|
|
|
|
|
|
|
dnl Set MTU value below lower bound and check for error
|
|
|
|
AT_CHECK([ovs-vsctl set Interface dpdkvhostuserclient0 mtu_request=67])
|
|
|
|
AT_CHECK([grep "dpdkvhostuserclient0: unsupported MTU 67" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 dpdkvhostuserclient0], [], [stdout], [stderr])
|
2023-11-20 16:56:48 +01:00
|
|
|
OVS_DPDK_STOP_TESTPMD()
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD(["dnl
|
|
|
|
/VHOST_CONFIG: (.*dpdkvhostclient0) failed to connect: No such file or directory/d
|
|
|
|
/dpdkvhostuserclient0: unsupported MTU 67/d
|
|
|
|
/failed to set MTU for network device dpdkvhostuserclient0: Invalid argument/d"])
|
2022-07-15 13:51:34 +00:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
|
2022-06-24 11:13:25 +01:00
|
|
|
dnl --------------------------------------------------------------------------
|
|
|
|
dnl Setup user configured mempools
|
|
|
|
AT_SETUP([OVS-DPDK - user configured mempool])
|
|
|
|
AT_KEYWORDS([dpdk])
|
|
|
|
OVS_DPDK_PRE_CHECK()
|
|
|
|
OVS_DPDK_START_OVSDB()
|
2023-05-12 15:41:41 +02:00
|
|
|
OVS_DPDK_START_VSWITCHD([--no-pci])
|
2022-06-24 11:13:25 +01:00
|
|
|
|
2022-09-14 08:36:59 +00:00
|
|
|
AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:shared-mempool-config=8000,6000,1500])
|
2022-06-24 11:13:25 +01:00
|
|
|
AT_CHECK([ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true])
|
|
|
|
|
2022-09-14 08:36:59 +00:00
|
|
|
CHECK_MEMPOOL_PARAM([8000], [ALL], [])
|
2022-06-24 11:13:25 +01:00
|
|
|
CHECK_MEMPOOL_PARAM([6000], [ALL], [])
|
|
|
|
CHECK_MEMPOOL_PARAM([1500], [ALL], [])
|
|
|
|
|
2022-09-14 08:36:59 +00:00
|
|
|
AT_CHECK(ovs-appctl vlog/set netdev_dpdk:dbg)
|
|
|
|
|
|
|
|
dnl Add userspace bridge and a dpdk port
|
|
|
|
AT_CHECK([ovs-vsctl add-br br10 -- set bridge br10 datapath_type=netdev])
|
|
|
|
AT_CHECK([ovs-vsctl add-port br10 p1 -- set Interface p1 type=dpdk options:dpdk-devargs=net_null0,no-rx=1], [], [stdout], [stderr])
|
|
|
|
AT_CHECK([ovs-vsctl show], [], [stdout])
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
dnl Check if the right user configured mempool is found for default MTU (1500)
|
|
|
|
AT_CHECK([grep "Found user configured shared mempool .* suitable for port with MTU 1500" ovs-vswitchd.log], [], [stdout])
|
|
|
|
AT_CHECK([grep "Port p1: Requesting a mempool" ovs-vswitchd.log], [], [stdout])
|
|
|
|
|
|
|
|
dnl Change the MTU value to 7000 to trigger mempool change
|
|
|
|
TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
|
|
|
|
AT_CHECK(ovs-vsctl set Interface p1 mtu_request=7000)
|
|
|
|
OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Found user configured shared mempool .* suitable for port with MTU 7000"])
|
|
|
|
OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Port p1: Requesting a mempool"])
|
|
|
|
|
|
|
|
dnl Change back the MTU value to 1500 to trigger mempool change (re-use)
|
|
|
|
TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
|
|
|
|
AT_CHECK(ovs-vsctl set Interface p1 mtu_request=1500)
|
|
|
|
OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Found user configured shared mempool .* suitable for port with MTU 1500"])
|
|
|
|
OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Reusing mempool"])
|
|
|
|
|
|
|
|
dnl Change the MTU value beyond the max value in shared-mempool-config list
|
|
|
|
TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
|
|
|
|
AT_CHECK(ovs-vsctl set Interface p1 mtu_request=9000)
|
|
|
|
OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "No user configured shared mempool mbuf sizes found suitable for port with MTU 9000"])
|
|
|
|
OVS_WAIT_UNTIL([tail -n +$TMP ovs-vswitchd.log | grep "Port p1: Requesting a mempool"])
|
|
|
|
|
|
|
|
dnl Clean up
|
|
|
|
AT_CHECK([ovs-vsctl del-port br10 p1], [], [stdout], [stderr])
|
2023-11-20 16:56:43 +01:00
|
|
|
OVS_DPDK_STOP_VSWITCHD
|
2022-06-24 11:13:25 +01:00
|
|
|
AT_CLEANUP
|
|
|
|
dnl --------------------------------------------------------------------------
|