From: David Miller <davem@davemloft.net>
To: gerrit@erg.abdn.ac.uk
Cc: dccp@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 4/7] [CCID-3]: Fix "t_ipi explosion" bug
Date: Tue, 27 May 2008 06:35:33 -0700 (PDT) [thread overview]
Message-ID: <20080527.063533.185406813.davem@davemloft.net> (raw)
In-Reply-To: <1211877167-10995-5-git-send-email-gerrit@erg.abdn.ac.uk>
From: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Date: Tue, 27 May 2008 09:32:44 +0100
> The identification of this bug is thanks to Cheng Wei and Tomasz Grobelny.
>
> To avoid divide-by-zero, the implementation previously ignored RTTs smaller
> than 4 microseconds when performing integer division RTT/4.
>
> When the RTT reached a value less than 4 microseconds (as observed on loopback),
> this prevented the Window Counter CCVal value from advancing. As a result, the
> receiver stopped sending feedback. This in turn caused non-ending expiries of
> the nofeedback timer at the sender, so that the sending rate was progressively
> reduced until reaching the minimum of one packet per 64 seconds.
>
> The patch fixes this bug by handling integer division more intelligently. Due to
> consistent use of dccp_sample_rtt(), divide-by-zero-RTT is avoided.
>
> Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Because you're mixing coding style cleanups, both of which I've
just NACK'd, with real bug fixes, you're making a lot of work for
me.
Bug fixes go into net-2.6 and anything else goes into net-next-2.6
I've backported this patch into net-2.6, therefore without all the
hctx prefix changes.
dccp ccid-3: Fix "t_ipi explosion" bug
The identification of this bug is thanks to Cheng Wei and Tomasz
Grobelny.
To avoid divide-by-zero, the implementation previously ignored RTTs
smaller than 4 microseconds when performing integer division RTT/4.
When the RTT reached a value less than 4 microseconds (as observed on
loopback), this prevented the Window Counter CCVal value from
advancing. As a result, the receiver stopped sending feedback. This in
turn caused non-ending expiries of the nofeedback timer at the sender,
so that the sending rate was progressively reduced until reaching the
minimum of one packet per 64 seconds.
The patch fixes this bug by handling integer division more
intelligently. Due to consistent use of dccp_sample_rtt(),
divide-by-zero-RTT is avoided.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/dccp/ccids/ccid3.c | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index cd61dea..f813077 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -193,22 +193,17 @@ static inline void ccid3_hc_tx_update_s(struct ccid3_hc_tx_sock *hctx, int len)
/*
* Update Window Counter using the algorithm from [RFC 4342, 8.1].
- * The algorithm is not applicable if RTT < 4 microseconds.
+ * As elsewhere, RTT > 0 is assumed by using dccp_sample_rtt().
*/
static inline void ccid3_hc_tx_update_win_count(struct ccid3_hc_tx_sock *hctx,
ktime_t now)
{
- u32 quarter_rtts;
-
- if (unlikely(hctx->ccid3hctx_rtt < 4)) /* avoid divide-by-zero */
- return;
-
- quarter_rtts = ktime_us_delta(now, hctx->ccid3hctx_t_last_win_count);
- quarter_rtts /= hctx->ccid3hctx_rtt / 4;
+ u32 delta = ktime_us_delta(now, hctx->ccid3hctx_t_last_win_count),
+ quarter_rtts = (4 * delta) / hctx->ccid3hctx_rtt;
if (quarter_rtts > 0) {
hctx->ccid3hctx_t_last_win_count = now;
- hctx->ccid3hctx_last_win_count += min_t(u32, quarter_rtts, 5);
+ hctx->ccid3hctx_last_win_count += min(quarter_rtts, 5U);
hctx->ccid3hctx_last_win_count &= 0xF; /* mod 16 */
}
}
--
1.5.5.1.308.g1fbb5
next prev parent reply other threads:[~2008-05-27 13:35 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <dccp_bug_fixes_and_format_updates>
2008-05-27 8:32 ` [DCCP] [Patch 0/7]: Bug fixes and format updates Gerrit Renker
2008-05-27 8:32 ` [PATCH 1/7] [DCCP]: Fix to handle short sequence numbers packet correctly Gerrit Renker
2008-05-27 8:32 ` [PATCH 2/7] [CCID-2]: Remove ccid2hc{tx,rx}_ prefixes Gerrit Renker
2008-05-27 8:32 ` [PATCH 3/7] [CCID-3]: Remove ccid3hc{tx,rx}_ prefixes Gerrit Renker
2008-05-27 8:32 ` [PATCH 4/7] [CCID-3]: Fix "t_ipi explosion" bug Gerrit Renker
2008-05-27 8:32 ` [PATCH 5/7] [CCID-3]: Remove ugly RTT-sampling history lookup Gerrit Renker
2008-05-27 8:32 ` [PATCH 6/7] [CCID-2/3]: Fix sparse warnings Gerrit Renker
2008-05-27 8:32 ` [PATCH 7/7] [TCP][DCCP]: Consolidate duplicate code which does RFC3390 conversion Gerrit Renker
2008-05-27 13:37 ` David Miller
2008-05-28 6:24 ` [Patch v2 1/1] [tcp/dccp]: " Gerrit Renker
2008-05-31 13:49 ` [Patch v3 " Gerrit Renker
2008-05-27 13:37 ` [PATCH 6/7] [CCID-2/3]: Fix sparse warnings David Miller
2008-05-27 13:36 ` [PATCH 5/7] [CCID-3]: Remove ugly RTT-sampling history lookup David Miller
2008-05-27 13:35 ` David Miller [this message]
2008-05-27 14:16 ` [PATCH 4/7] [CCID-3]: Fix "t_ipi explosion" bug Gerrit Renker
2008-05-27 13:26 ` [PATCH 3/7] [CCID-3]: Remove ccid3hc{tx,rx}_ prefixes David Miller
2008-05-27 13:25 ` [PATCH 2/7] [CCID-2]: Remove ccid2hc{tx,rx}_ prefixes David Miller
2008-05-27 14:07 ` Gerrit Renker
2008-05-27 19:31 ` David Miller
2008-05-27 13:22 ` [PATCH 1/7] [DCCP]: Fix to handle short sequence numbers packet correctly David Miller
2008-05-28 6:12 ` [DCCP] [Patch 0/7]: Bug fixes and format updates Gerrit Renker
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=20080527.063533.185406813.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dccp@vger.kernel.org \
--cc=gerrit@erg.abdn.ac.uk \
--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).