netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: ilpo.jarvinen@helsinki.fi
Cc: fleitner@redhat.com, netdev@vger.kernel.org, eric.dumazet@gmail.com
Subject: Re: [PATCH v3] TCP: avoid to send keepalive probes if receiving data
Date: Mon, 26 Apr 2010 11:24:22 -0700 (PDT)	[thread overview]
Message-ID: <20100426.112422.246526700.davem@davemloft.net> (raw)
In-Reply-To: <alpine.DEB.2.00.1004261241510.7041@wel-95.cs.helsinki.fi>

From: "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
Date: Mon, 26 Apr 2010 12:47:13 +0300 (EEST)

>>  			    !((1 << sk->sk_state) &
>>  			      (TCPF_CLOSE | TCPF_LISTEN))) {
>> -				__u32 elapsed = tcp_time_stamp - tp->rcv_tstamp;
>> +				u32 elapsed = min_t(u32,
>> +				      tcp_time_stamp - icsk->icsk_ack.lrcvtime,
>> +				      tcp_time_stamp - tp->rcv_tstamp);
>> +
> 
> I'd put this into a helper in include/net/tcp.h
> 
 ...
>> +	if (elapsed < keepalive_time_when(tp)) {
>> +		elapsed = keepalive_time_when(tp) - elapsed;
>> +		goto resched;
>> +	}
>> +
>>  	elapsed = tcp_time_stamp - tp->rcv_tstamp;
> 
> ...And then use it here too for setting the elapsed and doing the test 
> and what follows only once?
> 

Agreed.

  reply	other threads:[~2010-04-26 18:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-16 15:06 TCP keepalive question Flavio Leitner
2010-04-17 17:28 ` [PATCH] TCP: avoid to send keepalive probes if it is receiving data Flavio Leitner
2010-04-18  9:06   ` Eric Dumazet
2010-04-18 14:55     ` [PATCH v2] " Flavio Leitner
2010-04-18 17:15       ` Eric Dumazet
2010-04-18 20:34         ` Ilpo Järvinen
2010-04-22  5:42           ` David Miller
2010-04-25 23:55             ` Flavio Leitner
2010-04-26  2:40               ` [PATCH v3] TCP: avoid to send keepalive probes if " Flavio Leitner
2010-04-26  9:47                 ` Ilpo Järvinen
2010-04-26 18:24                   ` David Miller [this message]
2010-04-27  4:33                     ` [PATCH v4] " Flavio Leitner
2010-04-27  5:06                       ` Eric Dumazet
2010-04-27  6:08                       ` Ilpo Järvinen
2010-04-27 19:55                         ` David Miller
2010-04-25 23:44         ` [PATCH v2] TCP: avoid to send keepalive probes if it is " Flavio Leitner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100426.112422.246526700.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=fleitner@redhat.com \
    --cc=ilpo.jarvinen@helsinki.fi \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).