Skip to content

Commit 4b93dab

Browse files
chuckleveramschuma-ntap
authored andcommitted
xprtrdma: Add unique trace points for posting Local Invalidate WRs
When adding frwr_unmap_async way back when, I re-used the existing trace_xprtrdma_post_send() trace point to record the return code of ib_post_send. Unfortunately there are some cases where re-using that trace point causes a crash. Instead, construct a trace point specific to posting Local Invalidate WRs that will always be safe to use in that context, and will act as a trace log eye-catcher for Local Invalidation. Fixes: 8475689 ("xprtrdma: Remove fr_state") Fixes: d8099fe ("xprtrdma: Reduce context switching due ... ") Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Tested-by: Bill Baker <bill.baker@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent bf7ca70 commit 4b93dab

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

‎include/trace/events/rpcrdma.h‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,31 @@ TRACE_EVENT(xprtrdma_post_recvs,
735735
)
736736
);
737737

738+
TRACE_EVENT(xprtrdma_post_linv,
739+
TP_PROTO(
740+
const struct rpcrdma_req *req,
741+
int status
742+
),
743+
744+
TP_ARGS(req, status),
745+
746+
TP_STRUCT__entry(
747+
__field(const void *, req)
748+
__field(int, status)
749+
__field(u32, xid)
750+
),
751+
752+
TP_fast_assign(
753+
__entry->req = req;
754+
__entry->status = status;
755+
__entry->xid = be32_to_cpu(req->rl_slot.rq_xid);
756+
),
757+
758+
TP_printk("req=%p xid=0x%08x status=%d",
759+
__entry->req, __entry->xid, __entry->status
760+
)
761+
);
762+
738763
/**
739764
** Completion events
740765
**/

‎net/sunrpc/xprtrdma/frwr_ops.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,6 @@ void frwr_unmap_sync(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
570570
*/
571571
bad_wr = NULL;
572572
rc = ib_post_send(r_xprt->rx_ia.ri_id->qp, first, &bad_wr);
573-
trace_xprtrdma_post_send(req, rc);
574573

575574
/* The final LOCAL_INV WR in the chain is supposed to
576575
* do the wake. If it was never posted, the wake will
@@ -583,6 +582,7 @@ void frwr_unmap_sync(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
583582

584583
/* Recycle MRs in the LOCAL_INV chain that did not get posted.
585584
*/
585+
trace_xprtrdma_post_linv(req, rc);
586586
while (bad_wr) {
587587
frwr = container_of(bad_wr, struct rpcrdma_frwr,
588588
fr_invwr);
@@ -673,12 +673,12 @@ void frwr_unmap_async(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
673673
*/
674674
bad_wr = NULL;
675675
rc = ib_post_send(r_xprt->rx_ia.ri_id->qp, first, &bad_wr);
676-
trace_xprtrdma_post_send(req, rc);
677676
if (!rc)
678677
return;
679678

680679
/* Recycle MRs in the LOCAL_INV chain that did not get posted.
681680
*/
681+
trace_xprtrdma_post_linv(req, rc);
682682
while (bad_wr) {
683683
frwr = container_of(bad_wr, struct rpcrdma_frwr, fr_invwr);
684684
mr = container_of(frwr, struct rpcrdma_mr, frwr);

0 commit comments

Comments
 (0)