On Tue, Sep 22, 2020 at 3:27 PM Michal Hocko wrote:
>
> On Tue 22-09-20 12:20:52, Yafang Shao wrote:
> > On Mon, Sep 21, 2020 at 7:36 PM Michal Hocko wrote:
> > >
> > > On Mon 21-09-20 19:23:01, Yafang Shao wrote:
> > > > On Mon, S
On Mon, Sep 21, 2020 at 7:36 PM Michal Hocko wrote:
>
> On Mon 21-09-20 19:23:01, Yafang Shao wrote:
> > On Mon, Sep 21, 2020 at 7:05 PM Michal Hocko wrote:
> > >
> > > On Mon 21-09-20 18:55:40, Yafang Shao wrote:
> > > > On Mon, S
On Mon, Sep 21, 2020 at 7:05 PM Michal Hocko wrote:
>
> On Mon 21-09-20 18:55:40, Yafang Shao wrote:
> > On Mon, Sep 21, 2020 at 4:12 PM Michal Hocko wrote:
> > >
> > > On Mon 21-09-20 16:02:55, zangchun...@bytedance.com wrote:
> > > > From: Chunxin
On Mon, Sep 21, 2020 at 4:12 PM Michal Hocko wrote:
>
> On Mon 21-09-20 16:02:55, zangchun...@bytedance.com wrote:
> > From: Chunxin Zang
> >
> > In the cgroup v1, we have 'force_mepty' interface. This is very
> > useful for userspace to actively release memory. But the cgroup
> > v2 does not.
>
On Tue, Feb 26, 2019 at 6:58 AM Cong Wang wrote:
>
> On Mon, Feb 25, 2019 at 2:29 PM David Miller wrote:
> >
> > From: Cong Wang
> > Date: Mon, 25 Feb 2019 14:00:09 -0800
> >
> > > Just to clarify, I have been suggesting to completely remove
> > > this unused macro, never suggest to just undefin
Per discussion with Daniel[1] and Eric[2], these SOCK_DEBUG() calles in
TCP are not needed now.
We'd better clean up it.
[1] https://patchwork.ozlabs.org/patch/1035573/
[2] https://patchwork.ozlabs.org/patch/1040533/
Signed-off-by: Yafang Shao
---
net/ipv4/tcp_input.c
Per discussion with Daniel[1] and Eric[2], these SOCK_DEBUG() calles in
TCP are not needed now.
We'd better clean up it.
[1] https://patchwork.ozlabs.org/patch/1035573/
[2] https://patchwork.ozlabs.org/patch/1040533/
Signed-off-by: Yafang Shao
---
net/ipv4/tcp_input.c
able it by default.
The reason why I don't remove it comepletely is that someone may still
would like to use it for debugging.
Signed-off-by: Yafang Shao
Suggested-by: Joe Perches
---
include/net/sock.h | 13 -
net/core/sock.c| 3 +++
2 files changed, 11 insertions(+), 5 del
Per discussion with Daniel[1] and Eric[2], these SOCK_DEBUG() calles in
TCP are not needed now.
We'd better clean up it.
Plus undefine SOCK_DEBUGGING by default.
[1] https://patchwork.ozlabs.org/patch/1035573/
[2] https://patchwork.ozlabs.org/patch/1040533/
Yafang Shao (2):
tcp: cle
On Sun, Feb 17, 2019 at 7:58 PM Joe Perches wrote:
>
> On Sun, 2019-02-17 at 00:28 +0800, Yafang Shao wrote:
> > SOCK_DEBUG() is a old facility for debugging.
> > If the user want to use it for debugging, the user must modify the
> > application first, that doesn't
able it by default.
The reason why I don't remove it comepletely is that someone may still
would like to use it for debugging.
Signed-off-by: Yafang Shao
Suggested-by: Joe Perches
---
include/net/sock.h | 13 -
net/core/sock.c| 3 +++
2 files changed, 11 insertions(+), 5 del
Per discussion with Daniel[1] and Eric[2], these SOCK_DEBUG() calles in
TCP are not needed now.
We'd better clean up it.
[1] https://patchwork.ozlabs.org/patch/1035573/
[2] https://patchwork.ozlabs.org/patch/1040533/
Signed-off-by: Yafang Shao
---
net/ipv4/tcp_input.c
Per discussion with Daniel[1] and Eric[2], these SOCK_DEBUG() calles in
TCP are not needed now.
We'd better clean up it.
Plus undefine SOCK_DEBUGGING by default.
[1] https://patchwork.ozlabs.org/patch/1035573/
[2] https://patchwork.ozlabs.org/patch/1040533/
Yafang Shao (2):
tcp: cle
On Sat, Feb 16, 2019 at 2:51 AM Joe Perches wrote:
>
> On Fri, 2019-02-15 at 10:22 -0800, Eric Dumazet wrote:
> > On Fri, Feb 15, 2019 at 10:13 AM Cong Wang wrote:
> > > On Fri, Feb 15, 2019 at 8:26 AM Eric Dumazet wrote:
> > > > On Fri, Feb 15, 2019 at 6:
On Fri, Feb 15, 2019 at 10:58 PM Eric Dumazet wrote:
>
> On Fri, Feb 15, 2019 at 6:50 AM Yafang Shao wrote:
> >
> > As SOCK_DEBUG() isn't used any more, we can get ride of it now.
> >
>
> No, we are still using this infrastructure from time to time.
>
>
40533/
Signed-off-by: Yafang Shao
---
net/appletalk/ddp.c | 14 --
1 file changed, 14 deletions(-)
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 9b6bc5a..326c4fd 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -1608,8 +1608,6 @@ static int atalk_sendmsg(s
ll can use this option but don't take any effect from
now on.
Signed-off-by: Yafang Shao
---
include/net/sock.h | 19 ---
net/core/sock.c| 3 +++
2 files changed, 3 insertions(+), 19 deletions(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index 6679f3c..4c6b5
igned-off-by: Yafang Shao
---
net/ipv4/tcp_input.c | 19 +--
net/ipv6/tcp_ipv6.c | 2 --
2 files changed, 1 insertion(+), 20 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 7a027dec..6d2750e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_in
igned-off-by: Yafang Shao
---
net/x25/af_x25.c | 12
net/x25/x25_facilities.c | 32 ++--
net/x25/x25_out.c| 4 +---
3 files changed, 11 insertions(+), 37 deletions(-)
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 5121729..5892d05 1
igned-off-by: Yafang Shao
---
net/dccp/ipv6.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index d5740ba..8e72e50 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -878,8 +878,6 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr
*
aking
applications.
[1] https://patchwork.ozlabs.org/patch/1035573/
[2] https://patchwork.ozlabs.org/patch/1040533
Yafang Shao (5):
tcp: clean up SOCK_DEBUG()
x25: clean up SOCK_DEBUG()
appletalk: clean up SOCK_DEBUG()
dccp: clean up SOCK_DEBUG()
net: sock: remove the definition of SOCK_
On Wed, Feb 13, 2019 at 10:49 AM Alexei Starovoitov
wrote:
>
> On Tue, Feb 12, 2019 at 6:15 PM Eric Dumazet wrote:
> >
> > Do not add more debugging stuff unless you can demonstrate
> > they actually allowed you to find a real bug and that you sent a
> > public fix for it.
> >
> > Just adding "co
On Wed, Feb 13, 2019 at 10:15 AM Eric Dumazet wrote:
>
> On Tue, Feb 12, 2019 at 6:07 PM Yafang Shao wrote:
> >
>
> > Let me explain the background for you.
> > I want to track some TCP abnormal behavior in TCP/IP stack. But I
> > find there's no good way
On Tue, Feb 12, 2019 at 11:11 PM Eric Dumazet wrote:
>
>
>
> On 02/12/2019 03:31 AM, Yafang Shao wrote:
> > Introuce this new op BPF_SOCK_OPS_STATS_CB for tcp_stats() such that it
> > can be traced via BPF on a per socket basis.
> > There's one argument in BP
On Tue, Feb 12, 2019 at 11:07 PM Eric Dumazet wrote:
>
>
>
> On 02/12/2019 03:31 AM, Yafang Shao wrote:
> > SOCK_DEBUG is a very ancient debugging interface, and it's not very useful
> > for debugging.
> > So this patch removes the SOCK_DEBUG() and introduc
nk it is better to
keep as-is, because if we return an errno to tell the application that
this optname isn't supported for TCP, it may break the application.
The application still can use this option but don't take any effect for
TCP.
Signed-off-by: Yafang Shao
---
include/uapi/li
rnel.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
igned-off-by: Yafang Shao
---
include/uapi/linux/bpf.h | 5 +
net/ipv4/tcp_input.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 1777fa0..0314ddd 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -2
On Tue, Feb 5, 2019 at 4:23 AM Daniel Borkmann wrote:
>
> On 02/04/2019 06:35 PM, Alexei Starovoitov wrote:
> > On Sun, Feb 03, 2019 at 04:15:07PM +0800, Yafang Shao wrote:
> >> Then we can enable/disable socket debugging without modifying user code.
> >> That is
On Tue, Feb 5, 2019 at 1:35 AM Alexei Starovoitov
wrote:
>
> On Sun, Feb 03, 2019 at 04:15:07PM +0800, Yafang Shao wrote:
> > Then we can enable/disable socket debugging without modifying user code.
> > That is more convenient for debugging.
> >
> &
Then we can enable/disable socket debugging without modifying user code.
That is more convenient for debugging.
Signed-off-by: Yafang Shao
---
include/net/sock.h | 8
net/core/filter.c | 3 +++
net/core/sock.c| 8
3 files changed, 11 insertions(+), 8 deletions(-)
diff
As strncpy(..., TCP_CA_NAME_MAX-1) is used in bpf_setsockopt(),
this change will make it more consistent with the bpf_setsockopt() above.
Acked-by: Martin KaFai Lau
Acked-by: Lawrence Brakmo
Signed-off-by: Yafang Shao
---
net/core/filter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion
When sock recvbuff is set by bpf_setsockopt(), the value must by limited
by rmem_max.
It is the same with sendbuff.
Fixes: 8c4b4c7e9ff0 ("bpf: Add setsockopt helper function to bpf")
Acked-by: Martin KaFai Lau
Acked-by: Lawrence Brakmo
Signed-off-by: Yafang Shao
---
net/core/fi
As the last character of optval will be set with 0, so just copying
(optlen - 1) characters is enough.
Signed-off-by: Yafang Shao
---
net/core/filter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 447dd1b..7a4de22 100644
--- a
When sock recvbuff is set by bpf_setsockopt(), the value must by limited
by rmem_max.
It is the same with sendbuff.
Signed-off-by: Yafang Shao
---
net/core/filter.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/core/filter.c b/net/core/filter.c
index 447dd1b..f30b58a 100644
--- a
The only call site of sk_clone_lock is in inet_csk_clone_lock,
and sk_cookie will be set there.
So we don't need to set sk_cookie in sk_clone_lock().
Reviewed-by: Eric Dumazet
Signed-off-by: Yafang Shao
---
net/core/sock.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/core/soc
On Fri, Jan 18, 2019 at 12:40 AM Eric Dumazet wrote:
>
> On Thu, Jan 17, 2019 at 2:02 AM Yafang Shao wrote:
> >
> > The only call site of sk_clone_lock is in inet_csk_clone_lock,
> > and sk_cookie will be set there.
> > So we don't need to set sk_cookie in sk
Since tcp_mmap() is defined when CONFIG_MMU is set.
Signed-off-by: Yafang Shao
---
include/net/tcp.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index e0a65c0..5c95018 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -406,8 +406,10 @@ int
The only call site of sk_clone_lock is in inet_csk_clone_lock,
and sk_cookie will be set there.
So we don't need to set sk_cookie in sk_clone_lock().
That can save an atomic operation.
Signed-off-by: Yafang Shao
---
net/core/sock.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net
ve us a
little improvement.
Signed-off-by: Yafang Shao
---
net/ipv4/tcp_output.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 730bc44..12bb5e7 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -
On Thu, Dec 13, 2018 at 7:26 AM Pablo Neira Ayuso wrote:
>
> On Wed, Dec 05, 2018 at 08:56:29PM +0800, Yafang Shao wrote:
> > nf_ct_l4proto_net() may return NULL.
> > That may happens if some module forget to set both l4proto->get_net_proto
> > and l4proto->net_id.
&
After this patch, there will be two sysctl knobs for GRE.
net.netfilter.nf_conntrack_gre_timeout_replied = 180
net.netfilter.nf_conntrack_gre_timeout_unreplied = 30
Signed-off-by: Yafang Shao
---
net/netfilter/nf_conntrack_proto_gre.c | 43 +-
1
All of the callers will execute drop_sysctl_table() whatever the callee
insert_header() successes or fails.
So we can't execute drop_sysctl_table() in insert_header().
Signed-off-by: Yafang Shao
---
fs/proc/proc_sysctl.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/proc/proc_sysct
n fault issue.
After this patch, an error message will be printed to indicate some error
happens, for example, in this case bellow message will be printed,
"nf_conntrack_gre4: pernet registration failed."
Signed-off-by: Yafang Shao
---
net/netfilter/nf_conntrack
If pn is NULL, it will return 0.
That's not proper. We should return an error.
Signed-off-by: Yafang Shao
---
net/netfilter/nf_conntrack_proto.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/netfilter/nf_conntrack_proto.c
b/net/netfilter/nf_conntrack_proto.c
index 316fef3..3c
nf_ct_l4proto_net() may return NULL.
That may happens if some module forget to set both l4proto->get_net_proto
and l4proto->net_id.
We'd check the return value here, in case crash happens.
Signed-off-by: Yafang Shao
---
net/netfilter/nf_conntrack_proto.c | 3 +++
1 file changed, 3
On Wed, Nov 28, 2018 at 10:44 PM Eric Dumazet wrote:
>
>
>
> On 11/28/2018 04:16 AM, Yafang Shao wrote:
> > When walk RB tree, we'd better use skb_rbtree_walk* helpers, that can make
> > the code more clear.
> > As skb_rbtree_walk() can't be used in tcp_
When walk RB tree, we'd better use skb_rbtree_walk* helpers, that can make
the code more clear.
As skb_rbtree_walk() can't be used in tcp_clean_rtx_queue(), so the new
helper skb_rbtree_walk_safe() is introduced.
Signed-off-by: Yafang Shao
---
include/linux/skbuff.h | 5 +
On Wed, Jul 25, 2018 at 9:55 PM, Eric Dumazet wrote:
>
>
> On 07/25/2018 06:40 AM, Yafang Shao wrote:
>
>>
>> Because we want to know why packets were dropped.
>> If that could be show in netstat, we could easily find that it is
>> dropped due to ofo prune.
On Wed, Jul 25, 2018 at 9:33 PM, Eric Dumazet wrote:
>
>
> On 07/25/2018 06:06 AM, Yafang Shao wrote:
>> LINUX_MIB_OFOPRUNED is used to count how many times ofo queue is pruned,
>> but sometimes we want to know how many packets are pruned from this queue,
>> that
LINUX_MIB_OFOPRUNEDROP, which could be showed in netstat as
OfoPruneDrop.
Signed-off-by: Yafang Shao
---
include/uapi/linux/snmp.h | 1 +
net/ipv4/proc.c | 1 +
net/ipv4/tcp_input.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/include/uapi/linux/snmp.h b/include/uapi/linux/snmp.h
index
It will be helpful if we could display the drops due to zero window or no
enough window space.
So a new SNMP MIB entry is added to track this behavior.
This entry is named LINUX_MIB_TCPZEROWINDOWDROP and published in
/proc/net/netstat in TcpExt line as TCPZeroWindowDrop.
Signed-off-by: Yafang
replace ip_hdr()
with skb->data in these situations for optimization.
Signed-off-by: Yafang Shao
---
net/ipv6/ip6_input.c | 4 ++--
net/ipv6/ip6_output.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index f08d344..2ff4fe8 1006
ip_hdr()
with skb->data in these situations for optimization.
Signed-off-by: Yafang Shao
---
net/ipv4/ip_input.c | 8
net/ipv4/ip_output.c | 8
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 7582713..7a03e8c 1006
On Tue, May 29, 2018 at 12:36 AM, Eric Dumazet wrote:
> On Mon, May 28, 2018 at 8:36 AM Yafang Shao wrote:
>
>> This is additional to the commit ea1627c20c34 ("tcp: minor optimizations
> around tcp_hdr() usage").
>> At this point, skb->data is same with tcp_h
This is additional to the commit ea1627c20c34 ("tcp: minor optimizations around
tcp_hdr() usage").
At this point, skb->data is same with tcp_hdr() as tcp header has not
been pulled yet.
Cc: Eric Dumazet
Signed-off-by: Yafang Shao
---
net/ipv4/tcp_ipv4.c | 2 +-
net/ipv6/tcp_ipv
At this point skb->len is including tcp header length, so it is meaningless
to user. data length could be more helpful, with which we can easily filter
out the packet without payload.
Cc: Eric Dumazet
Acked-by: Song Liu
Signed-off-by: Yafang Shao
---
v3: tcp_hdr() is a little expensive t
On Sat, May 26, 2018 at 10:25 AM, YueHaibing wrote:
> On 2018/5/26 0:19, Alexei Starovoitov wrote:
>> On Fri, May 25, 2018 at 06:17:57PM +0800, YueHaibing wrote:
>>> gcc-7.3.0 report following err:
>>>
>>> HOSTCC net/bpfilter/main.o
>>> In file included from net/bpfilter/main.c:9:0:
>>> ./inclu
skb->len is meaningless to user.
data length could be more helpful, with which we can easily filter out
the packet without payload.
Signed-off-by: Yafang Shao
---
include/trace/events/tcp.h | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/trace/events/tcp.
skb->len is meaningless to user.
data length could be more helpful, with which we can easily filter out
the packet without payload.
Signed-off-by: Yafang Shao
---
include/trace/events/tcp.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/trace/events/tcp.
On Tue, Apr 24, 2018 at 11:49 PM, Eric Dumazet wrote:
>
>
> On 04/24/2018 08:12 AM, Yafang Shao wrote:
>> On Tue, Apr 24, 2018 at 8:38 PM, Eric Dumazet wrote:
>>>
>>>
>>> On 04/24/2018 05:05 AM, Yafang Shao wrote:
>>>> This revert commit
On Tue, Apr 24, 2018 at 8:38 PM, Eric Dumazet wrote:
>
>
> On 04/24/2018 05:05 AM, Yafang Shao wrote:
>> This revert commit ("net: init sk_cookie for inet socket")
>>
>> Per discussion with Eric.
>>
>
> I suggest you include a bit more details,
"Performance is reduced from ~5 Mpps to ~3.8 Mpps with 16 RX queues on
my host" when running synflood test.
Have to revert it to prevent from cache line false sharing.
Signed-off-by: Yafang Shao
---
include/linux/sock_diag.h | 9 -
net/ipv4/tcp_input.c | 8 +---
2 fil
On Tue, Apr 24, 2018 at 8:38 PM, Eric Dumazet wrote:
>
>
> On 04/24/2018 05:05 AM, Yafang Shao wrote:
>> This revert commit ("net: init sk_cookie for inet socket")
>>
>> Per discussion with Eric.
>>
>
> I suggest you include a bit more details,
This revert commit ("net: init sk_cookie for inet socket")
Per discussion with Eric.
Signed-off-by: Yafang Shao
---
include/linux/sock_diag.h | 9 -
net/ipv4/tcp_input.c | 8 +---
2 files changed, 1 insertion(+), 16 deletions(-)
diff --git a/include/linux/soc
On Tue, Apr 24, 2018 at 7:41 PM, Eric Dumazet wrote:
>
>
> On 04/23/2018 09:39 PM, Yafang Shao wrote:
>> On Tue, Apr 24, 2018 at 12:09 AM, Eric Dumazet
>> wrote:
>>>
>>>
>>> On 04/23/2018 08:58 AM, David Miller wrote:
>>>> F
On Tue, Apr 24, 2018 at 12:09 AM, Eric Dumazet wrote:
>
>
> On 04/23/2018 08:58 AM, David Miller wrote:
>> From: Yafang Shao
>> Date: Sun, 22 Apr 2018 21:50:04 +0800
>>
>>> With sk_cookie we can identify a socket, that is very helpful for
>>> tracein
With sk_cookie we can identify a socket, that is very helpful for
traceing and statistic, i.e. tcp tracepiont and ebpf.
So we'd better init it by default for inet socket.
When using it, we just need call atomic64_read(&sk->sk_cookie).
Signed-off-by: Yafang Shao
---
include/linux/soc
On Fri, Apr 20, 2018 at 11:21 PM, David Miller wrote:
>
> Why are you sending this same patch twice?
>
> Thank you.
Some mistake.
Sorry about that.
Pls. use the second patch.
Thanks
Yafang
ow us the whole lifespan of this packet. But we
could also implement that with pid as these functions are executed in
process context.
Signed-off-by: Yafang Shao
---
v2 -> v3: use sock_gen_cookie in tcp_event_sk as well.
Maybe we could init sk_cookie in the stack then in ot
ow us the whole lifespan of this packet. But we
could also implement that with pid as these functions are executed in
process context.
Signed-off-by: Yafang Shao
---
v2 -> v3: use sock_gen_cookie in tcp_event_sk as well.
Maybe we could init sk_cookie in the stack then in ot
On Wed, Apr 18, 2018 at 7:44 AM, Alexei Starovoitov
wrote:
> On Mon, Apr 16, 2018 at 08:43:31AM -0700, Eric Dumazet wrote:
>>
>>
>> On 04/16/2018 08:33 AM, Yafang Shao wrote:
>> > tcp_rcv_space_adjust is called every time data is copied to user space,
>> >
On Wed, Apr 18, 2018 at 1:38 AM, Song Liu wrote:
>
>
>> On Apr 17, 2018, at 9:36 AM, Yafang Shao wrote:
>>
>> tcp_rcv_space_adjust is called every time data is copied to user space,
>> introducing a tcp tracepoint for which could show us when the packet is
>>
On Wed, Apr 18, 2018 at 1:27 AM, Eric Dumazet wrote:
>
>
> On 04/17/2018 09:36 AM, Yafang Shao wrote:
>> tcp_rcv_space_adjust is called every time data is copied to user space,
>> introducing a tcp tracepoint for which could show us when the packet is
>> copied to
int with epoll/read/recv* tracepoints, and
finally that could show us the whole lifespan of this packet. But we
could also implement that with pid as these functions are executed in
process context.
Signed-off-by: Yafang Shao
---
v1 -> v2: use sk_cookie as key suggested by Eric.
---
include/t
On Mon, Apr 16, 2018 at 11:43 PM, Eric Dumazet wrote:
>
>
> On 04/16/2018 08:33 AM, Yafang Shao wrote:
>> tcp_rcv_space_adjust is called every time data is copied to user space,
>> introducing a tcp tracepoint for which could show us when the packet is
>> copied to
ead/recv* tracepoint, and
finally that could show us the whole lifespan of this packet. But we
could also implement that with pid as these functions are executed in
process context.
Signed-off-by: Yafang Shao
---
include/trace/events/tcp.h | 21 +++--
net/ipv4/tcp_input.c | 2 ++
ead/recv* tracepoint, and
finally that could show us the whole lifespan of this packet. But we
could also implement that with pid as these functions are executed in
process context.
Signed-off-by: Yafang Shao
---
include/trace/events/tcp.h | 21 +++--
net/ipv4/tcp_input.c | 2 ++
sk is already allocated in inet_create/inet6_create, hence when
BPF_CGROUP_RUN_PROG_INET_SOCK is executed sk will never be NULL.
The logic is as bellow,
sk = sk_alloc();
if (!sk)
goto out;
BPF_CGROUP_RUN_PROG_INET_SOCK(sk);
Signed-off-by: Yafang Shao
TCPF_ macro depends on the definition of TCP_ macro.
So it is better to define them with TCP_ marco.
Signed-off-by: Yafang Shao
---
include/net/tcp_states.h | 26 +-
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/include/net/tcp_states.h b/include/net
em as tracepoint arguments.
Suggested-by: Brendan Gregg
Suggested-by: Song Liu
Signed-off-by: Yafang Shao
---
include/trace/events/sock.h | 15 +--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h
index 3537c5f..31
On Sun, Jan 7, 2018 at 1:46 AM, Song Liu wrote:
>
>> On Jan 5, 2018, at 12:09 AM, Yafang Shao wrote:
>>
>> On Fri, Jan 5, 2018 at 3:21 PM, Song Liu wrote:
>>>
>>>> On Jan 4, 2018, at 10:42 PM, Yafang Shao wrote:
>>>>
>>>> sk-
On Fri, Jan 5, 2018 at 3:21 PM, Song Liu wrote:
>
>> On Jan 4, 2018, at 10:42 PM, Yafang Shao wrote:
>>
>> sk->sk_protocol and sk->sk_family are exposed as tracepoint arguments.
>> Then we can conveniently use these two arguments to do the filter.
>>
>&g
sk->sk_protocol and sk->sk_family are exposed as tracepoint arguments.
Then we can conveniently use these two arguments to do the filter.
Suggested-by: Brendan Gregg
Signed-off-by: Yafang Shao
---
include/trace/events/sock.h | 24 ++--
net/ipv4/af_inet.c
On Wed, Jan 3, 2018 at 3:46 AM, Brendan Gregg wrote:
> On Sat, Dec 30, 2017 at 7:06 PM, Yafang Shao wrote:
>> On Sun, Dec 31, 2017 at 6:33 AM, Brendan Gregg
>> wrote:
>>> On Tue, Dec 19, 2017 at 7:12 PM, Yafang Shao wrote:
>>>> As sk_state is a common
On Sun, Dec 31, 2017 at 6:33 AM, Brendan Gregg
wrote:
> On Tue, Dec 19, 2017 at 7:12 PM, Yafang Shao wrote:
>> As sk_state is a common field for struct sock, so the state
>> transition tracepoint should not be a TCP specific feature.
>> Currently it traces all AF_INET s
Signed-off-by: Yafang Shao
---
include/trace/events/sock.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h
index 3b9094a..3537c5f 100644
--- a/include/trace/events/sock.h
+++ b/include/trace/events/sock.h
@
On Sat, Dec 23, 2017 at 5:42 PM, Sergei Shtylyov
wrote:
> On 12/23/2017 4:10 AM, Yafang Shao wrote:
>
>>>> There's a space character missed in the printk messages.
>>>> This error should be prevented with checkscript.pl, but it couldn't
>>>> c
On Sat, Dec 23, 2017 at 9:10 AM, Yafang Shao wrote:
> On Sat, Dec 23, 2017 at 1:04 AM, Sergei Shtylyov
> wrote:
>> Hello!
>>
>> On 12/22/2017 06:37 PM, Yafang Shao wrote:
>>
>>> There's a space character missed in the printk messages.
>>> Th
cepoint: replace tcp_set_state tracepoint with
inet_sock_set_state tracepoint")
Cc: Sergei Shtylyov
Signed-off-by: Yafang Shao
---
include/trace/events/sock.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h
index 3b9094a..
On Sat, Dec 23, 2017 at 1:04 AM, Sergei Shtylyov
wrote:
> Hello!
>
> On 12/22/2017 06:37 PM, Yafang Shao wrote:
>
>> There's a space character missed in the printk messages.
>> This error should be prevented with checkscri
cepoint: replace tcp_set_state tracepoint with
inet_sock_set_state tracepoint")
Signed-off-by: Yafang Shao
---
include/trace/events/sock.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h
index 3b9094a..598399da 100644
---
sk_state_load is only used by AF_INET/AF_INET6, so rename it to
inet_sk_state_load and move it into inet_sock.h.
sk_state_store is removed as it is not used any more.
Signed-off-by: Yafang Shao
---
include/net/inet_sock.h | 25 -
include/net/sock.h
;TCP_TIME_WAIT" },
{ 7, "TCP_CLOSE" },
{ 8, "TCP_CLOSE_WAIT" },
{ 9, "TCP_LAST_ACK" },
{ 10, "TCP_LISTEN" },
{ 11, "TCP_CLOSING" },
{ 12, "TCP_NEW_SYN_RECV" })
Signed-off-by: Steven Rostedt (VMware)
Acked
r protocol should be traced, I will modify the
code to trace it.
I just want to make the code easy and not output useless information.
Steven Rostedt (VMware) (1):
tcp: Export to userspace the TCP state names for the trace events
Yafang Shao (4):
net: tracepoint: replace tcp_set_state trace
With changes in inet_ files, DCCP state transitions are traced with
inet_sock_set_state tracepoint.
Signed-off-by: Yafang Shao
---
net/dccp/proto.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 9d43c1f..7a75a1d 100644
--- a/net
: Yafang Shao
---
net/sctp/endpointola.c | 2 +-
net/sctp/sm_sideeffect.c | 4 ++--
net/sctp/socket.c| 12 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c
index ee1e601..8b31468 100644
--- a/net/sctp
included in other header files,
so they are defined in sock.c.
The protocol such as SCTP maybe compiled as a ko, hence export
inet_sk_set_state().
Signed-off-by: Yafang Shao
---
include/net/inet_sock.h | 2 +
include/trace/events/sock.h | 107
2017-12-16 6:47 GMT+08:00 Song Liu :
>
>> On Dec 15, 2017, at 9:56 AM, Yafang Shao wrote:
>>
>> As sk_state is a common field for struct sock, so the state
>> transition should not be a TCP specific feature.
>> So I rename tcp_set_state tracepoint to sock_set_st
;TCP_TIME_WAIT" },
{ 7, "TCP_CLOSE" },
{ 8, "TCP_CLOSE_WAIT" },
{ 9, "TCP_LAST_ACK" },
{ 10, "TCP_LISTEN" },
{ 11, "TCP_CLOSING" },
{ 12, "TCP_NEW_SYN_RECV" })
Signed-off-by: Steven Rostedt (VMware)
Acked
1 - 100 of 135 matches
Mail list logo