* Question about tcp_filter() in tcp_v6_do_rcv()
@ 2017-06-07 22:35 Chenbo Feng
2017-06-07 23:06 ` Eric Dumazet
0 siblings, 1 reply; 2+ messages in thread
From: Chenbo Feng @ 2017-06-07 22:35 UTC (permalink / raw)
To: netdev; +Cc: Lorenzo Colitti, Alexei Starovoitov, Daniel Borkmann, Chenbo Feng
Hello everybody,
I am testing eBPF programs on ipv6 and I just find out the tcp_filter()
function (previously named sk_filter()) is called both in tcp_v6_rcv()
and tcp_v6_do_rcv(). In contrast, it is only called by tcp_v4_rcv() in
ipv4 layer. I guess this implementation is used to capture some corner
cases in ipv6 ingress route but I cannot find why. Could I know why we
need this in two similar places in ipv6 transportation layer?
I have tried to dig into the commit history and the related code path
but I did not see any obvious reason for doing so. And my problem with
it is when a eBPF program is attached to a socket or a cgroup in ingress
side, the filter program will be applied on some packets twice. And it
affect the accuracy when using eBPF program for traffic accounting.
Thanks!
Chenbo Feng
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Question about tcp_filter() in tcp_v6_do_rcv()
2017-06-07 22:35 Question about tcp_filter() in tcp_v6_do_rcv() Chenbo Feng
@ 2017-06-07 23:06 ` Eric Dumazet
0 siblings, 0 replies; 2+ messages in thread
From: Eric Dumazet @ 2017-06-07 23:06 UTC (permalink / raw)
To: Chenbo Feng
Cc: netdev, Lorenzo Colitti, Alexei Starovoitov, Daniel Borkmann,
Chenbo Feng
On Wed, 2017-06-07 at 15:35 -0700, Chenbo Feng wrote:
> Hello everybody,
>
> I am testing eBPF programs on ipv6 and I just find out the tcp_filter()
> function (previously named sk_filter()) is called both in tcp_v6_rcv()
> and tcp_v6_do_rcv(). In contrast, it is only called by tcp_v4_rcv() in
> ipv4 layer. I guess this implementation is used to capture some corner
> cases in ipv6 ingress route but I cannot find why. Could I know why we
> need this in two similar places in ipv6 transportation layer?
>
> I have tried to dig into the commit history and the related code path
> but I did not see any obvious reason for doing so. And my problem with
> it is when a eBPF program is attached to a socket or a cgroup in ingress
> side, the filter program will be applied on some packets twice. And it
> affect the accuracy when using eBPF program for traffic accounting.
It seems this was added in this commit
commit 5234b9f7d650fe64975695d835cb9413e1d75f46
Author: James Morris <jmorris@intercode.com.au>
Date: Thu Feb 6 09:49:40 2003 -0800
[LSM]: Networking socket SKB receive hook.
You can find the history tree in :
[remote "origin"]
url = git://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git
fetch = +refs/heads/*:refs/remotes/origin/*
The call from tcp_v6_do_rcv() should be removed I guess
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-07 23:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-07 22:35 Question about tcp_filter() in tcp_v6_do_rcv() Chenbo Feng
2017-06-07 23:06 ` Eric Dumazet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox