Skip to content

Commit a062a2a

Browse files
chuckleveramschuma-ntap
authored andcommitted
xprtrdma: "Unoptimize" rpcrdma_prepare_hdr_sge()
Commit 655fec6 ("xprtrdma: Use gathered Send for large inline messages") assumed that, since the zeroeth element of the Send SGE array always pointed to req->rl_rdmabuf, it needed to be initialized just once. This was a valid assumption because the Send SGE array and rl_rdmabuf both live in the same rpcrdma_req. In a subsequent patch, the Send SGE array will be separated from the rpcrdma_req, so the zeroeth element of the SGE array needs to be initialized every time. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 857f9ac commit a062a2a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

net/sunrpc/xprtrdma/rpc_rdma.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ rpcrdma_unmap_sges(struct rpcrdma_ia *ia, struct rpcrdma_req *req)
533533
sge->addr, sge->length, DMA_TO_DEVICE);
534534
}
535535

536-
/* Prepare the RPC-over-RDMA header SGE.
536+
/* Prepare an SGE for the RPC-over-RDMA transport header.
537537
*/
538538
static bool
539539
rpcrdma_prepare_hdr_sge(struct rpcrdma_ia *ia, struct rpcrdma_req *req,
@@ -542,13 +542,11 @@ rpcrdma_prepare_hdr_sge(struct rpcrdma_ia *ia, struct rpcrdma_req *req,
542542
struct rpcrdma_regbuf *rb = req->rl_rdmabuf;
543543
struct ib_sge *sge = &req->rl_send_sge[0];
544544

545-
if (unlikely(!rpcrdma_regbuf_is_mapped(rb))) {
546-
if (!__rpcrdma_dma_map_regbuf(ia, rb))
547-
goto out_regbuf;
548-
sge->addr = rdmab_addr(rb);
549-
sge->lkey = rdmab_lkey(rb);
550-
}
545+
if (!rpcrdma_dma_map_regbuf(ia, rb))
546+
goto out_regbuf;
547+
sge->addr = rdmab_addr(rb);
551548
sge->length = len;
549+
sge->lkey = rdmab_lkey(rb);
552550

553551
ib_dma_sync_single_for_device(rdmab_device(rb), sge->addr,
554552
sge->length, DMA_TO_DEVICE);

0 commit comments

Comments
 (0)