1. 16 2月, 2011 1 次提交
  2. 14 2月, 2011 2 次提交
  3. 09 2月, 2011 1 次提交
    • D
      net: Fix lockdep regression caused by initializing netdev queues too early. · 8d3bdbd5
      David S. Miller 提交于
      In commit aa942104 ("net: init ingress
      queue") we moved the allocation and lock initialization of the queues
      into alloc_netdev_mq() since register_netdevice() is way too late.
      
      The problem is that dev->type is not setup until the setup()
      callback is invoked by alloc_netdev_mq(), and the dev->type is
      what determines the lockdep class to use for the locks in the
      queues.
      
      Fix this by doing the queue allocation after the setup() callback
      runs.
      
      This is safe because the setup() callback is not allowed to make any
      state changes that need to be undone on error (memory allocations,
      etc.).  It may, however, make state changes that are undone by
      free_netdev() (such as netif_napi_add(), which is done by the
      ipoib driver's setup routine).
      
      The previous code also leaked a reference to the &init_net namespace
      object on RX/TX queue allocation failures.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8d3bdbd5
  4. 03 2月, 2011 1 次提交
  5. 01 2月, 2011 1 次提交
  6. 30 1月, 2011 1 次提交
    • H
      gro: Reset dev pointer on reuse · 66c46d74
      Herbert Xu 提交于
      On older kernels the VLAN code may zero skb->dev before dropping
      it and causing it to be reused by GRO.
      
      Unfortunately we didn't reset skb->dev in that case which causes
      the next GRO user to get a bogus skb->dev pointer.
      
      This particular problem no longer happens with the current upstream
      kernel due to changes in VLAN processing.
      
      However, for correctness we should still reset the skb->dev pointer
      in the GRO reuse function in case a future user does the same thing.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      66c46d74
  7. 28 1月, 2011 1 次提交
    • E
      net: fix dev_seq_next() · ccf43438
      Eric Dumazet 提交于
      Commit c6d14c84 (net: Introduce for_each_netdev_rcu() iterator)
      added a race in dev_seq_next().
      
      The rcu_dereference() call should be done _before_ testing the end of
      list, or we might return a wrong net_device if a concurrent thread
      changes net_device list under us.
      
      Note : discovered thanks to a sparse warning :
      
      net/core/dev.c:3919:9: error: incompatible types in comparison expression
      (different address spaces)
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ccf43438
  8. 25 1月, 2011 5 次提交
  9. 22 1月, 2011 1 次提交
  10. 21 1月, 2011 2 次提交
  11. 20 1月, 2011 3 次提交
    • J
      net: implement mechanism for HW based QOS · 4f57c087
      John Fastabend 提交于
      This patch provides a mechanism for lower layer devices to
      steer traffic using skb->priority to tx queues. This allows
      for hardware based QOS schemes to use the default qdisc without
      incurring the penalties related to global state and the qdisc
      lock. While reliably receiving skbs on the correct tx ring
      to avoid head of line blocking resulting from shuffling in
      the LLD. Finally, all the goodness from txq caching and xps/rps
      can still be leveraged.
      
      Many drivers and hardware exist with the ability to implement
      QOS schemes in the hardware but currently these drivers tend
      to rely on firmware to reroute specific traffic, a driver
      specific select_queue or the queue_mapping action in the
      qdisc.
      
      By using select_queue for this drivers need to be updated for
      each and every traffic type and we lose the goodness of much
      of the upstream work. Firmware solutions are inherently
      inflexible. And finally if admins are expected to build a
      qdisc and filter rules to steer traffic this requires knowledge
      of how the hardware is currently configured. The number of tx
      queues and the queue offsets may change depending on resources.
      Also this approach incurs all the overhead of a qdisc with filters.
      
      With the mechanism in this patch users can set skb priority using
      expected methods ie setsockopt() or the stack can set the priority
      directly. Then the skb will be steered to the correct tx queues
      aligned with hardware QOS traffic classes. In the normal case with
      single traffic class and all queues in this class everything
      works as is until the LLD enables multiple tcs.
      
      To steer the skb we mask out the lower 4 bits of the priority
      and allow the hardware to configure upto 15 distinct classes
      of traffic. This is expected to be sufficient for most applications
      at any rate it is more then the 8021Q spec designates and is
      equal to the number of prio bands currently implemented in
      the default qdisc.
      
      This in conjunction with a userspace application such as
      lldpad can be used to implement 8021Q transmission selection
      algorithms one of these algorithms being the extended transmission
      selection algorithm currently being used for DCB.
      Signed-off-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4f57c087
    • V
      net_device: add support for network device groups · cbda10fa
      Vlad Dogaru 提交于
      Net devices can now be grouped, enabling simpler manipulation from
      userspace. This patch adds a group field to the net_device structure, as
      well as rtnetlink support to query and modify it.
      Signed-off-by: NVlad Dogaru <ddvlad@rosedu.org>
      Acked-by: NJamal Hadi Salim <hadi@cyberus.ca>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cbda10fa
    • E
      net: fix can_checksum_protocol() arguments swap · d402786e
      Eric Dumazet 提交于
      commit 03634668 (net offloading: Convert checksums to use
      centrally computed features.) mistakenly swapped can_checksum_protocol()
      arguments.
      
      This broke IPv6 on bnx2 for instance, on NIC without TCPv6 checksum
      offloads.
      Reported-by: NHans de Bruin <jmdebruin@xmsnet.nl>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Acked-by: NJesse Gross <jesse@nicira.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d402786e
  12. 19 1月, 2011 1 次提交
  13. 14 1月, 2011 1 次提交
    • E
      net: remove dev_txq_stats_fold() · 1ac9ad13
      Eric Dumazet 提交于
      After recent changes, (percpu stats on vlan/tunnels...), we dont need
      anymore per struct netdev_queue tx_bytes/tx_packets/tx_dropped counters.
      
      Only remaining users are ixgbe, sch_teql, gianfar & macvlan :
      
      1) ixgbe can be converted to use existing tx_ring counters.
      
      2) macvlan incremented txq->tx_dropped, it can use the
      dev->stats.tx_dropped counter.
      
      3) sch_teql : almost revert ab35cd4b (Use net_device internal stats)
          Now we have ndo_get_stats64(), use it, even for "unsigned long"
      fields (No need to bring back a struct net_device_stats)
      
      4) gianfar adds a stats structure per tx queue to hold
      tx_bytes/tx_packets
      
      This removes a lockdep warning (and possible lockup) in rndis gadget,
      calling dev_get_stats() from hard IRQ context.
      
      Ref: http://www.spinics.net/lists/netdev/msg149202.htmlReported-by: NNeil Jones <neiljay@gmail.com>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      CC: Jarek Poplawski <jarkao2@gmail.com>
      CC: Alexander Duyck <alexander.h.duyck@intel.com>
      CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      CC: Sandeep Gopalpet <sandeep.kumar@freescale.com>
      CC: Michal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1ac9ad13
  14. 11 1月, 2011 2 次提交
  15. 10 1月, 2011 6 次提交
  16. 22 12月, 2010 1 次提交
    • E
      net: timestamp cloned packet in dev_queue_xmit_nit · 70978182
      Eric Dumazet 提交于
      Le vendredi 17 décembre 2010 à 10:26 +0100, Eric Dumazet a écrit :
      
      >
      > I think we can add this after latest Changli patch :
      >
      > He does one skb_clone() before calling the sniffers.
      > We could set timestamp on this clone, instead of original skb.
      >
      > Problem solved.
      >
      
      [PATCH net-next-2.6] net: timestamp cloned packet in dev_queue_xmit_nit
      
      Now we do one clone of skb if at least one sniffer might take packet,
      we also can do the skb timestamping on the clone and let original packet
      unchanged.
      
      This is a generalization of commit 8caf1539 (net: sch_netem: Fix an
      inconsistency in ingress netem timestamps.)
      
      This way, we can have a good idea when packets are delivered to our
      stack (tcpdump -i ifb0), while a tcpdump on original device gives
      timestamps right before ingressing.
      
      This also speedup our stack, avoiding taking timestamps if not needed.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Cc: Changli Gao <xiaosuo@gmail.com>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Jarek Poplawski <jarkao2@gmail.com>
      Acked-by: NChangli Gao <xiaosuo@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      70978182
  17. 20 12月, 2010 1 次提交
  18. 17 12月, 2010 4 次提交
  19. 09 12月, 2010 3 次提交
  20. 07 12月, 2010 1 次提交
  21. 02 12月, 2010 1 次提交