]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
xprtrdma: Move unmap-safe logic to rpcrdma_marshal_req
authorChuck Lever <chuck.lever@oracle.com>
Fri, 15 Dec 2017 01:57:14 +0000 (20:57 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 16 Jan 2018 16:19:47 +0000 (11:19 -0500)
Clean up. This logic is related to marshaling the request, and I'd
like to keep everything that touches req->rl_registered close
together, for CPU cache efficiency.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/xprtrdma/rpc_rdma.c
net/sunrpc/xprtrdma/transport.c

index d7463bce3df3411636a49d5e6c4512b6ba1db4c3..dd7c0aab7535dde934ec9d7f5f56e779698371ab 100644 (file)
@@ -821,6 +821,17 @@ rpcrdma_marshal_req(struct rpcrdma_xprt *r_xprt, struct rpc_rqst *rqst)
                rtype = rpcrdma_areadch;
        }
 
+       /* If this is a retransmit, discard previously registered
+        * chunks. Very likely the connection has been replaced,
+        * so these registrations are invalid and unusable.
+        */
+       while (unlikely(!list_empty(&req->rl_registered))) {
+               struct rpcrdma_mw *mw;
+
+               mw = rpcrdma_pop_mw(&req->rl_registered);
+               rpcrdma_defer_mr_recovery(mw);
+       }
+
        /* This implementation supports the following combinations
         * of chunk lists in one RPC-over-RDMA Call message:
         *
index cebcd027d085bab1bda9dbda1c45e4c0f9c30d6b..d77dee5a2748751a69b18f2a5c5a91aed448022e 100644 (file)
@@ -731,11 +731,6 @@ xprt_rdma_send_request(struct rpc_task *task)
        if (!xprt_connected(xprt))
                goto drop_connection;
 
-       /* On retransmit, remove any previously registered chunks */
-       if (unlikely(!list_empty(&req->rl_registered)))
-               r_xprt->rx_ia.ri_ops->ro_unmap_sync(r_xprt,
-                                                   &req->rl_registered);
-
        rc = rpcrdma_marshal_req(r_xprt, rqst);
        if (rc < 0)
                goto failed_marshal;