1. 24 Feb, 2012 25 commits
  2. 23 Feb, 2012 10 commits
  3. 22 Feb, 2012 5 commits
    • Ben Hutchings's avatar
      sfc: Minor formatting cleanup · 2d0cc56d
      Ben Hutchings authored
      Fix some indentation and line continuations.
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      2d0cc56d
    • Ben Hutchings's avatar
      sfc: Reverse initial buffer table allocation to allow for later resizing · c92aaff1
      Ben Hutchings authored
      We have a very simple way of allocating buffer table entries to
      queues, which is just to take the next one available.  The extra
      channels are the highest numbered channels but they need to be
      allocated the lowest entries so that the traffic channels can be
      allocated new entries without any collisions.
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      c92aaff1
    • Ben Hutchings's avatar
      sfc: Correct validation of peer_page_count in efx_vfdi_set_status_page() · 01cb543d
      Ben Hutchings authored
      efx_vfdi_set_status_page() validates the peer page count by
      calculating the size of a request containing that many addresses and
      comparing that with the maximum valid request size (4KB).  The
      calculation involves a multiplication that may overflow on a 32-bit
      system.
      
      We use kcalloc() to allocate memory to store the addresses; that also
      does a multiplication and it does check for integer overflow, so any
      values larger than 0x1fffffff will be rejected.  However, values in
      the range [0x1fffffffc, 0x1fffffff] pass boh tests and result in an
      attempt to allocate nearly 4GB on the heap.  This should be rejected
      rather quickly as it's obviously impossible on a 32-bit system, and
      indeed the maximum possible heap allocation is 32MB.  Still, let's
      make absolutely sure by fixing the initial validation.
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      01cb543d
    • Ben Hutchings's avatar
      sfc: Specify that the VFDI status page has page alignment and size · c3cb2a87
      Ben Hutchings authored
      This requirement was meant to be implied in the name 'status page'.
      One out-of-tree VF driver allocates a buffer using the structure size
      and not a full page - hence the current odd specification - but in
      practice that allocation will be padded and aligned to at least 4KB.
      Therefore, we can specify this and have the option to extend the
      structure up to 4KB without worrying about VF drivers using odd-shaped
      buffers.
      Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
      c3cb2a87
    • Eric Dumazet's avatar
      af_unix: MSG_TRUNC support for dgram sockets · 9f6f9af7
      Eric Dumazet authored
      Piergiorgio Beruto expressed the need to fetch size of first datagram in
      queue for AF_UNIX sockets and suggested a patch against SIOCINQ ioctl.
      
      I suggested instead to implement MSG_TRUNC support as a recv() input
      flag, as already done for RAW, UDP & NETLINK sockets.
      
      len = recv(fd, &byte, 1, MSG_PEEK | MSG_TRUNC);
      
      MSG_TRUNC asks recv() to return the real length of the packet, even when
      is was longer than the passed buffer.
      
      There is risk that a userland application used MSG_TRUNC by accident
      (since it had no effect on af_unix sockets) and this might break after
      this patch.
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Tested-by: default avatarPiergiorgio Beruto <piergiorgio.beruto@gmail.com>
      CC: Michael Kerrisk <mtk.manpages@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9f6f9af7