Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 555698

Summary: [LTC 6.0 FEAT] KVM network performance: Defer skb allocation in virtio-net
Product: Red Hat Enterprise Linux 6 Reporter: IBM Bug Proxy <bugproxy>
Component: kernelAssignee: Anthony Liguori <aliguori>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: low    
Version: 6.0CC: arozansk, jjarvis, jolsa, knoel, lihuang, mgahagan, michen, mst, nhorman, nobody+PNT0273897, sbest, snagar, syeghiay, tburke, tgraf
Target Milestone: betaKeywords: FutureFeature, OtherQA
Target Release: 6.0   
Hardware: other   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-11 16:10:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 532696, 533943    
Attachments:
Description Flags
[PATCH 1/3]: Add detach buffers API in virtio
none
[PATCH 2/3] virtio-net: Defer skb allocation and remove recv queue
none
[PATCH 3/3]: virtio-net: remove send queue none

Description IBM Bug Proxy 2010-01-15 08:51:11 UTC
=Comment: #0=================================================
Sridhar Samudrala <sri.com> - 
+++ This bug was initially created as a clone of Bug #57507 +++

1. Feature Overview:
Feature Id:	[202045]
a. Name of Feature:	vhost-net  and  vm network performance
b. Feature Description
vhost-net patchset : add  tap and raw socket backend support to host kernel to improve network latency
 udp fragmentation offload: improve throughput of guest-host/guest-guest by enabling UFO to
send/receive large UDP packets 
 - virtio-net performance enhancement : avoid unnecessary skb allocs/frees for large packet in guest
receive path by deferring skb allocations
 IGMP Snooping - to briding code to improve multicast performnace when using a bridge to connect
multiple guests.

2. Feature Details:
Sponsor:	LTC
Architectures:
x86
x86_64

Arch Specificity: Both
Affects Kernel Modules: Yes
Delivery Mechanism: Direct from community
Category:	Xen
Request Type:	Kernel - Enhancement from Upstream
d. Upstream Acceptance:	In Progress
Sponsor Priority	1
f. Severity: High
IBM Confidential:	no
Code Contribution:	3rd party code
g. Component Version Target:	2.6.33
 qemu 0.12

3. Business Case
The network performance for  communication across VM to VM and host-VM  must be close to native
perf. to migrate applications to KVM, be competitive with industry virtualization solutions, and
support efficient workloads even as a large number of VMs supported per host.

4. Primary contact at Red Hat: 
John Jarvis
jjarvis

5. Primary contacts at Partner:
Project Management Contact:
Albert Kopp, AKOPP.com

Technical contact(s):
Vivek Kashyap, vivk.com
Sridhar Samudrala, samudrala.com

IBM Manager:
Deneen T. Dock, deneen.com
=Comment: #1=================================================
Sridhar Samudrala <sri.com> - 
- virtio-net performance enhancement : avoid unnecessary skb allocs/frees for
large packets in guest receive path by deferring skb allocations.
Patches to support this enhancement are under review on netdev and expected to
be accepted in linux 2.6.34.
Will post a link to the patches once they are accepted.
=Comment: #3=================================================
Sridhar Samudrala <sri.com> - 
Links to patches submitted on netdev. Expected to be included in 2.6.34

http://thread.gmane.org/gmane.linux.network/147074/focus=147075
http://thread.gmane.org/gmane.linux.network/147074/focus=45245

Comment 2 John Jarvis 2010-01-22 14:35:25 UTC
Has this been accepted upstream yet?

Comment 3 Anthony Liguori 2010-01-25 16:11:23 UTC
Yes, Rusty Russell has taken it into his tree.  Below is the Ack.

http://thread.gmane.org/gmane.linux.network/147074/focus=45245

Comment 4 Anthony Liguori 2010-01-25 16:13:55 UTC
Sridhar, please attach the patches to this bug with Rusty's Signed-off-by's.

Comment 6 IBM Bug Proxy 2010-02-04 19:51:06 UTC
------- Comment From xma.com 2010-02-04 14:43 EDT-------
The first two patches have been accepted in net-next tree, the third one has acked by MST.

http://patchwork.ozlabs.org/patch/43911/

http://patchwork.ozlabs.org/patch/43912/

http://patchwork.kernel.org/patch/76526/

------- Comment From xma.com 2010-02-04 14:46 EDT-------
First two patches are in git.kernel.org, see commit log below

git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6.git net-next

commit 9ab86bbcf8be755256f0a5e994e0b38af6b4d399
Author: Shirley Ma <mashirle.com>
Date:   Fri Jan 29 03:20:04 2010 +0000

virtio_net: Defer skb allocation in receive path Date: Wed, 13 Jan 2010 12:53:38 -0800

virtio_net receives packets from its pre-allocated vring buffers, then it
delivers these packets to upper layer protocols as skb buffs. So it's not
necessary to pre-allocate skb for each mergable buffer, then frees extra
skbs when buffers are merged into a large packet. This patch has deferred
skb allocation in receiving packets for both big packets and mergeable buffers
to reduce skb pre-allocations and skb frees. It frees unused buffers by calling
detach_unused_buf in vring, so recv skb queue is not needed.

Signed-off-by: Shirley Ma <xma.com>
Signed-off-by: Rusty Russell <rusty.au>
Signed-off-by: David S. Miller <davem>

commit f9bfbebf34eab707b065116cdc9699d25ba4252a
Author: Shirley Ma <mashirle.com>
Date:   Fri Jan 29 03:19:05 2010 +0000
virtio: Add ability to detach unused buffers from vrings

There's currently no way for a virtio driver to ask for unused
buffers, so it has to keep a list itself to reclaim them at shutdown.
This is redundant, since virtio_ring stores that information.  So
add a new hook to do this.

Signed-off-by: Shirley Ma <xma.com>
Signed-off-by: Amit Shah <amit.shah>
Signed-off-by: Rusty Russell <rusty.au>
Signed-off-by: David S. Miller <davem>

Comment 8 John Jarvis 2010-02-05 16:34:27 UTC
These patches need to be submitted to rh-kernel list for review.  Who is going to do that and what is your timeline?

Comment 9 IBM Bug Proxy 2010-02-05 16:51:14 UTC
------- Comment From xma.com 2010-02-05 11:50 EDT-------
I saw one patch has been submitted by Amit Shah <amit.shah> to jforbes

[PATCH 1/4] virtio: Add ability to detach unused buffers from vrings

I can submit the other two patches for review next week once I set up RHEL6 kernel source tree. Does that work?

Comment 10 IBM Bug Proxy 2010-02-08 19:50:53 UTC
------- Comment From sri.com 2010-02-08 14:40 EDT-------
Anthony,

Could you post these patches on rh-kernel mailing list?
I would expect they should apply cleanly against RHEL6 kernel based on 2.6.32.

Comment 11 Anthony Liguori 2010-02-18 02:35:49 UTC
The 3rd patch still wasn't upstream the last time this bug was updated.  I've confirmed that the patch has since been Acked-by Rusty but in the future, please collect the appropriate upstream Acks and attach a patch containing them to the bug report.  That makes it much easier.

I'll send these patches out tomorrow.

Comment 12 IBM Bug Proxy 2010-02-18 19:01:09 UTC
------- Comment From sri.com 2010-02-18 13:56 EDT-------
Here is the commit log for the 3rd patch and the link to the patch in net-next tree.

Subject: [PATCH] virtio_net: remove send queue

Now we have a virtio detach API (in commit
f9bfbebf34eab707b065116cdc9699d25ba4252a), we don't need to track xmit
skbs in the virio_net driver, which improves transmission performance.

Signed-off-by: Shirley Ma <xma.com>
Acked-by: Rusty Russell <rusty.au>
Acked-by: Michael S. Tsirkin <mst>
Signed-off-by: David S. Miller <davem>

http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=830a8a976ff2236ebc383e9a06f7872ed9243bfb

Comment 13 IBM Bug Proxy 2010-02-19 09:02:04 UTC
------- Comment From xma.com 2010-02-19 03:58 EDT-------
These patches have been applied and tested against 2.6.32 kernel. Let me know if it doesn't work with RHEL 6.0 kernel.

Comment 14 IBM Bug Proxy 2010-02-19 09:02:09 UTC
Created attachment 395052 [details]
[PATCH 1/3]: Add detach buffers API in virtio


------- Comment (attachment only) From xma.com 2010-02-19 03:52 EDT-------

Comment 15 IBM Bug Proxy 2010-02-19 09:02:13 UTC
Created attachment 395053 [details]
[PATCH 2/3] virtio-net: Defer skb allocation and remove recv queue


------- Comment (attachment only) From xma.com 2010-02-19 03:53 EDT-------

Comment 16 IBM Bug Proxy 2010-02-19 09:02:17 UTC
Created attachment 395054 [details]
[PATCH 3/3]: virtio-net: remove send queue


------- Comment (attachment only) From xma.com 2010-02-19 03:56 EDT-------

Comment 17 Anthony Liguori 2010-03-20 01:45:13 UTC
Patches have been submitted to the redhat kernel mailing list

Comment 21 IBM Bug Proxy 2010-05-27 17:10:42 UTC
------- Comment From xma.com 2010-05-27 13:06 EDT-------
I have verified. The patchset have been snapshot already.

Comment 23 releng-rhel@redhat.com 2010-11-11 16:10:01 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.