netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* de-indirect TCP congestion control
@ 2018-03-12 18:45 Stephen Hemminger
  2018-03-12 19:04 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2018-03-12 18:45 UTC (permalink / raw)
  To: Eric Dumazet, David Miller; +Cc: netdev

Since indirect calls are expensive, and now even more so, perhaps we should figure out
a way to make the default TCP congestion control hooks into direct calls.
99% of the users just use the single CC module compiled into the kernel.

Use some macros (or other stuff) to change indirect call to direct
calls. So that code like:

static void tcp_cong_avoid(struct sock *sk, u32 ack, u32 acked)
{
	const struct inet_connection_sock *icsk = inet_csk(sk);

	icsk->icsk_ca_ops->cong_avoid(sk, ack, acked);

to:

static void tcp_cong_avoid(struct sock *sk, u32 ack, u32 acked)
{
	const struct tcp_congestion_ops *ops = inet_csk(sk)->icsk_ca_ops;

	if (ops == default_tcp_ops)
		default_tcp_cong_avoid(s, ack, acked);
	else
		icsk->icsk_ca_ops->cong_avoid(sk, ack, acked);


The use macros and/or compiler symbols so the builtin (non-module) congestion
control is always default_tcp_XXX.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-12 20:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-12 18:45 de-indirect TCP congestion control Stephen Hemminger
2018-03-12 19:04 ` David Miller
2018-03-12 19:48   ` Stephen Hemminger
2018-03-12 20:03     ` Eric Dumazet
2018-03-12 20:05       ` David Miller
2018-03-12 20:51         ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).