Skip to content
Snippets Groups Projects
  1. Jun 24, 2013
  2. Jun 23, 2013
  3. Jun 21, 2013
  4. Jun 20, 2013
    • Dor Laor's avatar
      Limit the usage of indirect buffers · 5b751612
      Dor Laor authored
      Indirect is good for very large SG list but isn't required
      in case there is enough place on the ring or the SG list is tiny.
      For the time being there is barely use of it so I set it off
      by default
      5b751612
    • Dor Laor's avatar
      Add mergeable buffers support for virtio-net · d487ffd1
      Dor Laor authored
      The feature allows the hypervisor to batch several packets together
      as one large SG list. Once such header is received, the guest rx
      routine interates over the list and assembles a mega mbuf.
      
      The patch also simplifies the rx path by using a single buffer for
      the virtio data and its header. This shrinks the sg list from size of
      two into a single one.
      
      The issue is that at the moment I haven't seen packets w/ mbuf > 1
      being received. Linux guest does receives such packets here and there.
      It may be due to the use of offload features that enalrge the packet size
      d487ffd1
  5. Jun 19, 2013
    • Guy Zana's avatar
      rwlock: initial implementation for a rwlock · 6af9f16d
      Guy Zana authored
      this rwlock gives precedence to writers, it relies on a mutex and 2 condvars
      for it's implementation.
      
      it also supports taking the lock recursively for both readers and writers.
      
      this implementation is not fully tested but yet the TCP stack uses it
      extensively, so far without any seen races (tested TCPDownload and netperf).
      6af9f16d
    • Guy Zana's avatar
      bsd: avoid using extern "C" in c++ files · 8536721b
      Guy Zana authored
      1. it is much cleaner that the header files perform extern "C" themselves,
         so they can be included both from C and C++ code.
      
      2. when doing extern "C" from a C++ file then __cplusplus is also defined,
         and compilation can break in some situations.
      
      3. as a bonus, this patch increase compilation time.
      8536721b
    • Nadav Har'El's avatar
      bsd netport: rename log() to bsd_log() · bdd2b656
      Nadav Har'El authored
      netport.h defines a log() macro, which is an unfortunate choice of name
      because log is also a pretty-well-known mathematical function, and this
      
      So rename this macro bsd_log(), and change the dozen files which used
      log() to use bsd_log().
      bdd2b656
    • Nadav Har'El's avatar
      console: implement FIOREAD · ec2e5ebc
      Nadav Har'El authored
      Java's os::available() requires the FIONREAD on fds which do not
      implement seek. So we need to support this ioctl for the console.
      ec2e5ebc
    • Nadav Har'El's avatar
      lock-free mutex: use wake_with() · b4670b9c
      Nadav Har'El authored
      Use the new wake_with() in lock-free mutex
      b4670b9c
    • Nadav Har'El's avatar
      condvar: improve wake performance while maintaining correctness · 43e34bbf
      Nadav Har'El authored
      Before commit 1b53ec56,
      condvar_wake_all() had a crash which could be seen tst-pipe.so (which
      apparently tests some condvar code paths that weren't tested by
      tst-condvar.so).
      
      The fix in this commit was for condvar_wait() to regain the condvar
      internal lock after the wait, even if not needed (it's only really
      needed in case of timeout). This masked the bug (see details below)
      but also deteriorated performance: the woken up thread will now often
      goes back to sleep to wait for the lock which is still held by
      condvar_wake().
      
      This patch reverts that commit, i.e., condvar_wait() does not retake
      the lock when woken. Instead, we fix the real bug: The bug was in
      condvar_wake_all() which did:
      
              sched::thread *t = wr->t;
              wr->t = nullptr;
              t->wake();
              wr = wr->newer;
      
      but after the wake(), wr is no longer valid (the waiter, being woken,
      would quickly exit the condvar_wait() function which held wr on the stack).
      
      However, by not taking the lock after the wait we also have another
      potential for bug - in rare cases merely doing wr->t = nullptr can
      cause the thread t to start running, and if it not only stops waiting
      but also exits - the call to t->wake() will refer to an invalid thread
      and may crash. So we need to use the new wake_with() thread method
      introduced in a previous patch.
      43e34bbf
Loading