23 Nov, 2011

1 commit


17 Nov, 2011

2 commits


09 Nov, 2011

1 commit

  • Tunnels can force an alignment of their percpu data to reduce number of
    cache lines used in fast path, or read in .ndo_get_stats()

    percpu_alloc() is a very fine grained allocator, so any small hole will
    be used anyway.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

01 Nov, 2011

1 commit


28 Jul, 2011

1 commit

  • 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: Neil Horman
    CC: Karsten Keil
    CC: "David S. Miller"
    CC: Jay Vosburgh
    CC: Andy Gospodarek
    CC: Patrick McHardy
    CC: Krzysztof Halasa
    CC: "John W. Linville"
    CC: Greg Kroah-Hartman
    CC: Marcel Holtmann
    CC: Johannes Berg
    Signed-off-by: David S. Miller

    Neil Horman
     

06 Jul, 2011

2 commits


01 Jul, 2011

1 commit


20 Jun, 2011

1 commit

  • Using 64bit stats on 32bit arches must use a synchronization or readers
    can get transient values.

    Fixes bug introduced in commit 6311cc44a2 (veth: convert to 64 bit
    statistics)

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

09 Jun, 2011

1 commit


16 May, 2011

1 commit


06 May, 2011

1 commit


03 May, 2011

1 commit


30 Apr, 2011

1 commit

  • This updates the network drivers so that they don't access the
    ethtool_cmd::speed field directly, but use ethtool_cmd_speed()
    instead.

    For most of the drivers, these changes are purely cosmetic and don't
    fix any problem, such as for those 1GbE/10GbE drivers that indirectly
    call their own ethtool get_settings()/mii_ethtool_gset(). The changes
    are meant to enforce code consistency and provide robustness with
    future larger throughputs, at the expense of a few CPU cycles for each
    ethtool operation.

    All drivers compiled with make allyesconfig ion x86_64 have been
    updated.

    Tested: make allyesconfig on x86_64 + e1000e/bnx2x work
    Signed-off-by: David Decotigny
    Signed-off-by: David S. Miller

    David Decotigny
     

02 Apr, 2011

1 commit


22 Mar, 2011

1 commit

  • Commit 44540960 "veth: move loopback logic to common location" introduced
    a bug in the packet counters. I don't understand why that happened as it
    is not explained in the comments and the mut check in dev_forward_skb
    retains the assumption that skb->len is the total length of the packet.

    I just measured this emperically by setting up a veth pair between two
    noop network namespaces setting and attempting a telnet connection between
    the two. I saw three packets in each direction and the byte counters were
    exactly 14*3 = 42 bytes high in each direction. I got the actual
    packet lengths with tcpdump.

    So remove the extra ETH_HLEN from the veth byte count totals.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: David S. Miller

    Eric W. Biederman
     

25 Jan, 2011

1 commit


17 Dec, 2010

1 commit

  • We can't change ip_summed from CHECKSUM_PARTIAL to CHECKSUM_NONE
    or CHECKSUM_UNNECESSARY because checksum in packet's headers is
    not valid and will cause invalid checksum when frame is forwarded.

    Signed-off-by: Michał Mirosław
    Signed-off-by: David S. Miller

    Michał Mirosław
     

27 Sep, 2010

1 commit


06 May, 2010

1 commit

  • In case of congestion, netif_rx() frees the skb, so we must assume
    dev_forward_skb() also consume skb.

    Bug introduced by commit 445409602c092
    (veth: move loopback logic to common location)

    We must change dev_forward_skb() to always consume skb, and veth to not
    double free it.

    Bug report : http://marc.info/?l=linux-netdev&m=127310770900442&w=3

    Reported-by: Martín Ferrari
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

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
     

27 Feb, 2010

1 commit

  • commit e8469ed959c373c2ff9e6f488aa5a14971aebe1f
    Author: Patrick McHardy
    Date: Tue Feb 23 20:41:30 2010 +0100

    Support specifying the initial device flags when creating a device though
    rtnl_link. Devices allocated by rtnl_create_link() are marked as INITIALIZING
    in order to surpress netlink registration notifications. To complete setup,
    rtnl_configure_link() must be called, which performs the device flag changes
    and invokes the deferred notifiers if everything went well.

    Two examples:

    # add macvlan to eth0
    #
    $ ip link add link eth0 up allmulticast on type macvlan

    [LINK]11: macvlan0@eth0: mtu 1500 qdisc noqueue state UNKNOWN
    link/ether 26:f8:84:02:f9:2a brd ff:ff:ff:ff:ff:ff
    [ROUTE]ff00::/8 dev macvlan0 table local metric 256 mtu 1500 advmss 1440 hoplimit 0
    [ROUTE]fe80::/64 dev macvlan0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 0
    [LINK]11: macvlan0@eth0: mtu 1500
    link/ether 26:f8:84:02:f9:2a
    [ADDR]11: macvlan0 inet6 fe80::24f8:84ff:fe02:f92a/64 scope link
    valid_lft forever preferred_lft forever
    [ROUTE]local fe80::24f8:84ff:fe02:f92a via :: dev lo table local proto none metric 0 mtu 16436 advmss 16376 hoplimit 0
    [ROUTE]default via fe80::215:e9ff:fef0:10f8 dev macvlan0 proto kernel metric 1024 mtu 1500 advmss 1440 hoplimit 0
    [NEIGH]fe80::215:e9ff:fef0:10f8 dev macvlan0 lladdr 00:15:e9:f0:10:f8 router STALE
    [ROUTE]2001:6f8:974::/64 dev macvlan0 proto kernel metric 256 expires 0sec mtu 1500 advmss 1440 hoplimit 0
    [PREFIX]prefix 2001:6f8:974::/64 dev macvlan0 onlink autoconf valid 14400 preferred 131084
    [ADDR]11: macvlan0 inet6 2001:6f8:974:0:24f8:84ff:fe02:f92a/64 scope global dynamic
    valid_lft 86399sec preferred_lft 14399sec

    # add VLAN to eth1, eth1 is down
    #
    $ ip link add link eth1 up type vlan id 1000
    RTNETLINK answers: Network is down

    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Patrick McHardy
     

17 Feb, 2010

1 commit

  • Add __percpu sparse annotations to net drivers.

    These annotations are to make sparse consider percpu variables to be
    in a different address space and warn if accessed without going
    through percpu accessors. This patch doesn't affect normal builds.

    Signed-off-by: Tejun Heo
    Acked-by: David S. Miller
    Cc: Eric Dumazet
    Cc: Arnd Bergmann
    Signed-off-by: David S. Miller

    Tejun Heo
     

15 Dec, 2009

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (34 commits)
    m68k: rename global variable vmalloc_end to m68k_vmalloc_end
    percpu: add missing per_cpu_ptr_to_phys() definition for UP
    percpu: Fix kdump failure if booted with percpu_alloc=page
    percpu: make misc percpu symbols unique
    percpu: make percpu symbols in ia64 unique
    percpu: make percpu symbols in powerpc unique
    percpu: make percpu symbols in x86 unique
    percpu: make percpu symbols in xen unique
    percpu: make percpu symbols in cpufreq unique
    percpu: make percpu symbols in oprofile unique
    percpu: make percpu symbols in tracer unique
    percpu: make percpu symbols under kernel/ and mm/ unique
    percpu: remove some sparse warnings
    percpu: make alloc_percpu() handle array types
    vmalloc: fix use of non-existent percpu variable in put_cpu_var()
    this_cpu: Use this_cpu_xx in trace_functions_graph.c
    this_cpu: Use this_cpu_xx for ftrace
    this_cpu: Use this_cpu_xx in nmi handling
    this_cpu: Use this_cpu operations in RCU
    this_cpu: Use this_cpu ops for VM statistics
    ...

    Fix up trivial (famous last words) global per-cpu naming conflicts in
    arch/x86/kvm/svm.c
    mm/slab.c

    Linus Torvalds
     

29 Nov, 2009

1 commit


27 Nov, 2009

1 commit

  • The veth driver contains code to forward an skb
    from the start_xmit function of one network
    device into the receive path of another device.

    Moving that code into a common location lets us
    reuse the code for direct forwarding of data
    between macvlan ports, and possibly in other
    drivers.

    Signed-off-by: Arnd Bergmann
    Acked-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

20 Nov, 2009

1 commit

  • veth_get_stats() can be called in parallel on several cpus.

    It's better to not reset dev->stats as it could give wrong result on
    one cpu. Use temporary variables, then store the final results.

    Also, we should loop on every possible cpus, not only online cpus,
    or cpu hotplug can suddenly give wrong veth stats.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

08 Nov, 2009

1 commit

  • There is no good reason to not support userspace specifying the
    network namespace during device creation, and it makes it easier
    to create a network device and pass it to a child network namespace
    with a well known name.

    We have to be careful to ensure that the target network namespace
    for the new device exists through the life of the call. To keep
    that logic clear I have factored out the network namespace grabbing
    logic into rtnl_link_get_net.

    In addtion we need to continue to pass the source network namespace
    to the rtnl_link_ops.newlink method so that we can find the base
    device source network namespace.

    Signed-off-by: Eric W. Biederman
    Acked-by: Eric Dumazet

    Eric W. Biederman
     

30 Oct, 2009

1 commit

  • In commit 23289a37e2b127dfc4de1313fba15bb4c9f0cd5b
    (net: add a list_head parameter to dellink() method),
    I forgot to actually use this parameter in veth_dellink.

    I remember feeling a bit uncomfortable about veth_close(),
    because it does :

    netif_carrier_off(dev);
    netif_carrier_off(priv->peer);

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

28 Oct, 2009

1 commit


03 Oct, 2009

1 commit

  • There are cases where we can use this_cpu_ptr and as the result
    of using this_cpu_ptr() we no longer need to determine the
    currently executing cpu.

    In those places no get/put_cpu combination is needed anymore.
    The local cpu variable can be eliminated.

    Preemption still needs to be disabled and enabled since the
    modifications of the per cpu variables is not atomic. There may
    be multiple per cpu variables modified and those must all
    be from the same processor.

    Acked-by: Maciej Sosnowski
    Acked-by: Dan Williams
    Acked-by: Tejun Heo
    cc: Eric Biederman
    cc: Stephen Hemminger
    cc: David L Stevens
    Signed-off-by: Christoph Lameter
    Signed-off-by: Tejun Heo

    Christoph Lameter
     

02 Sep, 2009

1 commit


01 Sep, 2009

1 commit


24 Jul, 2009

1 commit

  • This patch zero's the timestamp before handing the packet to
    the peer interface. This lets the peer recalculate the rx timestamp
    if it cares about timestamps.

    Signed-off-by: Ben Greear
    Signed-off-by: David S. Miller

    Ben Greear
     

06 Jul, 2009

1 commit


25 Jun, 2009

1 commit

  • This reverts commit ae0e8e82205c903978a79ebf5e31c670b61fa5b4.

    This change had two problems:

    1) Since it frees the stats in the drivers' close method, we
    can OOPS in the transmit routine.

    2) stats are no longer remembered across ifdown/ifup which
    disagrees with how every other device operates.

    Thanks to analysis and test patch from Serge E. Hallyn
    and initial OOPS report by Sachin Sant.

    Signed-off-by: David S. Miller

    David S. Miller
     

30 May, 2009

1 commit


27 Apr, 2009

1 commit

  • From: Stephen Hemminger

    The veth driver will oops if sysfs hooks are open while module is removed.

    The net device destructor can not point to code in a module; basically
    there are only two possible safe values: NULL - no destructor, or
    free_netdev - free on last use

    Signed-off-by: David S. Miller

    Stephen Hemminger
     

04 Mar, 2009

1 commit

  • The limitation to only 1500 byte mtu's limits the utility of the veth
    device for testing routing. So implement implement a configurable
    MTU.

    For consistency I drop packets on the receive side when they are
    larger than the MTU. I count those drops. And I allow
    a little padding for vlan headers.

    I also test the mtu when a new device is created with netlink
    because that path currently bypasses the current mtu setting
    code.

    Signed-off-by: Eric Biederman
    Signed-off-by: David S. Miller

    Eric Biederman