<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/sctp/outqueue.c, branch linux-4.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-10-01T11:14:30Z</updated>
<entry>
<title>sctp: move trace_sctp_probe_path into sctp_outq_sack</title>
<updated>2020-10-01T11:14:30Z</updated>
<author>
<name>Kevin Kou</name>
</author>
<published>2019-12-26T12:29:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=479468bef2fa4845cd894ad352181b619195fe70'/>
<id>urn:sha1:479468bef2fa4845cd894ad352181b619195fe70</id>
<content type='text'>
[ Upstream commit f643ee295c1c63bc117fb052d4da681354d6f732 ]

The original patch bringed in the "SCTP ACK tracking trace event"
feature was committed at Dec.20, 2017, it replaced jprobe usage
with trace events, and bringed in two trace events, one is
TRACE_EVENT(sctp_probe), another one is TRACE_EVENT(sctp_probe_path).
The original patch intended to trigger the trace_sctp_probe_path in
TRACE_EVENT(sctp_probe) as below code,

+TRACE_EVENT(sctp_probe,
+
+	TP_PROTO(const struct sctp_endpoint *ep,
+		 const struct sctp_association *asoc,
+		 struct sctp_chunk *chunk),
+
+	TP_ARGS(ep, asoc, chunk),
+
+	TP_STRUCT__entry(
+		__field(__u64, asoc)
+		__field(__u32, mark)
+		__field(__u16, bind_port)
+		__field(__u16, peer_port)
+		__field(__u32, pathmtu)
+		__field(__u32, rwnd)
+		__field(__u16, unack_data)
+	),
+
+	TP_fast_assign(
+		struct sk_buff *skb = chunk-&gt;skb;
+
+		__entry-&gt;asoc = (unsigned long)asoc;
+		__entry-&gt;mark = skb-&gt;mark;
+		__entry-&gt;bind_port = ep-&gt;base.bind_addr.port;
+		__entry-&gt;peer_port = asoc-&gt;peer.port;
+		__entry-&gt;pathmtu = asoc-&gt;pathmtu;
+		__entry-&gt;rwnd = asoc-&gt;peer.rwnd;
+		__entry-&gt;unack_data = asoc-&gt;unack_data;
+
+		if (trace_sctp_probe_path_enabled()) {
+			struct sctp_transport *sp;
+
+			list_for_each_entry(sp, &amp;asoc-&gt;peer.transport_addr_list,
+					    transports) {
+				trace_sctp_probe_path(sp, asoc);
+			}
+		}
+	),

But I found it did not work when I did testing, and trace_sctp_probe_path
had no output, I finally found that there is trace buffer lock
operation(trace_event_buffer_reserve) in include/trace/trace_events.h:

static notrace void							\
trace_event_raw_event_##call(void *__data, proto)			\
{									\
	struct trace_event_file *trace_file = __data;			\
	struct trace_event_data_offsets_##call __maybe_unused __data_offsets;\
	struct trace_event_buffer fbuffer;				\
	struct trace_event_raw_##call *entry;				\
	int __data_size;						\
									\
	if (trace_trigger_soft_disabled(trace_file))			\
		return;							\
									\
	__data_size = trace_event_get_offsets_##call(&amp;__data_offsets, args); \
									\
	entry = trace_event_buffer_reserve(&amp;fbuffer, trace_file,	\
				 sizeof(*entry) + __data_size);		\
									\
	if (!entry)							\
		return;							\
									\
	tstruct								\
									\
	{ assign; }							\
									\
	trace_event_buffer_commit(&amp;fbuffer);				\
}

The reason caused no output of trace_sctp_probe_path is that
trace_sctp_probe_path written in TP_fast_assign part of
TRACE_EVENT(sctp_probe), and it will be placed( { assign; } ) after the
trace_event_buffer_reserve() when compiler expands Macro,

        entry = trace_event_buffer_reserve(&amp;fbuffer, trace_file,        \
                                 sizeof(*entry) + __data_size);         \
                                                                        \
        if (!entry)                                                     \
                return;                                                 \
                                                                        \
        tstruct                                                         \
                                                                        \
        { assign; }                                                     \

so trace_sctp_probe_path finally can not acquire trace_event_buffer
and return no output, that is to say the nest of tracepoint entry function
is not allowed. The function call flow is:

trace_sctp_probe()
-&gt; trace_event_raw_event_sctp_probe()
 -&gt; lock buffer
 -&gt; trace_sctp_probe_path()
   -&gt; trace_event_raw_event_sctp_probe_path()  --nested
   -&gt; buffer has been locked and return no output.

This patch is to remove trace_sctp_probe_path from the TP_fast_assign
part of TRACE_EVENT(sctp_probe) to avoid the nest of entry function,
and trigger sctp_probe_path_trace in sctp_outq_sack.

After this patch, you can enable both events individually,
  # cd /sys/kernel/debug/tracing
  # echo 1 &gt; events/sctp/sctp_probe/enable
  # echo 1 &gt; events/sctp/sctp_probe_path/enable

Or, you can enable all the events under sctp.

  # echo 1 &gt; events/sctp/enable

Signed-off-by: Kevin Kou &lt;qdkevin.kou@gmail.com&gt;
Acked-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>sctp: define SCTP_SS_DEFAULT for Stream schedulers</title>
<updated>2018-11-23T07:17:06Z</updated>
<author>
<name>Xin Long</name>
</author>
<published>2018-11-03T06:01:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cc8d2e5309ecc32162e70a285748fca4c5bd052e'/>
<id>urn:sha1:cc8d2e5309ecc32162e70a285748fca4c5bd052e</id>
<content type='text'>
[ Upstream commit 12480e3b16982c4026de10dd8155823219cd6391 ]

According to rfc8260#section-4.3.2, SCTP_SS_DEFAULT is required to
defined as SCTP_SS_FCFS or SCTP_SS_RR.

SCTP_SS_FCFS is used for SCTP_SS_DEFAULT's value in this patch.

Fixes: 5bbbbe32a431 ("sctp: introduce stream scheduler foundations")
Reported-by: Jianwen Ji &lt;jiji@redhat.com&gt;
Signed-off-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>sctp: fix fall-through annotation</title>
<updated>2018-10-03T16:33:13Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
</author>
<published>2018-10-03T10:45:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2cc543f5cd6deda27ef463686fa08c16c8c0990b'/>
<id>urn:sha1:2cc543f5cd6deda27ef463686fa08c16c8c0990b</id>
<content type='text'>
Replace "fallthru" with a proper "fall through" annotation.

This fix is part of the ongoing efforts to enabling
-Wimplicit-fallthrough

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/sctp: Make wrappers for accessing in/out streams</title>
<updated>2018-08-11T19:25:15Z</updated>
<author>
<name>Konstantin Khorenko</name>
</author>
<published>2018-08-10T17:11:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=05364ca03cfd419caecb292fede20eb39667eaae'/>
<id>urn:sha1:05364ca03cfd419caecb292fede20eb39667eaae</id>
<content type='text'>
This patch introduces wrappers for accessing in/out streams indirectly.
This will enable to replace physically contiguous memory arrays
of streams with flexible arrays (or maybe any other appropriate
mechanism) which do memory allocation on a per-page basis.

Signed-off-by: Oleg Babin &lt;obabin@virtuozzo.com&gt;
Signed-off-by: Konstantin Khorenko &lt;khorenko@virtuozzo.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: checkpatch fixups</title>
<updated>2018-05-15T03:15:27Z</updated>
<author>
<name>Marcelo Ricardo Leitner</name>
</author>
<published>2018-05-14T17:35:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5884f35f0d8924a1937c040e420255800c45ef0e'/>
<id>urn:sha1:5884f35f0d8924a1937c040e420255800c45ef0e</id>
<content type='text'>
A collection of fixups from previous patches, left for later to not
introduce unnecessary changes while moving code around.

Signed-off-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: add asoc and packet to sctp_flush_ctx</title>
<updated>2018-05-15T03:15:27Z</updated>
<author>
<name>Marcelo Ricardo Leitner</name>
</author>
<published>2018-05-14T17:35:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e136e965df596d8e4fffa4ae0b202fd4c388568f'/>
<id>urn:sha1:e136e965df596d8e4fffa4ae0b202fd4c388568f</id>
<content type='text'>
Pre-compute these so the compiler won't reload them (due to
no-strict-aliasing).

Changes since v2:
- Do not replace a return with a break in sctp_outq_flush_data

Signed-off-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: add sctp_flush_ctx, a context struct on outq_flush routines</title>
<updated>2018-05-15T03:15:27Z</updated>
<author>
<name>Marcelo Ricardo Leitner</name>
</author>
<published>2018-05-14T17:35:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bb543847a9c1b3904180b22add5e522f1f6c11c7'/>
<id>urn:sha1:bb543847a9c1b3904180b22add5e522f1f6c11c7</id>
<content type='text'>
With this struct we avoid passing lots of variables around and taking care
of updating the current transport/packet.

Signed-off-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: rework switch cases in sctp_outq_flush_data</title>
<updated>2018-05-15T02:57:15Z</updated>
<author>
<name>Marcelo Ricardo Leitner</name>
</author>
<published>2018-05-14T17:34:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4fdbb0efb9de51295071fdf968d476c1f0605d21'/>
<id>urn:sha1:4fdbb0efb9de51295071fdf968d476c1f0605d21</id>
<content type='text'>
Remove an inner one, which tended to be error prone due to the cascading
and it can be replaced by a simple if ().

Rework the outer one so that the actual flush code is not inside it. Now
we first validate if we can or cannot send data, return if not, and then
the flush code.

Suggested-by: Xin Long &lt;lucien.xin@gmail.com&gt;
Signed-off-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: make use of gfp on retransmissions</title>
<updated>2018-05-15T02:57:15Z</updated>
<author>
<name>Marcelo Ricardo Leitner</name>
</author>
<published>2018-05-14T17:34:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6605f694823965fe53ce761dad3aaf965861dc7e'/>
<id>urn:sha1:6605f694823965fe53ce761dad3aaf965861dc7e</id>
<content type='text'>
Retransmissions may be triggered when in user context, so lets make use
of gfp.

Signed-off-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sctp: move transport flush code out of sctp_outq_flush</title>
<updated>2018-05-15T02:57:15Z</updated>
<author>
<name>Marcelo Ricardo Leitner</name>
</author>
<published>2018-05-14T17:34:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4bf21b61f2bb3611ddb4fb75170c83905dd5c29e'/>
<id>urn:sha1:4bf21b61f2bb3611ddb4fb75170c83905dd5c29e</id>
<content type='text'>
To the new sctp_outq_flush_transports.

Comment on Nagle is outdated and removed. Nagle is performed earlier, while
checking if the chunk fits the packet: if the outq length is not enough to
fill the packet, it returns SCTP_XMIT_DELAY.

So by when it gets to sctp_outq_flush_transports, it has to go through all
enlisted transports.

Signed-off-by: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
