mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-23 01:40:30 +00:00
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 <chuck.lever@oracle.com> Tested-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
2dc3a69de0
commit
a473018cfe
@ -1086,14 +1086,6 @@ rpcrdma_recv_buffer_put(struct rpcrdma_rep *rep)
|
||||
* Wrappers for internal-use kmalloc memory registration, used by buffer code.
|
||||
*/
|
||||
|
||||
void
|
||||
rpcrdma_mapping_error(struct rpcrdma_mr_seg *seg)
|
||||
{
|
||||
dprintk("RPC: map_one: offset %p iova %llx len %zu\n",
|
||||
seg->mr_offset,
|
||||
(unsigned long long)seg->mr_dma, seg->mr_dmalen);
|
||||
}
|
||||
|
||||
/**
|
||||
* rpcrdma_alloc_regbuf - kmalloc and register memory for SEND/RECV buffers
|
||||
* @ia: controlling rpcrdma_ia
|
||||
|
@ -277,9 +277,6 @@ struct rpcrdma_mr_seg { /* chunk descriptors */
|
||||
u32 mr_rkey; /* registration result */
|
||||
u32 mr_len; /* length of chunk or segment */
|
||||
int mr_nsegs; /* number of segments in chunk or 0 */
|
||||
enum dma_data_direction mr_dir; /* segment mapping direction */
|
||||
dma_addr_t mr_dma; /* segment mapping address */
|
||||
size_t mr_dmalen; /* segment mapping length */
|
||||
struct page *mr_page; /* owning page, if any */
|
||||
char *mr_offset; /* kva if no page, else offset */
|
||||
};
|
||||
@ -496,45 +493,12 @@ void rpcrdma_destroy_wq(void);
|
||||
* Wrappers for chunk registration, shared by read/write chunk code.
|
||||
*/
|
||||
|
||||
void rpcrdma_mapping_error(struct rpcrdma_mr_seg *);
|
||||
|
||||
static inline enum dma_data_direction
|
||||
rpcrdma_data_dir(bool writing)
|
||||
{
|
||||
return writing ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
|
||||
}
|
||||
|
||||
static inline void
|
||||
rpcrdma_map_one(struct ib_device *device, struct rpcrdma_mr_seg *seg,
|
||||
enum dma_data_direction direction)
|
||||
{
|
||||
seg->mr_dir = direction;
|
||||
seg->mr_dmalen = seg->mr_len;
|
||||
|
||||
if (seg->mr_page)
|
||||
seg->mr_dma = ib_dma_map_page(device,
|
||||
seg->mr_page, offset_in_page(seg->mr_offset),
|
||||
seg->mr_dmalen, seg->mr_dir);
|
||||
else
|
||||
seg->mr_dma = ib_dma_map_single(device,
|
||||
seg->mr_offset,
|
||||
seg->mr_dmalen, seg->mr_dir);
|
||||
|
||||
if (ib_dma_mapping_error(device, seg->mr_dma))
|
||||
rpcrdma_mapping_error(seg);
|
||||
}
|
||||
|
||||
static inline void
|
||||
rpcrdma_unmap_one(struct ib_device *device, struct rpcrdma_mr_seg *seg)
|
||||
{
|
||||
if (seg->mr_page)
|
||||
ib_dma_unmap_page(device,
|
||||
seg->mr_dma, seg->mr_dmalen, seg->mr_dir);
|
||||
else
|
||||
ib_dma_unmap_single(device,
|
||||
seg->mr_dma, seg->mr_dmalen, seg->mr_dir);
|
||||
}
|
||||
|
||||
/*
|
||||
* RPC/RDMA connection management calls - xprtrdma/rpc_rdma.c
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user