[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1449507824.25029.76.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Mon, 07 Dec 2015 09:03:44 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Per Hurtig <per.hurtig@....se>
Cc: davem@...emloft.net, edumazet@...gle.com, ncardwell@...gle.com,
nanditad@...gle.com, tom@...bertland.com, ycheng@...gle.com,
viro@...iv.linux.org.uk, fw@...len.de, mleitner@...hat.com,
daniel@...earbox.net, willemb@...gle.com,
ilpo.jarvinen@...sinki.fi, pasi.sarolahti@....fi,
stephen@...workplumber.org, netdev@...r.kernel.org,
anna.brunstrom@....se, apetlund@...ula.no, michawe@....uio.no,
mohammad.rajiullah@....se
Subject: Re: [RFC PATCH net-next 1/2] tcp: RTO Restart (RTOR)
On Mon, 2015-12-07 at 10:00 +0100, Per Hurtig wrote:
\
>
> +static u32 tcp_unsent_pkts(const struct sock *sk)
> +{
> + struct sk_buff *skb = tcp_send_head(sk);
> + u32 pkts = 0;
> +
> + if (skb)
> + tcp_for_write_queue_from(skb, sk)
> + pkts += tcp_skb_pcount(skb);
> +
> + return pkts;
> +}
write queue can be very big (consider GSO/TSO being off for example)
Parsing it just to implement later :
(tp->packets_out + tcp_unsent_pkts(sk) <
> + TCP_RTORESTART_THRESH)
is probably not very efficient.
I would rather implement a different helper, aborting the loop as soon
as the condition can not be met anymore.
> +
> /* Restart timer after forward progress on connection.
> * RFC2988 recommends to restart timer to now+rto.
> */
> @@ -3027,6 +3040,17 @@ void tcp_rearm_rto(struct sock *sk)
> */
> if (delta > 0)
> rto = delta;
> + } else if (icsk->icsk_pending == ICSK_TIME_RETRANS &&
> + (sysctl_tcp_timer_restart == 1 ||
> + sysctl_tcp_timer_restart == 3) &&
> + (tp->packets_out + tcp_unsent_pkts(sk) <
> + TCP_RTORESTART_THRESH)) {
> + struct sk_buff *skb = tcp_write_queue_head(sk);
> + const u32 rto_time_stamp = tcp_skb_timestamp(skb);
> + s32 delta = (s32)(tcp_time_stamp - rto_time_stamp);
> +
> + if (delta > 0 && rto > delta)
> + rto -= delta;
> }
> inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, rto,
> TCP_RTO_MAX);
--
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