From: Yafang Shao <laoar.shao@gmail.com>
To: daniel@iogearbox.net, ast@kernel.org
Cc: yhs@fb.com, brakmo@fb.com, edumazet@google.com,
davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, shaoyafang@didiglobal.com,
Yafang Shao <laoar.shao@gmail.com>
Subject: [bpf-next 0/2] cleanup SOCK_DEBUG() and introduce BPF_SOCK_OPS_STATS_CB
Date: Tue, 12 Feb 2019 19:31:35 +0800 [thread overview]
Message-ID: <1549971097-12627-1-git-send-email-laoar.shao@gmail.com> (raw)
SOCK_DEBUG is a very ancient debugging interface, and it's not very useful
for debugging.
This pacthset cleanups SOCK_DEBUG() and replace it with a new methord
based on BPF.
I cleanup SOCK_DEBUG() only for TCP, and other protocols are kept as is.
After this patchset, the SO_DEBUG interface will not take any effect for
TCP, but I still keep it in sock_{s,g}etsockopt() for TCP to avoid breaking
applications.
In the future we may extend tcp_stats() as bellow or something else to
cover all the LINUX_MIB_* and TCP_MIB_* proposaled[0] in the netconf2018.
now:
tcp_stats(struct sock *sk, int mib_idx)
future:
tcp_stats(struct sock *sk, int mib_idx, int packets)
The argument packets can be 1 to indicates this is a event only;
and skb_shinfo(skb)->gso_segs to indicates the number of packets
are also concerned.
[0] page 14,
http://vger.kernel.org/netconf2018_files/BrendanGregg_netconf2018.pdf
Yafang Shao (2):
tcp: replace SOCK_DEBUG() with tcp_stats()
bpf: add BPF_SOCK_OPS_STATS_CB for tcp_stats()
include/uapi/linux/bpf.h | 5 +++++
include/uapi/linux/snmp.h | 3 +++
net/ipv4/proc.c | 3 +++
net/ipv4/tcp_input.c | 27 ++++++++++++---------------
net/ipv6/tcp_ipv6.c | 2 --
5 files changed, 23 insertions(+), 17 deletions(-)
--
1.8.3.1
next reply other threads:[~2019-02-12 11:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-12 11:31 Yafang Shao [this message]
2019-02-12 11:31 ` [bpf-next 1/2] tcp: replace SOCK_DEBUG() with tcp_stats() Yafang Shao
2019-02-12 15:07 ` Eric Dumazet
2019-02-13 2:07 ` Yafang Shao
2019-02-13 2:15 ` Eric Dumazet
2019-02-13 2:46 ` Yafang Shao
2019-02-13 2:49 ` Alexei Starovoitov
2019-02-13 3:04 ` Yafang Shao
2019-02-12 11:31 ` [bpf-next 2/2] bpf: add BPF_SOCK_OPS_STATS_CB for tcp_stats() Yafang Shao
2019-02-12 15:11 ` Eric Dumazet
2019-02-13 2:10 ` Yafang Shao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1549971097-12627-1-git-send-email-laoar.shao@gmail.com \
--to=laoar.shao@gmail.com \
--cc=ast@kernel.org \
--cc=brakmo@fb.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shaoyafang@didiglobal.com \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®