Thread (32 messages) 32 messages, 6 authors, 2018-08-11

RE: [PATCH v2 1/2] net/sctp: Make wrappers for accessing in/out streams

From: David Laight <hidden>
Date: 2018-08-03 18:37:05
Also in: linux-sctp

From: Konstantin Khorenko
Sent: 03 August 2018 17:21
...
quoted hunk ↗ jump to hunk
--- a/net/sctp/stream.c
+++ b/net/sctp/stream.c
@@ -37,6 +37,18 @@
 #include <net/sctp/sm.h>
 #include <net/sctp/stream_sched.h>

+struct sctp_stream_out *sctp_stream_out(const struct sctp_stream *stream,
+					__u16 sid)
+{
+	return ((struct sctp_stream_out *)(stream->out)) + sid;
+}
+
+struct sctp_stream_in *sctp_stream_in(const struct sctp_stream *stream,
+				      __u16 sid)
+{
+	return ((struct sctp_stream_in *)(stream->in)) + sid;
+}
+
Those look like they ought to be static inlines in the header file.
Otherwise you'll be making SCTP performance worse that it is already.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help