Skip to content

Commit a473018

Browse files
chuckleveramschuma-ntap
authored andcommitted
xprtrdma: Remove rpcrdma_map_one() and friends
Clean up: ALLPHYSICAL is gone and FMR has been converted to use scatterlists. There are no more users of these functions. This patch shrinks the size of struct rpcrdma_req by about 3500 bytes on x86_64. There is one of these structs for each RPC credit (128 credits per transport connection). Signed-off-by: Chuck Lever <[email protected]> Tested-by: Steve Wise <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 2dc3a69 commit a473018

File tree

2 files changed

+0
-44
lines changed

2 files changed

+0
-44
lines changed

net/sunrpc/xprtrdma/verbs.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,14 +1086,6 @@ rpcrdma_recv_buffer_put(struct rpcrdma_rep *rep)
10861086
* Wrappers for internal-use kmalloc memory registration, used by buffer code.
10871087
*/
10881088

1089-
void
1090-
rpcrdma_mapping_error(struct rpcrdma_mr_seg *seg)
1091-
{
1092-
dprintk("RPC: map_one: offset %p iova %llx len %zu\n",
1093-
seg->mr_offset,
1094-
(unsigned long long)seg->mr_dma, seg->mr_dmalen);
1095-
}
1096-
10971089
/**
10981090
* rpcrdma_alloc_regbuf - kmalloc and register memory for SEND/RECV buffers
10991091
* @ia: controlling rpcrdma_ia

net/sunrpc/xprtrdma/xprt_rdma.h

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,6 @@ struct rpcrdma_mr_seg { /* chunk descriptors */
277277
u32 mr_rkey; /* registration result */
278278
u32 mr_len; /* length of chunk or segment */
279279
int mr_nsegs; /* number of segments in chunk or 0 */
280-
enum dma_data_direction mr_dir; /* segment mapping direction */
281-
dma_addr_t mr_dma; /* segment mapping address */
282-
size_t mr_dmalen; /* segment mapping length */
283280
struct page *mr_page; /* owning page, if any */
284281
char *mr_offset; /* kva if no page, else offset */
285282
};
@@ -496,45 +493,12 @@ void rpcrdma_destroy_wq(void);
496493
* Wrappers for chunk registration, shared by read/write chunk code.
497494
*/
498495

499-
void rpcrdma_mapping_error(struct rpcrdma_mr_seg *);
500-
501496
static inline enum dma_data_direction
502497
rpcrdma_data_dir(bool writing)
503498
{
504499
return writing ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
505500
}
506501

507-
static inline void
508-
rpcrdma_map_one(struct ib_device *device, struct rpcrdma_mr_seg *seg,
509-
enum dma_data_direction direction)
510-
{
511-
seg->mr_dir = direction;
512-
seg->mr_dmalen = seg->mr_len;
513-
514-
if (seg->mr_page)
515-
seg->mr_dma = ib_dma_map_page(device,
516-
seg->mr_page, offset_in_page(seg->mr_offset),
517-
seg->mr_dmalen, seg->mr_dir);
518-
else
519-
seg->mr_dma = ib_dma_map_single(device,
520-
seg->mr_offset,
521-
seg->mr_dmalen, seg->mr_dir);
522-
523-
if (ib_dma_mapping_error(device, seg->mr_dma))
524-
rpcrdma_mapping_error(seg);
525-
}
526-
527-
static inline void
528-
rpcrdma_unmap_one(struct ib_device *device, struct rpcrdma_mr_seg *seg)
529-
{
530-
if (seg->mr_page)
531-
ib_dma_unmap_page(device,
532-
seg->mr_dma, seg->mr_dmalen, seg->mr_dir);
533-
else
534-
ib_dma_unmap_single(device,
535-
seg->mr_dma, seg->mr_dmalen, seg->mr_dir);
536-
}
537-
538502
/*
539503
* RPC/RDMA connection management calls - xprtrdma/rpc_rdma.c
540504
*/

0 commit comments

Comments
 (0)