Wind River Support Network

HomeDefectsLIN1023-640
Acknowledged

LIN1023-640 : qemux86-64: openvswitch_qos: throughput between host and vm is abnormal

Created: May 18, 2023    Updated: Jul 24, 2023
Found In Version: 10.23.30.1
Severity: Standard
Applicable for: Wind River Linux LTS 23
Component/s: Userspace

Description

1. build host
--machines intel-x86-64 --templates feature/libvirt feature/virt-host --distro wrlinux --dl-layers=1 --accept-eula=yes
echo 'PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt"' >> conf/local.conf
bitbake wrlinux-image-std

2. build guest
--machines qemux86-64 --templates feature/libvirt --distro wrlinux --dl-layers=1 --accept-eula=yes
echo 'PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt"' >> conf/local.conf
bitbake wrlinux-image-std

3.
boot the target with host image

4.
prepare guest image

copy guest kernel and image(qemux86-64 image) under /exports/guest1 , as below
root@intel-x86-64:/exports/guest1# ls -l
-rw-r--r-- 1 root root    9817152 May 18 03:43 kernel
-rw-r--r-- 1 root root 7232018432 May 18 06:47 wrlinux-image-qemux86-64.ext4
root@intel-x86-64:/exports/guest1#
root@intel-x86-64:/exports/guest1# dd if=/dev/zero of=/exports/guest1/test.img bs=1024 count=2
root@intel-x86-64:/exports/guest1# ls -l
total 7095864
-rw-r--r-- 1 root root    9817152 May 18 03:43 kernel
-rw-r--r-- 1 root root       2048   May  18 082:32 test.img
-rw-r--r-- 1 root root 7232018432 May 18 06:47 wrlinux-image-qemux86-64.ext4
root@intel-x86-64:~#


5. start up guest

root@intel-x86-64:~# cat vm0.xml 
<domain type='kvm'>
  <name>guest1</name>
  <memory>512000</memory>
  <currentMemory>512000</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc'>hvm</type>
    <boot dev='hd' />
    <kernel>/exports/guest1/kernel</kernel>
    <cmdline>console=ttyS0 root=/dev/vda rw ip=dhcp</cmdline>
  </os>
  <devices>
    <disk type='file' device='disk'>
      <source file='/exports/guest1/wrlinux-image-std-qemux86-64.ext4' />
      <target dev='vda' bus='virtio' />
    </disk>
    <disk type='file' device='disk'>
      <source file='/exports/guest1/test.img' />
      <target dev='vdb' bus='virtio' />
    </disk>
    <serial type='pty'>
      <source path='/dev/pts/0'/>
      <target port='0'/>
    </serial>
    <console type='pty' tty='/dev/pts/0'>
      <source path='/dev/pts/0'/>
      <target port='0'/>
    </console>
    <interface type='bridge'>
      <model type='virtio'/>
      <source bridge='br-ovp'/>
      <virtualport type='openvswitch'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
  </devices>
</domain>
root@intel-x86-64:~# 
root@intel-x86-64:~# 
root@intel-x86-64:~# cat >> /tmp/ovs_dnsmasq.conf <<-EOF
> interface=br-ovp
> dhcp-range=br-ovp,10.0.11.10,10.0.11.100
> EOF
root@intel-x86-64:~# 
root@intel-x86-64:~# ovs-vsctl add-br br
root@intel-x86-64:~# ifconfig br-ovp 10.0.11.1 up netmask 255.255.255.0
root@intel-x86-64:~# ip route add 10.0.11.0/24 via 10.0.11.1 dev br-ovp
root@intel-x86-64:~# 
root@intel-x86-64:~# 
root@intel-x86-64:~# pkill dnsmasq
root@intel-x86-64:~# dnsmasq --conf-file=/tmp/dnsmasq.conf -l /tmp/dnsmasq.leases -p 0
root@intel-x86-64:~# 
root@intel-x86-64:~# 
root@intel-x86-64:~# virsh create vm0.xml


6. check throughput as description part, using command
netperf -H XXXX(vm ip addr) -l 20 -t UDP_STREAM -- -m 1000 -R 1

7. result
the throughput value between host and vm(with qemux86-64 image) is very low.
But the throughput between host and vm(with qemux86 and intel-x86-64 image) are within the normal threshold range.

Throughput between host and 10.0.11.97(qemux86-64): 25.93

qemux86-64 login: root
Password:
root@qemux86-64:~#
root@qemux86-64:~# ip addr show
..........
    inet 10.0.11.97/24 brd 10.0.11.255 scope global dynamic eth0
..........
root@qemux86-64:~#
root@intel-x86-64:~# netperf -H 10.0.11.97 -l 20 -t UDP_STREAM -- -m 1000 -R 1
MIGRATED UDP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 10.0.11.97 () port 0 AF_INET
Socket  Message  Elapsed      Messages                
Size    Size     Time         Okay Errors   Throughput
bytes   bytes    secs            #      #   10^6bits/sec

212992    1000   20.00     1330182      0     532.07
212992           20.00       64827             25.93


Throughput between host and 10.0.11.95(qemux86): 530.44

qemux86 login: root
Password:
root@qemux86:~# ip addr show
.....
    inet 10.0.11.95/24 brd 10.0.11.255 scope global dynamic eth0
....
root@qemux86:~#
root@intel-x86-64:~# netperf -H 10.0.11.95 -l 20 -t UDP_STREAM -- -m 1000 -R 1
MIGRATED UDP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 10.0.11.95 () port 0 AF_INET
Socket  Message  Elapsed      Messages
Size    Size     Time         Okay Errors   Throughput
bytes   bytes    secs            #      #   10^6bits/sec

212992    1000   20.00     1333106      0     533.24
180224           20.00     1326115            530.44



root@intel-x86-64:~# cat /proc/version

Linux version 6.1.27-rt7-yocto-preempt-rt (oe-user@oe-host) (x86_64-wrs-linux-gcc (GCC) 12.2.0, GNU ld (GNU Binutils) 2.40.20230119) #1 SMP PREEMPT_RT Wed May  3 01:40:14 UTC 2023

Steps to Reproduce

1. bitbake image
[HOST]

1) setup.sh
--machines intel-x86-64 --templates feature/libvirt feature/virt-host --distro wrlinux --dl-layers=1 --accept-eula=yes
2)
source environment-setup-x86_64-wrlinuxsdk-linux
source oe-init-build-env build
3). bitbake-layers add-layer /path/to/local/testlayer/wr-testing/virtualization
4). prepare test_plan
cat << EOF >> customized_test_plan.ini
[Test_Case]
openvswitch_qos

5). modify conf/local.conf
echo 'PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt"' >> conf/local.conf
echo 'require templates/feature/virtualization/template.conf' >> conf/local.conf
echo 'IMAGE_FSTYPES += " tar.bz2 ext4"' >> conf/local.conf
echo 'BB_NO_NETWORK:pn-lmbench = "0"' >> conf/local.conf
echo 'ACTIVE_PLAN = "customized_test_plan.ini"' >> conf/local.conf
echo 'IMAGE_FSTYPES:remove = " live hddimg iso"' >> conf/local.conf
echo 'IMAGE_ROOTFS_EXTRA_SPACE = "5242880"' >> conf/local.conf
echo 'KERNEL_FEATURES:append = " features/usb/serial-all.scc"' >> conf/local.conf
6). bitbake wrlinux-image-std


[GUEST]

1) setup
--machines qemux86-64 --templates feature/libvirt --distro wrlinux --dl-layers=1 --accept-eula=yes
2)
source environment-setup-x86_64-wrlinuxsdk-linux
source oe-init-build-env build
3) bitbake-layers add-layer /path/to/local/testlayer/wr-testing/virtualization
4) prepare test_plan
cat customized_test_plan.ini
[Test_Case]
openvswitch_qos

5) modify conf/local.conf
echo 'PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt"' >> conf/local.conf
echo 'require templates/feature/virtualization/template.conf' >> conf/local.conf
echo 'IMAGE_FSTYPES += " tar.bz2"' >> conf/local.conf
echo 'BB_NO_NETWORK:pn-lmbench = "0"' >> conf/local.conf
echo 'ACTIVE_PLAN = "customized_test_plan.ini"' >> conf/local.conf
echo 'IMAGE_FSTYPES:remove = " live hddimg iso"' >> conf/local.conf
echo 'IMAGE_ROOTFS_EXTRA_SPACE = "5242880"' >> conf/local.conf
6) bitbake wrlinux-image-std


2.
boot the target with host image

3.
prepare guest image

copy guest kernel and image(qemux86-64 image) under /exports/guest1 , as below
root@intel-x86-64:/exports/guest1# ls -l
-rw-r--r-- 1 root root    9817152 May 18 03:43 kernel
-rw-r--r-- 1 root root 7232018432 May 18 06:47 wrlinux-image-ovp-guest-qemux86-64.ext4
root@intel-x86-64:/exports/guest1#
root@intel-x86-64:/exports/guest1# dd if=/dev/zero of=/exports/guest1/test.img bs=1024 count=2
root@intel-x86-64:/exports/guest1# ls -l
total 7095864
-rw-r--r-- 1 root root    9817152 May 18 03:43 kernel
-rw-r--r-- 1 root root       2048   May  18 082:32 test.img
-rw-r--r-- 1 root root 7232018432 May 18 06:47 wrlinux-image-ovp-guest-qemux86-64.ext4
root@intel-x86-64:~#


4. start up guest

root@intel-x86-64:~# cat vm0.xml 
<domain type='kvm'>
  <name>guest1</name>
  <memory>512000</memory>
  <currentMemory>512000</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc'>hvm</type>
    <boot dev='hd' />
    <kernel>/exports/guest1/kernel</kernel>
    <cmdline>console=ttyS0 root=/dev/vda rw ip=dhcp</cmdline>
  </os>
  <devices>
    <disk type='file' device='disk'>
      <source file='/exports/guest1/wrlinux-image-std-qemux86-64.ext4' />
      <target dev='vda' bus='virtio' />
    </disk>
    <disk type='file' device='disk'>
      <source file='/exports/guest1/test.img' />
      <target dev='vdb' bus='virtio' />
    </disk>
    <serial type='pty'>
      <source path='/dev/pts/0'/>
      <target port='0'/>
    </serial>
    <console type='pty' tty='/dev/pts/0'>
      <source path='/dev/pts/0'/>
      <target port='0'/>
    </console>
    <interface type='bridge'>
      <model type='virtio'/>
      <source bridge='br-ovp'/>
      <virtualport type='openvswitch'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
  </devices>
</domain>
root@intel-x86-64:~# 
root@intel-x86-64:~# 
root@intel-x86-64:~# cat >> /tmp/ovs_dnsmasq.conf <<-EOF
> interface=br-ovp
> dhcp-range=br-ovp,10.0.11.10,10.0.11.100
> EOF
root@intel-x86-64:~# 
root@intel-x86-64:~# ovs-vsctl add-br br-ovp
root@intel-x86-64:~# ifconfig br-ovp 10.0.11.1 up netmask 255.255.255.0
root@intel-x86-64:~# ip route add 10.0.11.0/24 via 10.0.11.1 dev br-ovp
root@intel-x86-64:~# 
root@intel-x86-64:~# 
root@intel-x86-64:~# pkill dnsmasq
root@intel-x86-64:~# dnsmasq --conf-file=/tmp/ovs_dnsmasq.conf -l /tmp/dnsmasq.leases -p 0
root@intel-x86-64:~# 
root@intel-x86-64:~# 
root@intel-x86-64:~# virsh create vm0.xml


5. check throughput as description part, using command
netperf -H XXXX(vm ip addr) -l 20 -t UDP_STREAM -- -m 1000 -R 1
Live chat
Online