netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Eric Dumazet <eric.dumazet@gmail.com>,
	David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: de-indirect TCP congestion control
Date: Mon, 12 Mar 2018 11:45:52 -0700	[thread overview]
Message-ID: <20180312114552.3f51e6ac@xeon-e3> (raw)

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.

             reply	other threads:[~2018-03-12 18:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12 18:45 Stephen Hemminger [this message]
2018-03-12 19:04 ` de-indirect TCP congestion control 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180312114552.3f51e6ac@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).