netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bpf-next 0/2] cleanup SOCK_DEBUG() and introduce BPF_SOCK_OPS_STATS_CB
@ 2019-02-12 11:31 Yafang Shao
  2019-02-12 11:31 ` [bpf-next 1/2] tcp: replace SOCK_DEBUG() with tcp_stats() Yafang Shao
  2019-02-12 11:31 ` [bpf-next 2/2] bpf: add BPF_SOCK_OPS_STATS_CB for tcp_stats() Yafang Shao
  0 siblings, 2 replies; 11+ messages in thread
From: Yafang Shao @ 2019-02-12 11:31 UTC (permalink / raw)
  To: daniel, ast
  Cc: yhs, brakmo, edumazet, davem, netdev, linux-kernel, shaoyafang,
	Yafang Shao

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-02-13  3:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-12 11:31 [bpf-next 0/2] cleanup SOCK_DEBUG() and introduce BPF_SOCK_OPS_STATS_CB Yafang Shao
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).