25 Aug, 2008

1 commit


12 Aug, 2008

1 commit


29 Jul, 2008

12 commits

  • lguest uses a Waker process to break it out of the kernel (ie.
    actually running the guest) when file descriptor needs attention.

    Changing this from a process to a thread somewhat simplifies things:
    it can directly access the fd_set of things to watch. More
    importantly, it means that the Waker can see Guest memory correctly,
    so /dev/vring file descriptors will work as anticipated (the
    alternative is to actually mmap MAP_SHARED, but you can't do that with
    /dev/zero).

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • With big packets, 128 entries is a little small.

    Guest -> Host 1GB TCP:
    Before: 8.43625 seconds xmit 95640 recv 198266 timeout 49771 usec 1252
    After: 8.01099 seconds xmit 49200 recv 102263 timeout 26014 usec 2118

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • Guest -> Host 1GB TCP:
    Before 20.1974 seconds xmit 214510 recv 5 timeout 214491 usec 278
    After 8.43625 seconds xmit 95640 recv 198266 timeout 49771 usec 1252

    Host -> Guest 1GB TCP:
    Before: Seconds 9.98854 xmit 172166 recv 5344 timeout 172157 usec 251
    After: Seconds 5.72803 xmit 244322 recv 9919 timeout 244302 usec 156

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • This warning can happen a lot under load, and it should be warnx not
    warn anwyay.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • Since the correct timeout value varies, use a heuristic which adjusts
    the timeout depending on how many packets we've seen. This gives
    slightly worse results, but doesn't need tweaking when GSO is
    introduced.

    500 usec 19.1887 xmit 561141 recv 1 timeout 559657
    Dynamic (278) 20.1974 xmit 214510 recv 5 timeout 214491 usec 278

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • virtio_ring has the ability to suppress notifications. This prevents
    a guest exit for every packet, but we need to set a timer on packet
    receipt to re-check if there were any remaining packets.

    Here are the times for 1G TCP Guest->Host with different timeout
    settings (it matters because the TCP window doesn't grow big enough to
    fill the entire buffer):

    Timeout value Seconds Xmit/Recv/Timeout
    None (before) 25.3784 xmit 7750233 recv 1
    2500 usec 62.5119 xmit 207020 recv 2 timeout 207020
    1000 usec 34.5379 xmit 207003 recv 2 timeout 207003
    750 usec 29.2305 xmit 207002 recv 1 timeout 207002
    500 usec 19.1887 xmit 561141 recv 1 timeout 559657
    250 usec 20.0465 xmit 214128 recv 2 timeout 214110
    100 usec 19.2583 xmit 561621 recv 1 timeout 560153

    (Note that these values are sensitive to the GSO patches which come
    later, and probably other traffic-related variables, so take with a
    large grain of salt).

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • Number of exits transmitting 10GB Guest->Host before:
    network xmit 7858610 recv 118136

    After:
    network xmit 7750233 recv 1

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • To simplify the transition to when we publish indices in the ring
    (and make shuffling my patch queue easier), wrap them in a lg_last_avail()
    macro.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • This is a simple patch to add support for the virtio "hardware random
    generator" to lguest. It gets about 1.2 MB/sec reading from /dev/hwrng
    in the guest.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • If you've got a nice DHCP configuration which maps MAC
    addresses to specific IP addresses, then you're going to
    want to start your guest with one of those MAC addresses.

    Also, in Fedora, we have persistent network interface naming
    based on the MAC address, so with randomly assigned
    addresses you're soon going to hit eth13. Who knows what
    will happen then!

    Allow assigning a MAC address to the network interface with
    e.g.

    --tunnet=bridge:eth0:00:FF:95:6B:DA:3D

    or:

    --tunnet=192.168.121.1:00:FF:95:6B:DA:3D

    which is pretty unintelligable, but ...

    (includes Rusty's minor rework)

    Signed-off-by: Mark McLoughlin
    Signed-off-by: Rusty Russell

    Mark McLoughlin
     
  • Signed-off-by: Mark McLoughlin
    Signed-off-by: Rusty Russell

    Mark McLoughlin
     
  • %02x is more appropriate for bytes than %08x.

    Signed-off-by: Rusty Russell

    Rusty Russell
     

30 May, 2008

1 commit

  • This is the lguest implementation of the VIRTIO_F_NOTIFY_ON_EMPTY feature.
    It is currently only published for network devices, but it is turned on for
    everyone.

    Signed-off-by: Rusty Russell

    Rusty Russell
     

02 May, 2008

2 commits


28 Mar, 2008

4 commits


11 Mar, 2008

1 commit

  • The lguest launcher appends a space to the kernel command line (if kernel
    arguments are specified on its command line). This space is unneeded. More
    importantly, this appended space will make Red Hat's nash script interpreter
    (used in a Fedora style initramfs) add an empty argument to init's command
    line. This empty argument will make kernel arguments like "init=/bin/bash"
    fail (because the shell will try to execute a script with an empty name).
    This could be considered a bug in nash, but is easily fixed in the lguest
    launcher too.

    Signed-off-by: Paul Bolle
    Signed-off-by: Rusty Russell

    Paul Bolle
     

04 Feb, 2008

3 commits

  • A reset function solves three problems:

    1) It allows us to renegotiate features, eg. if we want to upgrade a
    guest driver without rebooting the guest.

    2) It gives us a clean way of shutting down virtqueues: after a reset,
    we know that the buffers won't be used by the host, and

    3) It helps the guest recover from messed-up drivers.

    So we remove the ->shutdown hook, and the only way we now remove
    feature bits is via reset.

    We leave it to the driver to do the reset before it deletes queues:
    the balloon driver, for example, needs to chat to the host in its
    remove function.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • The other side (host) can set the NO_NOTIFY flag as an optimization,
    to say "no need to kick me when you add things". Make it clear that
    this is advisory only; especially that we should always notify when
    the ring is full.

    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
     

30 Jan, 2008

2 commits

  • This patch makes uses of pread() and pwrite() in lguest launcher
    to communicate the vcpu id to the lguest driver. The id is kept in
    a thread variable, which means we'll span in the future, vcpus as
    threads. But right now, only the infrastructure is out there.

    Signed-off-by: Glauber de Oliveira Costa
    Signed-off-by: Rusty Russell

    Glauber de Oliveira Costa
     
  • Reboot Implemented

    (Prevent fd leak, fix style and fix documentation --RR)

    Signed-off-by: Balaji Rao
    Signed-off-by: Rusty Russell

    Balaji Rao
     

18 Dec, 2007

1 commit

  • Share net is not supported, Rusty is an "idiot" .

    Signed-off-by: Sheela Sequeira
    Reviewed-by: James Morris
    Acked-by: Rusty Russell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sheela
     

19 Nov, 2007

1 commit


12 Nov, 2007

2 commits

  • The virtio descriptor rings of size N-1 were nicely set up to be
    aligned to an N-byte boundary. But as Anthony Liguori points out, the
    free-running indices used by virtio require that the sizes be a power
    of 2, otherwise we get problems on wrap (demonstrated with lguest).

    So we replace the clever "2^n-1" scheme with a simple "align to page
    boundary" scheme: this means that all virtio rings take at least two
    pages, but it's safer than guessing cache alignment.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • This seems like an obvious typo but it's worked in the past because the virtio
    blk frontend just ignores the length field on completion.

    Signed-off-by: Anthony Liguori
    Signed-off-by: Rusty Russell

    Anthony Liguori
     

25 Oct, 2007

2 commits


23 Oct, 2007

7 commits