Bug 1396578 - RFE: Backport virtio-net multi-queue enablement by default patch
RFE: Backport virtio-net multi-queue enablement by default patch
Status: ON_QA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: kernel (Show other bugs)
7.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Maxime Coquelin
xiywang
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-18 11:24 EST by Marko Myllynen
Modified: 2017-03-10 04:43 EST (History)
12 users (show)

See Also:
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:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marko Myllynen 2016-11-18 11:24:07 EST
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.

Thanks.

1) http://verticalindustriesblog.redhat.com/scaling-virtual-machine-network-performance-for-network-intensive-workloads/
2) https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Tuning_and_Optimization_Guide/sect-Virtualization_Tuning_Optimization_Guide-Networking-Techniques.html
3) https://specs.openstack.org/openstack/nova-specs/specs/liberty/implemented/libvirt-virtiomq.html

Version-Release number of selected component (if applicable):
kernel-3.10.0-514.el7
Comment 3 jason wang 2016-11-24 09:51:37 EST
(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
Comment 4 Amnon Ilan 2016-11-24 12:26:01 EST
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.
Comment 7 jason wang 2016-11-29 01:49:14 EST
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.
Comment 9 Rafael Aquini 2017-02-17 08:16:32 EST
Patch(es) committed on kernel repository and an interim kernel build is undergoing testing
Comment 11 Rafael Aquini 2017-02-20 13:15:25 EST
Patch(es) available on kernel-3.10.0-568.el7
Comment 13 xiywang 2017-03-10 04:26:55 EST
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
Comment 14 xiywang 2017-03-10 04:30:52 EST
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
Comment 15 xiywang 2017-03-10 04:38:28 EST
-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
Comment 16 xiywang 2017-03-10 04:43:35 EST
-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

Note You need to log in before you can comment on or make changes to this bug.