1. 18 5月, 2010 1 次提交
  2. 10 5月, 2010 1 次提交
  3. 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
  4. 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
  5. 26 2月, 2010 1 次提交
  6. 18 2月, 2010 1 次提交
  7. 26 1月, 2010 1 次提交
  8. 07 1月, 2010 1 次提交
    • S
      mv643xx_eth: don't include cache padding in rx desc buffer size · 530e557a
      Saeed Bishara 提交于
      If NET_SKB_PAD is not a multiple of the cache line size, mv643xx_eth
      allocates a couple of extra bytes at the start of each receive buffer
      to make the data payload end up on a cache line boundary.
      
      These extra bytes are skb_reserve()'d before DMA mapping, so they
      should not be included in the DMA map byte count (as the mapping is
      done starting at skb->data), nor should they be included in the
      receive descriptor buffer size field, or the hardware can end up
      DMAing beyond the end of the buffer, which can happen if someone
      sends us a larger-than-MTU sized packet.
      
      This problem was introduced in commit 7fd96ce4 ("mv643xx_eth:
      rework receive skb cache alignment", May 6 2009), but hasn't appeared
      to be problematic so far, probably as the main users of mv643xx_eth
      all have NET_SKB_PAD == L1_CACHE_BYTES.
      Signed-off-by: NSaeed Bishara <saeed@marvell.com>
      Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      530e557a
  9. 09 12月, 2009 1 次提交
  10. 30 11月, 2009 1 次提交
  11. 12 9月, 2009 1 次提交
  12. 19 6月, 2009 1 次提交
  13. 18 6月, 2009 1 次提交
    • J
      net: group address list and its count · 31278e71
      Jiri Pirko 提交于
      This patch is inspired by patch recently posted by Johannes Berg. Basically what
      my patch does is to group list and a count of addresses into newly introduced
      structure netdev_hw_addr_list. This brings us two benefits:
      1) struct net_device becames a bit nicer.
      2) in the future there will be a possibility to operate with lists independently
         on netdevices (with exporting right functions).
      I wanted to introduce this patch before I'll post a multicast lists conversion.
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      
       drivers/net/bnx2.c              |    4 +-
       drivers/net/e1000/e1000_main.c  |    4 +-
       drivers/net/ixgbe/ixgbe_main.c  |    6 +-
       drivers/net/mv643xx_eth.c       |    2 +-
       drivers/net/niu.c               |    4 +-
       drivers/net/virtio_net.c        |   10 ++--
       drivers/s390/net/qeth_l2_main.c |    2 +-
       include/linux/netdevice.h       |   17 +++--
       net/core/dev.c                  |  130 ++++++++++++++++++--------------------
       9 files changed, 89 insertions(+), 90 deletions(-)
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      31278e71
  14. 30 5月, 2009 1 次提交
    • J
      net: convert unicast addr list · ccffad25
      Jiri Pirko 提交于
      This patch converts unicast address list to standard list_head using
      previously introduced struct netdev_hw_addr. It also relaxes the
      locking. Original spinlock (still used for multicast addresses) is not
      needed and is no longer used for a protection of this list. All
      reading and writing takes place under rtnl (with no changes).
      
      I also removed a possibility to specify the length of the address
      while adding or deleting unicast address. It's always dev->addr_len.
      
      The convertion touched especially e1000 and ixgbe codes when the
      change is not so trivial.
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      
       drivers/net/bnx2.c               |   13 +--
       drivers/net/e1000/e1000_main.c   |   24 +++--
       drivers/net/ixgbe/ixgbe_common.c |   14 ++--
       drivers/net/ixgbe/ixgbe_common.h |    4 +-
       drivers/net/ixgbe/ixgbe_main.c   |    6 +-
       drivers/net/ixgbe/ixgbe_type.h   |    4 +-
       drivers/net/macvlan.c            |   11 +-
       drivers/net/mv643xx_eth.c        |   11 +-
       drivers/net/niu.c                |    7 +-
       drivers/net/virtio_net.c         |    7 +-
       drivers/s390/net/qeth_l2_main.c  |    6 +-
       drivers/scsi/fcoe/fcoe.c         |   16 ++--
       include/linux/netdevice.h        |   18 ++--
       net/8021q/vlan.c                 |    4 +-
       net/8021q/vlan_dev.c             |   10 +-
       net/core/dev.c                   |  195 +++++++++++++++++++++++++++-----------
       net/dsa/slave.c                  |   10 +-
       net/packet/af_packet.c           |    4 +-
       18 files changed, 227 insertions(+), 137 deletions(-)
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ccffad25
  15. 18 5月, 2009 1 次提交
  16. 07 5月, 2009 5 次提交
  17. 30 4月, 2009 2 次提交
    • L
      mv643xx_eth: 64bit mib counter read fix · 93af7aca
      Lennert Buytenhek 提交于
      On several mv643xx_eth hardware versions, the two 64bit mib counters
      for 'good octets received' and 'good octets sent' are actually 32bit
      counters, and reading from the upper half of the register has the same
      effect as reading from the lower half of the register: an atomic
      read-and-clear of the entire 32bit counter value.  This can under heavy
      traffic occasionally lead to small numbers being added to the upper
      half of the 64bit mib counter even though no 32bit wrap has occured.
      
      Since we poll the mib counters at least every 30 seconds anyway, we
      might as well just skip the reads of the upper halves of the hardware
      counters without breaking the stats, which this patch does.
      Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
      Cc: stable@kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      93af7aca
    • L
      mv643xx_eth: OOM handling fixes · 1319ebad
      Lennert Buytenhek 提交于
      Currently, when OOM occurs during rx ring refill, mv643xx_eth will get
      into an infinite loop, due to the refill function setting the OOM bit
      but not clearing the 'rx refill needed' bit for this queue, while the
      calling function (the NAPI poll handler) will call the refill function
      in a loop until the 'rx refill needed' bit goes off, without checking
      the OOM bit.
      
      This patch fixes this by checking the OOM bit in the NAPI poll handler
      before attempting to do rx refill.  This means that once OOM occurs,
      we won't try to do any memory allocations again until the next invocation
      of the poll handler.
      
      While we're at it, change the OOM flag to be a single bit instead of
      one bit per receive queue since OOM is a system state rather than a
      per-queue state, and cancel the OOM timer on entry to the NAPI poll
      handler if it's running to prevent it from firing when we've already
      come out of OOM.
      Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
      Cc: stable@kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1319ebad
  18. 09 4月, 2009 1 次提交
  19. 25 3月, 2009 1 次提交
  20. 14 3月, 2009 1 次提交
    • L
      mv643xx_eth: fix unicast address filter corruption on mtu change · 5a893922
      Lennert Buytenhek 提交于
      When mv643xx_eth_open() is called to up an interface, port_start()
      will first re-program the unicast address filter, and then
      re-initialise the PORT_CONFIG register, but that will disable unicast
      promiscuous mode if it was enabled by the unicast address filter setup.
      
      This isn't a problem on ifconfig up, as ->set_rx_mode() will be called
      shortly afterwards which will program the filters again, but it does
      trigger when changing the MTU, which calls mv643xx_eth_stop() and then
      mv643xx_eth_open() by hand to repopulate the receive rings with skbuffs
      of the new size.
      
      Swap the initialisation of the PORT_START register and the call to
      the unicast filter setup function to fix this.
      Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a893922
  21. 25 2月, 2009 4 次提交
  22. 19 2月, 2009 2 次提交
    • S
      net/mv643xx: don't disable the mib timer too early and lock properly · 57e8f26a
      Sebastian Siewior 提交于
      mib_counters_update() also restarts the timer.
      So the timer is dequeued, the stats are read and then the timer is
      enqueued again. This is "okay" unless someone unloads the module.
      The locking here is also broken:
      mib_counters_update() grabs just a simple spinlock. The only thing the
      lock is good for is to protect the timer func against other callers
      namely mv643xx_eth_stop() && mv643xx_eth_get_ethtool_stats(). That means
      if the spinlock is taken via the ethtool path and than the timer kicks
      in then the box will lock up.
      Signed-off-by: NSebastian Andrzej Siewior <sebastian@breakpoint.cc>
      Acked-by: NLennert Buytenhek <buytenh@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      57e8f26a
    • S
      net/mv643xx: use GFP_ATOMIC while atomic · 82a5bd6a
      Sebastian Siewior 提交于
      dev_set_rx_mode() grabs netif_addr_lock_bh():
      
      |BUG: sleeping function called from invalid context at /home/bigeasy/git/cryptodev-2.6/mm/slub.c:1599
      |in_atomic(): 1, irqs_disabled(): 0, pid: 859, name: ifconfig
      |2 locks held by ifconfig/859:
      | #0:  (rtnl_mutex){--..}, at: [<c0239ccc>] rtnl_lock+0x18/0x20
      | #1:  (_xmit_ETHER){-...}, at: [<c022d094>] dev_set_rx_mode+0x1c/0x30
      |[<c029f118>] (dump_stack+0x0/0x14) from [<c003df28>] (__might_sleep+0x11c/0x13c)
      |[<c003de0c>] (__might_sleep+0x0/0x13c) from [<c00a8854>] (kmem_cache_alloc+0x30/0xd4)
      | r5:c78093a0 r4:c034a47c
      |[<c00a8824>] (kmem_cache_alloc+0x0/0xd4) from [<c01a5fd0>] (mv643xx_eth_set_rx_mode+0x70/0x188)
      |[<c01a5f60>] (mv643xx_eth_set_rx_mode+0x0/0x188) from [<c022ced0>] (__dev_set_rx_mode+0x40/0xac)
      |[<c022ce90>] (__dev_set_rx_mode+0x0/0xac) from [<c022d09c>] (dev_set_rx_mode+0x24/0x30)
      | r6:00001043 r5:c78090f8 r4:c7809000
      |[<c022d078>] (dev_set_rx_mode+0x0/0x30) from [<c02304c4>] (dev_open+0xe4/0x114)
      | r5:c7809350 r4:c7809000
      |[<c02303e0>] (dev_open+0x0/0x114) from [<c022fd18>] (dev_change_flags+0xb0/0x190)
      | r5:00000041 r4:c7809000
      |[<c022fc68>] (dev_change_flags+0x0/0x190) from [<c0270250>] (devinet_ioctl+0x2f0/0x710)
      | r7:c7221e70 r6:c7aadb00 r5:00000000 r4:00000001
      |[<c026ff60>] (devinet_ioctl+0x0/0x710) from [<c02717c8>] (inet_ioctl+0xd4/0x110)
      |[<c02716f4>] (inet_ioctl+0x0/0x110) from [<c021fb74>] (sock_ioctl+0x1f4/0x254)
      | r4:c7242b40
      |[<c021f980>] (sock_ioctl+0x0/0x254) from [<c00b8160>] (vfs_ioctl+0x38/0x98)
      | r6:beec9bb8 r5:00008914 r4:c7242b40
      |[<c00b8128>] (vfs_ioctl+0x0/0x98) from [<c00b873c>] (do_vfs_ioctl+0x484/0x4d4)
      | r6:00008914 r5:c7242b40 r4:c74db1c0
      |[<c00b82b8>] (do_vfs_ioctl+0x0/0x4d4) from [<c00b87cc>] (sys_ioctl+0x40/0x64)
      |[<c00b878c>] (sys_ioctl+0x0/0x64) from [<c00269a0>] (ret_fast_syscall+0x0/0x2c)
      |[42949399.520000]  r7:00000036 r6:beec9c80 r5:00000041 r4:beec9bb8
      Signed-off-by: NSebastian Andrzej Siewior <sebastian@breakpoint.cc>
      Acked-by: NLennert Buytenhek <buytenh@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      82a5bd6a
  23. 16 2月, 2009 6 次提交
  24. 27 1月, 2009 1 次提交
  25. 20 1月, 2009 2 次提交
    • G
      mv643xx_eth: prevent interrupt storm on ifconfig down · fe65e704
      Gabriel Paubert 提交于
      Contrary to what the docs say, the 'extended interrupt cause' bit in
      the interrupt cause register (bit 1) appears to not be maskable on at
      least some of the mv643xx_eth platforms, making writing zeroes to the
      interrupt mask register but not the extended interrupt mask register
      insufficient to stop interrupts from occuring.  Therefore, also write
      zeroes to the extended interrupt mask register when shutting down the
      port.
      
      This fixes the interrupt storm seen on the Pegasos board when shutting
      down the interface.
      Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fe65e704
    • L
      mv643xx_eth: fix multicast filter programming · 2b448334
      Lennert Buytenhek 提交于
      Commit 66e63ffb ("mv643xx_eth:
      implement ->set_rx_mode()") cleaned up mv643xx_eth's multicast filter
      programming, but broke it as well.
      
      The non-special multicast filter table (for multicast addresses that
      are not of the form 01:00:5e:00:00:xx) consists of 256 hash table
      buckets organised as 64 32-bit words, where the 'accept' bits are
      in the LSB of each byte, so in bits 24 16 8 0 of each 32-bit word.
      The old code got this right, but the referenced commit broke this by
      using bits 3 2 1 0 instead.  This commit fixes this up.
      Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2b448334