Re: [PATCH] TCP-Hybla proposal

David S. Miller
2005-02-22T19:10:48Z

On Tue, 22 Feb 2005 09:42:19 -0800
Stephen Hemminger <shemminger@osdl.org> wrote:

> The protocol choices are mutually exclusive, if you walk through the code
> (or do experiments), you find that that only one gets used. As part of the
> longer term plan, I would like to:
> - have one sysctl
> - choice by route and destination
> - union for fields in control block

Let's take a first baby step and make the congestion control
algorithm a single enumeration instead of all of this
tp->foo_cong_ctrl_on, tp->bar_cong_ctrl_on stuff. Then make
the union to shrink the tcp_sock size, we could even use an
anonymous union to make the patch a lot smaller.

We can't just get rid of all the existing sysctls. We can
add a new one that just makes the choice as you describe.
We could therefore do something like this:

enum tcp_congctrl_alg tcp_global_congctrl_alg;

And then we use a special sysctl handler for all the individual
sysctl_tcp_bic et al. enablers that does something like:

if (tcp_global_congctrl_alg == TCP_CONGCTRL_BIC)
return 1;
return 0;

and setting just does the necessary assignment to
tcp_global_congctrl_alg. Well... I hope the sysctl framework
allows something like this :-) If not, it should not be hard to
add.