mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

DCCP was orphaned in 2021 by commit054c4610bd
("MAINTAINERS: dccp: move Gerrit Renker to CREDITS"), which noted that the last maintainer had been inactive for five years. In recent years, it has become a playground for syzbot, and most changes to DCCP have been odd bug fixes triggered by syzbot. Apart from that, the only changes have been driven by treewide or networking API updates or adjustments related to TCP. Thus, in 2023, we announced we would remove DCCP in 2025 via commitb144fcaf46
("dccp: Print deprecation notice."). Since then, only one individual has contacted the netdev mailing list. [0] There is ongoing research for Multipath DCCP. The repository is hosted on GitHub [1], and development is not taking place through the upstream community. While the repository is published under the GPLv2 license, the scheduling part remains proprietary, with a LICENSE file [2] stating: "This is not Open Source software." The researcher mentioned a plan to address the licensing issue, upstream the patches, and step up as a maintainer, but there has been no further communication since then. Maintaining DCCP for a decade without any real users has become a burden. Therefore, it's time to remove it. Removing DCCP will also provide significant benefits to TCP. It allows us to freely reorganize the layout of struct inet_connection_sock, which is currently shared with DCCP, and optimize it to reduce the number of cachelines accessed in the TCP fast path. Note that we keep DCCP netfilter modules as requested. [3] Link: https://lore.kernel.org/netdev/20230710182253.81446-1-kuniyu@amazon.com/T/#u #[0] Link: https://github.com/telekom/mp-dccp #[1] Link: https://github.com/telekom/mp-dccp/blob/mpdccp_v03_k5.10/net/dccp/non_gpl_scheduler/LICENSE #[2] Link: https://lore.kernel.org/netdev/Z_VQ0KlCRkqYWXa-@calendula/ #[3] Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Acked-by: Paul Moore <paul@paul-moore.com> (LSM and SELinux) Acked-by: Casey Schaufler <casey@schaufler-ca.com> Link: https://patch.msgid.link/20250410023921.11307-3-kuniyu@amazon.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
312 lines
7.5 KiB
C
312 lines
7.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#undef TRACE_SYSTEM
|
|
#define TRACE_SYSTEM sock
|
|
|
|
#if !defined(_TRACE_SOCK_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
#define _TRACE_SOCK_H
|
|
|
|
#include <net/sock.h>
|
|
#include <net/ipv6.h>
|
|
#include <linux/tracepoint.h>
|
|
#include <linux/ipv6.h>
|
|
#include <linux/tcp.h>
|
|
#include <trace/events/net_probe_common.h>
|
|
|
|
#define family_names \
|
|
EM(AF_INET) \
|
|
EMe(AF_INET6)
|
|
|
|
/* The protocol traced by inet_sock_set_state */
|
|
#define inet_protocol_names \
|
|
EM(IPPROTO_TCP) \
|
|
EM(IPPROTO_SCTP) \
|
|
EMe(IPPROTO_MPTCP)
|
|
|
|
#define tcp_state_names \
|
|
EM(TCP_ESTABLISHED) \
|
|
EM(TCP_SYN_SENT) \
|
|
EM(TCP_SYN_RECV) \
|
|
EM(TCP_FIN_WAIT1) \
|
|
EM(TCP_FIN_WAIT2) \
|
|
EM(TCP_TIME_WAIT) \
|
|
EM(TCP_CLOSE) \
|
|
EM(TCP_CLOSE_WAIT) \
|
|
EM(TCP_LAST_ACK) \
|
|
EM(TCP_LISTEN) \
|
|
EM(TCP_CLOSING) \
|
|
EMe(TCP_NEW_SYN_RECV)
|
|
|
|
#define skmem_kind_names \
|
|
EM(SK_MEM_SEND) \
|
|
EMe(SK_MEM_RECV)
|
|
|
|
/* enums need to be exported to user space */
|
|
#undef EM
|
|
#undef EMe
|
|
#define EM(a) TRACE_DEFINE_ENUM(a);
|
|
#define EMe(a) TRACE_DEFINE_ENUM(a);
|
|
|
|
family_names
|
|
inet_protocol_names
|
|
tcp_state_names
|
|
skmem_kind_names
|
|
|
|
#undef EM
|
|
#undef EMe
|
|
#define EM(a) { a, #a },
|
|
#define EMe(a) { a, #a }
|
|
|
|
#define show_family_name(val) \
|
|
__print_symbolic(val, family_names)
|
|
|
|
#define show_inet_protocol_name(val) \
|
|
__print_symbolic(val, inet_protocol_names)
|
|
|
|
#define show_tcp_state_name(val) \
|
|
__print_symbolic(val, tcp_state_names)
|
|
|
|
#define show_skmem_kind_names(val) \
|
|
__print_symbolic(val, skmem_kind_names)
|
|
|
|
TRACE_EVENT(sock_rcvqueue_full,
|
|
|
|
TP_PROTO(struct sock *sk, struct sk_buff *skb),
|
|
|
|
TP_ARGS(sk, skb),
|
|
|
|
TP_STRUCT__entry(
|
|
__field(int, rmem_alloc)
|
|
__field(unsigned int, truesize)
|
|
__field(int, sk_rcvbuf)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
__entry->rmem_alloc = atomic_read(&sk->sk_rmem_alloc);
|
|
__entry->truesize = skb->truesize;
|
|
__entry->sk_rcvbuf = READ_ONCE(sk->sk_rcvbuf);
|
|
),
|
|
|
|
TP_printk("rmem_alloc=%d truesize=%u sk_rcvbuf=%d",
|
|
__entry->rmem_alloc, __entry->truesize, __entry->sk_rcvbuf)
|
|
);
|
|
|
|
TRACE_EVENT(sock_exceed_buf_limit,
|
|
|
|
TP_PROTO(struct sock *sk, struct proto *prot, long allocated, int kind),
|
|
|
|
TP_ARGS(sk, prot, allocated, kind),
|
|
|
|
TP_STRUCT__entry(
|
|
__array(char, name, 32)
|
|
__array(long, sysctl_mem, 3)
|
|
__field(long, allocated)
|
|
__field(int, sysctl_rmem)
|
|
__field(int, rmem_alloc)
|
|
__field(int, sysctl_wmem)
|
|
__field(int, wmem_alloc)
|
|
__field(int, wmem_queued)
|
|
__field(int, kind)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
strscpy(__entry->name, prot->name, 32);
|
|
__entry->sysctl_mem[0] = READ_ONCE(prot->sysctl_mem[0]);
|
|
__entry->sysctl_mem[1] = READ_ONCE(prot->sysctl_mem[1]);
|
|
__entry->sysctl_mem[2] = READ_ONCE(prot->sysctl_mem[2]);
|
|
__entry->allocated = allocated;
|
|
__entry->sysctl_rmem = sk_get_rmem0(sk, prot);
|
|
__entry->rmem_alloc = atomic_read(&sk->sk_rmem_alloc);
|
|
__entry->sysctl_wmem = sk_get_wmem0(sk, prot);
|
|
__entry->wmem_alloc = refcount_read(&sk->sk_wmem_alloc);
|
|
__entry->wmem_queued = READ_ONCE(sk->sk_wmem_queued);
|
|
__entry->kind = kind;
|
|
),
|
|
|
|
TP_printk("proto:%s sysctl_mem=%ld,%ld,%ld allocated=%ld sysctl_rmem=%d rmem_alloc=%d sysctl_wmem=%d wmem_alloc=%d wmem_queued=%d kind=%s",
|
|
__entry->name,
|
|
__entry->sysctl_mem[0],
|
|
__entry->sysctl_mem[1],
|
|
__entry->sysctl_mem[2],
|
|
__entry->allocated,
|
|
__entry->sysctl_rmem,
|
|
__entry->rmem_alloc,
|
|
__entry->sysctl_wmem,
|
|
__entry->wmem_alloc,
|
|
__entry->wmem_queued,
|
|
show_skmem_kind_names(__entry->kind)
|
|
)
|
|
);
|
|
|
|
TRACE_EVENT(inet_sock_set_state,
|
|
|
|
TP_PROTO(const struct sock *sk, const int oldstate, const int newstate),
|
|
|
|
TP_ARGS(sk, oldstate, newstate),
|
|
|
|
TP_STRUCT__entry(
|
|
__field(const void *, skaddr)
|
|
__field(int, oldstate)
|
|
__field(int, newstate)
|
|
__field(__u16, sport)
|
|
__field(__u16, dport)
|
|
__field(__u16, family)
|
|
__field(__u16, protocol)
|
|
__array(__u8, saddr, 4)
|
|
__array(__u8, daddr, 4)
|
|
__array(__u8, saddr_v6, 16)
|
|
__array(__u8, daddr_v6, 16)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
const struct inet_sock *inet = inet_sk(sk);
|
|
__be32 *p32;
|
|
|
|
__entry->skaddr = sk;
|
|
__entry->oldstate = oldstate;
|
|
__entry->newstate = newstate;
|
|
|
|
__entry->family = sk->sk_family;
|
|
__entry->protocol = sk->sk_protocol;
|
|
__entry->sport = ntohs(inet->inet_sport);
|
|
__entry->dport = ntohs(inet->inet_dport);
|
|
|
|
p32 = (__be32 *) __entry->saddr;
|
|
*p32 = inet->inet_saddr;
|
|
|
|
p32 = (__be32 *) __entry->daddr;
|
|
*p32 = inet->inet_daddr;
|
|
|
|
TP_STORE_ADDRS(__entry, inet->inet_saddr, inet->inet_daddr,
|
|
sk->sk_v6_rcv_saddr, sk->sk_v6_daddr);
|
|
),
|
|
|
|
TP_printk("family=%s protocol=%s sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c oldstate=%s newstate=%s",
|
|
show_family_name(__entry->family),
|
|
show_inet_protocol_name(__entry->protocol),
|
|
__entry->sport, __entry->dport,
|
|
__entry->saddr, __entry->daddr,
|
|
__entry->saddr_v6, __entry->daddr_v6,
|
|
show_tcp_state_name(__entry->oldstate),
|
|
show_tcp_state_name(__entry->newstate))
|
|
);
|
|
|
|
TRACE_EVENT(inet_sk_error_report,
|
|
|
|
TP_PROTO(const struct sock *sk),
|
|
|
|
TP_ARGS(sk),
|
|
|
|
TP_STRUCT__entry(
|
|
__field(int, error)
|
|
__field(__u16, sport)
|
|
__field(__u16, dport)
|
|
__field(__u16, family)
|
|
__field(__u16, protocol)
|
|
__array(__u8, saddr, 4)
|
|
__array(__u8, daddr, 4)
|
|
__array(__u8, saddr_v6, 16)
|
|
__array(__u8, daddr_v6, 16)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
const struct inet_sock *inet = inet_sk(sk);
|
|
__be32 *p32;
|
|
|
|
__entry->error = sk->sk_err;
|
|
__entry->family = sk->sk_family;
|
|
__entry->protocol = sk->sk_protocol;
|
|
__entry->sport = ntohs(inet->inet_sport);
|
|
__entry->dport = ntohs(inet->inet_dport);
|
|
|
|
p32 = (__be32 *) __entry->saddr;
|
|
*p32 = inet->inet_saddr;
|
|
|
|
p32 = (__be32 *) __entry->daddr;
|
|
*p32 = inet->inet_daddr;
|
|
|
|
TP_STORE_ADDRS(__entry, inet->inet_saddr, inet->inet_daddr,
|
|
sk->sk_v6_rcv_saddr, sk->sk_v6_daddr);
|
|
),
|
|
|
|
TP_printk("family=%s protocol=%s sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c error=%d",
|
|
show_family_name(__entry->family),
|
|
show_inet_protocol_name(__entry->protocol),
|
|
__entry->sport, __entry->dport,
|
|
__entry->saddr, __entry->daddr,
|
|
__entry->saddr_v6, __entry->daddr_v6,
|
|
__entry->error)
|
|
);
|
|
|
|
TRACE_EVENT(sk_data_ready,
|
|
|
|
TP_PROTO(const struct sock *sk),
|
|
|
|
TP_ARGS(sk),
|
|
|
|
TP_STRUCT__entry(
|
|
__field(const void *, skaddr)
|
|
__field(__u16, family)
|
|
__field(__u16, protocol)
|
|
__field(unsigned long, ip)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
__entry->skaddr = sk;
|
|
__entry->family = sk->sk_family;
|
|
__entry->protocol = sk->sk_protocol;
|
|
__entry->ip = _RET_IP_;
|
|
),
|
|
|
|
TP_printk("family=%u protocol=%u func=%ps",
|
|
__entry->family, __entry->protocol, (void *)__entry->ip)
|
|
);
|
|
|
|
/*
|
|
* sock send/recv msg length
|
|
*/
|
|
DECLARE_EVENT_CLASS(sock_msg_length,
|
|
|
|
TP_PROTO(struct sock *sk, int ret, int flags),
|
|
|
|
TP_ARGS(sk, ret, flags),
|
|
|
|
TP_STRUCT__entry(
|
|
__field(void *, sk)
|
|
__field(__u16, family)
|
|
__field(__u16, protocol)
|
|
__field(int, ret)
|
|
__field(int, flags)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
__entry->sk = sk;
|
|
__entry->family = sk->sk_family;
|
|
__entry->protocol = sk->sk_protocol;
|
|
__entry->ret = ret;
|
|
__entry->flags = flags;
|
|
),
|
|
|
|
TP_printk("sk address = %p, family = %s protocol = %s, length = %d, error = %d, flags = 0x%x",
|
|
__entry->sk, show_family_name(__entry->family),
|
|
show_inet_protocol_name(__entry->protocol),
|
|
!(__entry->flags & MSG_PEEK) ?
|
|
(__entry->ret > 0 ? __entry->ret : 0) : 0,
|
|
__entry->ret < 0 ? __entry->ret : 0,
|
|
__entry->flags)
|
|
);
|
|
|
|
DEFINE_EVENT(sock_msg_length, sock_send_length,
|
|
TP_PROTO(struct sock *sk, int ret, int flags),
|
|
|
|
TP_ARGS(sk, ret, flags)
|
|
);
|
|
|
|
DEFINE_EVENT(sock_msg_length, sock_recv_length,
|
|
TP_PROTO(struct sock *sk, int ret, int flags),
|
|
|
|
TP_ARGS(sk, ret, flags)
|
|
);
|
|
#endif /* _TRACE_SOCK_H */
|
|
|
|
/* This part must be outside protection */
|
|
#include <trace/define_trace.h>
|