1. 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
  2. 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
  3. 09 7月, 2007 7 次提交
  4. 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
  5. 03 6月, 2007 1 次提交
  6. 25 5月, 2007 1 次提交
  7. 18 5月, 2007 1 次提交
  8. 12 5月, 2007 1 次提交
  9. 02 5月, 2007 1 次提交
  10. 26 4月, 2007 3 次提交
  11. 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
  12. 13 4月, 2007 1 次提交
  13. 27 2月, 2007 10 次提交
  14. 10 2月, 2007 1 次提交
  15. 08 2月, 2007 1 次提交
  16. 06 2月, 2007 4 次提交