Bug 1396578
Summary: | RFE: Backport virtio-net multi-queue enablement by default patch | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Marko Myllynen <myllynen> |
Component: | kernel | Assignee: | Maxime Coquelin <maxime.coquelin> |
kernel sub component: | KVM | QA Contact: | xiywang |
Status: | CLOSED ERRATA | Docs Contact: | |
Severity: | unspecified | ||
Priority: | unspecified | CC: | ailan, asimonel, chayang, jasowang, jeder, juzhang, knoel, maxime.coquelin, mst, pezhang, virt-maint, weliao, xfu, xiywang |
Version: | 7.3 | Keywords: | FutureFeature |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | kernel-3.10.0-568.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-08-02 04:33:28 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Marko Myllynen
2016-11-18 16:24:07 UTC
(In reply to Marko Myllynen from comment #0) > Description of problem: > On OpenStack / OVS-DPDK setups virtio-net multi-queue is needed for > scalability, see for example [1][2][3]. Neil Horman points out that instead > of manually configuring queues with ethtool(8) kernel could set this up by > default: > > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/ > ?id=0f13b66b01c6e2ec4913a7812414183844d1cc4f > > Please backport to allow automated virtio-net multi-queue setup for > scalability and to remove the need for the mandatory user-space > configuration by default. > I'm afraid this won't work. I will draft a patch to enable multiqueue by default for upstream (the patch was just as simple as this). Thanks Note that it does not make sense to take what is configured in Qemu automatically into the guest, since the qemu config defines the maximum value. e.g. if qemu is configured for 64 queues, is it a reasonable default for the guest? I would set the default number in the guest to the smaller value between {qemu#, 4} The guest admin can change it later on up to the max. David Miller has applied the patch upstream: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=4490001029012539937ff02778fe6180613fa949 Which tries to enable as much #queues as #vcpus. Two patches backported and posted to rhkernel list: https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=4490001029012539937ff02778fe6180613fa949 https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=a220871be66f99d8957c693cf22ec67ecbd9c23a Brew build: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=12512401 - Maxime Patch(es) committed on kernel repository and an interim kernel build is undergoing testing Patch(es) available on kernel-3.10.0-568.el7 1. # /usr/libexec/qemu-kvm \ -name rhel7.4 -cpu IvyBridge -m 4096 -realtime mlock=off -smp 4 \ -drive file=/home/rhel7.4.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,snapshot=off -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0 \ -netdev tap,id=hostnet0,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,queues=8 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:a1:d0:5f,vectors=18,mq=on \ -monitor stdio -device qxl-vga,id=video0 -serial unix:/tmp/console,server,nowait -vnc :1 -spice port=5900,disable-ticketing 2. in guest # ethtool -l eth0 Channel parameters for eth0: Pre-set maximums: RX: 0 TX: 0 Other: 0 Combined: 8 Current hardware settings: RX: 0 TX: 0 Other: 0 Combined: 4 3. # ethtool -L eth0 combined 8 4. # ethtool -l eth0 Channel parameters for eth0: Pre-set maximums: RX: 0 TX: 0 Other: 0 Combined: 8 Current hardware settings: RX: 0 TX: 0 Other: 0 Combined: 8 5. validation test # ethtool -L eth0 combined 9 Cannot set device channel parameters: Invalid argument # ethtool -L eth0 combined -2 no channel parameters changed, aborting current values: tx 0 rx 0 other 0 combined 8 # ethtool -l eth0 Channel parameters for eth0: Pre-set maximums: RX: 0 TX: 0 Other: 0 Combined: 8 Current hardware settings: RX: 0 TX: 0 Other: 0 Combined: 8 host kernel: 3.10.0-588.el7.x86_64 host qemu: qemu-kvm-rhev-2.8.0-5.el7.x86_64 guest kernel: 3.10.0-598.el7.x86_64 -smp 4 -netdev tap,id=hostnet0,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,queues=4 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:a1:d0:5f,vectors=10,mq=on # ethtool -l eth0 Channel parameters for eth0: Pre-set maximums: RX: 0 TX: 0 Other: 0 Combined: 4 Current hardware settings: RX: 0 TX: 0 Other: 0 Combined: 4 # ethtool -L eth0 combined 2 # ethtool -l eth0 Channel parameters for eth0: Pre-set maximums: RX: 0 TX: 0 Other: 0 Combined: 4 Current hardware settings: RX: 0 TX: 0 Other: 0 Combined: 2 -smp 4 -netdev tap,id=hostnet0,vhost=on,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown,queues=2 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:a1:d0:5f,vectors=6,mq=on # ethtool -l eth0 Channel parameters for eth0: Pre-set maximums: RX: 0 TX: 0 Other: 0 Combined: 2 Current hardware settings: RX: 0 TX: 0 Other: 0 Combined: 2 # ethtool -L eth0 combined 4 Cannot set device channel parameters: Invalid argument # ethtool -L eth0 combined 1 # ethtool -l eth0 Channel parameters for eth0: Pre-set maximums: RX: 0 TX: 0 Other: 0 Combined: 2 Current hardware settings: RX: 0 TX: 0 Other: 0 Combined: 1 # ethtool -L eth0 combined -2 no channel parameters changed, aborting current values: tx 0 rx 0 other 0 combined 1 # ethtool -l eth0 Channel parameters for eth0: Pre-set maximums: RX: 0 TX: 0 Other: 0 Combined: 2 Current hardware settings: RX: 0 TX: 0 Other: 0 Combined: 1 Verified on host&guest 3.10.0-663.el7.x86_64 qemu-kvm-rhev-2.9.0-2.el7.x86_64 Hi Maxime, Is the patch also expected to work with macvtap backend? I tested on macvtap backend but mq is not enabled automatically. 1. boot a guest /usr/libexec/qemu-kvm -name rhel7.4 -sandbox on -cpu Opteron_G5 -m 4096 -realtime mlock=off -smp 5 \ -drive file=/home/rhel7.4.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,snapshot=off -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0 \ -netdev tap,id=hostnet0,vhost=on,fd=1024 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=5e:af:75:e4:97:29,vectors=10,mq=on 1024<>/dev/tap12 \ -monitor stdio -device qxl-vga,id=video0 -serial unix:/tmp/console,server,nowait -vnc :1 -spice port=5900,disable-ticketing 2. check mq in guest # ethtool -l eth0 Channel parameters for eth0: Pre-set maximums: RX: 0 TX: 0 Other: 0 Combined: 1 Current hardware settings: RX: 0 TX: 0 Other: 0 Combined: 1 Hi Xiyue, Just tested it with macvtap and it seems to work for me. In my case, I run mainline kernel on host because I cannot reboot the machine right now. Host kernel version: 4.11.0-rc2 Guest kernel version: 3.10.0-685.el7.x86_64 Qemu version: qemu-kvm-rhev-2.9.0-12.el7 Below, I set a maximum of 4 queue pairs, and set 3 vCPUs, so the default number of queues is set to 3 at guest boot time: net-xml: # virsh net-dumpxml macvtap-net <network connections='1'> <name>macvtap-net</name> <uuid>e7e6343f-0dc9-4e4a-a8d0-65e42b39870d</uuid> <forward dev='em1' mode='bridge'> <interface dev='em1' connections='1'/> </forward> </network> domain-xml: <domain type='kvm'> ... <vcpu placement='static'>3</vcpu> <cputune> <vcpupin vcpu='0' cpuset='1'/> <vcpupin vcpu='1' cpuset='6'/> <vcpupin vcpu='2' cpuset='7'/> <emulatorpin cpuset='0'/> </cputune> ... <devices> <interface type='network'> <mac address='52:54:00:58:d7:bd'/> <source network='macvtap-net'/> <model type='virtio'/> <driver name='vhost' queues='4'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> </devices> </domain> On guest side: # ip addr ... 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000 link/ether 52:54:00:58:d7:bd brd ff:ff:ff:ff:ff:ff inet 10.19.159.3/21 brd 10.19.159.255 scope global dynamic eth0 valid_lft 85882sec preferred_lft 85882sec inet6 2620:52:0:1398:5054:ff:fe58:d7bd/64 scope global noprefixroute dynamic valid_lft 2591983sec preferred_lft 604783sec inet6 fe80::5054:ff:fe58:d7bd/64 scope link valid_lft forever preferred_lft forever # ethtool -l eth0 Channel parameters for eth0: Pre-set maximums: RX: 0 TX: 0 Other: 0 Combined: 4 Current hardware settings: RX: 0 TX: 0 Other: 0 Combined: 3 (In reply to xiywang from comment #18) > Hi Maxime, > > Is the patch also expected to work with macvtap backend? > I tested on macvtap backend but mq is not enabled automatically. > > 1. boot a guest > /usr/libexec/qemu-kvm -name rhel7.4 -sandbox on -cpu Opteron_G5 -m 4096 > -realtime mlock=off -smp 5 \ > -drive > file=/home/rhel7.4.qcow2,if=none,id=drive-virtio-disk0,format=qcow2, > snapshot=off -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0 > \ > -netdev tap,id=hostnet0,vhost=on,fd=1024 -device Seems 'queues=' otpion is missed. Best Regards, Pei > virtio-net-pci,netdev=hostnet0,id=net0,mac=5e:af:75:e4:97:29,vectors=10, > mq=on 1024<>/dev/tap12 \ > -monitor stdio -device qxl-vga,id=video0 -serial > unix:/tmp/console,server,nowait -vnc :1 -spice port=5900,disable-ticketing > > 2. check mq in guest > # ethtool -l eth0 > Channel parameters for eth0: > Pre-set maximums: > RX: 0 > TX: 0 > Other: 0 > Combined: 1 > Current hardware settings: > RX: 0 > TX: 0 > Other: 0 > Combined: 1 (In reply to Pei Zhang from comment #20) > (In reply to xiywang from comment #18) > > Hi Maxime, > > > > Is the patch also expected to work with macvtap backend? > > I tested on macvtap backend but mq is not enabled automatically. > > > > 1. boot a guest > > /usr/libexec/qemu-kvm -name rhel7.4 -sandbox on -cpu Opteron_G5 -m 4096 > > -realtime mlock=off -smp 5 \ > > -drive > > file=/home/rhel7.4.qcow2,if=none,id=drive-virtio-disk0,format=qcow2, > > snapshot=off -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0 > > \ > > -netdev tap,id=hostnet0,vhost=on,fd=1024 -device > > Seems 'queues=' otpion is missed. > > > Best Regards, > Pei > > virtio-net-pci,netdev=hostnet0,id=net0,mac=5e:af:75:e4:97:29,vectors=10, > > mq=on 1024<>/dev/tap12 \ > > -monitor stdio -device qxl-vga,id=video0 -serial > > unix:/tmp/console,server,nowait -vnc :1 -spice port=5900,disable-ticketing > > > > 2. check mq in guest > > # ethtool -l eth0 > > Channel parameters for eth0: > > Pre-set maximums: > > RX: 0 > > TX: 0 > > Other: 0 > > Combined: 1 > > Current hardware settings: > > RX: 0 > > TX: 0 > > Other: 0 > > Combined: 1 queues should not be used with fd= qemu-kvm: -netdev tap,id=hostnet0,vhost=on,fd=9,queues=4: ifname=, script=, downscript=, vnet_hdr=, helper=, queues=, fds=, and vhostfds= are invalid with fd= Test passed on macvtap backend. 1. boot a guest with smp4, queues 2, vectors 6 /usr/libexec/qemu-kvm -name rhel7.4 -sandbox on -cpu Opteron_G5 -m 4096 -realtime mlock=off -smp 4 \ -drive file=/home/rhel74-64-virtio.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,snapshot=off -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0 \ -netdev tap,id=hostnet0,vhost=on,fds=10:11 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=fa:a2:3d:50:b7:ca,vectors=6,mq=on 10<>/dev/tap28 11<>/dev/tap28 \ -monitor stdio -device qxl-vga,id=video0 -serial unix:/tmp/console,server,nowait -vnc :1 -spice port=5900,disable-ticketing 2. get ethtool status in guest # ethtool -l eth0 Channel parameters for eth0: Pre-set maximums: RX: 0 TX: 0 Other: 0 Combined: 2 Current hardware settings: RX: 0 TX: 0 Other: 0 Combined: 2 3. change mq in guest # ethtool -L eth0 combined 1 # ethtool -l eth0 Channel parameters for eth0: Pre-set maximums: RX: 0 TX: 0 Other: 0 Combined: 2 Current hardware settings: RX: 0 TX: 0 Other: 0 Combined: 1 Hi Maxime, Sorry for my careless. Last time I forgot to use fds=xx:xx to enable mqs when i tested with macvtap backend. After using fds= I can get mq enabled by default in gueset. Thanks a lot. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2017:1842 |