1. 07 9月, 2010 10 次提交
  2. 19 8月, 2010 1 次提交
    • R
      ibmveth: Fix opps during MTU change on an active device · 0645bab7
      Robert Jennings 提交于
      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 <EE,ME,IR,DR>  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: NRafael Camarda Silva Folco <rfolco@linux.vnet.ibm.com>
      Signed-off-by: NRobert Jennings <rcj@linux.vnet.ibm.com>
      Acked-by: NBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0645bab7
  3. 17 7月, 2010 1 次提交
  4. 18 5月, 2010 2 次提交
  5. 14 5月, 2010 1 次提交
    • J
      drivers/net: Remove unnecessary returns from void function()s · a4b77097
      Joe Perches 提交于
      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: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a4b77097
  6. 10 5月, 2010 1 次提交
  7. 04 4月, 2010 1 次提交
    • J
      net: convert multicast list to list_head · 22bedad3
      Jiri Pirko 提交于
      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: NJiri Pirko <jpirko@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22bedad3
  8. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit 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: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  9. 08 3月, 2010 1 次提交
  10. 23 2月, 2010 1 次提交
  11. 13 2月, 2010 1 次提交
  12. 19 11月, 2009 1 次提交
  13. 01 9月, 2009 1 次提交
  14. 06 7月, 2009 1 次提交
  15. 18 5月, 2009 2 次提交
  16. 05 5月, 2009 1 次提交
  17. 16 4月, 2009 1 次提交
  18. 22 1月, 2009 1 次提交
  19. 13 1月, 2009 1 次提交
  20. 07 1月, 2009 1 次提交
    • S
      ibmveth: use consistent types · ff5bfc35
      Stephen Rothwell 提交于
      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: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ff5bfc35
  21. 29 12月, 2008 1 次提交
  22. 23 12月, 2008 1 次提交
  23. 13 11月, 2008 1 次提交
    • W
      netdevice: safe convert to netdev_priv() #part-2 · 4cf1653a
      Wang Chen 提交于
      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: NWang Chen <wangchen@cn.fujitsu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4cf1653a
  24. 04 11月, 2008 1 次提交
  25. 28 10月, 2008 1 次提交
  26. 27 8月, 2008 1 次提交
    • S
      ibmveth: fix bad UDP checksums · 45e15bb7
      Santiago Leon 提交于
      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: NSantiago Leon <santil@us.ibm.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      45e15bb7
  27. 28 7月, 2008 1 次提交
    • S
      ibmveth: Fix multiple errors with dma_mapping_error conversion · c713e7cb
      Stephen Rothwell 提交于
      The addition of an argument to dma_mapping_error() in commit
      8d8bb39b "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: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      c713e7cb
  28. 27 7月, 2008 1 次提交
    • F
      dma-mapping: add the device argument to dma_mapping_error() · 8d8bb39b
      FUJITA Tomonori 提交于
      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: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Muli Ben-Yehuda <muli@il.ibm.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Avi Kivity <avi@qumranet.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8d8bb39b
  29. 25 7月, 2008 1 次提交
    • R
      ibmveth: enable driver for CMO · 1096d63d
      Robert Jennings 提交于
      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: NRobert Jennings <rcj@linux.vnet.ibm.com>
      Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NSantiago Leon <santil@us.ibm.com>
      Acked-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      1096d63d