xprtrdma: Remove rpcrdma_map_one() and friends
authorChuck Lever <chuck.lever@oracle.com>
Wed, 29 Jun 2016 17:53:19 +0000 (13:53 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Mon, 11 Jul 2016 19:50:43 +0000 (15:50 -0400)
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>
net/sunrpc/xprtrdma/verbs.c
net/sunrpc/xprtrdma/xprt_rdma.h

index 5ee98e9d0fe98982faf64a6c5bf016798d20c0af..b80e767fe687976032b77a47c9387b878191658b 100644 (file)
@@ -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
index bcb168e3fe15355b89f5f2c431960d528775c9c2..f1b6f2fb5355de87d6f45d930791c95713961abc 100644 (file)
@@ -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
  */