Skip to content

Commit 13bcf7e

Browse files
chuckleverTrond Myklebust
authored andcommitted
xprtrdma: Move fr_mr field to struct rpcrdma_mr
Clean up: The last remaining field in struct rpcrdma_frwr has been removed, so the struct can be eliminated. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent dcff9ed commit 13bcf7e

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

include/trace/events/rpcrdma.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ DECLARE_EVENT_CLASS(xprtrdma_mr_class,
379379

380380
__entry->task_id = task->tk_pid;
381381
__entry->client_id = task->tk_client->cl_clid;
382-
__entry->mr_id = mr->frwr.fr_mr->res.id;
382+
__entry->mr_id = mr->mr_ibmr->res.id;
383383
__entry->nents = mr->mr_nents;
384384
__entry->handle = mr->mr_handle;
385385
__entry->length = mr->mr_length;
@@ -420,7 +420,7 @@ DECLARE_EVENT_CLASS(xprtrdma_anonymous_mr_class,
420420
),
421421

422422
TP_fast_assign(
423-
__entry->mr_id = mr->frwr.fr_mr->res.id;
423+
__entry->mr_id = mr->mr_ibmr->res.id;
424424
__entry->nents = mr->mr_nents;
425425
__entry->handle = mr->mr_handle;
426426
__entry->length = mr->mr_length;
@@ -903,7 +903,7 @@ TRACE_EVENT(xprtrdma_frwr_alloc,
903903
),
904904

905905
TP_fast_assign(
906-
__entry->mr_id = mr->frwr.fr_mr->res.id;
906+
__entry->mr_id = mr->mr_ibmr->res.id;
907907
__entry->rc = rc;
908908
),
909909

@@ -931,7 +931,7 @@ TRACE_EVENT(xprtrdma_frwr_dereg,
931931
),
932932

933933
TP_fast_assign(
934-
__entry->mr_id = mr->frwr.fr_mr->res.id;
934+
__entry->mr_id = mr->mr_ibmr->res.id;
935935
__entry->nents = mr->mr_nents;
936936
__entry->handle = mr->mr_handle;
937937
__entry->length = mr->mr_length;
@@ -964,7 +964,7 @@ TRACE_EVENT(xprtrdma_frwr_sgerr,
964964
),
965965

966966
TP_fast_assign(
967-
__entry->mr_id = mr->frwr.fr_mr->res.id;
967+
__entry->mr_id = mr->mr_ibmr->res.id;
968968
__entry->addr = mr->mr_sg->dma_address;
969969
__entry->dir = mr->mr_dir;
970970
__entry->nents = sg_nents;
@@ -994,7 +994,7 @@ TRACE_EVENT(xprtrdma_frwr_maperr,
994994
),
995995

996996
TP_fast_assign(
997-
__entry->mr_id = mr->frwr.fr_mr->res.id;
997+
__entry->mr_id = mr->mr_ibmr->res.id;
998998
__entry->addr = mr->mr_sg->dma_address;
999999
__entry->dir = mr->mr_dir;
10001000
__entry->num_mapped = num_mapped;

net/sunrpc/xprtrdma/frwr_ops.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static void frwr_cid_init(struct rpcrdma_ep *ep,
5555
struct rpc_rdma_cid *cid = &mr->mr_cid;
5656

5757
cid->ci_queue_id = ep->re_attr.send_cq->res.id;
58-
cid->ci_completion_id = mr->frwr.fr_mr->res.id;
58+
cid->ci_completion_id = mr->mr_ibmr->res.id;
5959
}
6060

6161
static void frwr_mr_unmap(struct rpcrdma_xprt *r_xprt, struct rpcrdma_mr *mr)
@@ -79,7 +79,7 @@ void frwr_mr_release(struct rpcrdma_mr *mr)
7979

8080
frwr_mr_unmap(mr->mr_xprt, mr);
8181

82-
rc = ib_dereg_mr(mr->frwr.fr_mr);
82+
rc = ib_dereg_mr(mr->mr_ibmr);
8383
if (rc)
8484
trace_xprtrdma_frwr_dereg(mr, rc);
8585
kfree(mr->mr_sg);
@@ -139,7 +139,7 @@ int frwr_mr_init(struct rpcrdma_xprt *r_xprt, struct rpcrdma_mr *mr)
139139
goto out_list_err;
140140

141141
mr->mr_xprt = r_xprt;
142-
mr->frwr.fr_mr = frmr;
142+
mr->mr_ibmr = frmr;
143143
mr->mr_device = NULL;
144144
INIT_LIST_HEAD(&mr->mr_list);
145145
init_completion(&mr->mr_linv_done);
@@ -323,7 +323,7 @@ struct rpcrdma_mr_seg *frwr_map(struct rpcrdma_xprt *r_xprt,
323323
goto out_dmamap_err;
324324
mr->mr_device = ep->re_id->device;
325325

326-
ibmr = mr->frwr.fr_mr;
326+
ibmr = mr->mr_ibmr;
327327
n = ib_map_mr_sg(ibmr, mr->mr_sg, dma_nents, NULL, PAGE_SIZE);
328328
if (n != dma_nents)
329329
goto out_mapmr_err;

net/sunrpc/xprtrdma/xprt_rdma.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,12 @@ struct rpcrdma_sendctx {
229229
* An external memory region is any buffer or page that is registered
230230
* on the fly (ie, not pre-registered).
231231
*/
232-
struct rpcrdma_frwr {
233-
struct ib_mr *fr_mr;
234-
};
235-
236232
struct rpcrdma_req;
237233
struct rpcrdma_mr {
238234
struct list_head mr_list;
239235
struct rpcrdma_req *mr_req;
236+
237+
struct ib_mr *mr_ibmr;
240238
struct ib_device *mr_device;
241239
struct scatterlist *mr_sg;
242240
int mr_nents;
@@ -247,7 +245,6 @@ struct rpcrdma_mr {
247245
struct ib_reg_wr mr_regwr;
248246
struct ib_send_wr mr_invwr;
249247
};
250-
struct rpcrdma_frwr frwr;
251248
struct rpcrdma_xprt *mr_xprt;
252249
u32 mr_handle;
253250
u32 mr_length;

0 commit comments

Comments
 (0)