Skip to content
Snippets Groups Projects
  1. Mar 28, 2014
  2. Feb 20, 2014
  3. Nov 06, 2013
    • John Stultz's avatar
      net: Explicitly initialize u64_stats_sync structures for lockdep · 827da44c
      John Stultz authored
      
      In order to enable lockdep on seqcount/seqlock structures, we
      must explicitly initialize any locks.
      
      The u64_stats_sync structure, uses a seqcount, and thus we need
      to introduce a u64_stats_init() function and use it to initialize
      the structure.
      
      This unfortunately adds a lot of fairly trivial initialization code
      to a number of drivers. But the benefit of ensuring correctness makes
      this worth while.
      
      Because these changes are required for lockdep to be enabled, and the
      changes are quite trivial, I've not yet split this patch out into 30-some
      separate patches, as I figured it would be better to get the various
      maintainers thoughts on how to best merge this change along with
      the seqcount lockdep enablement.
      
      Feedback would be appreciated!
      
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Acked-by: default avatarJulian Anastasov <ja@ssi.bg>
      Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Cc: James Morris <jmorris@namei.org>
      Cc: Jesse Gross <jesse@nicira.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Mirko Lindner <mlindner@marvell.com>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Roger Luethi <rl@hellgate.ch>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Simon Horman <horms@verge.net.au>
      Cc: Stephen Hemminger <stephen@networkplumber.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: Wensong Zhang <wensong@linux-vs.org>
      Cc: netdev@vger.kernel.org
      Link: http://lkml.kernel.org/r/1381186321-4906-2-git-send-email-john.stultz@linaro.org
      
      
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      827da44c
  4. Oct 28, 2013
  5. Oct 10, 2013
  6. Oct 09, 2013
  7. Oct 08, 2013
  8. Jul 20, 2013
    • Flavio Leitner's avatar
      veth: add vlan features · b69bbddf
      Flavio Leitner authored
      
      The veth device doesn't provide the vlan features,
      so TSO for example is disabled and that causes
      performance issues when using tagged traffic.
      
      The test topology looks like this:
      
          br0                     br1
        /   \                  /     \
      vnet  veth0.10 ----- veth1.10   vnet
      VM                               VM
      
      The netperf results with current veth driver:
      MIGRATED TCP STREAM TEST from 192.168.1.1 ()
      port 0 AF_INET to 192.168.1.2 () port 0 AF_INET
      Recv   Send    Send
      Socket Socket  Message  Elapsed
      Size   Size    Size     Time     Throughput
      bytes  bytes   bytes    secs.    10^6bits/sec
      
       87380  16384  16384    10.01    2210.22
      
      Now after applying the proposed patch:
      MIGRATED TCP STREAM TEST from 192.168.1.1 ()
      port 0 AF_INET to 192.168.1.2 () port 0 AF_INET
      Recv   Send    Send
      Socket Socket  Message  Elapsed
      Size   Size    Size     Time     Throughput
      bytes  bytes   bytes    secs.    10^6bits/sec
      
       87380  16384  16384    10.00    13067.47
      
      Signed-off-by: default avatarFlavio Leitner <fbl@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b69bbddf
  9. Jun 12, 2013
  10. Apr 19, 2013
  11. Feb 11, 2013
  12. Jan 10, 2013
  13. Jan 08, 2013
    • Eric Dumazet's avatar
      veth: avoid a NULL deref in veth_stats_one · d0e2c55e
      Eric Dumazet authored
      
      commit 2681128f (veth: extend device features) added a NULL deref
      in veth_stats_one(), as veth_get_stats64() was not testing if the peer
      device was setup or not.
      
      At init time, we call dev_get_stats() before veth pair is fully setup.
      
      [  178.854758]  [<ffffffffa00f5677>] veth_get_stats64+0x47/0x70 [veth]
      [  178.861013]  [<ffffffff814f0a2d>] dev_get_stats+0x6d/0x130
      [  178.866486]  [<ffffffff81504efc>] rtnl_fill_ifinfo+0x47c/0x930
      [  178.872299]  [<ffffffff81505b93>] rtmsg_ifinfo+0x83/0x100
      [  178.877678]  [<ffffffff81505cc6>] rtnl_configure_link+0x76/0xa0
      [  178.883580]  [<ffffffffa00f52fa>] veth_newlink+0x16a/0x350 [veth]
      [  178.889654]  [<ffffffff815061cc>] rtnl_newlink+0x4dc/0x5e0
      [  178.895128]  [<ffffffff81505e1e>] ? rtnl_newlink+0x12e/0x5e0
      [  178.900769]  [<ffffffff8150587d>] rtnetlink_rcv_msg+0x11d/0x310
      [  178.906669]  [<ffffffff81505760>] ? __rtnl_unlock+0x20/0x20
      [  178.912225]  [<ffffffff81521f89>] netlink_rcv_skb+0xa9/0xd0
      [  178.917779]  [<ffffffff81502d55>] rtnetlink_rcv+0x25/0x40
      [  178.923159]  [<ffffffff815218d1>] netlink_unicast+0x1b1/0x230
      [  178.928887]  [<ffffffff81521c4e>] netlink_sendmsg+0x2fe/0x3b0
      [  178.934615]  [<ffffffff814dbe22>] sock_sendmsg+0xd2/0xf0
      
      So we must check if peer was setup in veth_get_stats64()
      
      As pointed out by Ben Hutchings, priv->peer is missing proper
      synchronization. Adding RCU protection is a safe and well documented
      way to make sure we don't access about to be freed or already
      freed data.
      
      Reported-by: default avatarTom Parkin <tparkin@katalix.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      CC: Ben Hutchings <bhutchings@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d0e2c55e
  14. Dec 30, 2012
  15. Nov 30, 2012
    • Rami Rosen's avatar
      rtnelink: remove unused parameter from rtnl_create_link(). · c0713563
      Rami Rosen authored
      
      This patch removes an unused parameter (src_net) from rtnl_create_link()
      method and from the method single invocation, in veth.
      This parameter was used in the past when calling
      ops->get_tx_queues(src_net, tb) in rtnl_create_link().
      The get_tx_queues() member of rtnl_link_ops was replaced by two methods,
      get_num_tx_queues() and get_num_rx_queues(), which do not get any
      parameter. This was done in commit d40156aa by
      Jiri Pirko ("rtnl: allow to specify different num for rx and tx queue count").
      
      Signed-off-by: default avatarRami Rosen <ramirose@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c0713563
  16. Nov 01, 2012
  17. Aug 09, 2012
    • Pavel Emelyanov's avatar
      veth: Allow to create peer link with given ifindex · e6f8f1a7
      Pavel Emelyanov authored
      
      The ifinfomsg is in there (thanks kaber@ for foreseeing this long time ago),
      so take the given ifidex and register netdev with it.
      
      Ben noticed, that this code path previously ignored ifmp->ifi_index and
      userland could be passing in garbage. Thus it may now fail occasionally
      because the value clashes with an existing interface.
      
      To address this it's assumed that if the caller specifies the ifindex for
      the veth master device, then it's aware of this possibility and should
      explicitly specify (or set to 0 for auto-assignment) the peer's ifindex as
      well. With this the compatibility with old tools not setting ifindex is
      preserved.
      
      Signed-off-by: default avatarPavel Emelyanov <xemul@parallels.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e6f8f1a7
  18. Feb 15, 2012
  19. Nov 22, 2011
  20. Nov 16, 2011
  21. Nov 08, 2011
  22. Oct 31, 2011
  23. Jul 28, 2011
    • Neil Horman's avatar
      net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared · 550fd08c
      Neil Horman authored
      
      After the last patch, We are left in a state in which only drivers calling
      ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
      hardware call ether_setup for their net_devices and don't hold any state in
      their skbs.  There are a handful of drivers that violate this assumption of
      course, and need to be fixed up.  This patch identifies those drivers, and marks
      them as not being able to support the safe transmission of skbs by clearning the
      IFF_TX_SKB_SHARING flag in priv_flags
      
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      CC: Karsten Keil <isdn@linux-pingi.de>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Jay Vosburgh <fubar@us.ibm.com>
      CC: Andy Gospodarek <andy@greyhouse.net>
      CC: Patrick McHardy <kaber@trash.net>
      CC: Krzysztof Halasa <khc@pm.waw.pl>
      CC: "John W. Linville" <linville@tuxdriver.com>
      CC: Greg Kroah-Hartman <gregkh@suse.de>
      CC: Marcel Holtmann <marcel@holtmann.org>
      CC: Johannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      550fd08c
  24. Jul 06, 2011
  25. Jul 01, 2011
  26. Jun 20, 2011
  27. Jun 09, 2011
  28. May 15, 2011
  29. May 02, 2011
  30. Apr 29, 2011
    • David Decotigny's avatar
      ethtool: cosmetic: Use ethtool ethtool_cmd_speed API · 70739497
      David Decotigny authored
      
      This updates the network drivers so that they don't access the
      ethtool_cmd::speed field directly, but use ethtool_cmd_speed()
      instead.
      
      For most of the drivers, these changes are purely cosmetic and don't
      fix any problem, such as for those 1GbE/10GbE drivers that indirectly
      call their own ethtool get_settings()/mii_ethtool_gset(). The changes
      are meant to enforce code consistency and provide robustness with
      future larger throughputs, at the expense of a few CPU cycles for each
      ethtool operation.
      
      All drivers compiled with make allyesconfig ion x86_64 have been
      updated.
      
      Tested: make allyesconfig on x86_64 + e1000e/bnx2x work
      Signed-off-by: default avatarDavid Decotigny <decot@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      70739497
  31. Apr 02, 2011
  32. Mar 22, 2011
    • Eric W. Biederman's avatar
      veth: Fix the byte counters · 675071a2
      Eric W. Biederman authored
      
      Commit 44540960 "veth: move loopback logic to common location" introduced
      a bug in the packet counters.  I don't understand why that happened as it
      is not explained in the comments and the mut check in dev_forward_skb
      retains the assumption that skb->len is the total length of the packet.
      
      I just measured this emperically by setting up a veth pair between two
      noop network namespaces setting and attempting a telnet connection between
      the two.  I saw three packets in each direction and the byte counters were
      exactly 14*3 = 42 bytes high in each direction.  I got the actual
      packet lengths with tcpdump.
      
      So remove the extra ETH_HLEN from the veth byte count totals.
      
      Signed-off-by: default avatarEric W. Biederman <ebiederm@aristanetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      675071a2
  33. Jan 25, 2011
  34. Dec 16, 2010
  35. Sep 27, 2010
Loading