1. 26 3月, 2019 4 次提交
  2. 16 2月, 2019 1 次提交
  3. 09 2月, 2019 1 次提交
    • R
      iw_cxgb4: complete the cached SRQ buffers · 11a27e21
      Raju Rangoju 提交于
      If TP fetches an SRQ buffer but ends up not using it before the connection
      is aborted, then it passes the index of that SRQ buffer to the host in
      ABORT_REQ_RSS or ABORT_RPL CPL message.
      
      But, if the srqidx field is zero in the received ABORT_RPL or
      ABORT_REQ_RSS CPL, then we need to read the tcb.rq_start field to see if
      it really did have an RQE cached. This works around a case where HW does
      not include the srqidx in the ABORT_RPL/ABORT_REQ_RSS CPL.
      
      The final value of rq_start is the one present in TCB with the
      TF_RX_PDU_OUT bit cleared. So, we need to read the TCB, examine the
      TF_RX_PDU_OUT (bit 49 of t_flags) in order to determine if there's a rx
      PDU feedback event pending.
      Signed-off-by: NRaju Rangoju <rajur@chelsio.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      11a27e21
  4. 08 8月, 2018 1 次提交
  5. 31 7月, 2018 2 次提交
  6. 26 7月, 2018 2 次提交
  7. 14 7月, 2018 1 次提交
  8. 04 5月, 2018 1 次提交
  9. 28 4月, 2018 2 次提交
  10. 22 12月, 2017 1 次提交
  11. 14 12月, 2017 1 次提交
    • A
      infiniband: cxgb4: use ktime_get for timestamps · f8109d9e
      Arnd Bergmann 提交于
      The debugfs file prints the difference between host timestamps as a
      seconds/nanoseconds tuple, along with a 64-bit nanoseconds hardware
      timestamp. The host time is read using getnstimeofday() which is
      deprecated because of the y2038 overflow, and it suffers from time jumps
      during settimeofday() and leap seconds.
      
      Converting to ktime_get_ts64() would solve those two, but I'm going
      a little further here by changing to ktime_get() and printing 64-bit
      nanoseconds on both host and hw timestamps.  This simplifies the code
      further and makes the output easier to understand.
      
      The format of the debugfs file obviously changes here, but this should
      only be read by humans and not scripts, so I assume it's fine.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      f8109d9e
  12. 14 11月, 2017 2 次提交
    • B
      iw_cxgb4: Fix possible circular dependency locking warning · 1c8f1da5
      Bharat Potnuri 提交于
      Locking sequence of iw_cxgb4 and RoCE drivers in ib_register_device() is
      slightly different and this leads to possible circular dependency locking
      warning when both the devices are brought up.
      
      Here is the locking sequence upto ib_register_device():
      iw_cxgb4: rtnl_mutex(net stack) --> uld_mutex --> device_mutex
      RoCE drivers: device_mutex --> rtnl_mutex
      
      Here is the possibility of cross locking:
      
      	CPU #0 (iw_cxgb4) 		     CPU #1 (RoCE drivers)
      
      -> on interface up cxgb4_up()
      executed with rtnl_mutex held
      -> hold uld_mutex and try
      registering ib device
      					-> In ib_register_device() hold
      					   device_mutex
      -> hold device mutex in
      ib_register_device
      					-> try acquiring rtnl_mutex in
      					   ib_enum_roce_netdev()
      
      Current patch schedules the ib_register_device() functionality of
      iw_cxgb4 to a workqueue to prevent the possible cross-locking.
      Also rename the labels in c4iw_reister_device().
      Signed-off-by: NPotnuri Bharat Teja <bharat@chelsio.com>
      Reviewed-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      1c8f1da5
    • S
      iw_cxgb4: remove BUG_ON() usage. · ba97b749
      Steve Wise 提交于
      iw_cxgb4 has many BUG_ON()s that were left over from various enhancemnets
      made over the years.  Almost all of them should just be removed.  Some,
      however indicate a ULP usage error and can be handled w/o bringing down
      the system.
      
      If the condition cannot happen with correctly implemented cxgb4 sw/fw,
      then remove the BUG_ON.
      
      If the condition indicates a misbehaving ULP (like CQ overflows), add
      proper recovery logic.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Reviewed-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      ba97b749
  13. 18 10月, 2017 1 次提交
  14. 29 9月, 2017 5 次提交
    • S
      iw_cxgb4: add referencing to wait objects · 2015f26c
      Steve Wise 提交于
      For messages sent from the host to fw that solicit a reply from fw,
      the c4iw_wr_wait struct pointer is passed in the host->fw message, and
      included in the fw->host fw6_msg reply.  This allows the sender to wait
      until the reply is received, and the code processing the ingress reply
      to wake up the sender.
      
      If c4iw_wait_for_reply() times out, however, we need to keep the
      c4iw_wr_wait object around in case the reply eventually does arrive.
      Otherwise we have touch-after-free bugs in the wake_up paths.
      
      This was hit due to a bad kernel driver that blocked ingress processing
      of cxgb4 for a long time, causing iw_cxgb4 timeouts, but eventually
      resuming ingress processing and thus hitting the touch-after-free bug.
      
      So I want to fix iw_cxgb4 such that we'll at least keep the wait object
      around until the reply comes.  If it never comes we leak a small amount of
      memory, but if it does come late, we won't potentially crash the system.
      
      So add a kref struct in the c4iw_wr_wait struct, and take a reference
      before sending a message to FW that will generate a FW6 reply.  And remove
      the reference (and potentially free the wait object) when the reply
      is processed.
      
      The ep code also uses the wr_wait for non FW6 CPL messages and doesn't
      embed the c4iw_wr_wait object in the message sent to firmware.  So for
      those cases we add c4iw_wake_up_noref().
      
      The mr/mw, cq, and qp object create/destroy paths do need this reference
      logic.  For these paths, c4iw_ref_send_wait() is introduced to take the
      wr_wait reference, send the msg to fw, and then wait for the reply.
      
      So going forward, iw_cxgb4 either uses c4iw_ofld_send(),
      c4iw_wait_for_reply() and c4iw_wake_up_noref() like is done in the some
      of the endpoint logic, or c4iw_ref_send_wait() and c4iw_wake_up_deref()
      (formerly c4iw_wake_up()) when sending messages with the c4iw_wr_wait
      object pointer embedded in the message and resulting FW6 reply.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      2015f26c
    • S
      iw_cxgb4: allocate wait object for each ep object · ef885dc6
      Steve Wise 提交于
      Remove the embedded c4iw_wr_wait object in preparation for correctly
      handling timeouts.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      ef885dc6
    • S
      iw_cxgb4: allocate wait object for each qp object · 7088a9ba
      Steve Wise 提交于
      Remove the local stack allocated c4iw_wr_wait object in preparation for
      correctly handling timeouts.
      
      Also cleaned up some error path unwind logic to make it more readable.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      7088a9ba
    • S
      iw_cxgb4: allocate wait object for each cq object · 13ce8317
      Steve Wise 提交于
      Remove the local stack allocated c4iw_wr_wait object in preparation for
      correctly handling timeouts.
      
      Also cleaned up some error path unwind logic to make it more readable.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      13ce8317
    • S
      iw_cxgb4: allocate wait object for each memory object · a3f12da0
      Steve Wise 提交于
      Remove the local stack allocated c4iw_wr_wait object in preparation for
      correctly handling timeouts.
      
      Also refactored some code to simplify it and make errpath unwinding
      more readable.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      a3f12da0
  15. 27 9月, 2017 2 次提交
  16. 21 4月, 2017 2 次提交
  17. 02 3月, 2017 1 次提交
  18. 14 1月, 2017 1 次提交
    • P
      locking/atomic, kref: Add kref_read() · 2c935bc5
      Peter Zijlstra 提交于
      Since we need to change the implementation, stop exposing internals.
      
      Provide kref_read() to read the current reference count; typically
      used for debug messages.
      
      Kills two anti-patterns:
      
      	atomic_read(&kref->refcount)
      	kref->refcount.counter
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      2c935bc5
  19. 11 1月, 2017 2 次提交
    • S
      iw_cxgb4: free EQ queue memory on last deref · c12a67fe
      Steve Wise 提交于
      Commit ad61a4c7 ("iw_cxgb4: don't block in destroy_qp awaiting
      the last deref") introduced a bug where the RDMA QP EQ queue memory
      (and QIDs) are possibly freed before the underlying connection has been
      fully shutdown.  The result being a possible DMA read issued by HW after
      the queue memory has been unmapped and freed.  This results in possible
      WR corruption in the worst case, system bus errors if an IOMMU is in use,
      and SGE "bad WR" errors reported in the very least.  The fix is to defer
      unmap/free of queue memory and QID resources until the QP struct has
      been fully dereferenced.  To do this, the c4iw_ucontext must also be kept
      around until the last QP that references it is fully freed.  In addition,
      since the last QP deref can happen in an IRQ disabled context, we need
      a new workqueue thread to do the final unmap/free of the EQ queue memory.
      
      Fixes: ad61a4c7 ("iw_cxgb4: don't block in destroy_qp awaiting the last deref")
      Cc: stable@vger.kernel.org
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      c12a67fe
    • S
      iw_cxgb4: refactor sq/rq drain logic · 4fe7c296
      Steve Wise 提交于
      With the addition of the IB/Core drain API, iw_cxgb4 supported drain
      by watching the CQs when the QP was out of RTS and signalling "drain
      complete" when the last CQE is polled.  This, however, doesn't fully
      support the drain semantics. Namely, the drain logic is supposed to signal
      "drain complete" only when the application has _processed_ the last CQE,
      not just removed them from the CQ.  Thus a small timing hole exists that
      can cause touch after free type bugs in applications using the drain API
      (nvmf, iSER, for example).  So iw_cxgb4 needs a better solution.
      
      The iWARP Verbs spec mandates that "_at some point_ after the QP is
      moved to ERROR", the iWARP driver MUST synchronously fail post_send and
      post_recv calls.  iw_cxgb4 was currently not allowing any posts once the
      QP is in ERROR.  This was in part due to the fact that the HW queues for
      the QP in ERROR state are disabled at this point, so there wasn't much
      else to do but fail the post operation synchronously.  This restriction
      is what drove the first drain implementation in iw_cxgb4 that has the
      above mentioned flaw.
      
      This patch changes iw_cxgb4 to allow post_send and post_recv WRs after
      the QP is moved to ERROR state for kernel mode users, thus still adhering
      to the Verbs spec for user mode users, but allowing flush WRs for kernel
      users.  Since the HW queues are disabled, we just synthesize a CQE for
      this post, queue it to the SW CQ, and then call the CQ event handler.
      This enables proper drain operations for the various storage applications.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      4fe7c296
  20. 17 11月, 2016 1 次提交
  21. 08 10月, 2016 1 次提交
  22. 16 9月, 2016 1 次提交
  23. 04 9月, 2016 1 次提交
  24. 03 8月, 2016 1 次提交
  25. 23 6月, 2016 2 次提交