[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1319760097.19125.55.camel@edumazet-laptop>
Date: Fri, 28 Oct 2011 02:01:37 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Daniel Baluta <dbaluta@...acom.com>
Cc: davem@...emloft.net, kuznet@....inr.ac.ru, jmorris@...ei.org,
yoshfuji@...ux-ipv6.org, kaber@...sh.net, netdev@...r.kernel.org
Subject: Re: [RFC] tcp: Export TCP Delayed ACK parameters to user
Le vendredi 28 octobre 2011 à 02:07 +0300, Daniel Baluta a écrit :
> RFC2581 ($4.2) specifies when an ACK should be generated as follows:
>
> " .. an ACK SHOULD be generated for at least every second
> full-sized segment, and MUST be generated within 500 ms
> of the arrival of the first unacknowledged packet.
> "
>
> We export the number of segments and the timeout limits
> specified above, so that a user can tune them according
> to its needs.
>
Well, this requires user has a machine exclusive use :)
> Specifically:
> * /proc/sys/net/ipv4/tcp_delack_segs, represents
> the threshold for the number of segments.
> * /proc/sys/net/ipv4/tcp_delack_min, specifies
> the minimum timeout value
> * /proc/sys/net/ipv4/tcp_delack_max, specifies
> the maximum timeout value.
>
> Signed-off-by: Daniel Baluta <dbaluta@...acom.com>
> ---
> include/net/tcp.h | 20 +++++++++++++++++---
> net/ipv4/sysctl_net_ipv4.c | 21 +++++++++++++++++++++
> net/ipv4/tcp.c | 5 +++--
> net/ipv4/tcp_input.c | 7 +++++--
> net/ipv4/tcp_output.c | 4 +++-
> 5 files changed, 49 insertions(+), 8 deletions(-)
>
Missing Documentation changes
> diff --git a/include/net/tcp.h b/include/net/tcp.h
> index e147f42..f3b0c17 100644
> --- a/include/net/tcp.h
> +++ b/include/net/tcp.h
> @@ -111,14 +111,21 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
> * TIME-WAIT timer.
> */
>
> -#define TCP_DELACK_MAX ((unsigned)(HZ/5)) /* maximal time to delay before sending an ACK */
> +/* default maximum time to delay before sending an ACK */
> +#define TCP_DELACK_MAX_DEFAULT ((unsigned)(HZ/5))
> +
> #if HZ >= 100
> -#define TCP_DELACK_MIN ((unsigned)(HZ/25)) /* minimal time to delay before sending an ACK */
> +/* default minimum time to delay before sending an ACK */
> +#define TCP_DELACK_MIN_DEFAULT ((unsigned)(HZ/25))
> #define TCP_ATO_MIN ((unsigned)(HZ/25))
> #else
> -#define TCP_DELACK_MIN 4U
> +#define TCP_DELACK_MIN_DEFAULT 4U
> #define TCP_ATO_MIN 4U
> #endif
> +
> +#define TCP_DELACK_MIN sysctl_tcp_delack_min
> +#define TCP_DELACK_MAX sysctl_tcp_delack_max
Hmm, please try to compile dccp as a module :)
You need some EXPORT_SYMBOL() definitions.
Frankly, I suggest removing TCP_DELACK_{MIN|MAX} to avoid unecessary
layer, and use sysctl_tcp_delack_{min|max} instead
> +
> #define TCP_RTO_MAX ((unsigned)(120*HZ))
> #define TCP_RTO_MIN ((unsigned)(HZ/5))
> #define TCP_TIMEOUT_INIT ((unsigned)(1*HZ)) /* RFC2988bis initial RTO value */
> @@ -251,6 +258,9 @@ extern int sysctl_tcp_max_ssthresh;
> extern int sysctl_tcp_cookie_size;
> extern int sysctl_tcp_thin_linear_timeouts;
> extern int sysctl_tcp_thin_dupack;
> +extern int sysctl_tcp_delack_segs;
> +extern int sysctl_tcp_delack_min;
> +extern int sysctl_tcp_delack_max;
>
> extern atomic_long_t tcp_memory_allocated;
> extern struct percpu_counter tcp_sockets_allocated;
> @@ -1557,6 +1567,10 @@ static inline struct tcp_extend_values *tcp_xv(struct request_values *rvp)
> {
> return (struct tcp_extend_values *)rvp;
> }
> +static inline int tcp_snd_thresh(struct sock *sk)
I am not sure name is properly chosen, its about delack or not ?
const struct *sk
> +{
> + return inet_csk(sk)->icsk_ack.rcv_mss * sysctl_tcp_delack_segs;
> +}
>
Thanks !
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists