29 Nov, 2011

1 commit

  • Since 2005 (c1b4a7e69576d65efc31a8cea0714173c2841244)
    tcp_tso_should_defer has been using tcp_max_burst() as a target limit
    for deciding how large to make outgoing TSO packets when not using
    sysctl_tcp_tso_win_divisor. But since 2008
    (dd9e0dda66ba38a2ddd1405ac279894260dc5c36) tcp_max_burst() returns the
    reordering degree. We should not have tcp_tso_should_defer attempt to
    build larger segments just because there is more reordering. This
    commit splits the notion of deferral size used in TSO from the notion
    of burst size used in cwnd moderation, and returns the TSO deferral
    limit to its original value.

    Signed-off-by: Neal Cardwell
    Signed-off-by: David S. Miller

    Neal Cardwell
     

28 Aug, 2010

1 commit

  • The string clone is only used as a temporary copy of the argument val
    within the while loop, and so it should be freed before leaving the
    function. The call to strsep, however, modifies clone, so a pointer to the
    front of the string is kept in saved_clone, to make it possible to free it.

    The sematic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r exists@
    local idexpression x;
    expression E;
    identifier l;
    statement S;
    @@

    *x= \(kasprintf\|kstrdup\)(...);
    ...
    if (x == NULL) S
    ... when != kfree(x)
    when != E = x
    if (...) {

    * return ...;
    }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

14 Aug, 2009

1 commit

  • The networking code checks CAP_SYS_MODULE before using request_module() to
    try to load a kernel module. While this seems reasonable it's actually
    weakening system security since we have to allow CAP_SYS_MODULE for things
    like /sbin/ip and bluetoothd which need to be able to trigger module loads.
    CAP_SYS_MODULE actually grants those binaries the ability to directly load
    any code into the kernel. We should instead be protecting modprobe and the
    modules on disk, rather than granting random programs the ability to load code
    directly into the kernel. Instead we are going to gate those networking checks
    on CAP_NET_ADMIN which still limits them to root but which does not grant
    those processes the ability to load arbitrary code into the kernel.

    Signed-off-by: Eric Paris
    Acked-by: Serge Hallyn
    Acked-by: Paul Moore
    Acked-by: David S. Miller
    Signed-off-by: James Morris

    Eric Paris
     

02 Mar, 2009

1 commit

  • It seems that implementation in yeah was inconsistent to what
    other did as it would increase cwnd one ack earlier than the
    others do.

    Size benefits:

    bictcp_cong_avoid | -36
    tcp_cong_avoid_ai | +52
    bictcp_cong_avoid | -34
    tcp_scalable_cong_avoid | -36
    tcp_veno_cong_avoid | -12
    tcp_yeah_cong_avoid | -38

    = -104 bytes total

    Signed-off-by: Ilpo Järvinen
    Signed-off-by: David S. Miller

    Ilpo Järvinen
     

17 Oct, 2008

1 commit


29 Apr, 2008

2 commits


29 Jan, 2008

2 commits

  • net/ipv4/tcp_cong.c:
    tcp_reno_cong_avoid | -65
    1 function changed, 65 bytes removed, diff: -65

    net/ipv4/arp.c:
    arp_ignore | -5
    1 function changed, 5 bytes removed, diff: -5

    net/ipv4/tcp_bic.c:
    bictcp_cong_avoid | -57
    1 function changed, 57 bytes removed, diff: -57

    net/ipv4/tcp_cubic.c:
    bictcp_cong_avoid | -61
    1 function changed, 61 bytes removed, diff: -61

    net/ipv4/tcp_highspeed.c:
    hstcp_cong_avoid | -63
    1 function changed, 63 bytes removed, diff: -63

    net/ipv4/tcp_hybla.c:
    hybla_cong_avoid | -85
    1 function changed, 85 bytes removed, diff: -85

    net/ipv4/tcp_htcp.c:
    htcp_cong_avoid | -57
    1 function changed, 57 bytes removed, diff: -57

    net/ipv4/tcp_veno.c:
    tcp_veno_cong_avoid | -52
    1 function changed, 52 bytes removed, diff: -52

    net/ipv4/tcp_scalable.c:
    tcp_scalable_cong_avoid | -61
    1 function changed, 61 bytes removed, diff: -61

    net/ipv4/tcp_yeah.c:
    tcp_yeah_cong_avoid | -75
    1 function changed, 75 bytes removed, diff: -75

    net/ipv4/tcp_illinois.c:
    tcp_illinois_cong_avoid | -54
    1 function changed, 54 bytes removed, diff: -54

    net/dccp/ccids/ccid3.c:
    ccid3_update_send_interval | -7
    ccid3_hc_tx_packet_recv | +7
    2 functions changed, 7 bytes added, 7 bytes removed, diff: +0

    net/ipv4/tcp_cong.c:
    tcp_is_cwnd_limited | +88
    1 function changed, 88 bytes added, diff: +88

    built-in.o:
    14 functions changed, 95 bytes added, 642 bytes removed, diff: -547

    ...Again some gcc artifacts visible as well.

    Signed-off-by: Ilpo Järvinen
    Signed-off-by: David S. Miller

    Ilpo Järvinen
     
  • Signed-off-by: Ilpo Järvinen
    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Ilpo Järvinen
     

18 Jul, 2007

1 commit


18 May, 2007

1 commit


26 Apr, 2007

2 commits


24 Apr, 2007

1 commit

  • Change to defer congestion control initialization.

    If setsockopt() was used to change TCP_CONGESTION before
    connection is established, then protocols that use sequence numbers
    to keep track of one RTT interval (vegas, illinois, ...) get confused.

    Change the init hook to be called after handshake.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

18 Feb, 2007

1 commit


11 Feb, 2007

1 commit


03 Dec, 2006

3 commits


02 Nov, 2006

1 commit


25 Sep, 2006

1 commit

  • Change how default TCP congestion control is chosen. Don't just use
    last installed module, instead allow selection during configuration,
    and make sure and use the default regardless of load order.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

30 Aug, 2006

1 commit


01 Jul, 2006

1 commit


18 Jun, 2006

1 commit

  • Many of the TCP congestion methods all just use ssthresh
    as the minimum congestion window on decrease. Rather than
    duplicating the code, just have that be the default if that
    handle in the ops structure is not set.

    Minor behaviour change to TCP compound. It probably wants
    to use this (ssthresh) as lower bound, rather than ssthresh/2
    because the latter causes undershoot on loss.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

29 Mar, 2006

1 commit


04 Jan, 2006

1 commit

  • TCP inline usage cleanup:
    * get rid of inline in several places
    * replace __inline__ with inline where possible
    * move functions used in one file out of tcp.h
    * let compiler decide on used once cases

    On x86_64:
    text data bss dec hex filename
    3594701 648348 567400 4810449 4966d1 vmlinux.orig
    3593133 648580 567400 4809113 496199 vmlinux

    On sparc64:
    text data bss dec hex filename
    2538278 406152 530392 3474822 350586 vmlinux.ORIG
    2536382 406384 530392 3473158 34ff06 vmlinux

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

11 Nov, 2005

3 commits

  • This is an updated version of the RFC3465 ABC patch originally
    for Linux 2.6.11-rc4 by Yee-Ting Li. ABC is a way of counting
    bytes ack'd rather than packets when updating congestion control.

    The orignal ABC described in the RFC applied to a Reno style
    algorithm. For advanced congestion control there is little
    change after leaving slow start.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • Move all the code that does linear TCP slowstart to one
    inline function to ease later patch to add ABC support.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     
  • TCP peformance with TSO over networks with delay is awful.
    On a 100Mbit link with 150ms delay, we get 4Mbits/sec with TSO and
    50Mbits/sec without TSO.

    The problem is with TSO, we intentionally do not keep the maximum
    number of packets in flight to fill the window, we hold out to until
    we can send a MSS chunk. But, we also don't update the congestion window
    unless we have filled, as per RFC2861.

    This patch replaces the check for the congestion window being full
    with something smarter that accounts for TSO.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Stephen Hemminger
     

30 Aug, 2005

1 commit

  • This changeset basically moves tcp_sk()->{ca_ops,ca_state,etc} to inet_csk(),
    minimal renaming/moving done in this changeset to ease review.

    Most of it is just changes of struct tcp_sock * to struct sock * parameters.

    With this we move to a state closer to two interesting goals:

    1. Generalisation of net/ipv4/tcp_diag.c, becoming inet_diag.c, being used
    for any INET transport protocol that has struct inet_hashinfo and are
    derived from struct inet_connection_sock. Keeps the userspace API, that will
    just not display DCCP sockets, while newer versions of tools can support
    DCCP.

    2. INET generic transport pluggable Congestion Avoidance infrastructure, using
    the current TCP CA infrastructure with DCCP.

    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: David S. Miller

    Arnaldo Carvalho de Melo
     

24 Jun, 2005

2 commits