1. 21 10月, 2011 1 次提交
    • E
      macvtap: Fix the minor device number allocation · e09eff7f
      Eric W. Biederman 提交于
      On systems that create and delete lots of dynamic devices the
      31bit linux ifindex fails to fit in the 16bit macvtap minor,
      resulting in unusable macvtap devices.  I have systems running
      automated tests that that hit this condition in just a few days.
      
      Use a linux idr allocator to track which mavtap minor numbers
      are available and and to track the association between macvtap
      minor numbers and macvtap network devices.
      
      Remove the unnecessary unneccessary check to see if the network
      device we have found is indeed a macvtap device.  With macvtap
      specific data structures it is impossible to find any other
      kind of networking device.
      
      Increase the macvtap minor range from 65536 to the full 20 bits
      that is supported by linux device numbers.  It doesn't solve the
      original problem but there is no penalty for a larger minor
      device range.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e09eff7f
  2. 17 11月, 2010 1 次提交
    • E
      macvlan: lockless tx path · 8ffab51b
      Eric Dumazet 提交于
      macvlan is a stacked device, like tunnels. We should use the lockless
      mechanism we are using in tunnels and loopback.
      
      This patch completely removes locking in TX path.
      
      tx stat counters are added into existing percpu stat structure, renamed
      from rx_stats to pcpu_stats.
      
      Note : this reverts commit 2c114553 (macvlan: add multiqueue
      capability)
      
      Note : rx_errors converted to a 32bit counter, like tx_dropped, since
      they dont need 64bit range.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Ben Greear <greearb@candelatech.com>
      Cc: Ben Hutchings <bhutchings@solarflare.com>
      Acked-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8ffab51b
  3. 16 11月, 2010 1 次提交
  4. 17 8月, 2010 1 次提交
  5. 23 7月, 2010 1 次提交
    • H
      macvtap: Limit packet queue length · 8a35747a
      Herbert Xu 提交于
      Mark Wagner reported OOM symptoms when sending UDP traffic over
      a macvtap link to a kvm receiver.
      
      This appears to be caused by the fact that macvtap packet queues
      are unlimited in length.  This means that if the receiver can't
      keep up with the rate of flow, then we will hit OOM. Of course
      it gets worse if the OOM killer then decides to kill the receiver.
      
      This patch imposes a cap on the packet queue length, in the same
      way as the tuntap driver, using the device TX queue length.
      
      Please note that macvtap currently has no way of giving congestion
      notification, that means the software device TX queue cannot be
      used and packets will always be dropped once the macvtap driver
      queue fills up.
      
      This shouldn't be a great problem for the scenario where macvtap
      is used to feed a kvm receiver, as the traffic is most likely
      external in origin so congestion notification can't be applied
      anyway.
      
      Of course, if anybody decides to complain about guest-to-guest
      UDP packet loss down the track, then we may have to revisit this.
      
      Incidentally, this patch also fixes a real memory leak when
      macvtap_get_queue fails.
      
      Chris Wright noticed that for this patch to work, we need a
      non-zero TX queue length.  This patch includes his work to change
      the default macvtap TX queue length to 500.
      Reported-by: NMark Wagner <mwagner@redhat.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Acked-by: NChris Wright <chrisw@sous-sol.org>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a35747a
  6. 29 6月, 2010 1 次提交
  7. 02 6月, 2010 1 次提交
  8. 16 5月, 2010 1 次提交
  9. 19 2月, 2010 1 次提交
  10. 17 2月, 2010 1 次提交
  11. 04 2月, 2010 2 次提交
    • A
      net: macvtap driver · 20d29d7a
      Arnd Bergmann 提交于
      In order to use macvlan with qemu and other tools that require
      a tap file descriptor, the macvtap driver adds a small backend
      with a character device with the same interface as the tun
      driver, with a minimum set of features.
      
      Macvtap interfaces are created in the same way as macvlan
      interfaces using ip link, but the netif is just used as a
      handle for configuration and accounting, while the data
      goes through the chardev. Each macvtap interface has its
      own character device, simplifying permission management
      significantly over the generic tun/tap driver.
      
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Stephen Hemminger <shemminger@linux-foundation.org>
      Cc: David S. Miller" <davem@davemloft.net>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: Or Gerlitz <ogerlitz@voltaire.com>
      Cc: netdev@vger.kernel.org
      Cc: bridge@lists.linux-foundation.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      20d29d7a
    • A
      macvlan: allow multiple driver backends · fc0663d6
      Arnd Bergmann 提交于
      This makes it possible to hook into the macvlan driver
      from another kernel module. In particular, the goal is
      to extend it with the macvtap backend that provides
      a tun/tap compatible interface directly on the macvlan
      device.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fc0663d6
  12. 30 4月, 2008 1 次提交
  13. 15 7月, 2007 1 次提交