1. 15 Apr, 2012 1 commit
    • John Fastabend's avatar
      macvlan: add FDB bridge ops and macvlan flags · df8ef8f3
      John Fastabend authored
      This adds FDB bridge ops to the macvlan device passthru mode.
      Additionally a flags field was added and a NOPROMISC bit to
      allow users to use passthru mode without the driver calling
      dev_set_promiscuity(). The flags field is a u16 placed in a
      4 byte hole (consuming 2 bytes) of the macvlan_dev struct.
      We want to do this so that the macvlan driver or stack
      above the macvlan driver does not have to process every
      packet. For the use case where we know all the MAC addresses
      of the endstations above us this works well.
      This patch is a result of Roopa Prabhu's work. Follow up
      patches are needed for VEPA and VEB macvlan modes.
      v2: Change from distinct nopromisc mode to a flags field to
          configure this. This avoids the tendency to add a new
          mode every time we need some slightly different behavior.
      v3: fix error in dev_set_promiscuity and add change and get
          link attributes for flags.
      CC: Roopa Prabhu <roprabhu@cisco.com>
      CC: Michael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  2. 21 Oct, 2011 1 commit
    • Eric W. Biederman's avatar
      macvtap: Fix the minor device number allocation · e09eff7f
      Eric W. Biederman authored
      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: default avatarEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  3. 16 Nov, 2010 1 commit
    • Eric Dumazet's avatar
      macvlan: lockless tx path · 8ffab51b
      Eric Dumazet authored
      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
      Note : rx_errors converted to a 32bit counter, like tx_dropped, since
      they dont need 64bit range.
      Signed-off-by: default avatarEric 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: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  4. 15 Nov, 2010 1 commit
  5. 17 Aug, 2010 1 commit
  6. 22 Jul, 2010 1 commit
    • Herbert Xu's avatar
      macvtap: Limit packet queue length · 8a35747a
      Herbert Xu authored
      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
      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: default avatarMark Wagner <mwagner@redhat.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Acked-by: default avatarChris Wright <chrisw@sous-sol.org>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  7. 29 Jun, 2010 1 commit
  8. 02 Jun, 2010 1 commit
  9. 16 May, 2010 1 commit
  10. 18 Feb, 2010 1 commit
  11. 17 Feb, 2010 1 commit
  12. 04 Feb, 2010 2 commits
    • Arnd Bergmann's avatar
      net: macvtap driver · 20d29d7a
      Arnd Bergmann authored
      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: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    • Arnd Bergmann's avatar
      macvlan: allow multiple driver backends · fc0663d6
      Arnd Bergmann authored
      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
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
  13. 30 Apr, 2008 1 commit
  14. 15 Jul, 2007 1 commit