提交 9ec1c6ac 编写于 作者: J Jakub Kicinski 提交者: David S. Miller

net/tls: add device decrypted trace point

Add a tracepoint to the TLS offload's fast path. This tracepoint
can be used to track the decrypted and encrypted status of received
records. Records decrypted by the device should have decrypted set
to 1, records which have neither decrypted nor decrypted set are
partially decrypted, require re-encryption and therefore are most
expensive to deal with.
Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 8538d29c
......@@ -850,6 +850,7 @@ int tls_device_decrypted(struct sock *sk, struct sk_buff *skb)
{
struct tls_context *tls_ctx = tls_get_ctx(sk);
struct tls_offload_context_rx *ctx = tls_offload_ctx_rx(tls_ctx);
struct strp_msg *rxm = strp_msg(skb);
int is_decrypted = skb->decrypted;
int is_encrypted = !is_decrypted;
struct sk_buff *skb_iter;
......@@ -860,6 +861,10 @@ int tls_device_decrypted(struct sock *sk, struct sk_buff *skb)
is_encrypted &= !skb_iter->decrypted;
}
trace_tls_device_decrypted(sk, tcp_sk(sk)->copied_seq - rxm->full_len,
tls_ctx->rx.rec_seq, rxm->full_len,
is_encrypted, is_decrypted);
ctx->sw.decrypted |= is_decrypted;
/* Return immediately if the record is either entirely plaintext or
......
......@@ -41,6 +41,39 @@ TRACE_EVENT(tls_device_offload_set,
)
);
TRACE_EVENT(tls_device_decrypted,
TP_PROTO(struct sock *sk, u32 tcp_seq, u8 *rec_no, u32 rec_len,
bool encrypted, bool decrypted),
TP_ARGS(sk, tcp_seq, rec_no, rec_len, encrypted, decrypted),
TP_STRUCT__entry(
__field( struct sock *, sk )
__field( u64, rec_no )
__field( u32, tcp_seq )
__field( u32, rec_len )
__field( bool, encrypted )
__field( bool, decrypted )
),
TP_fast_assign(
__entry->sk = sk;
__entry->rec_no = get_unaligned_be64(rec_no);
__entry->tcp_seq = tcp_seq;
__entry->rec_len = rec_len;
__entry->encrypted = encrypted;
__entry->decrypted = decrypted;
),
TP_printk(
"sk=%p tcp_seq=%u rec_no=%llu len=%u encrypted=%d decrypted=%d",
__entry->sk, __entry->tcp_seq,
__entry->rec_no, __entry->rec_len,
__entry->encrypted, __entry->decrypted
)
);
TRACE_EVENT(tls_device_rx_resync_send,
TP_PROTO(struct sock *sk, u32 tcp_seq, u8 *rec_no, int sync_type),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册