Re: [PATCH] fix tcp_default_win_scale.

From: John Heffner
Date: Wed Jul 07 2004 - 14:48:22 EST


On Tue, 6 Jul 2004, Stephen Hemminger wrote:

> +/* Default window scaling based on the size of the maximum window */
> +static inline __u8 tcp_default_win_scale(void)
> +{
> + int b = ffs(sysctl_tcp_rmem[2]);
> + return (b < 17) ? 0 : b-16;
> +}


I would actually change this to be:

static inline __u8 tcp_select_win_scale(void)
{
int b = ffs(tcp_win_from_space(max(sysctl_tcp_rmem[2], sysctl_rmem_max)));
b = (b < 17) ? 0 : b-16;
return max(b, 14);
}

Then you can also get rid of all the window scale calculation code in
tcp_select_initial_window().

-John

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html