Re: [PATCH net-next] net: bpf: add hook for close of tcp timewait sock

From
Alexei Starovoitov <hidden>
Date
2021-12-29 16:46:16
Also in
bpf, lkml
Reply to
unknown sender, 2021-12-29
On Wed, Dec 29, 2021 at 3:33 AM [off-list ref] wrote:
From: Menglong Dong <redacted>

The cgroup eBPF attach type 'CGROUP_SOCK_OPS' is able to monitor the
state change of a tcp connect with 'BPF_SOCK_OPS_STATE_CB' ops.

However, it can't trace the whole state change of a tcp connect. While
a connect becomes 'TCP_TIME_WAIT' state, this sock will be release and
a tw sock will be created. While tcp sock release, 'TCP_CLOSE' state
change will be passed to eBPF program. Howeven, the real state of this
connect is 'TCP_TIME_WAIT'.

To make eBPF get the real state change of a tcp connect, add
'CGROUP_TWSK_CLOSE' cgroup attach type, which will be called when
tw sock release and tcp connect become CLOSE.
The use case is not explained.
Why bpf tracing cannot be used to achieve the same?

Also there are no selftests.
Thread (5 messages) 5 messages, 2 authors, 2021-12-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help