1. 29 4月, 2008 1 次提交
    • A
      IB: expand ib_umem_get() prototype · cb9fbc5c
      Arthur Kepner 提交于
      Add a new parameter, dmasync, to the ib_umem_get() prototype.  Use dmasync = 1
      when mapping user-allocated CQs with ib_umem_get().
      Signed-off-by: NArthur Kepner <akepner@sgi.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Jes Sorensen <jes@sgi.com>
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Roland Dreier <rdreier@cisco.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: David Miller <davem@davemloft.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Grant Grundler <grundler@parisc-linux.org>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cb9fbc5c
  2. 20 4月, 2008 1 次提交
  3. 17 4月, 2008 2 次提交
  4. 05 2月, 2008 2 次提交
    • J
      IB/mthca: Don't read reserved fields in mthca_QUERY_ADAPTER() · 6ccef1de
      Jack Morgenstein 提交于
      For memfree devices, the firmware QUERY_ADAPTER command does not
      return vendor_id, device_id, and revision_id; do not return these
      fields in the QUERY_ADAPTER function for memfree devices.
      
      Instead, for memfree devices, initialize the rev_id field of the mthca
      device via init_node_data (MAD IFC query), as is done in the
      query_device verb implementation.
      Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      6ccef1de
    • R
      IB/mthca: Fix and simplify page size calculation in mthca_reg_phys_mr() · 0d89fe2c
      Roland Dreier 提交于
          
      In mthca_reg_phys_mr(), we calculate the page size for the HCA
      hardware to use to map the buffer list passed in by the consumer.
      For example, if the consumer passes in
      
          [0] addr 0x1000, size 0x1000
          [1] addr 0x2000, size 0x1000
      
      then the algorithm would come up with a page size of 0x2000 and a list
      of two pages, at 0x0000 and 0x2000.  Usually, this would work fine
      since the memory region would start at an offset of 0x1000 and have a
      length of 0x2000.
      
      However, the old code did not take into account the alignment of the
      IO virtual address passed in.  For example, if the consumer passed in
      a virtual address of 0x6000 for the above, then the offset of 0x1000
      would not be used correctly because the page mask of 0x1fff would
      result in an offset of 0.
      
      We can fix this quite neatly by making sure that the page shift we use
      is no bigger than the first bit where the start of the first buffer
      and the IO virtual address differ.  Also, we can further simplify the
      code by removing the special case for a single buffer by noticing that
      it doesn't matter if we use a page size that is too big.  This allows
      the loop to compute the page shift to be replaced with __ffs().
      
      Thanks to Bryan S Rosenburg <rosnbrg@us.ibm.com> for pointing out the
      original bug and suggesting several ways to improve this patch.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      0d89fe2c
  5. 09 5月, 2007 1 次提交
    • R
      IB/uverbs: Export ib_umem_get()/ib_umem_release() to modules · f7c6a7b5
      Roland Dreier 提交于
      Export ib_umem_get()/ib_umem_release() and put low-level drivers in
      control of when to call ib_umem_get() to pin and DMA map userspace,
      rather than always calling it in ib_uverbs_reg_mr() before calling the
      low-level driver's reg_user_mr method.
      
      Also move these functions to be in the ib_core module instead of
      ib_uverbs, so that driver modules using them do not depend on
      ib_uverbs.
      
      This has a number of advantages:
       - It is better design from the standpoint of making generic code a
         library that can be used or overridden by device-specific code as
         the details of specific devices dictate.
       - Drivers that do not need to pin userspace memory regions do not
         need to take the performance hit of calling ib_mem_get().  For
         example, although I have not tried to implement it in this patch,
         the ipath driver should be able to avoid pinning memory and just
         use copy_{to,from}_user() to access userspace memory regions.
       - Buffers that need special mapping treatment can be identified by
         the low-level driver.  For example, it may be possible to solve
         some Altix-specific memory ordering issues with mthca CQs in
         userspace by mapping CQ buffers with extra flags.
       - Drivers that need to pin and DMA map userspace memory for things
         other than memory regions can use ib_umem_get() directly, instead
         of hacks using extra parameters to their reg_phys_mr method.  For
         example, the mlx4 driver that is pending being merged needs to pin
         and DMA map QP and CQ buffers, but it does not need to create a
         memory key for these buffers.  So the cleanest solution is for mlx4
         to call ib_umem_get() in the create_qp and create_cq methods.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      f7c6a7b5
  6. 07 5月, 2007 1 次提交
    • 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
  7. 25 4月, 2007 1 次提交
  8. 13 2月, 2007 1 次提交
  9. 31 12月, 2006 1 次提交
  10. 09 12月, 2006 1 次提交
    • D
      [PATCH] LOG2: Implement a general integer log2 facility in the kernel · f0d1b0b3
      David Howells 提交于
      This facility provides three entry points:
      
      	ilog2()		Log base 2 of unsigned long
      	ilog2_u32()	Log base 2 of u32
      	ilog2_u64()	Log base 2 of u64
      
      These facilities can either be used inside functions on dynamic data:
      
      	int do_something(long q)
      	{
      		...;
      		y = ilog2(x)
      		...;
      	}
      
      Or can be used to statically initialise global variables with constant values:
      
      	unsigned n = ilog2(27);
      
      When performing static initialisation, the compiler will report "error:
      initializer element is not constant" if asked to take a log of zero or of
      something not reducible to a constant.  They treat negative numbers as
      unsigned.
      
      When not dealing with a constant, they fall back to using fls() which permits
      them to use arch-specific log calculation instructions - such as BSR on
      x86/x86_64 or SCAN on FRV - if available.
      
      [akpm@osdl.org: MMC fix]
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Wojtek Kaniewski <wojtekka@toxygen.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f0d1b0b3
  11. 30 11月, 2006 1 次提交
  12. 11 10月, 2006 1 次提交
  13. 23 9月, 2006 1 次提交
  14. 19 8月, 2006 1 次提交
    • R
      IB/mthca: No userspace SRQs if HCA doesn't have SRQ support · 5beba532
      Roland Dreier 提交于
      Leave all SRQ methods out of the device's uverbs_cmd_mask if the
      device doesn't have SRQ support (because of ancient firmware) so that
      we don't allow userspace to call the driver's create_srq method.  This
      fixes a userspace-triggerable oops caused by ib_uverbs_create_srq()
      following the device's ->create_srq function pointer, which will be
      NULL if the device doesn't support SRQs.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      5beba532
  15. 18 6月, 2006 2 次提交
  16. 02 5月, 2006 1 次提交
  17. 13 4月, 2006 1 次提交
    • J
      IB/mthca: Fix max_srq_sge returned by ib_query_device for Tavor devices · 59fef3b1
      Jack Morgenstein 提交于
      The driver allocates SRQ WQEs size with a power of 2 size both for
      Tavor and for memfree. For Tavor, however, the hardware only requires
      the WQE size to be a multiple of 16, not a power of 2, and the max
      number of scatter-gather allowed is reported accordingly by the
      firmware (and this is the value currently returned by
      ib_query_device() and ibv_query_device()).
      
      If the max number of scatter/gather entries reported by the FW is used
      when creating an SRQ, the creation will fail for Tavor, since the
      required WQE size will be increased to the next power of 2, which
      turns out to be larger than the device permitted max WQE size (which
      is not a power of 2).
      
      This patch reduces the reported SRQ max wqe size so that it can be used
      successfully in creating an SRQ on Tavor HCAs.
      Signed-off-by: NJack Morgenstein <jackm@mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      59fef3b1
  18. 21 3月, 2006 5 次提交
  19. 31 1月, 2006 1 次提交
  20. 13 1月, 2006 1 次提交
  21. 10 1月, 2006 4 次提交
  22. 11 11月, 2005 1 次提交
  23. 05 11月, 2005 1 次提交
  24. 03 11月, 2005 1 次提交
  25. 28 10月, 2005 1 次提交
    • R
      [IB] mthca: first pass at catastrophic error reporting · 3d155f8c
      Roland Dreier 提交于
      Add some initial support for detecting and reporting catastrophic
      errors reported by Mellanox HCAs.  We start a periodic timer which
      polls the catastrophic error reporting buffer in device memory.  If an
      error is detected, we dump the contents of the buffer for port-mortem
      debugging, and report a fatal asynchronous error to higher levels.
      
      In the future we can try to recover from these errors by resetting the
      device, but this will require some work in higher-level code as well.
      Let's get this in now, so that we at least get catastrophic errors
      reported in logs.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      3d155f8c
  26. 18 10月, 2005 5 次提交