1. 07 5月, 2007 5 次提交
    • R
      IB: Return "maybe missed event" hint from ib_req_notify_cq() · ed23a727
      Roland Dreier 提交于
      The semantics defined by the InfiniBand specification say that
      completion events are only generated when a completions is added to a
      completion queue (CQ) after completion notification is requested.  In
      other words, this means that the following race is possible:
      
      	while (CQ is not empty)
      		ib_poll_cq(CQ);
      	// new completion is added after while loop is exited
      	ib_req_notify_cq(CQ);
      	// no event is generated for the existing completion
      
      To close this race, the IB spec recommends doing another poll of the
      CQ after requesting notification.
      
      However, it is not always possible to arrange code this way (for
      example, we have found that NAPI for IPoIB cannot poll after
      requesting notification).  Also, some hardware (eg Mellanox HCAs)
      actually will generate an event for completions added before the call
      to ib_req_notify_cq() -- which is allowed by the spec, since there's
      no way for any upper-layer consumer to know exactly when a completion
      was really added -- so the extra poll of the CQ is just a waste.
      
      Motivated by this, we add a new flag "IB_CQ_REPORT_MISSED_EVENTS" for
      ib_req_notify_cq() so that it can return a hint about whether the a
      completion may have been added before the request for notification.
      The return value of ib_req_notify_cq() is extended so:
      
      	 < 0	means an error occurred while requesting notification
      	== 0	means notification was requested successfully, and if
      		IB_CQ_REPORT_MISSED_EVENTS was passed in, then no
      		events were missed and it is safe to wait for another
      		event.
      	 > 0	is only returned if IB_CQ_REPORT_MISSED_EVENTS was
      		passed in.  It means that the consumer must poll the
      		CQ again to make sure it is empty to avoid the race
      		described above.
      
      We add a flag to enable this behavior rather than turning it on
      unconditionally, because checking for missed events may incur
      significant overhead for some low-level drivers, and consumers that
      don't care about the results of this test shouldn't be forced to pay
      for the test.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      ed23a727
    • M
      IB: Add CQ comp_vector support · f4fd0b22
      Michael S. Tsirkin 提交于
      Add a num_comp_vectors member to struct ib_device and extend
      ib_create_cq() to pass in a comp_vector parameter -- this parallels
      the userspace libibverbs API.  Update all hardware drivers to set
      num_comp_vectors to 1 and have all ULPs pass 0 for the comp_vector
      value.  Pass the value of num_comp_vectors to userspace rather than
      hard-coding a value of 1.
      
      We want multiple CQ event vector support (via MSI-X or similar for
      adapters that can generate multiple interrupts), but it's not clear
      how many vectors we want, or how we want to deal with policy issues
      such as how to decide which vector to use or how to set up interrupt
      affinity.  This patch is useful for experimenting, since no core
      changes will be necessary when updating a driver to support multiple
      vectors, and we know that we want to make at least these changes
      anyway.
      Signed-off-by: NMichael S. Tsirkin <mst@dev.mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      f4fd0b22
    • R
      IB/ipath: Fix a race condition when generating ACKs · 154257f3
      Ralph Campbell 提交于
      Fix a problem where simple ACKs can be sent ahead of RDMA read
      responses thus implicitly NAKing the RDMA read.
      Signed-off-by: NRalph Campbell <ralph.cambpell@qlogic.com>
      Signed-off-by: NRobert Walsh <robert.walsh@qlogic.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      154257f3
    • R
      IB/ipath: Fix two more spin lock problems · 6ed89b95
      Ralph Campbell 提交于
      Fix a missing unlock in ipath_rc_rcv_resp() and remove an extra unlock
      from ipath_rc_rcv_error().
      Signed-off-by: NRalph Campbell <ralph.campbell@qlogic.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      6ed89b95
    • S
      RDMA/cxgb3: Support for new abort logic · aff9e39d
      Steve Wise 提交于
      The HW now posts 2 ABORT_RPL and/or PEER_ABORT_REQ messages.  We need
      to handle them by silenty dropping the 1st but mark that we're ready
      for the final message.  This plugs some close races between the uP and
      HW.  Also update the minimum required firmware version.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      aff9e39d
  2. 03 5月, 2007 1 次提交
    • J
      PCI: Cleanup the includes of <linux/pci.h> · 6473d160
      Jean Delvare 提交于
      I noticed that many source files include <linux/pci.h> while they do
      not appear to need it. Here is an attempt to clean it all up.
      
      In order to find all possibly affected files, I searched for all
      files including <linux/pci.h> but without any other occurence of "pci"
      or "PCI". I removed the include statement from all of these, then I
      compiled an allmodconfig kernel on both i386 and x86_64 and fixed the
      false positives manually.
      
      My tests covered 66% of the affected files, so there could be false
      positives remaining. Untested files are:
      
      arch/alpha/kernel/err_common.c
      arch/alpha/kernel/err_ev6.c
      arch/alpha/kernel/err_ev7.c
      arch/ia64/sn/kernel/huberror.c
      arch/ia64/sn/kernel/xpnet.c
      arch/m68knommu/kernel/dma.c
      arch/mips/lib/iomap.c
      arch/powerpc/platforms/pseries/ras.c
      arch/ppc/8260_io/enet.c
      arch/ppc/8260_io/fcc_enet.c
      arch/ppc/8xx_io/enet.c
      arch/ppc/syslib/ppc4xx_sgdma.c
      arch/sh64/mach-cayman/iomap.c
      arch/xtensa/kernel/xtensa_ksyms.c
      arch/xtensa/platform-iss/setup.c
      drivers/i2c/busses/i2c-at91.c
      drivers/i2c/busses/i2c-mpc.c
      drivers/media/video/saa711x.c
      drivers/misc/hdpuftrs/hdpu_cpustate.c
      drivers/misc/hdpuftrs/hdpu_nexus.c
      drivers/net/au1000_eth.c
      drivers/net/fec_8xx/fec_main.c
      drivers/net/fec_8xx/fec_mii.c
      drivers/net/fs_enet/fs_enet-main.c
      drivers/net/fs_enet/mac-fcc.c
      drivers/net/fs_enet/mac-fec.c
      drivers/net/fs_enet/mac-scc.c
      drivers/net/fs_enet/mii-bitbang.c
      drivers/net/fs_enet/mii-fec.c
      drivers/net/ibm_emac/ibm_emac_core.c
      drivers/net/lasi_82596.c
      drivers/parisc/hppb.c
      drivers/sbus/sbus.c
      drivers/video/g364fb.c
      drivers/video/platinumfb.c
      drivers/video/stifb.c
      drivers/video/valkyriefb.c
      include/asm-arm/arch-ixp4xx/dma.h
      sound/oss/au1550_ac97.c
      
      I would welcome test reports for these files. I am fine with removing
      the untested files from the patch if the general opinion is that these
      changes aren't safe. The tested part would still be nice to have.
      
      Note that this patch depends on another header fixup patch I submitted
      to LKML yesterday:
        [PATCH] scatterlist.h needs types.h
        http://lkml.org/lkml/2007/3/01/141Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: Badari Pulavarty <pbadari@us.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6473d160
  3. 01 5月, 2007 7 次提交
  4. 26 4月, 2007 6 次提交
  5. 25 4月, 2007 4 次提交
    • J
      IB: Set class_dev->dev in core for nice device symlink · 1912ffbb
      Joachim Fenkes 提交于
      All RDMA drivers except ehca set class_dev->dev to their dma_device
      value (ehca leaves this unset).  dma_device is the only value that
      makes any sense, so move this assignment to core/sysfs.c.  This reduce
      the duplicated code in the rest of the drivers and gives ehca a nice
      /sys/class/infiniband/ehcaX/device symlink.
      Signed-off-by: NJoachim Fenkes <fenkes@de.ibm.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      1912ffbb
    • J
      IB/ehca: Implement modify_port · c4ed790d
      Joachim Fenkes 提交于
      Add "Modify Port" verb support to eHCA driver.  The IB communication
      manager needs this to set the IsCM port capability bit when
      initializing.
      Signed-off-by: NJoachim Fenkes <fenkes@de.ibm.com>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      c4ed790d
    • R
      IB/mthca: Simplify CQ cleaning in mthca_free_qp() · 30c00986
      Roland Dreier 提交于
      mthca_free_qp() already has local variables to hold the QP's send_cq
      and recv_cq, so we can slightly clean up the calls to mthca_cq_clean()
      by using those local variables instead of expressions like
      to_mcq(qp->ibqp.send_cq).
      
      Also, by cleaning the recv_cq first, we can avoid worrying about
      whether the QP is attached to an SRQ for the second call, because we
      would only clean send_cq if send_cq is not equal to recv_cq, and that
      means send_cq cannot have any receive completions from the QP being
      destroyed.
      
      All this work even improves the generated code a bit:
      
      add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-5 (-5)
      function                                     old     new   delta
      mthca_free_qp                                510     505      -5
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      30c00986
    • R
      IB/mthca: Fix mthca_write_mtt() on HCAs with hidden memory · 532c3b58
      Roland Dreier 提交于
      Commit b2875d4c ("IB/mthca: Always fill MTTs from CPU") causes a crash
      in mthca_write_mtt() with non-memfree HCAs that have their memory
      hidden (that is, have only two PCI BARs instead of having a third BAR
      that allows access to the RAM attached to the HCA) on 64-bit
      architectures.  This is because the commit just before, c20e20ab
      ("IB/mthca: Merge MR and FMR space on 64-bit systems") makes
      dev->mr_table.fmr_mtt_buddy equal to &dev->mr_table.mtt_buddy and
      hence mthca_write_mtt() tries to write directly into the HCA's MTT
      table.  However, since that table is in the HCA's memory, this is
      impossible without the PCI BAR that gives access to that memory.
      
      This causes a crash because mthca_tavor_write_mtt_seg() basically
      tries to dereference some offset of a NULL pointer.  Fix this by
      adding a test of MTHCA_FLAG_FMR in mthca_write_mtt() so that we always
      use the WRITE_MTT firmware command rather than writing directly if
      FMRs are not enabled.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      532c3b58
  6. 19 4月, 2007 17 次提交