RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 665293 - RFE: Allow setting size of send buffer per TAP device in QEMU driver
Summary: RFE: Allow setting size of send buffer per TAP device in QEMU driver
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.0
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Laine Stump
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 584412 672619
Blocks: Rhel5KvmTier1 584428 591842 643348 665295 666367
TreeView+ depends on / blocked
 
Reported: 2010-12-23 06:44 UTC by Michael S. Tsirkin
Modified: 2013-01-11 03:41 UTC (History)
21 users (show)

Fixed In Version: libvirt-0.8.7-2.el6
Doc Type: Enhancement
Doc Text:
Clone Of: 584412
: 665295 666367 (view as bug list)
Environment:
Last Closed: 2011-05-19 13:25:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0596 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-05-18 17:56:36 UTC

Comment 2 Michael S. Tsirkin 2010-12-23 06:55:47 UTC
What is asked here of libvirt is an option to
run qemu-kvm with sndbuf=0.

With the default value (1M), given a sufficient number
of unresponsive guests on the same host, and assuming
a given guest tries to communicate to all of them,
all communication from a specific guest slows down
and then stops completely.
The bigger the buffer value, the less the risk of this.

sndbuf=0 is actually equivalent to 0xffffffff.

The disadvantage is that with large buffer values
UDP applications that
do not do any flow control in software will
get large packet drop rates for guest to guest
traffic on a local machine.

Comment 5 Dave Allan 2010-12-24 02:49:56 UTC
Providing an option to set the sndbuf parameter is reasonable.

Comment 7 Laine Stump 2011-01-05 05:42:20 UTC
I can add this in the same manner (and at the same time) as I will use to add the vhost on|off switch (Bug 643050). There is currently a discussion upstream on what the XML should look like:

https://www.redhat.com/archives/libvir-list/2011-January/msg00092.html

sndbuf would be added either as another attribute to <driver> (or whatever the element is called), or as a subelement (ie, either <driver sndbuf='0' .../> or <driver><sndbuf>0</sndbuf>...</driver>

Comment 8 Laine Stump 2011-01-13 06:52:29 UTC
Patch to add this has been posted upstream:

https://www.redhat.com/archives/libvir-list/2011-January/msg00522.html

The XML will look like this:


    <domain>
      ...
      <interface ... >
        ...
        <tune>
          <sndbuf>0</sndbuf>
        </tune>
        ...
      </interface>
      ...
    </domain>

Comment 9 Laine Stump 2011-01-14 20:50:34 UTC
An updated version of the above patch has been committed to upstream libvirt, and posted to rhvirt-patches for inclusion in the RHEL build of libvirt. Note that this patch also requires application of the 2nd patch listed in this comment:


commit fe053dbea761573c96617b01f41f1fd3e50b1330
Author: Laine Stump <laine>
Date:   Wed Jan 12 14:38:01 2011 -0500

    Enable tuning of qemu network tap device "sndbuf" size
    
    This is in response to a request in:
    
       https://bugzilla.redhat.com/show_bug.cgi?id=665293
    
    In short, under heavy load, it's possible for qemu's networking to
    lock up due to the tap device's default 1MB sndbuf being
    inadequate. adding "sndbuf=0" to the qemu commandline -netdevice
    option will alleviate this problem (sndbuf=0 actually sets it to
    0xffffffff).
    
    Because we must be able to explicitly specify "0" as a value, the
    standard practice of "0 means not specified" won't work here. Instead,
    virDomainNetDef also has a sndbuf_specified, which defaults to 0, but
    is set to 1 if some value was given.
    
    The sndbuf value is put inside a <tune> element of each <interface> in
    the domain. The intent is that further tunable settings will also be
    placed inside this element.
    
         <interface type='network'>
           ...
           <tune>
             <sndbuf>0</sndbuf>
           ...
           </tune>
         </interface>

commit 1ff03b28e938dd0cbde076aa0875f46d0ce52d30
Author: Eric Blake <eblake>
Date:   Thu Jan 13 15:09:18 2011 -0700

    util: add missing string->integer conversion functions
    
    It was awkward having only int conversion in the virStrToLong family,
    but only long conversion in the virXPath family.  Make both families
    support both types.
    
    * src/util/util.h (virStrToLong_l, virStrToLong_ul): New
    prototypes.
    * src/util/xml.h (virXPathInt, virXPathUInt): Likewise.
    * src/util/util.c (virStrToLong_l, virStrToLong_ul): New
    functions.
    * src/util/xml.c (virXPathInt, virXPathUInt): Likewise.
    * src/libvirt_private.syms (util.h, xml.h): Export them.

Comment 12 xhu 2011-01-18 08:19:07 UTC
Verified it on RHEL6 server with the following components:
libvirt-0.8.7-2.el6
qemu-kvm-0.12.1.2-2.129.el6
kernel-2.6.32-94.el6

The steps are as follows:
1 install a guest named rhel6

2 shutdown the guest and add the following xml into interface element:
<tune>
       <sndbuf>0</sndbuf>
</tune>

3 start the guest and check qemu -netdevice option
# ps -edf |grep qemu
qemu     19001     1  6 15:03 ?        00:01:16 /usr/libexec/qemu-kvm -S -M rhel6.0.0 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name rhel6 -uuid 816605ff-d6b2-db24-57a1-bf872f4c40d5 -nodefconfig -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/rhel6.monitor,server,nowait -mon chardev=monitor,mode=control -rtc base=utc -boot c -drive file=/var/lib/libvirt/images/rhel6-1.img,if=none,id=drive-virtio-disk0,format=raw,cache=none -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0 -netdev tap,fd=24,id=hostnet0,sndbuf=0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:1e:8e:ab,bus=pci.0,addr=0x3 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -device usb-tablet,id=input0 -vnc 127.0.0.1:0 -vga cirrus -device AC97,id=sound0,bus=pci.0,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6

4 shutdown the guest and add the following xml into interface element:
<tune>
       <sndbuf>1000</sndbuf>
</tune>

5 start the guest and check qemu -netdevice option
# ps -ef|grep qemu
qemu     24016     1 29 16:15 ?        00:00:20 /usr/libexec/qemu-kvm -S -M rhel6.0.0 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name rhel6 -uuid 816605ff-d6b2-db24-57a1-bf872f4c40d5 -nodefconfig -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/rhel6.monitor,server,nowait -mon chardev=monitor,mode=control -rtc base=utc -boot c -drive file=/var/lib/libvirt/images/rhel6-1.img,if=none,id=drive-virtio-disk0,format=raw,cache=none -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0 -netdev tap,fd=24,id=hostnet0,sndbuf=1000 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:1e:8e:ab,bus=pci.0,addr=0x3 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -device usb-tablet,id=input0 -vnc 127.0.0.1:0 -vga cirrus -device AC97,id=sound0,bus=pci.0,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6

Comment 15 errata-xmlrpc 2011-05-19 13:25:13 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0596.html


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