Statistics
| Branch: | Revision:

root / hw / virtio-net.c @ 7830cf78

History | View | Annotate | Download (41 kB)

# Date Author Comment
f6b26cf2 02/27/2013 05:10 pm Jason Wang

net: reduce the unnecessary memory allocation of multiqueue

Edivaldo reports a problem that the array of NetClientState in NICState is too
large - MAX_QUEUE_NUM(1024) which will wastes memory even if multiqueue is not
used.

Instead of static arrays, solving this issue by allocating the queues on demand...

14f9b664 02/08/2013 07:13 pm Jesse Larrew

hw/virtio-net.c: set config size using host features

Currently, the config size for virtio devices is hard coded. When a new
feature is added that changes the config size, drivers that assume a static
config size will break. For purposes of backward compatibility, there needs...

1e89ad5b 02/08/2013 03:37 pm Anthony Liguori

virtio-net: pass host features to virtio_net_init

Signed-off-by: Anthony Liguori <>

0c87e93e 02/01/2013 07:03 pm Jason Wang

virtio-net: separate virtqueue from VirtIONet

To support multiqueue virtio-net, the first step is to separate the virtqueue
related fields from VirtIONet to a new structure VirtIONetQueue. The following
patches will add an array of VirtIONetQueue to VirtIONet based on this patch....

fed699f9 02/01/2013 07:03 pm Jason Wang

virtio-net: multiqueue support

This patch implements both userspace and vhost support for multiple queue
virtio-net (VIRTIO_NET_F_MQ). This is done by introducing an array of
VirtIONetQueue to VirtIONet.

Signed-off-by: Jason Wang <>
Signed-off-by: Anthony Liguori <>

5f800801 02/01/2013 07:03 pm Jason Wang

virtio-net: migration support for multiqueue

This patch add migration support for multiqueue virtio-net. Instead of bumping
the version, we conditionally send the info of multiqueue only when the device
support more than one queue to maintain the backward compatibility....

a9f98bb5 02/01/2013 07:03 pm Jason Wang

vhost: multiqueue support

This patch lets vhost support multiqueue. The idea is simple, just launching
multiple threads of vhost and let each of vhost thread processing a subset of
the virtqueues of the device. After this change each emulated device can have...

948ecf21 02/01/2013 07:03 pm Jason Wang

net: intorduce qemu_del_nic()

To support multiqueue nic, this patch separate the nic destructor from
qemu_del_net_client() to a new helper qemu_del_nic() since the mapping bettween
NiCState and NetClientState were not 1:1 in multiqueue. The following patches...

cc1f0f45 02/01/2013 07:03 pm Jason Wang

net: introduce qemu_get_nic()

To support multiqueue, this patch introduces a helper qemu_get_nic() to get
NICState from a NetClientState. The following patches would refactor this helper
to support multiqueue.

Signed-off-by: Jason Wang <>...

b356f76d 02/01/2013 07:02 pm Jason Wang

net: introduce qemu_get_queue()

To support multiqueue, the patch introduce a helper qemu_get_queue()
which is used to get the NetClientState of a device. The following patches would
refactor this helper to support multiqueue.

Signed-off-by: Jason Wang <>...

ec45f083 02/01/2013 06:50 pm Jason Wang

net: tap: using bool instead of bitfield

Signed-off-by: Jason Wang <>
Signed-off-by: Anthony Liguori <>

921ac5d0 01/30/2013 01:31 am Michael S. Tsirkin

virtio-net: remove layout assumptions for ctrl vq

Virtio-net code makes assumption about virtqueue descriptor layout
(e.g. sg0 is the header, sg1 is the data buffer).

This patch makes code not rely on the layout of descriptors.

Signed-off-by: Michael S. Tsirkin <>...

c1943a3f 01/30/2013 01:31 am Amos Kong

virtio-net: introduce a new macaddr control

In virtio-net guest driver, currently we write MAC address to
pci config space byte by byte, this means that we have an
intermediate step where mac is wrong. This patch introduced
a new control command to set MAC address, it's atomic....

dd23454b 01/30/2013 01:31 am Amos Kong

virtio-net: rename ctrl rx commands

This patch makes rx commands consistent with specification.

Signed-off-by: Amos Kong <>
Signed-off-by: Michael S. Tsirkin <>

41dc8a67 01/30/2013 01:31 am Michael S. Tsirkin

virtio-net: revert mac on reset

Once guest overrides virtio net primary mac,
it retains the value set until qemu exit.
This is inconsistent with standard nic behaviour.
To fix, revert the mac to the original value on reset.

Signed-off-by: Michael S. Tsirkin <>

1830b80f 01/07/2013 07:42 pm Michael S. Tsirkin

virtio-net: set/clear vhost_started in reverse order

As vhost started is cleared last thing on stop,
set it first things on start. This makes it
possible to use vhost_started while start is in
progress which is used by follow-up patches.

Signed-off-by: Michael S. Tsirkin <>

f56a1247 01/07/2013 07:42 pm Michael S. Tsirkin

vhost: backend masking support

Support backend guest notifier masking in vhost-net:
create eventfd at device init, when masked,
make vhost use that as eventfd instead of
sending an interrupt.

Signed-off-by: Michael S. Tsirkin <>

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

1422e32d 12/19/2012 09:31 am Paolo Bonzini

net: reorganize headers

Move public headers to include/net, and leave private headers in net/.
Put the virtio headers in include/net/tap.h, removing the multiple copies
that existed. Leave include/net/tap.h as the interface for NICs, and
net/tap_int.h as the interface for OS-specific parts of the tap backend....

22cc84db 10/29/2012 06:25 pm Michael S. Tsirkin

virtio-net: avoid sg copy

Avoid tweaking iovec during receive. This removes
the need to copy the vector.
Note: we currently have an evil cast in work_around_broken_dhclient
and unfortunately this patch does not fix it - just
pushes the evil cast to another place....

63c58728 10/29/2012 06:25 pm Michael S. Tsirkin

virtio-net: use safe iov operations for rx

Avoid magling iov manually: use safe iov operations
for processing packets incoming to guest.
This also removes the requirement for virtio header to
fit the first s/g entry exactly.

Signed-off-by: Michael S. Tsirkin <>

280598b7 10/29/2012 06:25 pm Michael S. Tsirkin

virtio-net: refactor receive_hdr

Now that we know host hdr length, we don't need to
duplicate the logic in receive_hdr: caller can
figure out the offset itself.

Signed-off-by: Michael S. Tsirkin <>

c8d28e7e 10/29/2012 06:25 pm Michael S. Tsirkin

virtio-net: first s/g is always at start of buf

We know offset is 0, assert that.

Signed-off-by: Michael S. Tsirkin <>

14761f9c 10/29/2012 06:25 pm Michael S. Tsirkin

virtio-net: switch tx to safe iov functions

Avoid mangling iovec manually: use safe iov_*
functions.

Signed-off-by: Michael S. Tsirkin <>

7b80d08e 10/29/2012 06:25 pm Michael S. Tsirkin

virtio-net: simplify rx code

Remove code duplication using guest header length that we track.
Drop specific layout requirement for rx buffers: things work
using generic iovec functions in any case.

Signed-off-by: Michael S. Tsirkin <>

e043ebc6 10/29/2012 06:25 pm Michael S. Tsirkin

virtio-net: minor code simplification

During packet filtering, we can now use host hdr len
to offset incoming buffer unconditionally.

Signed-off-by: Michael S. Tsirkin <>

6e371ab8 10/29/2012 06:25 pm Michael S. Tsirkin

virtio-net: test peer header support at init time

There's no reason to query header support at random
times: at load or feature query.
Driver also might not query functions.
Cleaner to do it at device init.

Signed-off-by: Michael S. Tsirkin <>

ff3a8066 10/29/2012 06:25 pm Michael S. Tsirkin

virtio-net: enable mrg buf header in tap on linux

Modern linux supports arbitrary header size,
which makes it possible to pass mrg buf header
to tap directly without iovec mangling.
Use this capability when it is there.

This removes the need to deal with it in...

e35e23f6 10/29/2012 06:25 pm Michael S. Tsirkin

virtio-net: track host/guest header length

Tracking these in device state instead of
re-calculating on each packet. No functional
changes.

Signed-off-by: Michael S. Tsirkin <>

e398d61b 10/17/2012 07:34 pm Juan Quintela

virtio-net: use qemu_get_buffer() in a temp buffer

qemu_fseek() is known to be wrong. Would be removed on the next
commit. This code should never been used (value has been
MAC_TABLE_ENTRIES since 2009).

Signed-off-by: Juan Quintela <>...

98991481 10/08/2012 02:59 pm Amos Kong

virtio-net: update nc.link_down in virtio_net_load()

nc.link_down could not be migrated, this patch updates link_down in
virtio_post_load() to keep it coincident with real link status.

Signed-off-by: Amos Kong <>
Signed-off-by: Stefan Hajnoczi <>

40bad8f3 09/28/2012 01:16 pm Michael S. Tsirkin

virtio-net: fix used len for tx

There is no out sg for TX, so used buf length for tx
should always be 0.

Signed-off-by: Michael S. Tsirkin <>

987a9b48 09/14/2012 10:40 am Paolo Bonzini

net: notify iothread after flushing queue

virtio-net has code to flush the queue and notify the iothread
whenever new receive buffers are added by the guest. That is
fine, and indeed we need to do the same in all other drivers.
However, notifying the iothread should be work for the network...

4e68f7a0 08/01/2012 03:32 pm Stefan Hajnoczi

net: Rename VLANClientState to NetClientState

The vlan feature is no longer part of net core. Rename VLANClientState
to NetClientState because net clients are not explicitly associated with
a vlan at all, instead they have a peer net client to which they are...

b20c6b9e 08/01/2012 03:32 pm Stefan Hajnoczi

net: Rename qemu_del_vlan_client() to qemu_del_net_client()

Another step in moving the vlan feature out of net core. Users only
deal with NetClientState and therefore qemu_del_vlan_client() should be
named qemu_del_net_client().

Signed-off-by: Stefan Hajnoczi <>...

2be64a68 07/23/2012 01:55 pm Laszlo Ersek

hw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated)

NET_CLIENT_TYPE_ -> NET_CLIENT_OPTIONS_KIND_

Signed-off-by: Laszlo Ersek <>
Signed-off-by: Stefan Hajnoczi <>

dcf6f5e1 06/07/2012 07:43 pm Michael Tokarev

change iov_* function prototypes to be more appropriate

Reorder arguments to be more natural, readable and
consistent with other iov_* functions, and change
argument names, from:
iov_from_buf(iov, iov_cnt, buf, iov_off, size)
to
iov_from_buf(iov, iov_cnt, offset, buf, bytes)...

2a633c46 05/21/2012 11:40 pm Orit Wassermann

virtio: check virtio_load return code

Otherwise we crash on error.

Signed-off-by: Ulrich Obergfell <>
Signed-off-by: Orit Wassermann <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

f79f2bfc 01/27/2012 06:50 pm Anthony Liguori

qdev: don't access name through info

We already have a QOM interface for this so let's use it.

Signed-off-by: Anthony Liguori <>

30fbb9fc 01/27/2012 06:50 pm Anthony Liguori

qdev: move qdev->info to class

Right now, DeviceInfo acts as the class for qdev. In order to switch to a
proper ObjectClass derivative, we need to ween all of the callers off of
interacting directly with the info pointer.

Signed-off-by: Anthony Liguori <>

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

81e34a24 08/05/2011 01:15 am Anthony Liguori

Merge remote-tracking branch 'mst/for_anthony' into staging

b52dfd71 07/27/2011 08:18 pm Amit Shah

virtio-net: don't use vdev after virtio_cleanup

virtio_cleanup() will be changed by the following patch to remove the
VirtIONet struct that gets allocated via virtio_common_init(). Ensure
we don't dereference the structure after calling the cleanup function....

348e7b8d 07/18/2011 05:06 pm Hannes Reinecke

iov: Update parameter usage in iov_(to|from)_buf()

iov_to_buf() has an 'offset' parameter, iov_from_buf() hasn't.
This patch adds the missing parameter to iov_from_buf().
It also renames the 'offset' parameter to 'iov_off' to
emphasize it's the offset into the iovec and not the buffer....

74475455 03/21/2011 10:23 am Paolo Bonzini

change all other clock references to use nanosecond resolution accessors

This was done with:

sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \
$(git grep -l 'qemu_get_clock\>' )
sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \
$(git grep -l 'qemu_new_timer\>' )...
b46d97f2 03/04/2011 12:33 am Stefan Hajnoczi

virtio-net: Fix lduw_p() pointer argument of wrong size

A pointer to a size_t variable was passed as the void * pointer to
lduw_p() in virtio_net_receive(). Instead of acting on the 16-bit value
this caused failure on big-endian hosts.

Avoid this issue in the future by using stw_p() instead. In general we...

32993698 02/20/2011 07:06 pm Michael S. Tsirkin

vhost: disable on tap link down

qemu makes it possible to disable link at tap which is not communicated
to the guest but causes all packets to be dropped.

When vhost-net is enabled, vhost needs to be aware of both the virtio
link_down and the peer link_down. we switch to userspace emulation when...

5430a28f 02/02/2011 12:50 am mst@redhat.com

vhost: force vhost off for non-MSI guests

When MSI is off, each interrupt needs to be bounced through the io
thread when it's set/cleared, so vhost-net causes more context switches and
higher CPU utilization than userspace virtio which handles networking in...

44b15bc5 01/29/2011 04:07 pm Aurelien Jarno

virtio-net: fix cross-endianness support

virtio-net used to work on cross-endianness configurations, but doesn't
anymore with recent guest kernels, as the new features don't handle
endianness correctly.

This patch fixes wrong conversion, and add missing ones to make...

85cf2a8d 01/10/2011 02:44 pm Michael S. Tsirkin

virtio: move vmstate change tracking to core

Move tracking vmstate change from virtio-net to virtio.c
as it is going to be used by virito-blk and virtio-pci
for the ioeventfd support.

Signed-off-by: Michael S. Tsirkin <>

b254b0d1 12/17/2010 04:21 pm Anthony Liguori

Merge remote branch 'mst/for_anthony' into staging

1ca4d09a 12/11/2010 11:32 pm Gleb Natapov

Add bootindex parameter to net/block/fd device

If bootindex is specified on command line a string that describes device
in firmware readable way is added into sorted list. Later this list will
be passed into firmware to control boot order.

Signed-off-by: Gleb Natapov <>...

95477323 12/09/2010 12:47 pm Michael S. Tsirkin

virtio-net: don't dma while vm is stopped

DMA into memory while VM is stopped makes it
hard to debug migration (consequitive saves
result in different files).
Fixing this completely is a large effort,
this patch does this for virtio-net.

Signed-off-by: Michael S. Tsirkin <>...

783e7706 12/09/2010 12:47 pm Michael S. Tsirkin

virtio-net: stop/start bh when appropriate

Avoid sending out packets, and modifying
memory, when VM is stopped.
Add assert statements to verify this does not happen.

Avoid scheduling bh when vhost-net is started.

Stop bh when driver disabled bus mastering...

e7b43f7e 11/21/2010 05:16 pm Stefan Hajnoczi

virtio-net: Convert fprintf() to error_report()

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Anthony Liguori <>

afbaa7b4 10/07/2010 01:19 pm Michael S. Tsirkin

virtio-net: unify vhost-net start/stop

Move all of vhost-net start/stop logic to a single routine,
and call it from everywhere.

Additionally, start/stop vhost-net on link up/down:
we should not transmit anything if user asked us to
put the link down.

Signed-off-by: Michael S. Tsirkin <>...

a697a334 09/07/2010 08:29 pm Alex Williamson

virtio-net: Introduce a new bottom half packet TX

Based on a patch from Mark McLoughlin, this patch introduces a new
bottom half packet transmitter that avoids the latency imposed by
the tx_timer approach. Rather than scheduling a timer when a TX
packet comes in, schedule a bottom half to be run from the iothread....

4b4b8d36 09/07/2010 08:29 pm Alex Williamson

virtio-net: Rename tx_timer_active to tx_waiting

De-couple this from the timer since we might want to use
different backends to send the packet.

Signed-off-by: Alex Williamson <>
Signed-off-by: Michael S. Tsirkin <>

e3f30488 09/07/2010 08:29 pm Alex Williamson

virtio-net: Limit number of packets sent per TX flush

If virtio_net_flush_tx() is called with notification disabled, we can
race with the guest, processing packets at the same rate as they
get produced. The trouble is that this means we have no guaranteed...

f0c07c7c 09/07/2010 08:29 pm Alex Williamson

virtio-net: Make tx_timer timeout configurable

Add an option to make the TX mitigation timer adjustable as a device
option. The 150us hard coded default used currently is reasonable,
but may not be suitable for all workloads, this gives us a way to
adjust it using a single binary. We can't support any random option...

279a4253 07/11/2010 11:31 pm Michael S. Tsirkin

virtio-net: correct packet length math

We were requesting too much when checking buffer
length: size already includes host header length.

Further, we should not exit if we get a packet that
is too long, since this might not be under control
of the guest. Just drop the packet....

0be71e32 07/06/2010 06:36 pm Alex Williamson

savevm: Add DeviceState param

When available, we'd like to be able to access the DeviceState
when registering a savevm. For buses with a get_dev_path()
function, this will allow us to create more unique savevm
id strings.

Signed-off-by: Alex Williamson <>...

01657c86 07/06/2010 06:36 pm Alex Williamson

virtio-net: Incorporate a DeviceState pointer and let savevm track instances

Stuff a pointer to the DeviceState into the VirtIONet structure so that
we can easily remove the vmstate entry later. Also, let vmstate track
the instance number (it should always be zero internally since the...

940cda94 06/07/2010 05:23 pm Michael S. Tsirkin

virtio-net: truncating packet

virtio net attempts to peek into virtio queue to
determine that we have enough space for the complete
packet to fit. However, it fails to account for space
consumed by virtio net header when it does this,
under stress this results in a failure...

7f974481 06/02/2010 11:54 am Michael S. Tsirkin

virtio-net: stop vhost backend on vmstop

vhost net currently keeps running after vmstop,
which causes trouble as qemy does not check
for dirty pages anymore.
The fix is to simply keep vm and vhost running/stopped
status in sync.

Tested-by: David L Stevens <>...

57c3229b 05/12/2010 06:33 pm Michael S. Tsirkin

virtio-net: return with value in void function

virtio-net has return with value in a void function.
No idea why does it compile with gcc,
but this isn't standard C.

Signed-off-by: Michael S. Tsirkin <>

e4d5639d 04/28/2010 04:58 pm Amit Shah

iov: Introduce a new file for helpers around iovs, add iov_from_buf()

The virtio-net code uses iov_fill() which fills an iov from a linear
buffer. The virtio-serial-bus code does something similar in an
open-coded function.

Create a new iov.c file that has iov_from_buf()....

dc14a397 04/14/2010 12:58 am David L Stevens

vhost: fix features ack

vhost driver in qemu didn't ack features, and this happens
to work because we don't really require any features. However,
it's better not to rely on this. This patch passes features to
vhost as guest acks them.

Signed-off-by: David L Stevens <>...

9bc6304c 04/01/2010 09:56 pm Michael S. Tsirkin

virtio-net: vhost net support

This connects virtio-net to vhost net backend.
The code is structured in a way analogous to what we have with vnet
header capability in tap.

We start/stop backend on driver start/stop as
well as on save and vm start (for migration)....

1ecda02b 03/16/2010 05:58 pm Markus Armbruster

error: Replace qemu_error() by error_report()

error_report() terminates the message with a newline. Strip it it
from its arguments.

This fixes a few error messages lacking a newline:
net_handle_fd_param()'s "No file descriptor named %s found", and
tap_open()'s "vnet_hdr=1 requested, but no kernel support for...

2f792016 03/16/2010 05:55 pm Markus Armbruster

error: Move qemu_error & friends into their own header

06b12970 02/10/2010 08:48 pm Tom Lendacky

virtio-net: fix network stall under load

Fix a race condition where qemu finds that there are not enough virtio
ring buffers available and the guest make more buffers available before
qemu can enable notifications.

Signed-off-by: Tom Lendacky <>...

22c253d9 01/14/2010 01:14 am Amit Shah

virtio: net: remove dead assignment

clang-analyzer points out value assigned to 'len' is not used.

Signed-off-by: Amit Shah <>
Signed-off-by: Anthony Liguori <>

c9f79a3f 01/12/2010 10:32 pm Michael S. Tsirkin

virtio-net: mac property is mandatory

Mac feature bit isn't going to work as all network cards already have a
'mac' property to set the mac address. Remove it from mask and add in
get_features.

Reported-by: Gerd Hoffmann <>
Signed-off-by: Michael S. Tsirkin <>...

704a76fc 01/11/2010 09:40 pm Michael S. Tsirkin

virtio: rename features -> guest_features

Rename features->guest_features. This is
what they are, avoid confusion with
host features which we also need to keep around.

Signed-off-by: Michael S. Tsirkin <>
Signed-off-by: Anthony Liguori <>

8172539d 01/11/2010 09:40 pm Michael S. Tsirkin

virtio: add features as qdev properties

Add feature bits as properties to virtio. This makes it possible to e.g. define
machine without indirect buffer support, which is required for 0.10
compatibility, or without hardware checksum support, which is required for 0.11...

665a3b07 12/03/2009 05:41 pm Mark McLoughlin

net: remove VLANClientState members now in NetClientInfo

Add a NetClientInfo pointer to VLANClientState and use that
for the typecode and function pointers.

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

eb6b6c12 12/03/2009 05:41 pm Mark McLoughlin

net: convert virtio to NICState

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

184bd048 11/09/2009 04:43 pm Dustin Kirkland

whitelist host virtio networking features

This patch is a followup to 8eca6b1bc770982595db2f7207c65051572436cb,
fixing crashes when guests with 2.6.25 virtio drivers have saturated
virtio network connections.

https://bugs.edge.launchpad.net/ubuntu/+source/qemu-kvm/+bug/458521...

cdd5cc12 11/09/2009 04:43 pm Mark McLoughlin

virtio-net: split the has_buffers() logic from can_receive()

We should only return zero from receive() for a condition which we'll
get notification of when it changes. Currently, we're returning zero
if the guest driver is not ready, but we won't ever flush our queue...

3cbe04c4 10/30/2009 04:42 pm Mark McLoughlin

virtio-net: fix macaddr config regression

This commit:

commit 97b15621
virtio: use qdev properties for configuration.
Signed-off-by: Gerd Hoffmann &lt;&gt;
Signed-off-by: Anthony Liguori &lt;&gt;

makes a guest using virtio-net see an empty macaddr because we never...

a8ed73f7 10/30/2009 03:39 pm Mark McLoughlin

net: move more stuff into net/tap-win32.c, add net/tap.h

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

7200ac3c 10/30/2009 03:39 pm Mark McLoughlin

net: move net-checksum.c under net/

Also add a new net/checksum.h header

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

0ce0e8f4 10/27/2009 07:29 pm Mark McLoughlin

virtio-net: add tap_has_ufo flag to saved state

If we tell the guest we support UFO and then migrate to host which
doesn't support it, we will find ourselves in grave difficulties.

Prevent this scenario by adding a flag to virtio-net's savevm format
which indicates whether the device requires host UFO support....

1d41b0c1 10/27/2009 07:29 pm Anthony Liguori

Work around dhclient brokenness

With the latest GSO/csum offload patches, any guest using an unpatched version
of dhclient (any Ubuntu guest, for instance), will no longer be able to get
a DHCP address.

dhclient is actually at fault here. It uses AF_PACKET to receive DHCP responses...

6c9f58ba 10/27/2009 07:29 pm Sridhar Samudrala

Enable UFO on virtio-net and tap devices

Enable UFO on the host tap device if supported and allow setting UFO
on virtio-net in the guest.

Signed-off-by: Sridhar Samudrala <>
Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

f5436dd9 10/27/2009 07:29 pm Mark McLoughlin

virtio-net: enable tap offload if guest supports it

We query the guest's feature set to see if it supports offload and,
if so, we enable those features on the tap interface.

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

3a330134 10/27/2009 07:29 pm Mark McLoughlin

virtio-net: add vnet_hdr support

With '-netdev tap,id=foo -nic model=virtio,netdev=foo' virtio-net can
detect that its peer (i.e. the tap backend) supports vnet headers
and advertise to the guest that it can send packets with partial
checksums and/or TSO packets....

97b15621 10/27/2009 07:28 pm Gerd Hoffmann

virtio: use qdev properties for configuration.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

a61d1f67 07/22/2009 06:58 pm Glauber Costa

notify io_thread at the end of rx handling

This is a backport from qemu-kvm. Just instead of using kvm's specific
notification mechanism, we use qemu_notify_event()

Signed-off-by: Glauber Costa <>
Signed-off-by: Anthony Liguori <>

566e2d3e 06/24/2009 05:09 pm Michael S. Tsirkin

qemu/net: request 3 vectors in virtio-net

Request up to 3 vectors in virtio-net. Actual bindings might supply
less.

Signed-off-by: Michael S. Tsirkin <>
Signed-off-by: Anthony Liguori <>

ffe6370c 06/24/2009 05:09 pm Michael S. Tsirkin

qemu/net: flag to control the number of vectors a nic has

Add an option to specify the number of MSI-X vectors for PCI NIC cards. This
can also be used to disable MSI-X, for compatibility with old qemu. This
option currently only affects virtio cards.

Signed-off-by: Michael S. Tsirkin <>...

6243375f 06/22/2009 06:15 pm Mark McLoughlin

virtio-net: implement async packet sending

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

e16044ef 06/22/2009 06:15 pm Mark McLoughlin

virtio-net: enable mergeable receive buffers

When virtio-net was merged in from qemu-kvm.git, the VNET_HDR related
features were dropped from the code.

However, VIRTIO_NET_F_MRG_RXBUF appears to have accidentally been
dropped too. Re-instate that now.

Reported-by: Michael S. Tsirkin <>...

f10c592e 06/09/2009 01:38 pm Alex Williamson

virtio-net: Use a byte to store RX mode flags

There's no need to save 4 bytes for promisc and allmulti.
Use one byte each just to avoid the overhead of a bitmap.

Signed-off-by: Alex Williamson <>
Signed-off-by: Mark McLoughlin <>

bbe2f399 06/09/2009 01:38 pm Alex Williamson

virtio-net: reorganize receive_filter()

Reorganize receive_filter to better handle the split between
unicast and multicast filtering. This allows us to skip the
broadcast check on unicast packets and leads to more opportunities
for optimization.

Signed-off-by: Alex Williamson <>...

8fd2a2f1 06/09/2009 01:38 pm Alex Williamson

virtio-net: Fix MAC filter overflow handling

Overloading the promisc and allmulti flags for indicating filter
table overflow makes it difficult to track the actual requested
operating mode. Split these out into separate flags.

Signed-off-by: Alex Williamson <>...

2d9aba39 06/09/2009 01:38 pm Alex Williamson

virtio-net: MAC filter optimization

The MAC filter table is received from the guest as two separate
buffers, one with unicast entries, the other with multicast
entries. If we track the index dividing the two sets, we can
avoid searching the part of the table with the wrong type of...

015cb166 06/09/2009 01:38 pm Alex Williamson

virtio-net: Add new RX filter controls

Add a few new RX modes to better control the receive_filter. These
are all fairly obvious features that hardware could provide.

Signed-off-by: Alex Williamson <>
Signed-off-by: Mark McLoughlin <>

4ffb17f5 06/09/2009 01:38 pm Alex Williamson

virtio-net: Increase filter and control limits

Increase the size of the perfect filter table and control queue depth.
This should give us more headroom in the MAC filter and is known to be
needed by at least one guest user. Increasing the control queue depth...