12 Jun, 2011

1 commit

  • There's no need for the guest to validate the checksum if it have been
    validated by host nics. So this patch introduces a new flag -
    VIRTIO_NET_HDR_F_DATA_VALID which is used to bypass the checksum
    examing in guest. The backend (tap/macvtap) may set this flag when
    met skbs with CHECKSUM_UNNECESSARY to save cpu utilization.

    No feature negotiation is needed as old driver just ignore this flag.

    Iperf shows 12%-30% performance improvement for UDP traffic. For TCP,
    when gro is on no difference as it produces skb with partial
    checksum. But when gro is disabled, 20% or even higher improvement
    could be measured by netperf.

    Signed-off-by: Jason Wang
    Acked-by: Michael S. Tsirkin
    Signed-off-by: David S. Miller

    Jason Wang
     

30 May, 2011

1 commit

  • It's unclear to me if it's important, but it's obviously causing my
    technical colleages some headaches and I'd hate such imprecision to
    slow virtio adoption.

    I've emailed this to all non-trivial contributors for approval, too.

    Signed-off-by: Rusty Russell
    Acked-by: Grant Likely
    Acked-by: Ryan Harper
    Acked-by: Anthony Liguori
    Acked-by: Eric Van Hensbergen
    Acked-by: john cooper
    Acked-by: Aneesh Kumar K.V
    Acked-by: Christian Borntraeger
    Acked-by: Fernando Luis Vazquez Cao

    Rusty Russell
     

22 Oct, 2009

1 commit

  • Rusty,

    commit 3ca4f5ca73057a617f9444a91022d7127041970a
    virtio: add virtio IDs file
    moved all device IDs into a single file. While the change itself is
    a very good one, it can break userspace applications. For example
    if a userspace tool wanted to get the ID of virtio_net it used to
    include virtio_net.h. This does no longer work, since virtio_net.h
    does not include virtio_ids.h.
    This patch moves all "#include " from the C
    files into the header files, making the header files compatible with
    the old ones.

    In addition, this patch exports virtio_ids.h to userspace.

    CC: Fernando Luis Vazquez Cao
    Signed-off-by: Christian Borntraeger
    Signed-off-by: Rusty Russell

    Christian Borntraeger
     

23 Sep, 2009

1 commit


30 Jul, 2009

1 commit


17 Jul, 2009

1 commit


02 May, 2009

1 commit


05 Feb, 2009

4 commits

  • VLAN filtering allows the hypervisor to drop packets from VLANs
    that we're not a part of, further reducing the number of extraneous
    packets recieved. This makes use of the VLAN virtqueue command class.
    The CTRL_VLAN feature bit tells us whether the backend supports VLAN
    filtering.

    Signed-off-by: Alex Williamson
    Acked-by: Rusty Russell
    Signed-off-by: David S. Miller

    Alex Williamson
     
  • Make use of the MAC control virtqueue class to support a MAC
    filter table. The filter table is managed by the hypervisor.
    We consider the table to be available if the CTRL_RX feature
    bit is set. We leave it to the hypervisor to manage the table
    and enable promiscuous or all-multi mode as necessary depending
    on the resources available to it.

    Signed-off-by: Alex Williamson
    Acked-by: Rusty Russell
    Signed-off-by: David S. Miller

    Alex Williamson
     
  • Make use of the RX_MODE control virtqueue class to enable the
    set_rx_mode netdev interface. This allows us to selectively
    enable/disable promiscuous and allmulti mode so we don't see
    packets we don't want. For now, we automatically enable these
    as needed if additional unicast or multicast addresses are
    requested.

    Signed-off-by: Alex Williamson
    Acked-by: Rusty Russell
    Signed-off-by: David S. Miller

    Alex Williamson
     
  • This will be used for RX mode, MAC filter table, VLAN filtering, etc...

    The control transaction consists of one or more "out" sg entries and
    one or more "in" sg entries. The first out entry contains a header
    defining the class and command. Additional out entries may provide
    data for the command. The last in entry provides a status response
    back from the command.

    Virtqueues typically run asynchronous, running a callback function
    when there's data in the channel. We can't readily make use of this
    in the command paths where we need to use this. Instead, we kick
    the virtqueue and spin. The kick causes an I/O write, triggering an
    immediate trap into the hypervisor.

    Signed-off-by: Alex Williamson
    Acked-by: Rusty Russell
    Signed-off-by: David S. Miller

    Alex Williamson
     

03 Feb, 2009

1 commit


31 Jan, 2009

1 commit


22 Jan, 2009

1 commit

  • Allow the host to inform us that the link is down by adding
    a VIRTIO_NET_F_STATUS which indicates that device status is
    available in virtio_net config.

    This is currently useful for simulating link down conditions
    (e.g. using proposed qemu 'set_link' monitor command) but
    would also be needed if we were to support device assignment
    via virtio.

    Signed-off-by: Mark McLoughlin
    Signed-off-by: Rusty Russell (added future masking)
    Signed-off-by: David S. Miller

    Mark McLoughlin
     

17 Nov, 2008

1 commit

  • If segmentation offload is enabled by the host, we currently allocate
    maximum sized packet buffers and pass them to the host. This uses up
    20 ring entries, allowing us to supply only 20 packet buffers to the
    host with a 256 entry ring. This is a huge overhead when receiving
    small packets, and is most keenly felt when receiving MTU sized
    packets from off-host.

    The VIRTIO_NET_F_MRG_RXBUF feature flag is set by hosts which support
    using receive buffers which are smaller than the maximum packet size.
    In order to transfer large packets to the guest, the host merges
    together multiple receive buffers to form a larger logical buffer.
    The number of merged buffers is returned to the guest via a field in
    the virtio_net_hdr.

    Make use of this support by supplying single page receive buffers to
    the host. On receive, we extract the virtio_net_hdr, copy 128 bytes of
    the payload to the skb's linear data buffer and adjust the fragment
    offset to point to the remaining data. This ensures proper alignment
    and allows us to not use any paged data for small packets. If the
    payload occupies multiple pages, we simply append those pages as
    fragments and free the associated skbs.

    This scheme allows us to be efficient in our use of ring entries
    while still supporting large packets. Benchmarking using netperf from
    an external machine to a guest over a 10Gb/s network shows a 100%
    improvement from ~1Gb/s to ~2Gb/s. With a local host->guest benchmark
    with GSO disabled on the host side, throughput was seen to increase
    from 700Mb/s to 1.7Gb/s.

    Based on a patch from Herbert Xu.

    Signed-off-by: Mark McLoughlin
    Signed-off-by: Rusty Russell (use netdev_priv)
    Signed-off-by: David S. Miller

    Mark McLoughlin
     

25 Jul, 2008

1 commit


11 Jun, 2008

1 commit


02 May, 2008

1 commit

  • So, we previously had a 'VIRTIO_NET_F_GSO' bit which meant that 'the
    host can handle csum offload, and any TSO (v4&v6 incl ECN) or UFO
    packets you might want to send. I thought this was good enough for
    Linux, but it actually isn't, since we don't do UFO in software.

    So, add separate feature bits for what the host can handle. Add
    equivalent ones for the guest to say what it can handle, because LRO
    is coming too (thanks Herbert!).

    Signed-off-by: Rusty Russell

    Rusty Russell
     

04 Feb, 2008

3 commits

  • 1) Turn GSO on virtio net into an all-or-nothing (keep checksumming
    separate). Having multiple bits is a pain: if you can't support something
    you should handle it in software, which is still a performance win.

    2) Make VIRTIO_NET_HDR_GSO_ECN a flag in the header, so it can apply to
    IPv6 or v4.

    3) Rename VIRTIO_NET_F_NO_CSUM to VIRTIO_NET_F_CSUM (ie. means we do
    checksumming).

    4) Add csum and gso params to virtio_net to allow more testing.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • It's far easier to deal with packets if we don't have to parse the
    packet to figure out the header length to know how much to pull into
    the skb data. Add the field to the virtio_net_hdr struct (and fix the
    spaces that somehow crept in there).

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • Previously we used a type/len pair within the config space, but this
    seems overkill. We now simply define a structure which represents the
    layout in the config space: the config space can now only be extended
    at the end.

    The main driver-visible changes:
    1) We indicate what fields are present with an explicit feature bit.
    2) Virtqueues are explicitly numbered, and not in the config space.

    Signed-off-by: Rusty Russell

    Rusty Russell
     

23 Oct, 2007

1 commit

  • The network driver uses two virtqueues: one for input packets and one
    for output packets. This has nice locking properties (ie. we don't do
    any for recv vs send).

    TODO:
    1) Big packets.
    2) Multi-client devices (maybe separate driver?).
    3) Resolve freeing of old xmit skbs (Christian Borntraeger)

    Signed-off-by: Rusty Russell
    Cc: Christian Borntraeger
    Cc: Herbert Xu
    Cc: netdev@vger.kernel.org

    Rusty Russell