21 Oct, 2011

1 commit

  • 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: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     

17 Nov, 2010

1 commit

  • 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 2c11455321f37 (macvlan: add multiqueue
    capability)

    Note : rx_errors converted to a 32bit counter, like tx_dropped, since
    they dont need 64bit range.

    Signed-off-by: Eric Dumazet
    Cc: Patrick McHardy
    Cc: Ben Greear
    Cc: Ben Hutchings
    Acked-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Eric Dumazet
     

16 Nov, 2010

1 commit


17 Aug, 2010

1 commit


28 Jul, 2010

1 commit


23 Jul, 2010

1 commit

  • 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: Mark Wagner
    Signed-off-by: Herbert Xu
    Acked-by: Chris Wright
    Acked-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Herbert Xu
     

29 Jun, 2010

1 commit


02 Jun, 2010

1 commit

  • What this patch does is it removes two receive frame hooks (for bridge and for
    macvlan) from __netif_receive_skb. These are replaced them with a single
    hook for both. It only supports one hook per device because it makes no
    sense to do bridging and macvlan on the same device.

    Then a network driver (of virtual netdev like macvlan or bridge) can register
    an rx_handler for needed net device.

    Signed-off-by: Jiri Pirko
    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Jiri Pirko
     

16 May, 2010

1 commit


19 Feb, 2010

1 commit

  • This adds support for passing a macvtap file descriptor into
    vhost-net, much like we already do for tun/tap.

    Most of the new code is taken from the respective patch
    in the tun driver and may get consolidated in the future.

    Signed-off-by: Arnd Bergmann
    Acked-by: Sridhar Samudrala
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

17 Feb, 2010

1 commit

  • Add __percpu sparse annotations to net drivers.

    These annotations are to make sparse consider percpu variables to be
    in a different address space and warn if accessed without going
    through percpu accessors. This patch doesn't affect normal builds.

    Signed-off-by: Tejun Heo
    Acked-by: David S. Miller
    Cc: Eric Dumazet
    Cc: Arnd Bergmann
    Signed-off-by: David S. Miller

    Tejun Heo
     

04 Feb, 2010

2 commits

  • 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
    Cc: Stephen Hemminger
    Cc: David S. Miller"
    Cc: "Michael S. Tsirkin"
    Cc: Herbert Xu
    Cc: Or Gerlitz
    Cc: netdev@vger.kernel.org
    Cc: bridge@lists.linux-foundation.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    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: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

30 Apr, 2008

1 commit


15 Jul, 2007

1 commit