1. 31 8月, 2013 30 次提交
  2. 30 8月, 2013 10 次提交
    • J
      drivers:net: Convert dma_alloc_coherent(...__GFP_ZERO) to dma_zalloc_coherent · ede23fa8
      Joe Perches 提交于
      __GFP_ZERO is an uncommon flag and perhaps is better
      not used.  static inline dma_zalloc_coherent exists
      so convert the uses of dma_alloc_coherent with __GFP_ZERO
      to the more common kernel style with zalloc.
      
      Remove memset from the static inline dma_zalloc_coherent
      and add just one use of __GFP_ZERO instead.
      
      Trivially reduces the size of the existing uses of
      dma_zalloc_coherent.
      
      Realign arguments as appropriate.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      Acked-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Acked-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ede23fa8
    • E
      pkt_sched: fq: Fair Queue packet scheduler · afe4fd06
      Eric Dumazet 提交于
      - Uses perfect flow match (not stochastic hash like SFQ/FQ_codel)
      - Uses the new_flow/old_flow separation from FQ_codel
      - New flows get an initial credit allowing IW10 without added delay.
      - Special FIFO queue for high prio packets (no need for PRIO + FQ)
      - Uses a hash table of RB trees to locate the flows at enqueue() time
      - Smart on demand gc (at enqueue() time, RB tree lookup evicts old
        unused flows)
      - Dynamic memory allocations.
      - Designed to allow millions of concurrent flows per Qdisc.
      - Small memory footprint : ~8K per Qdisc, and 104 bytes per flow.
      - Single high resolution timer for throttled flows (if any).
      - One RB tree to link throttled flows.
      - Ability to have a max rate per flow. We might add a socket option
        to add per socket limitation.
      
      Attempts have been made to add TCP pacing in TCP stack, but this
      seems to add complex code to an already complex stack.
      
      TCP pacing is welcomed for flows having idle times, as the cwnd
      permits TCP stack to queue a possibly large number of packets.
      
      This removes the 'slow start after idle' choice, hitting badly
      large BDP flows, and applications delivering chunks of data
      as video streams.
      
      Nicely spaced packets :
      Here interface is 10Gbit, but flow bottleneck is ~20Mbit
      
      cwin is big, yet FQ avoids the typical bursts generated by TCP
      (as in netperf TCP_RR -- -r 100000,100000)
      
      15:01:23.545279 IP A > B: . 78193:81089(2896) ack 65248 win 3125 <nop,nop,timestamp 1115 11597805>
      15:01:23.545394 IP B > A: . ack 81089 win 3668 <nop,nop,timestamp 11597985 1115>
      15:01:23.546488 IP A > B: . 81089:83985(2896) ack 65248 win 3125 <nop,nop,timestamp 1115 11597805>
      15:01:23.546565 IP B > A: . ack 83985 win 3668 <nop,nop,timestamp 11597986 1115>
      15:01:23.547713 IP A > B: . 83985:86881(2896) ack 65248 win 3125 <nop,nop,timestamp 1115 11597805>
      15:01:23.547778 IP B > A: . ack 86881 win 3668 <nop,nop,timestamp 11597987 1115>
      15:01:23.548911 IP A > B: . 86881:89777(2896) ack 65248 win 3125 <nop,nop,timestamp 1115 11597805>
      15:01:23.548949 IP B > A: . ack 89777 win 3668 <nop,nop,timestamp 11597988 1115>
      15:01:23.550116 IP A > B: . 89777:92673(2896) ack 65248 win 3125 <nop,nop,timestamp 1115 11597805>
      15:01:23.550182 IP B > A: . ack 92673 win 3668 <nop,nop,timestamp 11597989 1115>
      15:01:23.551333 IP A > B: . 92673:95569(2896) ack 65248 win 3125 <nop,nop,timestamp 1115 11597805>
      15:01:23.551406 IP B > A: . ack 95569 win 3668 <nop,nop,timestamp 11597991 1115>
      15:01:23.552539 IP A > B: . 95569:98465(2896) ack 65248 win 3125 <nop,nop,timestamp 1115 11597805>
      15:01:23.552576 IP B > A: . ack 98465 win 3668 <nop,nop,timestamp 11597992 1115>
      15:01:23.553756 IP A > B: . 98465:99913(1448) ack 65248 win 3125 <nop,nop,timestamp 1115 11597805>
      15:01:23.554138 IP A > B: P 99913:100001(88) ack 65248 win 3125 <nop,nop,timestamp 1115 11597805>
      15:01:23.554204 IP B > A: . ack 100001 win 3668 <nop,nop,timestamp 11597993 1115>
      15:01:23.554234 IP B > A: . 65248:68144(2896) ack 100001 win 3668 <nop,nop,timestamp 11597993 1115>
      15:01:23.555620 IP B > A: . 68144:71040(2896) ack 100001 win 3668 <nop,nop,timestamp 11597993 1115>
      15:01:23.557005 IP B > A: . 71040:73936(2896) ack 100001 win 3668 <nop,nop,timestamp 11597993 1115>
      15:01:23.558390 IP B > A: . 73936:76832(2896) ack 100001 win 3668 <nop,nop,timestamp 11597993 1115>
      15:01:23.559773 IP B > A: . 76832:79728(2896) ack 100001 win 3668 <nop,nop,timestamp 11597993 1115>
      15:01:23.561158 IP B > A: . 79728:82624(2896) ack 100001 win 3668 <nop,nop,timestamp 11597994 1115>
      15:01:23.562543 IP B > A: . 82624:85520(2896) ack 100001 win 3668 <nop,nop,timestamp 11597994 1115>
      15:01:23.563928 IP B > A: . 85520:88416(2896) ack 100001 win 3668 <nop,nop,timestamp 11597994 1115>
      15:01:23.565313 IP B > A: . 88416:91312(2896) ack 100001 win 3668 <nop,nop,timestamp 11597994 1115>
      15:01:23.566698 IP B > A: . 91312:94208(2896) ack 100001 win 3668 <nop,nop,timestamp 11597994 1115>
      15:01:23.568083 IP B > A: . 94208:97104(2896) ack 100001 win 3668 <nop,nop,timestamp 11597994 1115>
      15:01:23.569467 IP B > A: . 97104:100000(2896) ack 100001 win 3668 <nop,nop,timestamp 11597994 1115>
      15:01:23.570852 IP B > A: . 100000:102896(2896) ack 100001 win 3668 <nop,nop,timestamp 11597994 1115>
      15:01:23.572237 IP B > A: . 102896:105792(2896) ack 100001 win 3668 <nop,nop,timestamp 11597994 1115>
      15:01:23.573639 IP B > A: . 105792:108688(2896) ack 100001 win 3668 <nop,nop,timestamp 11597994 1115>
      15:01:23.575024 IP B > A: . 108688:111584(2896) ack 100001 win 3668 <nop,nop,timestamp 11597994 1115>
      15:01:23.576408 IP B > A: . 111584:114480(2896) ack 100001 win 3668 <nop,nop,timestamp 11597994 1115>
      15:01:23.577793 IP B > A: . 114480:117376(2896) ack 100001 win 3668 <nop,nop,timestamp 11597994 1115>
      
      TCP timestamps show that most packets from B were queued in the same ms
      timeframe (TSval 1159799{3,4}), but FQ managed to send them right
      in time to avoid a big burst.
      
      In slow start or steady state, very few packets are throttled [1]
      
      FQ gets a bunch of tunables as :
      
        limit : max number of packets on whole Qdisc (default 10000)
      
        flow_limit : max number of packets per flow (default 100)
      
        quantum : the credit per RR round (default is 2 MTU)
      
        initial_quantum : initial credit for new flows (default is 10 MTU)
      
        maxrate : max per flow rate (default : unlimited)
      
        buckets : number of RB trees (default : 1024) in hash table.
                     (consumes 8 bytes per bucket)
      
        [no]pacing : disable/enable pacing (default is enable)
      
      All of them can be changed on a live qdisc.
      
      $ tc qd add dev eth0 root fq help
      Usage: ... fq [ limit PACKETS ] [ flow_limit PACKETS ]
                    [ quantum BYTES ] [ initial_quantum BYTES ]
                    [ maxrate RATE  ] [ buckets NUMBER ]
                    [ [no]pacing ]
      
      $ tc -s -d qd
      qdisc fq 8002: dev eth0 root refcnt 32 limit 10000p flow_limit 100p buckets 256 quantum 3028 initial_quantum 15140
       Sent 216532416 bytes 148395 pkt (dropped 0, overlimits 0 requeues 14)
       backlog 0b 0p requeues 14
        511 flows, 511 inactive, 0 throttled
        110 gc, 0 highprio, 0 retrans, 1143 throttled, 0 flows_plimit
      
      [1] Except if initial srtt is overestimated, as if using
      cached srtt in tcp metrics. We'll provide a fix for this issue.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Cc: Neal Cardwell <ncardwell@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      afe4fd06
    • D
      net: packet: document available fanout policies · 7ec06da8
      Daniel Borkmann 提交于
      Update documentation to add fanout policies that are available.
      Signed-off-by: NDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7ec06da8
    • D
      net: packet: use reciprocal_divide in fanout_demux_hash · f55d112e
      Daniel Borkmann 提交于
      Instead of hard-coding reciprocal_divide function, use the inline
      function from reciprocal_div.h.
      Signed-off-by: NDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f55d112e
    • D
      net: packet: add randomized fanout scheduler · 5df0ddfb
      Daniel Borkmann 提交于
      We currently allow for different fanout scheduling policies in pf_packet
      such as scheduling by skb's rxhash, round-robin, by cpu, and rollover.
      Also allow for a random, equidistributed selection of the socket from the
      fanout process group.
      Signed-off-by: NDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5df0ddfb
    • S
      sh_eth: no need to call ether_setup() · 48859488
      Sergei Shtylyov 提交于
      There's no need to call ether_setup() in the driver since prior alloc_etherdev()
      call already arranges for it.
      Suggested-by: NDenis Kirjanov <kda@linux-powerpc.org>
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      48859488
    • D
      Merge branch 'bond_vlan' · d7ef9b04
      David S. Miller 提交于
      Veaceslav Falico says:
      
      ====================
      bonding: remove vlan special handling
      
      v1: Per Jiri's advice, remove the exported netdev_upper struct to keep it
          inside dev.c only, and instead implement a macro to iterate over the
          list and return only net_device *.
      v2: Jiri noted that we need to see every upper device, but not only the
          first level. Modify the netdev_upper logic to include a list of lower
          devices and for both upper/lower lists every device would see both its
          first-level devices and every other devices that is lower/upper of it.
          Also, convert some annoying spamming warnings to pr_debug in
          bond_arp_send_all.
      v3: move renaming part completely to patch 1 (did I forget to git add
          before commiting?) and address Jiri's input about comments/style of
          patch 2.
      v4: as Vlad found spotted, bond_arp_send_all() won't work in a config where
          we have a device with ip on top of our upper vlan. It fails to send
          packets because we don't tag the packet, while the device on top of
          vlan will emit tagged packets through this vlan. Fix this by first
          searching for all upper vlans, and for each vlan - for the devs on top
          of it. If we find the dev - then tag the packet with the underling's
          vlan_id, otherwise just search the old way - for all devices on top of
          bonding. Also, move the version changes under "---" so they won't get
          into the commit message, if/when applied.
      
      The aim of this patchset is to remove bondings' own vlan handling as much
      as possible and replace it with the netdev upper device functionality.
      
      The upper device functionality is extended to include also lower devices
      and to have, for each device, a full view of every lower and upper device,
      but not only the first-level ones. This might permit in the future to
      avoid, for any grouping/teaming/upper/lower devices, to maintain its own
      lists of slaves/vlans/etc.
      
      This is achieved by adding a helper function to upper dev list handling -
      netdev_upper_get_next_dev(dev, iter), which returns the next device after
      the list_head **iter, and sets *iter to the next list_head *. This patchset
      also adds netdev_for_each_upper_dev(dev, upper, iter), which iterates
      through the whole dev->upper_dev_list, setting upper to the net_device.
      The only special treatment of vlans remains in rlb code.
      
      This patchset solves several issues with bonding, simplifies it overall,
      RCUify further and exports upper list functions for any other users which
      might also want to get rid of its own vlan_lists or slaves.
      
      I'm testing it continuously currently, no issues found, will update on
      anything.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d7ef9b04
    • V
      bonding: pr_debug instead of pr_warn in bond_arp_send_all · 3e32582f
      Veaceslav Falico 提交于
      They're simply annoying and will spam dmesg constantly if we hit them, so
      convert to pr_debug so that we still can access them in case of debugging.
      
      CC: Jay Vosburgh <fubar@us.ibm.com>
      CC: Andy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3e32582f
    • V
      bonding: remove vlan_list/current_alb_vlan · e868b0c9
      Veaceslav Falico 提交于
      Currently there are no real users of vlan_list/current_alb_vlan, only the
      helpers which maintain them, so remove them.
      
      CC: Jay Vosburgh <fubar@us.ibm.com>
      CC: Andy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e868b0c9
    • V
      bonding: make alb_send_learning_packets() use upper dev list · 5bf94b83
      Veaceslav Falico 提交于
      Currently, if there are vlans on top of bond, alb_send_learning_packets()
      will never send LPs from the bond itself (i.e. untagged), which might leave
      untagged clients unupdated.
      
      Also, the 'circular vlan' logic (i.e. update only MAX_LP_BURST vlans at a
      time, and save the last vlan for the next update) is really suboptimal - in
      case of lots of vlans it will take a lot of time to update every vlan. It
      is also never called in any hot path and sends only a few small packets -
      thus the optimization by itself is useless.
      
      So remove the whole current_alb_vlan/MAX_LP_BURST logic from
      alb_send_learning_packets(). Instead, we'll first send a packet untagged
      and then traverse the upper dev list, sending a tagged packet for each vlan
      found. Also, remove the MAX_LP_BURST define - we already don't need it.
      
      CC: Jay Vosburgh <fubar@us.ibm.com>
      CC: Andy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5bf94b83