Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xprtrdma: Add an xprtrdma_post_send_err tracepoint

Unlike xprtrdma_post_send(), this one can be left enabled all the
time, and should almost never fire. But we do want to know about
immediate errors when they happen.

Note that there is already a similar post_linv_err tracepoint.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>

authored by

Chuck Lever and committed by
Anna Schumaker
d9ae8134 683f31c3

+38 -1
+33
include/trace/events/rpcrdma.h
··· 793 793 ) 794 794 ); 795 795 796 + TRACE_EVENT(xprtrdma_post_send_err, 797 + TP_PROTO( 798 + const struct rpcrdma_xprt *r_xprt, 799 + const struct rpcrdma_req *req, 800 + int rc 801 + ), 802 + 803 + TP_ARGS(r_xprt, req, rc), 804 + 805 + TP_STRUCT__entry( 806 + __field(u32, cq_id) 807 + __field(unsigned int, task_id) 808 + __field(unsigned int, client_id) 809 + __field(int, rc) 810 + ), 811 + 812 + TP_fast_assign( 813 + const struct rpc_rqst *rqst = &req->rl_slot; 814 + const struct rpcrdma_ep *ep = r_xprt->rx_ep; 815 + 816 + __entry->cq_id = ep ? ep->re_attr.recv_cq->res.id : 0; 817 + __entry->task_id = rqst->rq_task->tk_pid; 818 + __entry->client_id = rqst->rq_task->tk_client ? 819 + rqst->rq_task->tk_client->cl_clid : -1; 820 + __entry->rc = rc; 821 + ), 822 + 823 + TP_printk("task:%u@%u cq.id=%u rc=%d", 824 + __entry->task_id, __entry->client_id, 825 + __entry->cq_id, __entry->rc 826 + ) 827 + ); 828 + 796 829 TRACE_EVENT(xprtrdma_post_recv, 797 830 TP_PROTO( 798 831 const struct rpcrdma_rep *rep
+5 -1
net/sunrpc/xprtrdma/frwr_ops.c
··· 394 394 struct rpcrdma_ep *ep = r_xprt->rx_ep; 395 395 struct rpcrdma_mr *mr; 396 396 unsigned int num_wrs; 397 + int ret; 397 398 398 399 num_wrs = 1; 399 400 post_wr = send_wr; ··· 421 420 } 422 421 423 422 trace_xprtrdma_post_send(req); 424 - return ib_post_send(ep->re_id->qp, post_wr, NULL); 423 + ret = ib_post_send(ep->re_id->qp, post_wr, NULL); 424 + if (ret) 425 + trace_xprtrdma_post_send_err(r_xprt, req, ret); 426 + return ret; 425 427 } 426 428 427 429 /**