Thread (30 messages) 30 messages, 5 authors, 2017-12-11

Re: [PATCHv2 net-next 04/12] sctp: implement make_datafrag for sctp_stream_interleave

flat view

From: Neil Horman <nhorman@tuxdriver.com>
Date: 2017-12-08 16:09:45
Also in: linux-sctp

On Fri, Dec 08, 2017 at 04:04:58PM +0000, David Laight wrote:
From: Marcelo Ricardo Leitner
quoted
Sent: 08 December 2017 16:00
...
quoted
quoted
Is it worth replacing the si struct with an index/enum value, and indexing an
array of method pointer structs?  That would save you at least one dereference.
Hmmm, maybe, yes. It would be like
sctp_stream_interleave[asoc->stream.si].make_datafrag(...)
If you only expect 2 choices then an if () is likely
to produce better code that the above.

The actual implementation can be hidden inside a #define
or static inline function.
Thats the real question though, will we expect more than two interleaving
strategies?  Currently its a boolean operation so the answer seems like yes, but
is there a possiblity of a biased interleaving, or other worthwhile algorithm?

Neil
	David

--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help