1. 03 5月, 2010 1 次提交
    • M
      tun: add ioctl to modify vnet header size · d9d52b51
      Michael S. Tsirkin 提交于
      virtio added mergeable buffers mode where 2 bytes of extra info is put
      after vnet header but before actual data (tun does not need this data).
      In hindsight, it would have been better to add the new info *before* the
      packet: as it is, users need a lot of tricky code to skip the extra 2
      bytes in the middle of the iovec, and in fact applications seem to get
      it wrong, and only work with specific iovec layout.  The fact we might
      need to split iovec also means we might in theory overflow iovec max
      size.
      
      This patch adds a simpler way for applications to handle this,
      and future proofs the interface against further extensions,
      by making the size of the virtio net header configurable
      from userspace. As a result, tun driver will simply
      skip the extra 2 bytes on both input and output.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      d9d52b51
  2. 02 5月, 2010 2 次提交
    • E
      net/usb: initiate sync sequence in sierra_net.c driver · 6f1464bf
      Elina Pasheva 提交于
      The following patch adds the initiation of the sync sequence to
      "sierra_net_bind()". If this step is omitted, the modem will never sync up
      with the host and it will not be possible to establish a data connection.
      Signed-off-by: NElina Pasheva <epasheva@sierrawireless.com>
      Signed-off-by: NRory Filer <rfiler@sierrawireless.com>
      Tested-by: NElina Pasheva <epasheva@sierrawireless.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6f1464bf
    • E
      net: sock_def_readable() and friends RCU conversion · 43815482
      Eric Dumazet 提交于
      sk_callback_lock rwlock actually protects sk->sk_sleep pointer, so we
      need two atomic operations (and associated dirtying) per incoming
      packet.
      
      RCU conversion is pretty much needed :
      
      1) Add a new structure, called "struct socket_wq" to hold all fields
      that will need rcu_read_lock() protection (currently: a
      wait_queue_head_t and a struct fasync_struct pointer).
      
      [Future patch will add a list anchor for wakeup coalescing]
      
      2) Attach one of such structure to each "struct socket" created in
      sock_alloc_inode().
      
      3) Respect RCU grace period when freeing a "struct socket_wq"
      
      4) Change sk_sleep pointer in "struct sock" by sk_wq, pointer to "struct
      socket_wq"
      
      5) Change sk_sleep() function to use new sk->sk_wq instead of
      sk->sk_sleep
      
      6) Change sk_has_sleeper() to wq_has_sleeper() that must be used inside
      a rcu_read_lock() section.
      
      7) Change all sk_has_sleeper() callers to :
        - Use rcu_read_lock() instead of read_lock(&sk->sk_callback_lock)
        - Use wq_has_sleeper() to eventually wakeup tasks.
        - Use rcu_read_unlock() instead of read_unlock(&sk->sk_callback_lock)
      
      8) sock_wake_async() is modified to use rcu protection as well.
      
      9) Exceptions :
        macvtap, drivers/net/tun.c, af_unix use integrated "struct socket_wq"
      instead of dynamically allocated ones. They dont need rcu freeing.
      
      Some cleanups or followups are probably needed, (possible
      sk_callback_lock conversion to a spinlock for example...).
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      43815482
  3. 01 5月, 2010 5 次提交
  4. 29 4月, 2010 26 次提交
  5. 28 4月, 2010 6 次提交