1. 02 5月, 2021 1 次提交
    • C
      xprtrdma: Fix a NULL dereference in frwr_unmap_sync() · 9e895cd9
      Chuck Lever 提交于
      The normal mechanism that invalidates and unmaps MRs is
      frwr_unmap_async(). frwr_unmap_sync() is used only when an RPC
      Reply bearing Write or Reply chunks has been lost (ie, almost
      never).
      
      Coverity found that after commit 9a301caf ("xprtrdma: Move
      fr_linv_done field to struct rpcrdma_mr"), the while() loop in
      frwr_unmap_sync() exits only once @mr is NULL, unconditionally
      causing subsequent dereferences of @mr to Oops.
      
      I've tested this fix by creating a client that skips invoking
      frwr_unmap_async() when RPC Replies complete. That forces all
      invalidation tasks to fall upon frwr_unmap_sync(). Simple workloads
      with this fix applied to the adulterated client work as designed.
      Reported-by: Ncoverity-bot <keescook+coverity-bot@chromium.org>
      Addresses-Coverity-ID: 1504556 ("Null pointer dereferences")
      Fixes: 9a301caf ("xprtrdma: Move fr_linv_done field to struct rpcrdma_mr")
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      9e895cd9
  2. 26 4月, 2021 13 次提交
  3. 06 2月, 2021 2 次提交
  4. 11 11月, 2020 5 次提交
  5. 22 9月, 2020 1 次提交
  6. 14 7月, 2020 1 次提交
  7. 22 6月, 2020 1 次提交
  8. 27 3月, 2020 6 次提交
  9. 14 2月, 2020 1 次提交
  10. 15 1月, 2020 3 次提交
  11. 24 10月, 2019 4 次提交
    • C
      xprtrdma: Move the rpcrdma_sendctx::sc_wr field · dc15c3d5
      Chuck Lever 提交于
      Clean up: This field is not needed in the Send completion handler,
      so it can be moved to struct rpcrdma_req to reduce the size of
      struct rpcrdma_sendctx, and to reduce the amount of memory that
      is sloshed between the sending process and the Send completion
      process.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      dc15c3d5
    • C
      xprtrdma: Ensure ri_id is stable during MR recycling · 15d9b015
      Chuck Lever 提交于
      ia->ri_id is replaced during a reconnect. The connect_worker runs
      with the transport send lock held to prevent ri_id from being
      dereferenced by the send_request path during this process.
      
      Currently, however, there is no guarantee that ia->ri_id is stable
      in the MR recycling worker, which operates in the background and is
      not serialized with the connect_worker in any way.
      
      But now that Local_Inv completions are being done in process
      context, we can handle the recycling operation there instead of
      deferring the recycling work to another process. Because the
      disconnect path drains all work before allowing tear down to
      proceed, it is guaranteed that Local Invalidations complete only
      while the ri_id pointer is stable.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      15d9b015
    • C
      xprtrdma: Manage MRs in context of a single connection · 9d2da4ff
      Chuck Lever 提交于
      MRs are now allocated on demand so we can safely throw them away on
      disconnect. This way an idle transport can disconnect and it won't
      pin hardware MR resources.
      
      Two additional changes:
      
      - Now that all MRs are destroyed on disconnect, there's no need to
        check during header marshaling if a req has MRs to recycle. Each
        req is sent only once per connection, and now rl_registered is
        guaranteed to be empty when rpcrdma_marshal_req is invoked.
      
      - Because MRs are now destroyed in a WQ_MEM_RECLAIM context, they
        also must be allocated in a WQ_MEM_RECLAIM context. This reduces
        the likelihood that device driver memory allocation will trigger
        memory reclaim during NFS writeback.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      9d2da4ff
    • C
      xprtrdma: Add unique trace points for posting Local Invalidate WRs · 4b93dab3
      Chuck Lever 提交于
      When adding frwr_unmap_async way back when, I re-used the existing
      trace_xprtrdma_post_send() trace point to record the return code
      of ib_post_send.
      
      Unfortunately there are some cases where re-using that trace point
      causes a crash. Instead, construct a trace point specific to posting
      Local Invalidate WRs that will always be safe to use in that context,
      and will act as a trace log eye-catcher for Local Invalidation.
      
      Fixes: 84756894 ("xprtrdma: Remove fr_state")
      Fixes: d8099fed ("xprtrdma: Reduce context switching due ... ")
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Tested-by: NBill Baker <bill.baker@oracle.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      4b93dab3
  12. 27 8月, 2019 1 次提交
  13. 21 8月, 2019 1 次提交