1. 03 11月, 2015 1 次提交
    • C
      xprtrdma: Prevent loss of completion signals · 4220a072
      Chuck Lever 提交于
      Commit 8301a2c0 ("xprtrdma: Limit work done by completion
      handler") was supposed to prevent xprtrdma's upcall handlers from
      starving other softIRQ work by letting them return to the provider
      before all CQEs have been polled.
      
      The logic assumes the provider will call the upcall handler again
      immediately if the CQ is re-armed while there are still queued CQEs.
      
      This assumption is invalid. The IBTA spec says that after a CQ is
      armed, the hardware must interrupt only when a new CQE is inserted.
      xprtrdma can't rely on the provider calling again, even though some
      providers do.
      
      Therefore, leaving CQEs on queue makes sense only when there is
      another mechanism that ensures all remaining CQEs are consumed in a
      timely fashion. xprtrdma does not have such a mechanism. If a CQE
      remains queued, the transport can wait forever to send the next RPC.
      
      Finally, move the wcs array back onto the stack to ensure that the
      poll array is always local to the CPU where the completion upcall is
      running.
      
      Fixes: 8301a2c0 ("xprtrdma: Limit work done by completion ...")
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Reviewed-by: NSagi Grimberg <sagig@mellanox.com>
      Reviewed-by: NDevesh Sharma <devesh.sharma@avagotech.com>
      Tested-By: NDevesh Sharma <devesh.sharma@avagotech.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      4220a072
  2. 25 9月, 2015 1 次提交
  3. 11 8月, 2015 1 次提交
  4. 06 8月, 2015 5 次提交
  5. 13 6月, 2015 9 次提交
  6. 05 6月, 2015 2 次提交
  7. 31 3月, 2015 11 次提交
  8. 24 2月, 2015 1 次提交
    • C
      xprtrdma: Store RDMA credits in unsigned variables · 9b1dcbc8
      Chuck Lever 提交于
      Dan Carpenter's static checker pointed out:
      
         net/sunrpc/xprtrdma/rpc_rdma.c:879 rpcrdma_reply_handler()
         warn: can 'credits' be negative?
      
      "credits" is defined as an int. The credits value comes from the
      server as a 32-bit unsigned integer.
      
      A malicious or broken server can plant a large unsigned integer in
      that field which would result in an underflow in the following
      logic, potentially triggering a deadlock of the mount point by
      blocking the client from issuing more RPC requests.
      
      net/sunrpc/xprtrdma/rpc_rdma.c:
      
        876          credits = be32_to_cpu(headerp->rm_credit);
        877          if (credits == 0)
        878                  credits = 1;    /* don't deadlock */
        879          else if (credits > r_xprt->rx_buf.rb_max_requests)
        880                  credits = r_xprt->rx_buf.rb_max_requests;
        881
        882          cwnd = xprt->cwnd;
        883          xprt->cwnd = credits << RPC_CWNDSHIFT;
        884          if (xprt->cwnd > cwnd)
        885                  xprt_release_rqst_cong(rqst->rq_task);
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Fixes: eba8ff66 ("xprtrdma: Move credit update to RPC . . .")
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      9b1dcbc8
  9. 06 2月, 2015 1 次提交
  10. 30 1月, 2015 8 次提交