Bug 1186886 - RFE : Allow virtio-net-pci.mrg_rxbuf to be disabled without using qemu:commandline XML.
Summary: RFE : Allow virtio-net-pci.mrg_rxbuf to be disabled without using qemu:comman...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-28 18:46 UTC by Lee Yarwood
Modified: 2019-10-10 09:35 UTC (History)
7 users (show)

Fixed In Version: libvirt-1.2.13-1.el7
Doc Type: Enhancement
Doc Text:
Feature: Allow disabling mrg_rxbuf. Reason: Some applications require mrg_rxbuf to be disabled. Result: Now mrg_rxbuf can be disabled in the domain XML.
Clone Of:
Environment:
Last Closed: 2015-11-19 06:09:05 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 1585493 0 None None None Never
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description Lee Yarwood 2015-01-28 18:46:45 UTC
Description of problem:

Allow virtio-net-pci.mrg_rxbuf to be disabled without using qemu:commandline XML. 

At present the only way to disable virtio-net-pci.mrg_rxbuf via libvirt is to add the following qemu:commandline XML to a domain  :

 <qemu:commandline>
    <qemu:arg value='-global'/>
    <qemu:arg value='virtio-net-pci.mrg_rxbuf=off'/>
 </qemu:commandline>

If possible it would be useful to control this from within a each interface element of a domain.

Comment 3 Ján Tomko 2015-02-06 14:52:19 UTC
Proposed upstream patches:
https://www.redhat.com/archives/libvir-list/2015-February/msg00188.html

Comment 4 Ján Tomko 2015-02-13 12:50:30 UTC
Now pushed upstream as:
commit 6ba5d1afecc091d856906cd2e2b5ec8350fefa77
Author:     Ján Tomko <jtomko@redhat.com>
CommitDate: 2015-02-13 12:31:38 +0100

    Wire up mrg_rxbuf option for qemu
    
    <interface ...>
      ...
      <model type='virtio'/>
      <driver ...>
        <host mrg_rxbuf='off'/>
      </driver>
    </interface>
    
    will result in:
    -device virtio-net-pci,mrg_rxbuf=off,...
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1186886

commit 6067182b0d50202a53db610bedfe89b6a7c133f3
Author:     Ján Tomko <jtomko@redhat.com>
CommitDate: 2015-02-13 12:31:38 +0100

    Add mrg_rxbuf option to virtio interfaces
    
    Add an XML attribute to allow disabling merge of rx buffers
    on the host:
    <interface ...>
      ...
      <model type='virtio'/>
      <driver ...>
        <host mrg_rxbuf='off'/>
      </driver>
    </interface>
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1186886

git describe: v1.2.12-132-g6ba5d1a

Comment 6 Hu Jianwei 2015-05-19 06:43:40 UTC
I do a sanity testing for this RFE bug, all below scenarios are passed.

Old method:

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
...
  <qemu:commandline>
    <qemu:arg value='-global'/>
    <qemu:arg value='virtio-net-pci.mrg_rxbuf=off'/>
  </qemu:commandline>
</domain>

[root@localhost network-scripts]# ps axu | grep r71
qemu     26959 77.0  1.2 1720500 98092 ?       Sl   13:38   0:03 /usr/libexec/qemu-kvm -name r71 -S -machine pc-i440fx-rhel7.1.0,accel=kvm,usb=off -cpu SandyBridge ... -global virtio-net-pci.mrg_rxbuf=off -msg timestamp=on

New way:
Version:
libvirt-1.2.15-1.el7.x86_64
qemu-kvm-rhev-2.3.0-1.el7.x86_64
kernel-3.10.0-201.el7.x86_64

1. Add below xml block in <interface>, then start domain and check qemu command line
      <driver>
        <host mrg_rxbuf='off'/>
      </driver>

[root@localhost vnet2]# virsh dumpxml r71 | grep "/interface" -B8
    <interface type='network'>
      <mac address='52:54:00:43:0b:f9'/>
      <source network='default'/>
      <model type='virtio'/>
      <driver>
        <host mrg_rxbuf='off'/>
      </driver>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
[root@localhost vnet2]# virsh start r71
Domain r71 started

[root@localhost network-scripts]# ps axu | grep r71
qemu     27099 99.3  1.2 1720340 98200 ?       Sl   13:44   0:02 /usr/libexec/qemu-kvm -name r71 -S -machine pc-i440fx-rhel7.1.0,accel=kvm,usb=off -cpu SandyBridge ... -netdev tap,fd=25,id=hostnet0 -device virtio-net-pci,mrg_rxbuf=off,netdev=hostnet0,id=net0,mac=52:54:00:43:0b:f9,bus=pci.0,addr=0x3 ...

2. Hot plug/unplug a interface with mrg_rxbuf="off"
[root@localhost ~]# virsh start r71
Domain r71 started

[root@localhost ~]# virsh dumpxml r71| grep "/interface" -B10
    <interface type='network'>
      <mac address='52:54:00:43:0b:f9'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet2'/>
      <model type='virtio'/>
      <driver>
        <host csum='off' gso='off' tso4='off' tso6='off' mrg_rxbuf='off'/>
      </driver>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
[root@localhost ~]# 
[root@localhost ~]# cat nic.xml 
<interface type='network'>
  <source network='default'/>
  <model type='virtio'/>
  <driver>
    <host mrg_rxbuf='off'/>
  </driver>
</interface>
[root@localhost ~]# virsh attach-device r71 nic.xml
Device attached successfully

[root@localhost ~]# virsh dumpxml r71| grep "/interface" -B10
    <interface type='network'>
      <mac address='52:54:00:43:0b:f9'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet2'/>
      <model type='virtio'/>
      <driver>
        <host csum='off' gso='off' tso4='off' tso6='off' mrg_rxbuf='off'/>
      </driver>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='52:54:00:ab:6a:c5'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet3'/>
      <model type='virtio'/>
      <driver>
        <host mrg_rxbuf='off'/>
      </driver>
      <alias name='net1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </interface>

[root@localhost ~]# cat nic1.xml 
<interface type='network'>
  <mac address='52:54:00:ab:6a:c5'/>
  <source network='default' bridge='virbr0'/>
  <target dev='vnet3'/>
  <model type='virtio'/>
  <driver>
    <host mrg_rxbuf='off'/>
  </driver>
</interface>
[root@localhost ~]# virsh detach-device r71 nic1.xml
Device detached successfully

[root@localhost ~]# virsh dumpxml r71| grep "/interface" -B10
    <interface type='network'>
      <mac address='52:54:00:43:0b:f9'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet2'/>
      <model type='virtio'/>
      <driver>
        <host csum='off' gso='off' tso4='off' tso6='off' mrg_rxbuf='off'/>
      </driver>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

3. Exception error message with an invalid mode, non on/off
like:
  <driver>
    <host mrg_rxbuf='yes'/>
  </driver>
[root@localhost ~]# virsh edit r71
error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng
Extra element devices in interleave
Element domain failed to validate content

Failed. Try again? [y,n,i,f,?]:    <====press "i"
error: unsupported configuration: unknown host mrg_rxbuf mode 'yes'
Failed. Try again? [y,n,f,?]:

Comment 7 Hu Jianwei 2015-06-30 09:39:25 UTC
According to comment 6, changed to Verified.

Thanks.

Comment 9 errata-xmlrpc 2015-11-19 06:09:05 UTC
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://rhn.redhat.com/errata/RHBA-2015-2202.html


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