1. 16 7月, 2014 1 次提交
  2. 11 6月, 2014 1 次提交
    • H
      iw_cxgb4: Allocate and use IQs specifically for indirect interrupts · cf38be6d
      Hariprasad Shenai 提交于
      Currently indirect interrupts for RDMA CQs funnel through the LLD's RDMA
      RXQs, which also handle direct interrupts for offload CPLs during RDMA
      connection setup/teardown.  The intended T4 usage model, however, is to
      have indirect interrupts flow through dedicated IQs. IE not to mix
      indirect interrupts with CPL messages in an IQ.  This patch adds the
      concept of RDMA concentrator IQs, or CIQs, setup and maintained by the
      LLD and exported to iw_cxgb4 for use when creating CQs. RDMA CPLs will
      flow through the LLD's RDMA RXQs, and CQ interrupts flow through the
      CIQs.
      
      Design:
      
      cxgb4 creates and exports an array of CIQs for the RDMA ULD.  These IQs
      are sized according to the max available CQs available at adapter init.
      In addition, these IQs don't need FL buffers since they only service
      indirect interrupts.  One CIQ is setup per RX channel similar to the
      RDMA RXQs.
      
      iw_cxgb4 will utilize these CIQs based on the vector value passed into
      create_cq().  The num_comp_vectors advertised by iw_cxgb4 will be the
      number of CIQs configured, and thus the vector value will be the index
      into the array of CIQs.
      
      Based on original work by Steve Wise <swise@opengridcomputing.com>
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NHariprasad Shenai <hariprasad@chelsio.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cf38be6d
  3. 30 5月, 2014 1 次提交
    • Y
      RDMA/cxgb4: Add missing padding at end of struct c4iw_create_cq_resp · b6f04d3d
      Yann Droneaud 提交于
      The i386 ABI disagrees with most other ABIs regarding alignment of
      data types larger than 4 bytes: on most ABIs a padding must be added
      at end of the structures, while it is not required on i386.
      
      So for most ABI struct c4iw_create_cq_resp gets implicitly padded
      to be aligned on a 8 bytes multiple, while for i386, such padding
      is not added.
      
      The tool pahole can be used to find such implicit padding:
      
        $ pahole --anon_include \
                 --nested_anon_include \
                 --recursive \
                 --class_name c4iw_create_cq_resp \
                 drivers/infiniband/hw/cxgb4/iw_cxgb4.o
      
      Then, structure layout can be compared between i386 and x86_64:
      
        +++ obj-i386/drivers/infiniband/hw/cxgb4/iw_cxgb4.o.pahole.txt   2014-03-28 11:43:05.547432195 +0100
        --- obj-x86_64/drivers/infiniband/hw/cxgb4/iw_cxgb4.o.pahole.txt 2014-03-28 10:55:10.990133017 +0100
        @@ -14,9 +13,8 @@ struct c4iw_create_cq_resp {
                __u32                      size;                 /*    28     4 */
                __u32                      qid_mask;             /*    32     4 */
      
        -       /* size: 36, cachelines: 1, members: 6 */
        -       /* last cacheline: 36 bytes */
        +       /* size: 40, cachelines: 1, members: 6 */
        +       /* padding: 4 */
        +       /* last cacheline: 40 bytes */
         };
      
      This ABI disagreement will make an x86_64 kernel try to write past the
      buffer provided by an i386 binary.
      
      When boundary check will be implemented, the x86_64 kernel will refuse
      to write past the i386 userspace provided buffer and the uverbs will
      fail.
      
      If the structure is on a page boundary and the next page is not
      mapped, ib_copy_to_udata() will fail and the uverb will fail.
      
      This patch adds an explicit padding at end of structure
      c4iw_create_cq_resp, and, like 92b0ca7c ("IB/mlx5: Fix stack info
      leak in mlx5_ib_alloc_ucontext()"), makes function c4iw_create_cq()
      not writting this padding field to userspace. This way, x86_64 kernel
      will be able to write struct c4iw_create_cq_resp as expected by
      unpatched and patched i386 libcxgb4.
      
      Link: http://marc.info/?i=cover.1399309513.git.ydroneaud@opteya.com
      Cc: <stable@vger.kernel.org>
      Fixes: cfdda9d7 ("RDMA/cxgb4: Add driver for Chelsio T4 RNIC")
      Fixes: e24a72a3 ("RDMA/cxgb4: Fix four byte info leak in c4iw_create_cq()")
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NYann Droneaud <ydroneaud@opteya.com>
      Acked-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      b6f04d3d
  4. 12 4月, 2014 2 次提交
    • S
      RDMA/cxgb4: Use uninitialized_var() · 97df1c67
      Steve Wise 提交于
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      97df1c67
    • S
      RDMA/cxgb4: SQ flush fix · b4e2901c
      Steve Wise 提交于
      There is a race when moving a QP from RTS->CLOSING where a SQ work
      request could be posted after the FW receives the RDMA_RI/FINI WR.
      The SQ work request will never get processed, and should be completed
      with FLUSHED status.  Function c4iw_flush_sq(), however was dropping
      the oldest SQ work request when in CLOSING or IDLE states, instead of
      completing the pending work request. If that oldest pending work
      request was actually complete and has a CQE in the CQ, then when that
      CQE is proceessed in poll_cq, we'll BUG_ON() due to the inconsistent
      SQ/CQ state.
      
      This is a very small timing hole and has only been hit once so far.
      
      The fix is two-fold:
      
      1) c4iw_flush_sq() MUST always flush all non-completed WRs with FLUSHED
         status regardless of the QP state.
      
      2) In c4iw_modify_rc_qp(), always set the "in error" bit on the queue
         before moving the state out of RTS.  This ensures that the state
         transition will not happen while another thread is in
         post_rc_send(), because set_state() and post_rc_send() both aquire
         the qp spinlock.  Also, once we transition the state out of RTS,
         subsequent calls to post_rc_send() will fail because the "in error"
         bit is set.  I don't think this fully closes the race where the FW
         can get a FINI followed a SQ work request being posted (because
         they are posted to differente EQs), but the #1 fix will handle the
         issue by flushing the SQ work request.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      b4e2901c
  5. 25 3月, 2014 1 次提交
  6. 21 3月, 2014 3 次提交
  7. 14 8月, 2013 2 次提交
    • S
      RDMA/cxgb4: Fix accounting for unsignaled SQ WRs to deal with wrap · 27ca34f5
      Steve Wise 提交于
      When determining how many WRs are completed with a signaled CQE,
      correctly deal with queue wraps.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NVipul Pandya <vipul@chelsio.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      27ca34f5
    • S
      RDMA/cxgb4: Fix QP flush logic · 1cf24dce
      Steve Wise 提交于
      This patch makes following fixes in QP flush logic:
      
      - correctly flushes unsignaled WRs followed by a signaled WR
      - supports for flushing a CQ bound to multiple QPs
      - resets cidx_flush if a active queue starts getting HW CQEs again
      - marks WQ in error when we leave RTS. This was only being done for
        user queues, but we need it for kernel queues too so that
        post_send/post_recv will start returning the appropriate error
        synchronously
      - eats unsignaled read resp CQEs. HW always inserts CQEs so we must
        silently discard them if the read work request was unsignaled.
      - handles QP flushes with pending SW CQEs. The flush and out of order
        completion logic has a bug where if out of order completions are
        flushed but not yet polled by the consumer and the qp is then
        flushed then we end up inserting duplicate completions.
      - c4iw_flush_sq() should only flush wrs that have not already been
        flushed.  Since we already track where in the SQ we've flushed via
        sq.cidx_flush, just start at that point and flush any remaining.
        This bug only caused a problem in the presence of unsignaled work
        requests.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NVipul Pandya <vipul@chelsio.com>
      
      [ Fixed sparse warning due to htonl/ntohl confusion.  - Roland ]
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      1cf24dce
  8. 29 11月, 2011 1 次提交
  9. 01 11月, 2011 1 次提交
  10. 15 10月, 2011 1 次提交
  11. 18 6月, 2011 1 次提交
  12. 29 9月, 2010 2 次提交
  13. 28 9月, 2010 1 次提交
    • R
      RDMA/cxgb4: Fix warnings about casts to/from pointers of different sizes · c8e081a1
      Roland Dreier 提交于
      Fix:
      
        drivers/infiniband/hw/cxgb4/qp.c: In function ‘create_qp’:
        drivers/infiniband/hw/cxgb4/qp.c:147: warning: cast from pointer to integer of different size
        drivers/infiniband/hw/cxgb4/qp.c: In function ‘rdma_fini’:
        drivers/infiniband/hw/cxgb4/qp.c:988: warning: cast from pointer to integer of different size
        drivers/infiniband/hw/cxgb4/qp.c: In function ‘rdma_init’:
        drivers/infiniband/hw/cxgb4/qp.c:1063: warning: cast from pointer to integer of different size
        drivers/infiniband/hw/cxgb4/mem.c: In function ‘write_adapter_mem’:
        drivers/infiniband/hw/cxgb4/mem.c:74: warning: cast from pointer to integer of different size
        drivers/infiniband/hw/cxgb4/cq.c: In function ‘destroy_cq’:
        drivers/infiniband/hw/cxgb4/cq.c:58: warning: cast from pointer to integer of different size
        drivers/infiniband/hw/cxgb4/cq.c: In function ‘create_cq’:
        drivers/infiniband/hw/cxgb4/cq.c:135: warning: cast from pointer to integer of different size
        drivers/infiniband/hw/cxgb4/cm.c: In function ‘fw6_msg’:
        drivers/infiniband/hw/cxgb4/cm.c:2326: warning: cast to pointer from integer of different size
      
      by casting pointers to unsigned long instead of u64.
      Reported-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      c8e081a1
  14. 22 7月, 2010 1 次提交
  15. 07 7月, 2010 2 次提交
  16. 25 5月, 2010 2 次提交
  17. 22 4月, 2010 1 次提交