From: David Miller <davem@davemloft.net>
To: hkchu@google.com
Cc: eric.dumazet@gmail.com, hannemann@nets.rwth-aachen.de,
hagen@jauu.net, lars.eggert@nokia.com, netdev@vger.kernel.org
Subject: Re: [PATCH] TCP_USER_TIMEOUT: a new socket option to specify max timeout before a TCP connection is aborted
Date: Sat, 28 Aug 2010 16:13:20 -0700 (PDT) [thread overview]
Message-ID: <20100828.161320.245404727.davem@davemloft.net> (raw)
In-Reply-To: <1282972408-19164-1-git-send-email-hkchu@google.com>
From: "H.K. Jerry Chu" <hkchu@google.com>
Date: Fri, 27 Aug 2010 22:13:28 -0700
> @@ -556,7 +559,14 @@ static void tcp_keepalive_timer (unsigned long data)
> elapsed = keepalive_time_elapsed(tp);
>
> if (elapsed >= keepalive_time_when(tp)) {
> - if (icsk->icsk_probes_out >= keepalive_probes(tp)) {
> + /* If the TCP_USER_TIMEOUT option is enabled, use that
> + * to determine when to timeout instead.
> + */
> + if ((icsk->icsk_user_timeout != 0 &&
> + elapsed >= icsk->icsk_user_timeout &&
> + icsk->icsk_probes_out > 0) ||
> + (icsk->icsk_user_timeout == 0 &&
> + icsk->icsk_probes_out >= keepalive_probes(tp))) {
> tcp_send_active_reset(sk, GFP_ATOMIC);
> tcp_write_err(sk);
> goto out;
I think if we want to add a socket option which overrides, it makes
more sense to provide overrides in the same units. This
transformation here is transforming a check against apples into a
check against oranges.
But if that's how this thing is specified, so be it... I guess. :-/
next prev parent reply other threads:[~2010-08-28 23:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-28 5:13 [PATCH] TCP_USER_TIMEOUT: a new socket option to specify max timeout before a TCP connection is aborted H.K. Jerry Chu
2010-08-28 23:13 ` David Miller [this message]
2010-08-30 0:23 ` Jerry Chu
2010-08-30 4:19 ` David Miller
2010-08-30 6:54 ` Jerry Chu
2010-08-30 20:25 ` David Miller
2010-08-30 20:30 ` Eric Dumazet
2010-08-30 20:47 ` David Miller
2010-08-30 22:41 ` Jerry Chu
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=20100828.161320.245404727.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=hagen@jauu.net \
--cc=hannemann@nets.rwth-aachen.de \
--cc=hkchu@google.com \
--cc=lars.eggert@nokia.com \
--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).