27 Jul, 2011

1 commit

  • This allows us to move duplicated code in
    (atomic_inc_not_zero() for now) to

    Signed-off-by: Arun Sharma
    Reviewed-by: Eric Dumazet
    Cc: Ingo Molnar
    Cc: David Miller
    Cc: Eric Dumazet
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arun Sharma
     

07 Jun, 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
     

29 Apr, 2011

1 commit

  • Commit b9367bf3ee6d ("net: ibmveth: convert to hw_features") accidentally
    removed call to ibmveth_set_csum_offload() in ibmveth_probe(). Put the
    call back where it was, but with additional error checking provided
    by ibmveth_set_features().

    Signed-off-by: Michał Mirosław
    Reported-by: Stephen Rothwell
    [sfr: dev -> netdev]
    Signed-off-by: Stephen Rothwell
    Signed-off-by: David S. Miller

    Michał Mirosław
     

20 Apr, 2011

1 commit


11 Dec, 2010

1 commit


21 Oct, 2010

2 commits


07 Sep, 2010

21 commits

  • Add an entry to the MAINTAINERS file for ibmveth, clean up the copyright
    and add all authors. Change the name of the module to reflect the product name
    over the last number of years.

    Considering all the changes we have made, bump the driver version.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • These files probably came across from the skeleton driver. Remove them.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • We had a driver specific assert function which wasn't enabled most of the
    time. Convert them to BUG_ON and enable them all the time.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • We had a few cases where we returned success on error.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • Fix most of the kernel coding style issues in ibmveth.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • IbmVethNumBufferPools -> IBMVETH_NUM_BUFF_POOLS

    Also change IBMVETH_MAX_MTU -> IBMVETH_MIN_MTU, it refers to the minimum
    size not the maximum.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • Use netdev_err to standardise the error output.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • Use netdev_dbg to standardise the debug output.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • These functions appear before their use, so we can remove the redundant
    prototypes.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • We were using alloc_skb which doesn't create any headroom. Change it to
    use netdev_alloc_skb to match most other drivers.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • We export all the driver specific statistics via ethtool, so there is no need
    to duplicate this in procfs.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • This patch enables TCP checksum offload support for IPv6 on ibmveth.
    This completely eliminates the generation and checking of the checksum
    for IPv6 packets that are completely virtual and never touch a physical
    network. A basic TCPIPV6_STREAM netperf run showed a ~30% throughput
    improvement when an MTU of 64000 was used.

    This featured is enabled by default, as is the case for IPv4 checksum
    offload. When checksum offload is enabled the driver will negotiate
    IPv4 and IPv6 offload with the firmware separately and enable what
    is available. As long as either IPv4 or IPv6 offload is supported
    and enabled the device will report that checksum offload is enabled.
    The device stats, available through ethtool, will display which
    checksum offload features are supported/enabled by firmware.

    Performance testing against a stock kernel shows no regression for IPv4
    or IPv6 in terms of throughput or processor utilization with checksum
    disabled or enabled.

    Signed-off-by: Robert Jennings
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • Remove code in the device probe function where we set up the checksum
    offload feature and replace it with a call to an existing function that
    is doing the same. This is done to clean up the driver in preparation
    of adding IPv6 checksum offload support.

    Signed-off-by: Robert Jennings
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • On some machines we can improve the bandwidth by ensuring rx buffers are
    not in the cache. Add a module option that is disabled by default that flushes
    rx buffers on insertion.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • ibmveth can scatter gather up to 6 segments. If we go over this then
    we have no option but to call skb_linearize, like other drivers with
    similar limitations do.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • We want to order the read in ibmveth_rxq_pending_buffer and the read of
    ibmveth_rxq_buffer_valid which are both cacheable memory. smp_rmb() is good
    enough for this.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Anton Blanchard
     
  • For small packets, create a new skb and copy the packet into it so we
    avoid tearing down and creating a TCE entry.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • Use the existing bounce buffer if we send a buffer under a certain size.
    This saves the overhead of a TCE map/unmap.

    I can't see any reason for the wmb() in the bounce buffer case, if we need
    a barrier it will be before we call h_send_logical_lan but we have
    nothing in the common case. Remove it.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • The ibmveth adapter needs locking in the transmit routine to protect
    the bounce_buffer but it sets LLTX and forgets to add any of its own
    locking.

    Just remove the deprecated LLTX option. Remove the stats lock in the process.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • At the moment we try and replenish the receive ring on every rx interrupt.
    We even have a pool->threshold but aren't using it.

    To limit the maximum latency incurred when refilling, change the threshold
    from 1/2 to 7/8 and reduce the largest rx pool from 768 buffers to 512 which
    should be more than enough.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     
  • Replace some modulus operators with an increment and compare to avoid
    an integer divide.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Santiago Leon
    Signed-off-by: David S. Miller

    Santiago Leon
     

19 Aug, 2010

1 commit

  • This fixes the following opps which can occur when trying to deallocate
    receive buffer pools when changing the MTU of an active ibmveth device.

    Oops: Kernel access of bad area, sig: 11 [#1]
    NIP: d000000004db00e8 LR: d000000004db00ac CTR: 0000000000591038
    REGS: c00000007fff39d0 TRAP: 0300 Not tainted (2.6.36-rc1)
    MSR: 8000000000009032 CR: 22248244 XER: 00000002
    DAR: 0000000000000488, DSISR: 0000000042000000
    TASK = c00000007c463790[6531] 'netserver' THREAD: c00000007a154000 CPU: 0
    GPR00: 0000000000000000 c00000007fff3c50 d000000004dbd360 0000000000000001
    GPR04: 0000000000000001 1fffffffffffffff 000000000000043c c00000007a8e9f60
    GPR08: c00000007a8e9e20 0000000000000245 0000000000000488 0000000000000000
    GPR12: 00000000000000c0 c000000006d70000 c00000007bfec098 c00000007bfebc2c
    GPR16: c00000007a157c78 0000000000000000 0000000000000001 0000000000000000
    GPR20: 0000000000000001 0000000000000010 c000000000b51180 c00000007a8e9d90
    GPR24: c00000007a8e9da0 c00000007a8e9580 00000000000005ea 00000000000002ff
    GPR28: 0000000000000004 0000000000000080 c000000000a946f8 c00000007a8e9d80
    NIP [d000000004db00e8] .ibmveth_remove_buffer_from_pool+0xe8/0x130 [ibmveth]
    LR [d000000004db00ac] .ibmveth_remove_buffer_from_pool+0xac/0x130 [ibmveth]
    Call Trace:
    [c00000007fff3c50] [d000000004db00ac] .ibmveth_remove_buffer_from_pool+0xac/0x130 [ibmveth] (unreliable)
    [c00000007fff3cf0] [d000000004db31dc] .ibmveth_poll+0x30c/0x460 [ibmveth]
    [c00000007fff3dd0] [c00000000042c4b8] .net_rx_action+0x178/0x278
    [c00000007fff3eb0] [c000000000093cf0] .__do_softirq+0x118/0x1f8
    [c00000007fff3f90] [c00000000002ab3c] .call_do_softirq+0x14/0x24
    [c00000007a157600] [c00000000000e3e4] .do_softirq+0xec/0x110
    [c00000007a1576a0] [c000000000093394] .local_bh_enable_ip+0xb4/0xe0
    [c00000007a157720] [c0000000004f0bac] ._raw_spin_unlock_bh+0x3c/0x50
    [c00000007a157790] [c0000000004186e0] .release_sock+0x158/0x188
    [c00000007a157840] [c000000000479660] .tcp_recvmsg+0x560/0x9b8
    [c00000007a157970] [c0000000004a0d78] .inet_recvmsg+0x80/0xd8
    [c00000007a157a00] [c000000000413e28] .sock_recvmsg+0x128/0x178
    [c00000007a157bf0] [c0000000004164ac] .SyS_recvfrom+0xb4/0x148
    [c00000007a157d70] [c000000000411f3c] .SyS_socketcall+0x274/0x360
    [c00000007a157e30] [c0000000000085b4] syscall_exit+0x0/0x40

    Reported-by: Rafael Camarda Silva Folco
    Signed-off-by: Robert Jennings
    Acked-by: Brian King
    Signed-off-by: David S. Miller

    Robert Jennings
     

17 Jul, 2010

1 commit

  • The order of freeing the IRQ and freeing the device in firmware
    in ibmveth_close can cause the adapter to become unusable after a
    subsequent ibmveth_open. Only a reboot of the OS will make the
    network device usable again. This is seen when cycling the adapter
    up and down while there is network activity.

    There is a window where an IRQ will be left unserviced (H_EOI will not
    be called). The solution is to make a VIO_IRQ_DISABLE h_call, free the
    device with firmware, and then call free_irq.

    Signed-off-by: Robert Jennings
    Signed-off-by: David S. Miller

    Robert Jennings
     

18 May, 2010

2 commits

  • Use kcalloc or kzalloc rather than the combination of kmalloc and memset.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression x,y,flags;
    statement S;
    type T;
    @@

    x =
    - kmalloc
    + kcalloc
    (
    - y * sizeof(T),
    + y, sizeof(T),
    flags);
    if (x == NULL) S
    -memset(x, 0, y * sizeof(T));

    @@
    expression x,size,flags;
    statement S;
    @@

    -x = kmalloc(size,flags);
    +x = kzalloc(size,flags);
    if (x == NULL) S
    -memset(x, 0, size);
    //

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

    Julia Lawall
     
  • Adds support for resuming from suspend for IBM virtual ethernet devices.
    We may have lost an interrupt over the suspend, so we just kick the
    interrupt handler to process anything that is outstanding.

    Signed-off-by: Brian King
    Signed-off-by: David S. Miller

    Brian King
     

14 May, 2010

1 commit

  • This patch removes from drivers/net/ all the unnecessary
    return; statements that precede the last closing brace of
    void functions.

    It does not remove the returns that are immediately
    preceded by a label as gcc doesn't like that.

    It also does not remove null void functions with return.

    Done via:
    $ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
    xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'

    with some cleanups by hand.

    Compile tested x86 allmodconfig only.

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

10 May, 2010

1 commit

  • Now that core network takes care of trans_start updates, dont do it
    in drivers themselves, if possible. Drivers can avoid one cache miss
    (on dev->trans_start) in their start_xmit() handler.

    Exceptions are NETIF_F_LLTX drivers

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

    Eric Dumazet
     

12 Apr, 2010

1 commit


04 Apr, 2010

1 commit

  • Converts the list and the core manipulating with it to be the same as uc_list.

    +uses two functions for adding/removing mc address (normal and "global"
    variant) instead of a function parameter.
    +removes dev_mcast.c completely.
    +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for
    manipulation with lists on a sandbox (used in bonding and 80211 drivers)

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     

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
     

08 Mar, 2010

1 commit

  • Constify struct sysfs_ops.

    This is part of the ops structure constification
    effort started by Arjan van de Ven et al.

    Benefits of this constification:

    * prevents modification of data that is shared
    (referenced) by many other structure instances
    at runtime

    * detects/prevents accidental (but not intentional)
    modification attempts on archs that enforce
    read-only kernel data at runtime

    * potentially better optimized code as the compiler
    can assume that the const data cannot be changed

    * the compiler/linker move const data into .rodata
    and therefore exclude them from false sharing

    Signed-off-by: Emese Revfy
    Acked-by: David Teigland
    Acked-by: Matt Domsch
    Acked-by: Maciej Sosnowski
    Acked-by: Hans J. Koch
    Acked-by: Pekka Enberg
    Acked-by: Jens Axboe
    Acked-by: Stephen Hemminger
    Signed-off-by: Greg Kroah-Hartman

    Emese Revfy
     

23 Feb, 2010

1 commit