1. 12 4月, 2014 4 次提交
    • 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
    • S
      RDMA/cxgb4: rmb() after reading valid gen bit · def4771f
      Steve Wise 提交于
      Some HW platforms can reorder read operations, so we must rmb() after
      we see a valid gen bit in a CQE but before we read any other fields
      from the CQE.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      def4771f
    • S
      RDMA/cxgb4: Endpoint timeout fixes · b33bd0cb
      Steve Wise 提交于
      1) timedout endpoint processing can be starved. If there are continual
         CPL messages flowing into the driver, the endpoint timeout
         processing can be starved.  This condition exposed the other bugs
         below.
      
      Solution: In process_work(), call process_timedout_eps() after each CPL
      is processed.
      
      2) Connection events can be processed even though the endpoint is on
         the timeout list.  If the endpoint is scheduled for timeout
         processing, then we must ignore MPA Start Requests and Replies.
      
      Solution: Change stop_ep_timer() to return 1 if the ep has already been
      queued for timeout processing.  All the callers of stop_ep_timer() need
      to check this and act accordingly.  There are just a few cases where
      the caller needs to do something different if stop_ep_timer() returns 1:
      
      1) in process_mpa_reply(), ignore the reply and  process_timeout()
         will abort the connection.
      
      2) in process_mpa_request, ignore the request and process_timeout()
         will abort the connection.
      
      It is ok for callers of stop_ep_timer() to abort the connection since
      that will leave the state in ABORTING or DEAD, and process_timeout()
      now ignores timeouts when the ep is in these states.
      
      3) Double insertion on the timeout list.  Since the endpoint timers
         are used for connection setup and teardown, we need to guard
         against the possibility that an endpoint is already on the timeout
         list.  This is a rare condition and only seen under heavy load and
         in the presense of the above 2 bugs.
      
      Solution: In ep_timeout(), don't queue the endpoint if it is already on
      the queue.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      b33bd0cb
    • S
      RDMA/cxgb4: Use the BAR2/WC path for kernel QPs and T5 devices · fa658a98
      Steve Wise 提交于
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      
      [ Fix cast from u64* to integer.  - Roland ]
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      fa658a98
  2. 02 4月, 2014 4 次提交
  3. 29 3月, 2014 1 次提交
  4. 25 3月, 2014 5 次提交
  5. 21 3月, 2014 9 次提交
  6. 15 3月, 2014 2 次提交
    • S
      cxgb4/iw_cxgb4: Doorbell Drop Avoidance Bug Fixes · 05eb2389
      Steve Wise 提交于
      The current logic suffers from a slow response time to disable user DB
      usage, and also fails to avoid DB FIFO drops under heavy load. This commit
      fixes these deficiencies and makes the avoidance logic more optimal.
      This is done by more efficiently notifying the ULDs of potential DB
      problems, and implements a smoother flow control algorithm in iw_cxgb4,
      which is the ULD that puts the most load on the DB fifo.
      
      Design:
      
      cxgb4:
      
      Direct ULD callback from the DB FULL/DROP interrupt handler.  This allows
      the ULD to stop doing user DB writes as quickly as possible.
      
      While user DB usage is disabled, the LLD will accumulate DB write events
      for its queues.  Then once DB usage is reenabled, a single DB write is
      done for each queue with its accumulated write count.  This reduces the
      load put on the DB fifo when reenabling.
      
      iw_cxgb4:
      
      Instead of marking each qp to indicate DB writes are disabled, we create
      a device-global status page that each user process maps.  This allows
      iw_cxgb4 to only set this single bit to disable all DB writes for all
      user QPs vs traversing the idr of all the active QPs.  If the libcxgb4
      doesn't support this, then we fall back to the old approach of marking
      each QP.  Thus we allow the new driver to work with an older libcxgb4.
      
      When the LLD upcalls iw_cxgb4 indicating DB FULL, we disable all DB writes
      via the status page and transition the DB state to STOPPED.  As user
      processes see that DB writes are disabled, they call into iw_cxgb4
      to submit their DB write events.  Since the DB state is in STOPPED,
      the QP trying to write gets enqueued on a new DB "flow control" list.
      As subsequent DB writes are submitted for this flow controlled QP, the
      amount of writes are accumulated for each QP on the flow control list.
      So all the user QPs that are actively ringing the DB get put on this
      list and the number of writes they request are accumulated.
      
      When the LLD upcalls iw_cxgb4 indicating DB EMPTY, which is in a workq
      context, we change the DB state to FLOW_CONTROL, and begin resuming all
      the QPs that are on the flow control list.  This logic runs on until
      the flow control list is empty or we exit FLOW_CONTROL mode (due to
      a DB DROP upcall, for example).  QPs are removed from this list, and
      their accumulated DB write counts written to the DB FIFO.  Sets of QPs,
      called chunks in the code, are removed at one time. The chunk size is 64.
      So 64 QPs are resumed at a time, and before the next chunk is resumed, the
      logic waits (blocks) for the DB FIFO to drain.  This prevents resuming to
      quickly and overflowing the FIFO.  Once the flow control list is empty,
      the db state transitions back to NORMAL and user QPs are again allowed
      to write directly to the user DB register.
      
      The algorithm is designed such that if the DB write load is high enough,
      then all the DB writes get submitted by the kernel using this flow
      controlled approach to avoid DB drops.  As the load lightens though, we
      resume to normal DB writes directly by user applications.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05eb2389
    • S
      cxgb4/iw_cxgb4: Treat CPL_ERR_KEEPALV_NEG_ADVICE as negative advice · 7a2cea2a
      Steve Wise 提交于
      Based on original work by Anand Priyadarshee <anandp@chelsio.com>.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7a2cea2a
  7. 05 3月, 2014 1 次提交
  8. 14 2月, 2014 1 次提交
  9. 23 1月, 2014 1 次提交
  10. 23 12月, 2013 3 次提交
  11. 16 12月, 2013 1 次提交
  12. 09 11月, 2013 1 次提交
  13. 14 8月, 2013 7 次提交