1. 22 May, 2014 1 commit
    • Neal Cardwell's avatar
      tcp: make cwnd-limited checks measurement-based, and gentler · ca8a2263
      Neal Cardwell authored
      Experience with the recent e114a710 ("tcp: fix cwnd limited
      checking to improve congestion control") has shown that there are
      common cases where that commit can cause cwnd to be much larger than
      necessary. This leads to TSO autosizing cooking skbs that are too
      large, among other things.
      
      The main problems seemed to be:
      
      (1) That commit attempted to predict the future behavior of the
      connection by looking at the write queue (if TSO or TSQ limit
      sending). That prediction sometimes overestimated future outstanding
      packets.
      
      (2) That commit always allowed cwnd to grow to twice the number of
      outstanding packets (even in congestion avoidance, where this is not
      needed).
      
      This commit improves both of these, by:
      
      (1) Switching to a measurement-based approach where we explicitly
      track the largest number of packets in flight during the past window
      ("max_packets_out"), and remember whether we were cwnd-limited at the
      moment we finished sending that flight.
      
      (2) Only allowing cwnd to grow to twice the number of outstanding
      packets ("max_packets_out") in slow start. In congestion avoidance
      mode we now only allow cwnd to grow if it was fully utilized.
      Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ca8a2263
  2. 21 May, 2014 13 commits
    • Julia Lawall's avatar
      wimax/i2400m: make return of 0 explicit · aff4b974
      Julia Lawall authored
      Delete unnecessary local variable whose value is always 0 and that hides
      the fact that the result is always 0.
      
      A simplified version of the semantic patch that fixes this problem is as
      follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r exists@
      local idexpression ret;
      expression e;
      position p;
      @@
      
      -ret = 0;
      ... when != ret = e
      return
      - ret
      + 0
        ;
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aff4b974
    • Alexei Starovoitov's avatar
      net: filter: cleanup invocation of internal BPF · 5fe821a9
      Alexei Starovoitov authored
      Kernel API for classic BPF socket filters is:
      
      sk_unattached_filter_create() - validate classic BPF, convert, JIT
      SK_RUN_FILTER() - run it
      sk_unattached_filter_destroy() - destroy socket filter
      
      Cleanup internal BPF kernel API as following:
      
      sk_filter_select_runtime() - final step of internal BPF creation.
        Try to JIT internal BPF program, if JIT is not available select interpreter
      SK_RUN_FILTER() - run it
      sk_filter_free() - free internal BPF program
      
      Disallow direct calls to BPF interpreter. Execution of the BPF program should
      be done with SK_RUN_FILTER() macro.
      
      Example of internal BPF create, run, destroy:
      
        struct sk_filter *fp;
      
        fp = kzalloc(sk_filter_size(prog_len), GFP_KERNEL);
        memcpy(fp->insni, prog, prog_len * sizeof(fp->insni[0]));
        fp->len = prog_len;
      
        sk_filter_select_runtime(fp);
      
        SK_RUN_FILTER(fp, ctx);
      
        sk_filter_free(fp);
      
      Sockets, seccomp, testsuite, tracing are using different ways to populate
      sk_filter, so first steps of program creation are not common.
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Acked-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5fe821a9
    • David S. Miller's avatar
      Merge branch 'enic-next' · 21ea04fa
      David S. Miller authored
      Govindarajulu Varadarajan says:
      
      ====================
      enic: Add adaptive coalescing interrupt support
      
      This series add support for adaptive coalescing interrupt and updates
      enic Maintainers.
      
      v1->v2:
      	* Add commit log
      	* do vnic_intr_coalescing_timer_set only while enabling intr
      	* use ktime_get instead of hrtimer
      	* make enic_set_rx_coal_setting return type void
      	* change func name enic_apply_int_moderation to enic_calc_int_moderation
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      21ea04fa
    • Govindarajulu Varadarajan's avatar
      MAINTAINERS: Update enic maintainers · c327e8f4
      Govindarajulu Varadarajan authored
      Cc: Sujith Sankar <ssujith@cisco.com>
      Cc: Christian Benvenuti <benve@cisco.com>
      Cc: Neel Patel <neepatel@cisco.com>
      Signed-off-by: default avatarGovindarajulu Varadarajan <_govind@gmx.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c327e8f4
    • Sujith Sankar's avatar
      enic: Add support for adaptive interrupt coalescing · 7c2ce6e6
      Sujith Sankar authored
      This patch adds support for adaptive interrupt coalescing.
      
      For small pkts with low pkt rate, we can decrease the coalescing interrupt
      dynamically which decreases the latency. This however increases the cpu
      utilization. Based on testing with different coal intr and pkt rate we came up
      with a table(mod_table) with rx_rate and coalescing interrupt value where we
      get low latency without significant increase in cpu. mod_table table stores
      the coalescing timer percentage value for different throughputs.
      
      Function enic_calc_int_moderation() calculates the desired coalescing intr timer
      value. This function is called in driver rx napi_poll. The actual value is set
      by enic_set_int_moderation() which is called when napi_poll is complete. i.e
      when we unmask the rx intr.
      
      Adaptive coal intr is support only when driver is using msix intr. Because
      intr is not shared.
      
      Struct mod_range is used to store only the default adaptive coalescing intr
      value.
      
      Adaptive coal intr calue is calculated by
      
      timer = range_start + ((rx_coal->range_end - range_start) *
      		       mod_table[index].range_percent / 100);
      
      rx_coal->range_end is the rx-usecs-high value set using ethtool.
      range_start is rx-usecs-low, set using ethtool, if rx_small_pkt_bytes_cnt is
      greater than 2 * rx_large_pkt_bytes_cnt. i.e small pkts are dominant. Else its
      rx-usecs-low + 3.
      
      Cc: Christian Benvenuti <benve@cisco.com>
      Cc: Neel Patel <neepatel@cisco.com>
      Signed-off-by: default avatarSujith Sankar <ssujith@cisco.com>
      Signed-off-by: default avatarGovindarajulu Varadarajan <_govind@gmx.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7c2ce6e6
    • Manuel Schölling's avatar
      vxge: Use time_before() · f6e92d10
      Manuel Schölling authored
      To be future-proof and for better readability the time comparisons are modified
      to use time_before() instead of plain, error-prone math.
      Signed-off-by: default avatarManuel Schölling <manuel.schoelling@gmx.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f6e92d10
    • Himangi Saraogi's avatar
      ieee802154: Introduce the use of the managed version of kzalloc · 12b5c38f
      Himangi Saraogi authored
      This patch moves data allocated using kzalloc to managed data allocated
      using devm_kzalloc and cleans now unnecessary kfrees in probe and remove
      functions. An explicit linux/device.h include is added to make sure
      the devm_*() routine declarations are unambiguously available.
      
      The following Coccinelle semantic patch was used for making the change:
      
      @platform@
      identifier p, probefn, removefn;
      @@
      struct platform_driver p = {
        .probe = probefn,
        .remove = removefn,
      };
      
      @prb@
      identifier platform.probefn, pdev;
      expression e, e1, e2;
      @@
      probefn(struct platform_device *pdev, ...) {
        <+...
      - e = kzalloc(e1, e2)
      + e = devm_kzalloc(&pdev->dev, e1, e2)
        ...
      ?-kfree(e);
        ...+>
      }
      
      @rem depends on prb@
      identifier platform.removefn;
      expression e;
      @@
      removefn(...) {
        <...
      - kfree(e);
        ...>
      }
      Signed-off-by: default avatarHimangi Saraogi <himangi774@gmail.com>
      Acked-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      12b5c38f
    • Peter Senna Tschudin's avatar
      atm: idt77252: Remove redundant error check · 7e910357
      Peter Senna Tschudin authored
      Remove double checks, convert printk to pr_warn, and move the call to
      pr_warn to the first check. The simplified version of the coccinelle
      semantic patch that find this issue is as follows:
      
      // <smpl>
      @@
      expression E; identifier pr; expression list es;
      @@
      while(...){
      ...
      -       if (E) break;
      +       if (E){
      +               pr(es);
      +               break;
      +       }
      ...
      }
      - if(E) pr(es);
      // </smpl>
      
      Tested by compilation only.
      Signed-off-by: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7e910357
    • Li RongQing's avatar
      ipv6: slight optimization in ip6_dst_gc · 14956643
      Li RongQing authored
      entries is always greater than rt_max_size here, since if entries is less
      than rt_max_size, the fib6_run_gc function will be skipped
      Signed-off-by: default avatarLi RongQing <roy.qing.li@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      14956643
    • Xi Wang's avatar
      net-tun: restructure tun_do_read for better sleep/wakeup efficiency · 9e641bdc
      Xi Wang authored
      tun_do_read always adds current thread to wait queue, even if a packet
      is ready to read. This is inefficient because both sleeper and waker
      want to acquire the wait queue spin lock when packet rate is high.
      
      We restructure the read function and use common kernel networking
      routines to handle receive, sleep and wakeup. With the change
      available packets are checked first before the reading thread is added
      to the wait queue.
      
      Ran performance tests with the following configuration:
      
       - my packet generator -> tap1 -> br0 -> tap0 -> my packet consumer
       - sender pinned to one core and receiver pinned to another core
       - sender send small UDP packets (64 bytes total) as fast as it can
       - sandy bridge cores
       - throughput are receiver side goodput numbers
      
      The results are
      
      baseline: 731k pkts/sec, cpu utilization at 1.50 cpus
       changed: 783k pkts/sec, cpu utilization at 1.53 cpus
      
      The performance difference is largely determined by packet rate and
      inter-cpu communication cost. For example, if the sender and
      receiver are pinned to different cpu sockets, the results are
      
      baseline: 558k pkts/sec, cpu utilization at 1.71 cpus
       changed: 690k pkts/sec, cpu utilization at 1.67 cpus
      Co-authored-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarXi Wang <xii@google.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9e641bdc
    • Tom Gundersen's avatar
      net: tunnels - enable module autoloading · f98f89a0
      Tom Gundersen authored
      Enable the module alias hookup to allow tunnel modules to be autoloaded on demand.
      
      This is in line with how most other netdev kinds work, and will allow userspace
      to create tunnels without having CAP_SYS_MODULE.
      Signed-off-by: default avatarTom Gundersen <teg@jklm.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f98f89a0
    • David S. Miller's avatar
      Merge tag 'linux-can-next-for-3.16-20140519' of git://gitorious.org/linux-can/linux-can-next · 2a7ede54
      David S. Miller authored
      Marc Kleine-Budde says:
      
      ====================
      pull-request: can-next 2014-05-19
      
      this is a pull request of 13 patches for net-next/master.
      
      A patch by Dan Carpenter fixes a coccinelle warning in the mcp251x
      driver. Jean Delvare contributes three patches to tightening the
      Kconfig dependencies for some drivers. Then come three patches by Pavel
      Machek that improve the c_can driver support on the socfpga platform.
      Sergei Shtylyov's patch brings support for the CAN hardware found on
      Renesas R-Car CAN controllers. Four patches by Oliver Hartkopp, the
      first cleans up the guard macros in the CAN headers the other three
      improve the EFF frame filtering. Maximilian Schneider's patch adds
      support for the GS_USB CAN devices.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2a7ede54
    • Bjørn Mork's avatar
      net: cdc_ncm: fix 64bit division build error · 7d10d261
      Bjørn Mork authored
      The upper timer_interval limit is arbitrary and much higher
      than anything usable in the real world.  Reducing it from 15s
      to ~4s to make the timer_interval fit in an u32 does not make
      much difference.  The limit is still outside the practical
      bounds.
      
      This eliminates the need for a 64bit timer_interval, fixing a
      build error related to 64bit division:
      
       drivers/built-in.o: In function `cdc_ncm_get_coalesce':
       ak8975.c:(.text+0x1ac994): undefined reference to `__aeabi_uldivmod'
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7d10d261
  3. 19 May, 2014 21 commits
  4. 18 May, 2014 3 commits
  5. 17 May, 2014 2 commits
    • David S. Miller's avatar
      Merge branch 'cdc_ncm-coalesce' · 33fcc5e0
      David S. Miller authored
      Bjørn Mork says:
      
      ====================
      cdc_ncm: add buffer tuning and stats using ethtool
      
      Quoting the previous description of this series (skip to the
      changelog below if you only want a summary of the changes):
      
      "I have got quite a few reports from frustrated users of OpenWRT
      hosts trying to use some powerful LTE modem, but not achieving
      full speed.  This is typically caused by a combination of
      big buffers and little memory, giving in allocation errors and
      bad performance as a result.
      
      This series is an attempt to let users adjust the size of these
      buffers without having to rebuild the driver.
      
      Patches 1 - 4 are mostly rearranging existing code, in preparing
      for the dynamic buffer size changes.
      
      Patch 5 adds userspace control (ab)using the ethtool coalescing
      API. This isn't a perfect match, which is the main reason why I
      post this series as a RFC.
      
      Patch 6 is an unrelated framing optimization, reducing the
      overhead quite a bit and allowing for better use of smaller
      buffers.
      
      Patch 7 changes the way we calculate frame padding cutoff. The
      problem with big buffers is made much worse by the current padding
      strategy where zero padding often can account for more than 90% of
      the frames.
      
      Patch 8 add some counters giving some insight into how well the
      NCM/MBIM protocol works, supporting further tuning.
      
      Patch 9 reduce the initial maximum buffer size from 32kB to 16kB
      in an attempt to make the default better suit all. It is still
      possible to tune this up again to the old fixed max, using the
      new tuning knobs.
      
      I must admit that I had higher hopes for this series before I
      tested it on my own modems.  One really unexpected result was
      that one of the MBIM modems accepted the new rx buffer size we
      set, but happily continued sending buffers of the same size as
      before.  Needless to say:  This did not work very well...
      
      So don't really expect to be able to use any values with any
      given device. Firmware implementations are still... I don't
      think I have words suitable for a public mailing list.
      
      But I am hoping this will help the many users who have had success
      rebuilding the driver with lower fixed limits.
      
      Please test and/or comment!"
      
      Changes:
      
      ** RFC -> v1 **
      
      Patch 10 - a follow-up to a comment Joe Perches made in November
                 2013.  I don't always forget :-)
      Patch 11 - removes the redundant "connected" driver state, and the
                 associated .check_connect callbacks.
      
      ** v1 -> v2 **
      
      Patch 1  - Better handling of minium rx buffer size, based on feedback
                 from Oliver Neukum and Enrico Mioso
      Patch 5  - fixed locking around timer interval update
      Patch 9  - fixed whitespace error
      Patch 12 - new fix related to the tuneable tx timer
      
      ...and spelling fixes all over the commit messages.  I have finally
      added a spelling hook, which I'm sure may of you will appreciate :-)
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      33fcc5e0
    • Bjørn Mork's avatar
      net: cdc_ncm: do not start timer on an empty skb · 046c6594
      Bjørn Mork authored
      We can end up with a freshly allocated tx_curr_skb with no frames
      in it.  In this case it does not make any sense to start the timer.
      This avoids the timer periodically trying to start tx when there
      is nothing in the queue.
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      046c6594