Patchwork tcp: fix tcp_shifted_skb() adjustment of lost_cnt_hint for FACK

login
register
mail settings
Submitter Neal Cardwell
Date Feb. 14, 2012, 6:22 a.m.
Message ID <1329200528-19718-1-git-send-email-ncardwell@google.com>
Download mbox | patch
Permalink /patch/141051/
State Accepted
Delegated to: David Miller
Headers show

Comments

Neal Cardwell - Feb. 14, 2012, 6:22 a.m.
This commit ensures that lost_cnt_hint is correctly updated in
tcp_shifted_skb() for FACK TCP senders. The lost_cnt_hint adjustment
in tcp_sacktag_one() only applies to non-FACK senders, so FACK senders
need their own adjustment.

This applies the spirit of 1e5289e121372a3494402b1b131b41bfe1cf9b7f -
except now that the sequence range passed into tcp_sacktag_one() is
correct we need only have a special case adjustment for FACK.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
---
 net/ipv4/tcp_input.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
David Miller - Feb. 14, 2012, 7:40 p.m.
From: Neal Cardwell <ncardwell@google.com>
Date: Tue, 14 Feb 2012 01:22:08 -0500

> This commit ensures that lost_cnt_hint is correctly updated in
> tcp_shifted_skb() for FACK TCP senders. The lost_cnt_hint adjustment
> in tcp_sacktag_one() only applies to non-FACK senders, so FACK senders
> need their own adjustment.
> 
> This applies the spirit of 1e5289e121372a3494402b1b131b41bfe1cf9b7f -
> except now that the sequence range passed into tcp_sacktag_one() is
> correct we need only have a special case adjustment for FACK.
> 
> Signed-off-by: Neal Cardwell <ncardwell@google.com>

Applied, and queued up for -stable, thanks Neil.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Feb. 14, 2012, 7:41 p.m.
From: David Miller <davem@davemloft.net>
Date: Tue, 14 Feb 2012 14:40:33 -0500 (EST)

> Applied, and queued up for -stable, thanks Neil.

Sorry for the typo, I truly meant to say "Neal" :-)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ilpo Järvinen - Feb. 27, 2012, 11:39 p.m.
On Tue, 14 Feb 2012, David Miller wrote:

> From: Neal Cardwell <ncardwell@google.com>
> Date: Tue, 14 Feb 2012 01:22:08 -0500
> 
> > This commit ensures that lost_cnt_hint is correctly updated in
> > tcp_shifted_skb() for FACK TCP senders. The lost_cnt_hint adjustment
> > in tcp_sacktag_one() only applies to non-FACK senders, so FACK senders
> > need their own adjustment.
> > 
> > This applies the spirit of 1e5289e121372a3494402b1b131b41bfe1cf9b7f -
> > except now that the sequence range passed into tcp_sacktag_one() is
> > correct we need only have a special case adjustment for FACK.
> > 
> > Signed-off-by: Neal Cardwell <ncardwell@google.com>
> 
> Applied, and queued up for -stable, thanks Neil.

There has been lots of TCP related warnings posted recently to netdev.
Finding out which of these three recent changes caused which warning and 
if they're all cured by the full series is bit challenging. ...IMHO we 
should wait a bit more until these recent fixes are put to stable in order 
to verify that the dust has really settled.
Ilpo Järvinen - Feb. 27, 2012, 11:43 p.m.
...Grr, I picked up Greg's new address but ended still using his old one.
The correct is one now added.

On Tue, 28 Feb 2012, Ilpo Järvinen wrote:

> On Tue, 14 Feb 2012, David Miller wrote:
> 
> > From: Neal Cardwell <ncardwell@google.com>
> > Date: Tue, 14 Feb 2012 01:22:08 -0500
> > 
> > > This commit ensures that lost_cnt_hint is correctly updated in
> > > tcp_shifted_skb() for FACK TCP senders. The lost_cnt_hint adjustment
> > > in tcp_sacktag_one() only applies to non-FACK senders, so FACK senders
> > > need their own adjustment.
> > > 
> > > This applies the spirit of 1e5289e121372a3494402b1b131b41bfe1cf9b7f -
> > > except now that the sequence range passed into tcp_sacktag_one() is
> > > correct we need only have a special case adjustment for FACK.
> > > 
> > > Signed-off-by: Neal Cardwell <ncardwell@google.com>
> > 
> > Applied, and queued up for -stable, thanks Neil.
> 
> There has been lots of TCP related warnings posted recently to netdev.
> Finding out which of these three recent changes caused which warning and 
> if they're all cured by the full series is bit challenging. ...IMHO we 
> should wait a bit more until these recent fixes are put to stable in order 
> to verify that the dust has really settled.
Neal Cardwell - Feb. 28, 2012, 2:40 a.m.
Yes, I agree that it would make sense to hold off on adding these
three 3.3-rc4 commits to the stable tree:

cc9a672ee522d4805495b98680f4a3db5d0a0af9

daef52bab1fd26e24e8e9578f8fb33ba1d0cb412

0af2a0d0576205dda778d25c6c344fc6508fc81d

It would make sense to let the dust settle a bit more before adding
those to the stable tree.

The same goes for the http://patchwork.ozlabs.org/patch/143114/ patch
(under review) that is in the same area of the code.

neal

On Mon, Feb 27, 2012 at 6:43 PM, Ilpo Järvinen
<ilpo.jarvinen@helsinki.fi> wrote:
> ...Grr, I picked up Greg's new address but ended still using his old one.
> The correct is one now added.
>
> On Tue, 28 Feb 2012, Ilpo Järvinen wrote:
>
>> On Tue, 14 Feb 2012, David Miller wrote:
>>
>> > From: Neal Cardwell <ncardwell@google.com>
>> > Date: Tue, 14 Feb 2012 01:22:08 -0500
>> >
>> > > This commit ensures that lost_cnt_hint is correctly updated in
>> > > tcp_shifted_skb() for FACK TCP senders. The lost_cnt_hint adjustment
>> > > in tcp_sacktag_one() only applies to non-FACK senders, so FACK senders
>> > > need their own adjustment.
>> > >
>> > > This applies the spirit of 1e5289e121372a3494402b1b131b41bfe1cf9b7f -
>> > > except now that the sequence range passed into tcp_sacktag_one() is
>> > > correct we need only have a special case adjustment for FACK.
>> > >
>> > > Signed-off-by: Neal Cardwell <ncardwell@google.com>
>> >
>> > Applied, and queued up for -stable, thanks Neil.
>>
>> There has been lots of TCP related warnings posted recently to netdev.
>> Finding out which of these three recent changes caused which warning and
>> if they're all cured by the full series is bit challenging. ...IMHO we
>> should wait a bit more until these recent fixes are put to stable in order
>> to verify that the dust has really settled.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Feb. 28, 2012, 2:58 a.m.
From: Neal Cardwell <ncardwell@google.com>
Date: Mon, 27 Feb 2012 21:40:03 -0500

> Yes, I agree that it would make sense to hold off on adding these
> three 3.3-rc4 commits to the stable tree:
> 
> cc9a672ee522d4805495b98680f4a3db5d0a0af9
> 
> daef52bab1fd26e24e8e9578f8fb33ba1d0cb412
> 
> 0af2a0d0576205dda778d25c6c344fc6508fc81d
> 
> It would make sense to let the dust settle a bit more before adding
> those to the stable tree.
> 
> The same goes for the http://patchwork.ozlabs.org/patch/143114/ patch
> (under review) that is in the same area of the code.

I totally disagree and I have submitted those fixes to -stable
already and do not plan to rescind those submissions at all.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Neal Cardwell - Feb. 28, 2012, 3:45 a.m.
On Mon, Feb 27, 2012 at 9:58 PM, David Miller <davem@davemloft.net> wrote:
> From: Neal Cardwell <ncardwell@google.com>
> Date: Mon, 27 Feb 2012 21:40:03 -0500
>
>> Yes, I agree that it would make sense to hold off on adding these
>> three 3.3-rc4 commits to the stable tree:
>>
>> cc9a672ee522d4805495b98680f4a3db5d0a0af9
>>
>> daef52bab1fd26e24e8e9578f8fb33ba1d0cb412
>>
>> 0af2a0d0576205dda778d25c6c344fc6508fc81d
>>
>> It would make sense to let the dust settle a bit more before adding
>> those to the stable tree.
>>
>> The same goes for the http://patchwork.ozlabs.org/patch/143114/ patch
>> (under review) that is in the same area of the code.
>
> I totally disagree and I have submitted those fixes to -stable
> already and do not plan to rescind those submissions at all.

OK, sounds good to me. In that case I think it would be good to have
the http://patchwork.ozlabs.org/patch/143114/ patch in -stable as
well, since having just the three patches above would leave us with a
known reordering issue.

neal
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Feb. 28, 2012, 4:31 a.m.
From: Neal Cardwell <ncardwell@google.com>
Date: Mon, 27 Feb 2012 22:45:31 -0500

> On Mon, Feb 27, 2012 at 9:58 PM, David Miller <davem@davemloft.net> wrote:
>> From: Neal Cardwell <ncardwell@google.com>
>> Date: Mon, 27 Feb 2012 21:40:03 -0500
>>
>>> Yes, I agree that it would make sense to hold off on adding these
>>> three 3.3-rc4 commits to the stable tree:
>>>
>>> cc9a672ee522d4805495b98680f4a3db5d0a0af9
>>>
>>> daef52bab1fd26e24e8e9578f8fb33ba1d0cb412
>>>
>>> 0af2a0d0576205dda778d25c6c344fc6508fc81d
>>>
>>> It would make sense to let the dust settle a bit more before adding
>>> those to the stable tree.
>>>
>>> The same goes for the http://patchwork.ozlabs.org/patch/143114/ patch
>>> (under review) that is in the same area of the code.
>>
>> I totally disagree and I have submitted those fixes to -stable
>> already and do not plan to rescind those submissions at all.
> 
> OK, sounds good to me. In that case I think it would be good to have
> the http://patchwork.ozlabs.org/patch/143114/ patch in -stable as
> well, since having just the three patches above would leave us with a
> known reordering issue.

I'll make sure it hits the -stable release after the one Greg is
trying to put out right now.

The change you reference rarely matters as most of the time it passes
a degreee of reordering of one.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Neal Cardwell - Feb. 28, 2012, 4:42 a.m.
On Mon, Feb 27, 2012 at 11:31 PM, David Miller <davem@davemloft.net> wrote:
>> OK, sounds good to me. In that case I think it would be good to have
>> the http://patchwork.ozlabs.org/patch/143114/ patch in -stable as
>> well, since having just the three patches above would leave us with a
>> known reordering issue.
>
> I'll make sure it hits the -stable release after the one Greg is
> trying to put out right now.

Great. Thanks!

> The change you reference rarely matters as most of the time it passes
> a degreee of reordering of one.

Yep.

neal
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 8116d06..53c8ce4 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1403,6 +1403,10 @@  static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
 
 	BUG_ON(!pcount);
 
+	/* Adjust hint for FACK. Non-FACK is handled in tcp_sacktag_one(). */
+	if (tcp_is_fack(tp) && (skb == tp->lost_skb_hint))
+		tp->lost_cnt_hint += pcount;
+
 	TCP_SKB_CB(prev)->end_seq += shifted;
 	TCP_SKB_CB(skb)->seq += shifted;