1. 03 10月, 2018 4 次提交
    • C
      xprtrdma: Explicitly resetting MRs is no longer necessary · 61da886b
      Chuck Lever 提交于
      When a memory operation fails, the MR's driver state might not match
      its hardware state. The only reliable recourse is to dereg the MR.
      This is done in ->ro_recover_mr, which then attempts to allocate a
      fresh MR to replace the released MR.
      
      Since commit e2ac236c ("xprtrdma: Allocate MRs on demand"),
      xprtrdma dynamically allocates MRs. It can add more MRs whenever
      they are needed.
      
      That makes it possible to simply release an MR when a memory
      operation fails, instead of "recovering" it. It will automatically
      be replaced by the on-demand MR allocator.
      
      This commit is a little larger than I wanted, but it replaces
      ->ro_recover_mr, rb_recovery_lock, rb_recovery_worker, and the
      rb_stale_mrs list with a generic work queue.
      
      Since MRs are no longer orphaned, the mrs_orphaned metric is no
      longer used.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      61da886b
    • C
      xprtrdma: Create more MRs at a time · c421ece6
      Chuck Lever 提交于
      Some devices require more than 3 MRs to build a single 1MB I/O.
      Ensure that rpcrdma_mrs_create() will add enough MRs to build that
      I/O.
      
      In a subsequent patch I'm changing the MR recovery logic to just
      toss out the MRs. In that case it's possible for ->send_request to
      loop acquiring some MRs, not getting enough, getting called again,
      recycling the previous MRs, then not getting enough, lather rinse
      repeat. Thus first we need to ensure enough MRs are created to
      prevent that loop.
      
      I'm "reusing" ia->ri_max_segs. All of its accessors seem to want the
      maximum number of data segments plus two, so I'm going to bake that
      into the initial calculation.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      c421ece6
    • C
      xprtrdma: Reset credit grant properly after a disconnect · ef739b21
      Chuck Lever 提交于
      On a fresh connection, an RPC/RDMA client is supposed to send only
      one RPC Call until it gets a credit grant in the first RPC Reply
      from the server [RFC 8166, Section 3.3.3].
      
      There is a bug in the Linux client's credit accounting mechanism
      introduced by commit e7ce710a ("xprtrdma: Avoid deadlock when
      credit window is reset"). On connect, it simply dumps all pending
      RPC Calls onto the new connection.
      
      Servers have been tolerant of this bad behavior. Currently no server
      implementation ever changes its credit grant over reconnects, and
      servers always repost enough Receives before connections are fully
      established.
      
      To correct this issue, ensure that the client resets both the credit
      grant _and_ the congestion window when handling a reconnect.
      
      Fixes: e7ce710a ("xprtrdma: Avoid deadlock when credit ... ")
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Cc: stable@kernel.org
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      ef739b21
    • C
      xprtrdma: xprt_release_rqst_cong is called outside of transport_lock · 91ca1866
      Chuck Lever 提交于
      Since commit ce7c252a ("SUNRPC: Add a separate spinlock to
      protect the RPC request receive list") the RPC/RDMA reply handler
      has been calling xprt_release_rqst_cong without holding
      xprt->transport_lock.
      
      I think the only way this call is ever made is if the credit grant
      increases and there are RPCs pending. Current server implementations
      do not change their credit grant during operation (except at
      connect time).
      
      Commit e7ce710a ("xprtrdma: Avoid deadlock when credit window is
      reset") added the ->release_rqst call because UDP invokes
      xprt_adjust_cwnd(), which calls __xprt_put_cong() after adjusting
      xprt->cwnd. Both xprt_release() and ->xprt_release_xprt already wake
      another task in this case, so it is safe to remove this call from
      the reply handler.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      91ca1866
  2. 30 9月, 2018 8 次提交
  3. 29 9月, 2018 12 次提交
  4. 28 9月, 2018 11 次提交
  5. 27 9月, 2018 5 次提交