1. 23 3月, 2009 1 次提交
  2. 22 3月, 2009 1 次提交
  3. 22 1月, 2009 1 次提交
  4. 29 12月, 2008 1 次提交
    • D
      net: Fix unused variable warnings in pasemi_mac.c and spider_net.c · 59c5ea6e
      David S. Miller 提交于
      As reported by Stephen Rothwell:
      
      --------------------
      Today's linux-next build (powerpc ppc64_defconfig) produced these new
      warnings:
      
      drivers/net/pasemi_mac.c: In function 'pasemi_mac_rx_intr':
      drivers/net/pasemi_mac.c:957: warning: unused variable 'dev'
      drivers/net/pasemi_mac.c: In function 'pasemi_mac_poll':
      drivers/net/pasemi_mac.c:1637: warning: unused variable 'dev'
      drivers/net/spider_net.c: In function 'spider_net_poll':
      drivers/net/spider_net.c:1280: warning: unused variable 'netdev'
      
      Probably caused by commit 908a7a16 ("net:
      Remove unused netdev arg from some NAPI interfaces").
      --------------------
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      59c5ea6e
  5. 23 12月, 2008 1 次提交
  6. 07 12月, 2008 1 次提交
  7. 24 11月, 2008 1 次提交
  8. 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
  9. 13 5月, 2008 1 次提交
  10. 17 4月, 2008 3 次提交
  11. 20 10月, 2007 2 次提交
  12. 11 10月, 2007 3 次提交
    • J
      [NET] drivers/net: statistics cleanup #1 -- save memory and shrink code · 09f75cd7
      Jeff Garzik 提交于
      We now have struct net_device_stats embedded in struct net_device,
      and the default ->get_stats() hook does the obvious thing for us.
      
      Run through drivers/net/* and remove the driver-local storage of
      statistics, and driver-local ->get_stats() hook where applicable.
      
      This was just the low-hanging fruit in drivers/net; plenty more drivers
      remain to be updated.
      
      [ Resolved conflicts with napi_struct changes and fix sunqe build
        regression... -DaveM ]
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      09f75cd7
    • R
      [NET]: Nuke SET_MODULE_OWNER macro. · 10d024c1
      Ralf Baechle 提交于
      It's been a useless no-op for long enough in 2.6 so I figured it's time to
      remove it.  The number of people that could object because they're
      maintaining unified 2.4 and 2.6 drivers is probably rather small.
      
      [ Handled drivers added by netdev tree and some missed IRDA cases... -DaveM ]
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      10d024c1
    • S
      [NET]: Make NAPI polling independent of struct net_device objects. · bea3348e
      Stephen Hemminger 提交于
      Several devices have multiple independant RX queues per net
      device, and some have a single interrupt doorbell for several
      queues.
      
      In either case, it's easier to support layouts like that if the
      structure representing the poll is independant from the net
      device itself.
      
      The signature of the ->poll() call back goes from:
      
      	int foo_poll(struct net_device *dev, int *budget)
      
      to
      
      	int foo_poll(struct napi_struct *napi, int budget)
      
      The caller is returned the number of RX packets processed (or
      the number of "NAPI credits" consumed if you want to get
      abstract).  The callee no longer messes around bumping
      dev->quota, *budget, etc. because that is all handled in the
      caller upon return.
      
      The napi_struct is to be embedded in the device driver private data
      structures.
      
      Furthermore, it is the driver's responsibility to disable all NAPI
      instances in it's ->stop() device close handler.  Since the
      napi_struct is privatized into the driver's private data structures,
      only the driver knows how to get at all of the napi_struct instances
      it may have per-device.
      
      With lots of help and suggestions from Rusty Russell, Roland Dreier,
      Michael Chan, Jeff Garzik, and Jamal Hadi Salim.
      
      Bug fixes from Thomas Graf, Roland Dreier, Peter Zijlstra,
      Joseph Fannin, Scott Wood, Hans J. Koch, and Michael Chan.
      
      [ Ported to current tree and all drivers converted.  Integrated
        Stephen's follow-on kerneldoc additions, and restored poll_list
        handling to the old style to fix mutual exclusion issues.  -DaveM ]
      Signed-off-by: NStephen Hemminger <shemminger@linux-foundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bea3348e
  13. 13 9月, 2007 1 次提交
    • I
      spidernet: fix interrupt reason recognition · a041fe2e
      Ishizaki Kou 提交于
      This patch solves a problem that the spidernet driver sometimes fails
      to handle IRQ.
      
      The problem happens because,
      - In Cell architecture, interrupts may arrive at an interrupt
        controller, even if they are masked by the setting on registers of
        devices. It happens when interrupt packets are sent just before
        the interrupts are masked.
      - spidernet interrupt handler compares interrupt reasons with
        interrupt masks, so when such interrupts occurs, spidernet interrupt
        handler returns IRQ_NONE.
      - When all of interrupt handler return IRQ_NONE, linux kernel disables
        the IRQ and it no longer delivers interrupts to the interrupt handlers.
      
      spidernet doesn't work after above sequence, because it can't receive
      interrupts.
      
      This patch changes spidernet interrupt handler that it compares
      interrupt reason with SPIDER_NET_INTX_MASK_VALUE.
      Signed-off-by: NKou Ishizaki <kou.ishizaki@toshiba.co.jp>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      a041fe2e
  14. 11 7月, 2007 1 次提交
    • I
      spidernet: improve interrupt handling · 7a627558
      Ishizaki Kou 提交于
      We intend this patch to improve spidernet interrupt handling to be
      more strict.  We had following problem and this patch solves it.
      
       -when CONFIG_DEBUG_SHIRQ=y, request_irq() calls handler().
       -when spider_net_open() is called, it calls request_irq() which calls
        spider_net_interrupt().
       -if some specific interrupt bit is set at this timing, it calls
        netif_rx_schedule() and spider_net_poll() is scheduled.
       -spider_net_open() calls netif_poll_enable() which clears the bit
        __LINK_STATE_RX_SCHED.
       -when spider_net_poll() is called, it calls netif_rx_complete() which
        causes BUG_ON() because __LINK_STATE_RX_SCHED is not set.
      Signed-off-by: NKou Ishizaki <kou.ishizaki@toshiba.co.jp>
      Signed-off-by: NLinas Vepstas <linas@austin.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      7a627558
  15. 09 7月, 2007 7 次提交
  16. 21 6月, 2007 5 次提交
    • S
      spidernet: checksum and ethtool · 3a2c892d
      Stephen Hemminger 提交于
      It doesn't look like spidernet hardware can really checksum all protocols,
      the code looks like it does IPV4 only.  If so, it should use NETIF_F_IP_CSUM
      instead of NETIF_F_HW_CSUM.
      
      The driver doesn't need it's own get/set for ethtool tx csum, and it
      should use the standard ethtool_op_get_link.
      Signed-off-by: NStephen Hemminger <shemminger@linux-foundation.org>
      Signed-off-by: NLinas Vepstas <linas@austin.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      3a2c892d
    • L
      spidernet: silence the ramfull messages · c3d1182a
      Linas Vepstas 提交于
      Although the previous patch resolved issues with hangs when the
      RX ram full interrupt is encountered, there are still situations
      where lots of RX ramfull interrupts arrive, resulting in a noisy
      log in syslog. There is no need for this.
      Signed-off-by: NLinas Vepstas <linas@austin.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      c3d1182a
    • L
      spidernet: Don't terminate the RX ring · 2bf27a0d
      Linas Vepstas 提交于
      The terminated RX ring will cause trouble during the RX ram full
      conditions, leading to a hung driver, as the hardware can't find
      the next descr.  There is no real reason to terminate the RX ring;
      it doesn't make the operation any smooother, and it does
      require an extra sync. So don't do it.
      Signed-off-by: NLinas Vepstas <linas@austin.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      2bf27a0d
    • L
      spidernet: Cure RX ram full bug · 4c4bd5a9
      Linas Vepstas 提交于
      This patch fixes a rare deadlock that can occur when the kernel
      is not able to empty out the RX ring quickly enough. Below follows
      a detailed description of the bug and the fix.
      
      As long as the OS can empty out the RX buffers at a rate faster than
      the hardware can fill them, there is no problem. If, for some reason,
      the OS fails to empty the RX ring fast enough, the hardware GDACTDPA
      pointer will catch up to the head, notice the not-empty condition,
      ad stop. However, RX packets may still continue arriving on the wire.
      The spidernet chip can save some limited number of these in local RAM.
      When this local ram fills up, the spider chip will issue an interrupt
      indicating this (GHIINT0STS will show ERRINT, and the GRMFLLINT bit
      will be set in GHIINT1STS).  When te RX ram full condition occurs,
      a certain bug/feature is triggered that has to be specially handled.
      This section describes the special handling for this condition.
      
      When the OS finally has a chance to run, it will empty out the RX ring.
      In particular, it will clear the descriptor on which the hardware had
      stopped. However, once the hardware has decided that a certain
      descriptor is invalid, it will not restart at that descriptor; instead
      it will restart at the next descr. This potentially will lead to a
      deadlock condition, as the tail pointer will be pointing at this descr,
      which, from the OS point of view, is empty; the OS will be waiting for
      this descr to be filled. However, the hardware has skipped this descr,
      and is filling the next descrs. Since the OS doesn't see this, there
      is a potential deadlock, with the OS waiting for one descr to fill,
      while the hardware is waiting for a differen set of descrs to become
      empty.
      
      A call to show_rx_chain() at this point indicates the nature of the
      problem. A typical print when the network is hung shows the following:
      
      net eth1: Spider RX RAM full, incoming packets might be discarded!
      net eth1: Total number of descrs=256
      net eth1: Chain tail located at descr=255
      net eth1: Chain head is at 255
      net eth1: HW curr desc (GDACTDPA) is at 0
      net eth1: Have 1 descrs with stat=xa0800000
      net eth1: HW next desc (GDACNEXTDA) is at 1
      net eth1: Have 127 descrs with stat=x40800101
      net eth1: Have 1 descrs with stat=x40800001
      net eth1: Have 126 descrs with stat=x40800101
      net eth1: Last 1 descrs with stat=xa0800000
      
      Both the tail and head pointers are pointing at descr 255, which is
      marked xa... which is "empty". Thus, from the OS point of view, there
      is nothing to be done. In particular, there is the implicit assumption
      that everything in front of the "empty" descr must surely also be empty,
      as explained in the last section. The OS is waiting for descr 255 to
      become non-empty, which, in this case, will never happen.
      
      The HW pointer is at descr 0. This descr is marked 0x4.. or "full".
      Since its already full, the hardware can do nothing more, and thus has
      halted processing. Notice that descrs 0 through 254 are all marked
      "full", while descr 254 and 255 are empty. (The "Last 1 descrs" is
      descr 254, since tail was at 255.) Thus, the system is deadlocked,
      and there can be no forward progress; the OS thinks there's nothing
      to do, and the hardware has nowhere to put incoming data.
      
      This bug/feature is worked around with the spider_net_resync_head_ptr()
      routine. When the driver receives RX interrupts, but an examination
      of the RX chain seems to show it is empty, then it is probable that
      the hardware has skipped a descr or two (sometimes dozens under heavy
      network conditions). The spider_net_resync_head_ptr() subroutine will
      search the ring for the next full descr, and the driver will resume
      operations there.  Since this will leave "holes" in the ring, there
      is also a spider_net_resync_tail_ptr() that will skip over such holes.
      Signed-off-by: NLinas Vepstas <linas@austin.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4c4bd5a9
    • L
      spidernet: null out skb pointer after its been used. · 83d35145
      Linas Vepstas 提交于
      Avoid kernel crash in mm/slab.c due to double-free of pointer.
      
      If the ethernet interface is brought down while there is still
      RX traffic in flight, the device shutdown routine can end up
      trying to double-free an skb, leading to a crash in mm/slab.c
      Avoid the double-free by nulling out the skb pointer.
      Signed-off-by: NLinas Vepstas <linas@austin.ibm.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      83d35145
  17. 03 6月, 2007 1 次提交
  18. 25 5月, 2007 1 次提交
  19. 18 5月, 2007 1 次提交
  20. 12 5月, 2007 1 次提交
  21. 02 5月, 2007 1 次提交
  22. 26 4月, 2007 3 次提交
  23. 20 4月, 2007 1 次提交
    • L
      spidernet: Fix problem sending IP fragments · 33bdeec8
      Linas Vepstas 提交于
      The basic structure of "normal" UDP/IP/Ethernet
      frames (that actually work):
       - It starts with the Ethernet header (dest MAC, src MAC, etc.)
       - The next part is occupied by the IP header (version info, length of
      packet, id=0, fragment offset=0, checksum, from / to address, etc.)
       - Then comes the UDP header (src / dest port, length, checksum)
       - Actual payload
       - Ethernet checksum
      
      Now what's different for IP fragment:
       - The IP header has id set to some value (same for all fragments),
      offset is set appropriately (i.e. 0 for first fragment, following
      according to size of other fragments), size is the length of the frame.
       - UDP header is unchanged. I.e. length is according to full UDP
      datagram, not just the part within the actual frame! But this is only
      true within the first frame: all following frames don't have a valid
      UDP-header at all.
      
      The spidernet silicon seems to be quite intelligent: It's able to
      compute (IP / UDP / Ethernet) checksums on the fly and tests if frames
      are conforming to RFC -- at least conforming to RFC on complete frames.
      
      But IP fragments are different as explained above:
      I.e. for IP fragments containing part of a UDP datagram it sees
      incompatible length in the headers for IP and UDP in the first frame
      and, thus, skips this frame. But the content *is* correct for IP
      fragments. For all following frames it finds (most probably) no valid
      UDP header at all. But this *is* also correct for IP fragments.
      
      The Linux IP-stack seems to be clever in this point. It expects the
      spidernet to calculate the checksum (since the module claims to be able
      to do so) and marks the skb's for "normal" frames accordingly
      (ip_summed set to CHECKSUM_HW).
      But for the IP fragments it does not expect the driver to be capable to
      handle the frames appropriately. Thus all checksums are allready
      computed. This is also flaged within the skb (ip_summed set to
      CHECKSUM_NONE).
      
      Unfortunately the spidernet driver ignores that hints. It tries to send
      the IP fragments of UDP datagrams as normal UDP/IP frames. Since they
      have different structure the silicon detects them the be not
      "well-formed" and skips them.
      
      The following one-liner against 2.6.21-rc2 changes this behavior. If the
      IP-stack claims to have done the checksumming, the driver should not
      try to checksum (and analyze) the frame but send it as is.
      Signed-off-by: NNorbert Eicker <n.eicker@fz-juelich.de>
      Signed-off-by: NLinas Vepstas <linas@austin.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      33bdeec8