RE: TCP keepalive timer problem

From: Li_Xin2
Date: Thu Aug 27 2009 - 21:56:26 EST



> Yep, so to recap we have two changes :

> 1) The one I sent (taking into account the time of last ACK we
received) to compute the
> timer delays.

> 2) The one you suggest, avoiding to send a probe if we have packets in
flight, relying
> on normal retransmits timers.

I agree with these two changes, but I think the patch for point 2 given
by Eric is not correct:


elapsed = keepalive_time_when(tp);

if (tp->packets_out || tcp_send_head(sk))
if (tcp_retries2_time < keepalive_time_when(tp))
goto resched;
elapsed = tcp_time_stamp - tp->rcv_tstamp;


The problem is: you should not always compare tcp_retries2_time with
keepalive_time_when. If the first keepalive probe is already sent, you
should compare with keepalive_intvl_when
( or keepalive_intvl_when * (
tp->keepalive_probes?:sysctl_tcp_keepalive_probes -
icsk->icsk_probes_out ) if keepalive probe is already sent, and the
elapsed time also needs to take that into account.

elapsed =
icsk->icsk_probes_out?keepalive_intvl_when(tp):keepalive_time_when(tp);

if (tp->packets_out || tcp_send_head(sk))
if (tcp_retries2_time < (icsk->icsk_probes_out?
keepalive_intvl_when(tp) : keepalive_time_when(tp))
goto resched;
elapsed = tcp_time_stamp - tp->rcv_tstamp;

How do you think?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/