SUNRPC: Restructure svc_tcp_recv_record()

Refactor: svc_recvfrom() is going to be converted to read into
bio_vecs in a moment. Unhook the only other caller,
svc_tcp_recv_record(), which just wants to read the 4-byte stream
record marker into a kvec.

While we're in the area, streamline this helper by straight-lining
the hot path, replace dprintk call sites with tracepoints, and
reduce the number of atomic bit operations in this path.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
Chuck Lever
2020-05-18 10:21:23 -04:00
parent 02648908d1
commit a5cda73e49
2 changed files with 49 additions and 26 deletions
+24
View File
@@ -1443,6 +1443,30 @@ TRACE_EVENT(svcsock_new_socket,
)
);
TRACE_EVENT(svcsock_marker,
TP_PROTO(
const struct svc_xprt *xprt,
__be32 marker
),
TP_ARGS(xprt, marker),
TP_STRUCT__entry(
__field(unsigned int, length)
__field(bool, last)
__string(addr, xprt->xpt_remotebuf)
),
TP_fast_assign(
__entry->length = be32_to_cpu(marker) & RPC_FRAGMENT_SIZE_MASK;
__entry->last = be32_to_cpu(marker) & RPC_LAST_STREAM_FRAGMENT;
__assign_str(addr, xprt->xpt_remotebuf);
),
TP_printk("addr=%s length=%u%s", __get_str(addr),
__entry->length, __entry->last ? " (last)" : "")
);
DECLARE_EVENT_CLASS(svcsock_class,
TP_PROTO(
const struct svc_xprt *xprt,