<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/include/trace/events/sock.h, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/include/trace/events/sock.h?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/include/trace/events/sock.h?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2021-06-29T18:28:21Z</updated>
<entry>
<title>net: sock: add trace for socket errors</title>
<updated>2021-06-29T18:28:21Z</updated>
<author>
<name>Alexander Aring</name>
<email>aahringo@redhat.com</email>
</author>
<published>2021-06-27T22:48:22Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e6a3e4434000de5c36d606e5b5da5f7ba49444bd'/>
<id>urn:sha1:e6a3e4434000de5c36d606e5b5da5f7ba49444bd</id>
<content type='text'>
This patch will add tracers to trace inet socket errors only. A user
space monitor application can track connection errors indepedent from
socket lifetime and do additional handling. For example a cluster
manager can fence a node if errors occurs in a specific heuristic.

Signed-off-by: Alexander Aring &lt;aahringo@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tcp: Define IPPROTO_MPTCP</title>
<updated>2020-01-10T02:41:41Z</updated>
<author>
<name>Mat Martineau</name>
<email>mathew.j.martineau@linux.intel.com</email>
</author>
<published>2020-01-09T15:59:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=faf391c3826cd29feae02078ca2022d2f912f7cc'/>
<id>urn:sha1:faf391c3826cd29feae02078ca2022d2f912f7cc</id>
<content type='text'>
To open a MPTCP socket with socket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP),
IPPROTO_MPTCP needs a value that differs from IPPROTO_TCP. The existing
IPPROTO numbers mostly map directly to IANA-specified protocol numbers.
MPTCP does not have a protocol number allocated because MPTCP packets
use the TCP protocol number. Use private number not used OTA.

Reviewed-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: Mat Martineau &lt;mathew.j.martineau@linux.intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sock: Make sk_protocol a 16-bit value</title>
<updated>2020-01-10T02:41:41Z</updated>
<author>
<name>Mat Martineau</name>
<email>mathew.j.martineau@linux.intel.com</email>
</author>
<published>2020-01-09T15:59:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=bf9765145b856fa2e238a5b8a54453795ba30ad6'/>
<id>urn:sha1:bf9765145b856fa2e238a5b8a54453795ba30ad6</id>
<content type='text'>
Match the 16-bit width of skbuff-&gt;protocol. Fills an 8-bit hole so
sizeof(struct sock) does not change.

Also take care of BPF field access for sk_type/sk_protocol. Both of them
are now outside the bitfield, so we can use load instructions without
further shifting/masking.

v5 -&gt; v6:
 - update eBPF accessors, too (Intel's kbuild test robot)
v2 -&gt; v3:
 - keep 'sk_type' 2 bytes aligned (Eric)
v1 -&gt; v2:
 - preserve sk_pacing_shift as bit field (Eric)

Cc: Alexei Starovoitov &lt;ast@kernel.org&gt;
Cc: Daniel Borkmann &lt;daniel@iogearbox.net&gt;
Cc: bpf@vger.kernel.org
Co-developed-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Co-developed-by: Matthieu Baerts &lt;matthieu.baerts@tessares.net&gt;
Signed-off-by: Matthieu Baerts &lt;matthieu.baerts@tessares.net&gt;
Signed-off-by: Mat Martineau &lt;mathew.j.martineau@linux.intel.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tcp: annotate sk-&gt;sk_wmem_queued lockless reads</title>
<updated>2019-10-13T17:13:08Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2019-10-11T03:17:46Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ab4e846a82d0ae00176de19f2db3c5c64f8eb5f2'/>
<id>urn:sha1:ab4e846a82d0ae00176de19f2db3c5c64f8eb5f2</id>
<content type='text'>
For the sake of tcp_poll(), there are few places where we fetch
sk-&gt;sk_wmem_queued while this field can change from IRQ or other cpu.

We need to add READ_ONCE() annotations, and also make sure write
sides use corresponding WRITE_ONCE() to avoid store-tearing.

sk_wmem_queued_add() helper is added so that we can in
the future convert to ADD_ONCE() or equivalent if/when
available.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tcp: annotate sk-&gt;sk_rcvbuf lockless reads</title>
<updated>2019-10-13T17:13:08Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2019-10-11T03:17:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=ebb3b78db7bf842270a46fd4fe7cc45c78fa5ed6'/>
<id>urn:sha1:ebb3b78db7bf842270a46fd4fe7cc45c78fa5ed6</id>
<content type='text'>
For the sake of tcp_poll(), there are few places where we fetch
sk-&gt;sk_rcvbuf while this field can change from IRQ or other cpu.

We need to add READ_ONCE() annotations, and also make sure write
sides use corresponding WRITE_ONCE() to avoid store-tearing.

Note that other transports probably need similar fixes.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: expose sk wmem in sock_exceed_buf_limit tracepoint</title>
<updated>2018-07-02T13:40:56Z</updated>
<author>
<name>Yafang Shao</name>
<email>laoar.shao@gmail.com</email>
</author>
<published>2018-07-01T15:31:30Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d6f19938eb031ee2158272757db33258153ae59c'/>
<id>urn:sha1:d6f19938eb031ee2158272757db33258153ae59c</id>
<content type='text'>
Currently trace_sock_exceed_buf_limit() only show rmem info,
but wmem limit may also be hit.
So expose wmem info in this tracepoint as well.

Regarding memcg, I think it is better to introduce a new tracepoint(if
that is needed), i.e. trace_memcg_limit_hit other than show memcg info in
trace_sock_exceed_buf_limit.

Signed-off-by: Yafang Shao &lt;laoar.shao@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: tracepoint: exposing sk_faimily in tracepoint inet_sock_set_state</title>
<updated>2018-01-08T19:32:45Z</updated>
<author>
<name>Yafang Shao</name>
<email>laoar.shao@gmail.com</email>
</author>
<published>2018-01-07T06:31:47Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=0c3b34d804947fef7fb9e74912b7b7563729231e'/>
<id>urn:sha1:0c3b34d804947fef7fb9e74912b7b7563729231e</id>
<content type='text'>
As of now, there're two sk_family are traced with sock:inet_sock_set_state,
which are AF_INET and AF_INET6.
So the sk_family are exposed as well.
Then we can conveniently use it to do the filter.

Both sk_family and sk_protocol are showed in the printk message, so we need
not expose them as tracepoint arguments.

Suggested-by: Brendan Gregg &lt;brendan.d.gregg@gmail.com&gt;
Suggested-by: Song Liu &lt;songliubraving@fb.com&gt;
Signed-off-by: Yafang Shao &lt;laoar.shao@gmail.com&gt;
Reviewed-by: Song Liu &lt;songliubraving@fb.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/trace: fix printk format in inet_sock_set_state</title>
<updated>2017-12-27T22:03:44Z</updated>
<author>
<name>Yafang Shao</name>
<email>laoar.shao@gmail.com</email>
</author>
<published>2017-12-24T15:10:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=4f36b935ec83e592fd5e866f382c0133b3cffc60'/>
<id>urn:sha1:4f36b935ec83e592fd5e866f382c0133b3cffc60</id>
<content type='text'>
There's a space character missed in the printk messages.

Put the message into one line could simplify searching for
the messages in the kernel source.

Fixes: 563e0bb0dc74("net: tracepoint: replace tcp_set_state tracepoint with inet_sock_set_state tracepoint")
Cc: Sergei Shtylyov &lt;sergei.shtylyov@cogentembedded.com&gt;
Signed-off-by: Yafang Shao &lt;laoar.shao@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: tracepoint: replace tcp_set_state tracepoint with inet_sock_set_state tracepoint</title>
<updated>2017-12-20T19:00:25Z</updated>
<author>
<name>Yafang Shao</name>
<email>laoar.shao@gmail.com</email>
</author>
<published>2017-12-20T03:12:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=563e0bb0dc74b3ca888e24f8c08f0239fe4016b0'/>
<id>urn:sha1:563e0bb0dc74b3ca888e24f8c08f0239fe4016b0</id>
<content type='text'>
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 state transition, so I rename this
tracepoint to inet_sock_set_state tracepoint with some minor changes and move it
into trace/events/sock.h.
We dont need to create a file named trace/events/inet_sock.h for this one single
tracepoint.

Two helpers are introduced to trace sk_state transition
    - void inet_sk_state_store(struct sock *sk, int newstate);
    - void inet_sk_set_state(struct sock *sk, int state);
As trace header should not be 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 &lt;laoar.shao@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: allow per netns sysctl_rmem and sysctl_wmem for protos</title>
<updated>2017-11-10T05:34:58Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2017-11-07T08:29:27Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a3dcaf17ee54f1d01d22cc2b22cab0b4f60d78cf'/>
<id>urn:sha1:a3dcaf17ee54f1d01d22cc2b22cab0b4f60d78cf</id>
<content type='text'>
As we want to gradually implement per netns sysctl_rmem and sysctl_wmem
on per protocol basis, add two new fields in struct proto,
and two new helpers : sk_get_wmem0() and sk_get_rmem0()

First user will be TCP. Then UDP and SCTP can be easily converted,
while DECNET probably wont get this support.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
