1. 09 5月, 2016 1 次提交
  2. 09 7月, 2015 1 次提交
    • E
      ifb: add multiqueue operation · 9e29e21a
      Eric Dumazet 提交于
      Add multiqueue capabilities to ifb netdevice.
      
      This removes last bottleneck for ingress when mq qdisc can be used
      to shard load from multiple RX queues on physical device.
      
      Tested:
      
      # netem based setup, installed at receiver side
      ETH=eth0
      IFB=ifb10
      EST="est 1sec 4sec" # Optional rate estimator
      RTT_HALF=2ms
      #REORDER=20us
      #LOSS="loss 1"
      TXQ=8
      
      ip link add ifb10 numtxqueues $TXQ type ifb
      ip link set dev $IFB up
      
      tc qdisc add dev $ETH ingress 2>/dev/null
      
      tc filter add dev $ETH parent ffff: \
         protocol ip u32 match u32 0 0 flowid 1:1 \
      	action mirred egress redirect dev $IFB
      
      tc qdisc del dev $IFB root 2>/dev/null
      
      tc qdisc add dev $IFB root handle 1: mq
      for i in `seq 1 $TXQ`
      do
       slot=$( printf %x $(( i )) )
       tc qd add dev $IFB parent 1:$slot $EST netem \
      	limit 100000 delay $RTT_HALF $REORDER $LOSS
      done
      
      lpaa24:~# tc -s -d qd sh dev ifb10
      qdisc mq 1: root
       Sent 316544766 bytes 5265927 pkt (dropped 0, overlimits 0 requeues 0)
       backlog 98880b 1648p requeues 0
      qdisc netem 8002: parent 1:1 limit 100000 delay 2.0ms
       Sent 39601416 bytes 658721 pkt (dropped 0, overlimits 0 requeues 0)
       rate 38235Kbit 79657pps backlog 12240b 204p requeues 0
      qdisc netem 8003: parent 1:2 limit 100000 delay 2.0ms
       Sent 39472866 bytes 657227 pkt (dropped 0, overlimits 0 requeues 0)
       rate 38234Kbit 79655pps backlog 10620b 176p requeues 0
      qdisc netem 8004: parent 1:3 limit 100000 delay 2.0ms
       Sent 39703417 bytes 659699 pkt (dropped 0, overlimits 0 requeues 0)
       rate 38320Kbit 79831pps backlog 12780b 213p requeues 0
      qdisc netem 8005: parent 1:4 limit 100000 delay 2.0ms
       Sent 39565149 bytes 658011 pkt (dropped 0, overlimits 0 requeues 0)
       rate 38174Kbit 79530pps backlog 11880b 198p requeues 0
      qdisc netem 8006: parent 1:5 limit 100000 delay 2.0ms
       Sent 39506078 bytes 657354 pkt (dropped 0, overlimits 0 requeues 0)
       rate 38195Kbit 79571pps backlog 12480b 208p requeues 0
      qdisc netem 8007: parent 1:6 limit 100000 delay 2.0ms
       Sent 39675994 bytes 658849 pkt (dropped 0, overlimits 0 requeues 0)
       rate 38323Kbit 79838pps backlog 12600b 210p requeues 0
      qdisc netem 8008: parent 1:7 limit 100000 delay 2.0ms
       Sent 39532042 bytes 658367 pkt (dropped 0, overlimits 0 requeues 0)
       rate 38177Kbit 79536pps backlog 13140b 219p requeues 0
      qdisc netem 8009: parent 1:8 limit 100000 delay 2.0ms
       Sent 39488164 bytes 657705 pkt (dropped 0, overlimits 0 requeues 0)
       rate 38192Kbit 79568pps backlog 13Kb 222p requeues 0
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Alexei Starovoitov <ast@plumgrid.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: John Fastabend <john.fastabend@gmail.com>
      Acked-by: NAlexei Starovoitov <ast@plumgrid.com>
      Acked-by: NJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9e29e21a
  3. 18 4月, 2015 1 次提交
  4. 08 10月, 2014 1 次提交
    • E
      net: better IFF_XMIT_DST_RELEASE support · 02875878
      Eric Dumazet 提交于
      Testing xmit_more support with netperf and connected UDP sockets,
      I found strange dst refcount false sharing.
      
      Current handling of IFF_XMIT_DST_RELEASE is not optimal.
      
      Dropping dst in validate_xmit_skb() is certainly too late in case
      packet was queued by cpu X but dequeued by cpu Y
      
      The logical point to take care of drop/force is in __dev_queue_xmit()
      before even taking qdisc lock.
      
      As Julian Anastasov pointed out, need for skb_dst() might come from some
      packet schedulers or classifiers.
      
      This patch adds new helper to cleanly express needs of various drivers
      or qdiscs/classifiers.
      
      Drivers that need skb_dst() in their ndo_start_xmit() should call
      following helper in their setup instead of the prior :
      
      	dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
      ->
      	netif_keep_dst(dev);
      
      Instead of using a single bit, we use two bits, one being
      eventually rebuilt in bonding/team drivers.
      
      The other one, is permanent and blocks IFF_XMIT_DST_RELEASE being
      rebuilt in bonding/team. Eventually, we could add something
      smarter later.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Julian Anastasov <ja@ssi.bg>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      02875878
  5. 16 7月, 2014 1 次提交
    • T
      net: set name_assign_type in alloc_netdev() · c835a677
      Tom Gundersen 提交于
      Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert
      all users to pass NET_NAME_UNKNOWN.
      
      Coccinelle patch:
      
      @@
      expression sizeof_priv, name, setup, txqs, rxqs, count;
      @@
      
      (
      -alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs)
      +alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs)
      |
      -alloc_netdev_mq(sizeof_priv, name, setup, count)
      +alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count)
      |
      -alloc_netdev(sizeof_priv, name, setup)
      +alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup)
      )
      
      v9: move comments here from the wrong commit
      Signed-off-by: NTom Gundersen <teg@jklm.no>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c835a677
  6. 29 3月, 2014 1 次提交
  7. 15 3月, 2014 1 次提交
  8. 06 11月, 2013 1 次提交
    • J
      net: Explicitly initialize u64_stats_sync structures for lockdep · 827da44c
      John Stultz 提交于
      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: NJohn Stultz <john.stultz@linaro.org>
      Acked-by: NJulian Anastasov <ja@ssi.bg>
      Signed-off-by: NPeter 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.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      827da44c
  9. 12 7月, 2013 1 次提交
  10. 11 7月, 2013 1 次提交
  11. 20 4月, 2013 2 次提交
  12. 15 1月, 2013 1 次提交
  13. 16 2月, 2012 1 次提交
  14. 17 11月, 2011 1 次提交
  15. 28 7月, 2011 1 次提交
    • N
      net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared · 550fd08c
      Neil Horman 提交于
      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: NNeil 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: NDavid S. Miller <davem@davemloft.net>
      550fd08c
  16. 22 6月, 2011 1 次提交
  17. 07 6月, 2011 1 次提交
  18. 06 5月, 2011 1 次提交
  19. 04 1月, 2011 1 次提交
    • E
      ifb: add performance flags · 39980292
      Eric Dumazet 提交于
      Le lundi 03 janvier 2011 à 11:40 -0800, David Miller a écrit :
      > From: Jarek Poplawski <jarkao2@gmail.com>
      > Date: Mon, 3 Jan 2011 20:37:03 +0100
      >
      > > On Sun, Jan 02, 2011 at 09:24:36PM +0100, Eric Dumazet wrote:
      > >> Le mercredi 29 décembre 2010 ?? 00:07 +0100, Jarek Poplawski a écrit :
      > >>
      > >> > Ingress is before vlans handler so these features and the
      > >> > NETIF_F_HW_VLAN_TX flag seem useful for ifb considering
      > >> > dev_hard_start_xmit() checks.
      > >>
      > >> OK, here is v2 of the patch then, thanks everybody.
      > >>
      > >>
      > >> [PATCH v2 net-next-2.6] ifb: add performance flags
      > >>
      > >> IFB can use the full set of features flags (NETIF_F_SG |
      > >> NETIF_F_FRAGLIST | NETIF_F_TSO | NETIF_F_NO_CSUM | NETIF_F_HIGHDMA) to
      > >> avoid unnecessary split of some packets (GRO for example)
      > >>
      > >> Changli suggested to also set vlan_features,
      > >
      > > He also suggested more GSO flags of which especially NETIF_F_TSO6
      > > seems interesting (wrt GRO)?
      >
      > I think at least TSO6 would very much be appropriate here.
      
      Yes, why not, I am only wondering why loopback / dummy (and others ?)
      only set NETIF_F_TSO :)
      
      Since I want to play with ECN, I might also add NETIF_F_TSO_ECN ;)
      
      For other flags, I really doubt it can matter on ifb ?
      
      [PATCH v3 net-next-2.6] ifb: add performance flags
      
      IFB can use the full set of features flags (NETIF_F_SG |
      NETIF_F_FRAGLIST | NETIF_F_TSO | NETIF_F_NO_CSUM | NETIF_F_HIGHDMA) to
      avoid unnecessary split of some packets (GRO for example)
      
      Changli suggested to also set vlan_features, NETIF_F_TSO6,
      NETIF_F_TSO_ECN.
      
      Jarek suggested to add NETIF_F_HW_VLAN_TX as well.
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Cc: Changli Gao <xiaosuo@gmail.com>
      Cc: Jarek Poplawski <jarkao2@gmail.com>
      Cc: Pawel Staszewski <pstaszewski@itcare.pl>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      39980292
  20. 20 12月, 2010 1 次提交
  21. 17 12月, 2010 1 次提交
  22. 11 12月, 2010 3 次提交
  23. 09 12月, 2010 1 次提交
  24. 10 5月, 2010 1 次提交
  25. 21 11月, 2009 1 次提交
  26. 02 11月, 2009 1 次提交
  27. 23 10月, 2009 1 次提交
  28. 01 9月, 2009 1 次提交
  29. 06 7月, 2009 1 次提交
  30. 19 5月, 2009 1 次提交
    • E
      net: release dst entry in dev_hard_start_xmit() · 93f154b5
      Eric Dumazet 提交于
      One point of contention in high network loads is the dst_release() performed
      when a transmited skb is freed. This is because NIC tx completion calls
      dev_kree_skb() long after original call to dev_queue_xmit(skb).
      
      CPU cache is cold and the atomic op in dst_release() stalls. On SMP, this is
      quite visible if one CPU is 100% handling softirqs for a network device,
      since dst_clone() is done by other cpus, involving cache line ping pongs.
      
      It seems right place to release dst is in dev_hard_start_xmit(), for most
      devices but ones that are virtual, and some exceptions.
      
      David Miller suggested to define a new device flag, set in alloc_netdev_mq()
      (so that most devices set it at init time), and carefuly unset in devices
      which dont want a NULL skb->dst in their ndo_start_xmit().
      
      List of devices that must clear this flag is :
      
      - loopback device, because it calls netif_rx() and quoting Patrick :
          "ip_route_input() doesn't accept loopback addresses, so loopback packets
           already need to have a dst_entry attached."
      - appletalk/ipddp.c : needs skb->dst in its xmit function
      
      - And all devices that call again dev_queue_xmit() from their xmit function
      (as some classifiers need skb->dst) : bonding, vlan, macvlan, eql, ifb, hdlc_fr
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      93f154b5
  31. 21 11月, 2008 1 次提交
  32. 20 11月, 2008 1 次提交
  33. 01 8月, 2008 1 次提交
  34. 18 7月, 2008 2 次提交
    • D
      pkt_sched: Kill netdev_queue lock. · 83874000
      David S. Miller 提交于
      We can simply use the qdisc->q.lock for all of the
      qdisc tree synchronization.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      83874000
    • D
      netdev: Allocate multiple queues for TX. · e8a0464c
      David S. Miller 提交于
      alloc_netdev_mq() now allocates an array of netdev_queue
      structures for TX, based upon the queue_count argument.
      
      Furthermore, all accesses to the TX queues are now vectored
      through the netdev_get_tx_queue() and netdev_for_each_tx_queue()
      interfaces.  This makes it easy to grep the tree for all
      things that want to get to a TX queue of a net device.
      
      Problem spots which are not really multiqueue aware yet, and
      only work with one queue, can easily be spotted by grepping
      for all netdev_get_tx_queue() calls that pass in a zero index.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e8a0464c
  35. 09 7月, 2008 2 次提交