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


13 Feb, 2010

1 commit


19 Nov, 2009

1 commit

  • Not as fancy as coccinelle. Checkpatch errors ignored.
    Compile tested allyesconfig x86, not all files compiled.

    grep -rPl --include=*.[ch] "\brequest_irq\s*\([^,\)]+,\s*\&" drivers/net | while read file ; do \
    perl -i -e 'local $/; while (<>) { s@(\brequest_irq\s*\([^,\)]+,\s*)\&@\1@g ; print ; }' $file ;\
    done

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

    Joe Perches
     

01 Sep, 2009

1 commit


06 Jul, 2009

1 commit


18 May, 2009

2 commits


05 May, 2009

1 commit


16 Apr, 2009

1 commit


22 Jan, 2009

1 commit

  • Following the removal of the unused struct net_device * parameter from
    the NAPI functions named *netif_rx_* in commit 908a7a1, they are
    exactly equivalent to the corresponding *napi_* functions and are
    therefore redundant.

    Signed-off-by: Ben Hutchings
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller

    Ben Hutchings
     

13 Jan, 2009

1 commit


07 Jan, 2009

1 commit

  • These variables are only used with an interface that just dumps their
    values into registers to be passed to the hypervisor. The arguments
    to that interface are declared to be "unsigned long", so make these
    variables match. The macros are only used with these variables, so make
    them match as well.

    This code is currently only built for 64bit powerpc, so the transformation
    is really a noop. If the interface was ever ported to 32 bit, it would
    almost certainly still use registers to pass the parameters and so
    "unsigned long" would still be appropriate.

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

    Stephen Rothwell
     

29 Dec, 2008

1 commit


23 Dec, 2008

1 commit

  • When the napi api was changed to separate its 1:1 binding to the net_device
    struct, the netif_rx_[prep|schedule|complete] api failed to remove the now
    vestigual net_device structure parameter. This patch cleans up that api by
    properly removing it..

    Signed-off-by: Neil Horman
    Signed-off-by: David S. Miller

    Neil Horman
     

13 Nov, 2008

1 commit

  • We have some reasons to kill netdev->priv:
    1. netdev->priv is equal to netdev_priv().
    2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously
    netdev_priv() is more flexible than netdev->priv.
    But we cann't kill netdev->priv, because so many drivers reference to it
    directly.

    This patch is a safe convert for netdev->priv to netdev_priv(netdev).
    Since all of the netdev->priv is only for read.
    But it is too big to be sent in one mail.
    I split it to 4 parts and make every part smaller than 100,000 bytes,
    which is max size allowed by vger.

    Signed-off-by: Wang Chen
    Signed-off-by: David S. Miller

    Wang Chen
     

04 Nov, 2008

1 commit


28 Oct, 2008

1 commit

  • This converts pretty much everything to print_mac. There were
    a few things that had conflicts which I have just dropped for
    now, no harm done.

    I've built an allyesconfig with this and looked at the files
    that weren't built very carefully, but it's a huge patch.

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

27 Aug, 2008

1 commit

  • This patch fixes a ibmveth bug where bad UDP checksums are being transmitted
    when checksum offloading is enabled.
    The hypervisor does checksum offloading only on TCP packets, so ibmveth calls
    skb_checksum_help() for any other protocol. The bug happens because
    the packet is being modified after the DMA map, so we would need a memory
    barrier before making the hypervisor call. Reordering the code so that the
    DMA map happens after skb_checksum_help() has the additional advantage of
    fixing a DMA map leak if skb_checksum_help() where to fail.

    Signed-off-by: Santiago Leon
    Signed-off-by: Jeff Garzik

    Santiago Leon
     

28 Jul, 2008

1 commit

  • The addition of an argument to dma_mapping_error() in commit
    8d8bb39b9eba32dd70e87fd5ad5c5dd4ba118e06 "dma-mapping: add the device
    argument to dma_mapping_error()" left a bit of fallout:

    drivers/net/ibmveth.c:263: error: too few arguments to function 'dma_mapping_error'
    drivers/net/ibmveth.c:264: error: expected ')' before 'goto'
    drivers/net/ibmveth.c:284: error: expected expression before '}' token
    drivers/net/ibmveth.c:297: error: too few arguments to function 'dma_mapping_error'
    drivers/net/ibmveth.c:298: error: expected ')' before 'dma_unmap_single'
    drivers/net/ibmveth.c:306: error: expected expression before '}' token
    drivers/net/ibmveth.c:491: error: too few arguments to function 'dma_mapping_error'
    drivers/net/ibmveth.c:927: error: too few arguments to function 'dma_mapping_error'
    drivers/net/ibmveth.c:927: error: expected ')' before '{' token
    drivers/net/ibmveth.c:974: error: expected expression before '}' token
    drivers/net/ibmveth.c:914: error: label 'out' used but not defined m

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Benjamin Herrenschmidt

    Stephen Rothwell
     

27 Jul, 2008

1 commit

  • Add per-device dma_mapping_ops support for CONFIG_X86_64 as POWER
    architecture does:

    This enables us to cleanly fix the Calgary IOMMU issue that some devices
    are not behind the IOMMU (http://lkml.org/lkml/2008/5/8/423).

    I think that per-device dma_mapping_ops support would be also helpful for
    KVM people to support PCI passthrough but Andi thinks that this makes it
    difficult to support the PCI passthrough (see the above thread). So I
    CC'ed this to KVM camp. Comments are appreciated.

    A pointer to dma_mapping_ops to struct dev_archdata is added. If the
    pointer is non NULL, DMA operations in asm/dma-mapping.h use it. If it's
    NULL, the system-wide dma_ops pointer is used as before.

    If it's useful for KVM people, I plan to implement a mechanism to register
    a hook called when a new pci (or dma capable) device is created (it works
    with hot plugging). It enables IOMMUs to set up an appropriate
    dma_mapping_ops per device.

    The major obstacle is that dma_mapping_error doesn't take a pointer to the
    device unlike other DMA operations. So x86 can't have dma_mapping_ops per
    device. Note all the POWER IOMMUs use the same dma_mapping_error function
    so this is not a problem for POWER but x86 IOMMUs use different
    dma_mapping_error functions.

    The first patch adds the device argument to dma_mapping_error. The patch
    is trivial but large since it touches lots of drivers and dma-mapping.h in
    all the architecture.

    This patch:

    dma_mapping_error() doesn't take a pointer to the device unlike other DMA
    operations. So we can't have dma_mapping_ops per device.

    Note that POWER already has dma_mapping_ops per device but all the POWER
    IOMMUs use the same dma_mapping_error function. x86 IOMMUs use device
    argument.

    [akpm@linux-foundation.org: fix sge]
    [akpm@linux-foundation.org: fix svc_rdma]
    [akpm@linux-foundation.org: build fix]
    [akpm@linux-foundation.org: fix bnx2x]
    [akpm@linux-foundation.org: fix s2io]
    [akpm@linux-foundation.org: fix pasemi_mac]
    [akpm@linux-foundation.org: fix sdhci]
    [akpm@linux-foundation.org: build fix]
    [akpm@linux-foundation.org: fix sparc]
    [akpm@linux-foundation.org: fix ibmvscsi]
    Signed-off-by: FUJITA Tomonori
    Cc: Muli Ben-Yehuda
    Cc: Andi Kleen
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Avi Kivity
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     

25 Jul, 2008

2 commits

  • Enable ibmveth for Cooperative Memory Overcommitment (CMO). For this driver
    it means calculating a desired amount of IO memory based on the current MTU
    and updating this value with the bus when MTU changes occur. Because DMA
    mappings can fail, we have added a bounce buffer for temporary cases where
    the driver can not map IO memory for the buffer pool.

    The following changes are made to enable the driver for CMO:
    * DMA mapping errors will not result in error messages if entitlement has
    been exceeded and resources were not available.
    * DMA mapping errors are handled gracefully, ibmveth_replenish_buffer_pool()
    is corrected to check the return from dma_map_single and fail gracefully.
    * The driver will have a get_desired_dma function defined to function
    in a CMO environment.
    * When the MTU is changed, the driver will update the device IO entitlement

    Signed-off-by: Robert Jennings
    Signed-off-by: Brian King
    Signed-off-by: Santiago Leon
    Acked-by: Paul Mackerras
    Signed-off-by: Benjamin Herrenschmidt

    Robert Jennings
     
  • Activates larger rx buffer pools when the MTU is changed to a larger
    value. This patch de-activates the large rx buffer pools when the MTU
    changes to a smaller value.

    Signed-off-by: Santiago Leon
    Signed-off-by: Robert Jennings
    Acked-by: Paul Mackerras
    Signed-off-by: Benjamin Herrenschmidt

    Santiago Leon
     

29 Apr, 2008

1 commit


19 Apr, 2008

1 commit


26 Mar, 2008

1 commit


25 Jan, 2008

2 commits


13 Oct, 2007

1 commit


11 Oct, 2007

3 commits