rxrpc: Add a tracepoint to log injected Rx packet loss
Add a tracepoint to log received packets that get discarded due to Rx packet loss. Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
parent
be832aecc5
commit
89b475abdb
@ -484,6 +484,27 @@ TRACE_EVENT(rxrpc_timer,
|
|||||||
__entry->timer - __entry->now)
|
__entry->timer - __entry->now)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
TRACE_EVENT(rxrpc_rx_lose,
|
||||||
|
TP_PROTO(struct rxrpc_skb_priv *sp),
|
||||||
|
|
||||||
|
TP_ARGS(sp),
|
||||||
|
|
||||||
|
TP_STRUCT__entry(
|
||||||
|
__field_struct(struct rxrpc_host_header, hdr )
|
||||||
|
),
|
||||||
|
|
||||||
|
TP_fast_assign(
|
||||||
|
memcpy(&__entry->hdr, &sp->hdr, sizeof(__entry->hdr));
|
||||||
|
),
|
||||||
|
|
||||||
|
TP_printk("%08x:%08x:%08x:%04x %08x %08x %02x %02x %s *LOSE*",
|
||||||
|
__entry->hdr.epoch, __entry->hdr.cid,
|
||||||
|
__entry->hdr.callNumber, __entry->hdr.serviceId,
|
||||||
|
__entry->hdr.serial, __entry->hdr.seq,
|
||||||
|
__entry->hdr.type, __entry->hdr.flags,
|
||||||
|
__entry->hdr.type <= 15 ? rxrpc_pkts[__entry->hdr.type] : "?UNK")
|
||||||
|
);
|
||||||
|
|
||||||
#endif /* _TRACE_RXRPC_H */
|
#endif /* _TRACE_RXRPC_H */
|
||||||
|
|
||||||
/* This part must be outside protection */
|
/* This part must be outside protection */
|
||||||
|
@ -837,20 +837,19 @@ void rxrpc_data_ready(struct sock *udp_sk)
|
|||||||
skb_orphan(skb);
|
skb_orphan(skb);
|
||||||
sp = rxrpc_skb(skb);
|
sp = rxrpc_skb(skb);
|
||||||
|
|
||||||
|
/* dig out the RxRPC connection details */
|
||||||
|
if (rxrpc_extract_header(sp, skb) < 0)
|
||||||
|
goto bad_message;
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_AF_RXRPC_INJECT_LOSS)) {
|
if (IS_ENABLED(CONFIG_AF_RXRPC_INJECT_LOSS)) {
|
||||||
static int lose;
|
static int lose;
|
||||||
if ((lose++ & 7) == 7) {
|
if ((lose++ & 7) == 7) {
|
||||||
|
trace_rxrpc_rx_lose(sp);
|
||||||
rxrpc_lose_skb(skb, rxrpc_skb_rx_lost);
|
rxrpc_lose_skb(skb, rxrpc_skb_rx_lost);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_net("Rx UDP packet from %08x:%04hu",
|
|
||||||
ntohl(ip_hdr(skb)->saddr), ntohs(udp_hdr(skb)->source));
|
|
||||||
|
|
||||||
/* dig out the RxRPC connection details */
|
|
||||||
if (rxrpc_extract_header(sp, skb) < 0)
|
|
||||||
goto bad_message;
|
|
||||||
trace_rxrpc_rx_packet(sp);
|
trace_rxrpc_rx_packet(sp);
|
||||||
|
|
||||||
_net("Rx RxRPC %s ep=%x call=%x:%x",
|
_net("Rx RxRPC %s ep=%x call=%x:%x",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user