Skip to contentSkip to conversation

2.6.10 TCP troubles -- suggested patch

DISCUSSION Hubert Tonneau 8 participants 31 messages Feb 11, 2005 – Feb 16, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Sorry, it still does not work, unless I made a mistake:
Linux 2.6.9 takes 15 seconds to copy 105 MB to Mac OSX
Linux 2.6.10 with the TCP patch below still takes 325 seconds to do the same.

You can pick the new tcpdump report, created through:
tcpdump -i eth1 ip host 10.107.96.230 -w /tmp/dump-2.6.10-tcp2 at http://fullpliant.org/pliant/browse/file/archive/dump-2.6.10-tcp2.gz

Here is the connection summary:

Dell PowerEdge 2600 (dual Xeon with hyper threading) running libsmbclient on Linux 2.6.x, IP for eth1 (Intel pro 1000) is 10.107.96.7 (full duplex, flow control is enabled)

     |
     |
gigabit switch
     |
     |
100 Mbps switch
     |
     |

Mac running Samba server on OSX,
IP is 10.107.96.230

Quoted 55 lines · David S. Miller

Hubert, try this patch instead.

===== net/ipv4/tcp_output.c 1.77 vs edited =====

net/ipv4/tcp_output.c +14 -0
@@ -408,6 +408,16 @@
 		sk->sk_send_head = skb;
 }
 
+static inline void tcp_tso_set_push(struct sk_buff *skb)
+{
+	/* Force push to be on for any TSO frames to workaround
+	 * problems with busted implementations like Mac OS-X that
+	 * hold off socket reveive wakeups until push is seen.
+	 */
+	if (tcp_skb_pcount(skb) > 1)
+		TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH;
+}
+
 /* Send _single_ skb sitting at the send head. This function requires
  * true push pending frames to setup probe timer etc.
  */
@@ -419,6 +429,7 @@
 	if (tcp_snd_test(tp, skb, cur_mss, TCP_NAGLE_PUSH)) {
 		/* Send it out now. */
 		TCP_SKB_CB(skb)->when = tcp_time_stamp;
+		tcp_tso_set_push(skb);
 		if (!tcp_transmit_skb(sk, skb_clone(skb, sk->sk_allocation))) {
 			sk->sk_send_head = NULL;
 			tp->snd_nxt = TCP_SKB_CB(skb)->end_seq;
@@ -755,6 +766,7 @@
 			}
 
 			TCP_SKB_CB(skb)->when = tcp_time_stamp;
+			tcp_tso_set_push(skb);
 			if (tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC)))
 				break;
 
@@ -1096,6 +1108,7 @@
 	 * is still in somebody's hands, else make a clone.
 	 */
 	TCP_SKB_CB(skb)->when = tcp_time_stamp;
+	tcp_tso_set_push(skb);
 
 	err = tcp_transmit_skb(sk, (skb_cloned(skb) ?
 				    pskb_copy(skb, GFP_ATOMIC):
@@ -1668,6 +1681,7 @@
 
 			TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH;
 			TCP_SKB_CB(skb)->when = tcp_time_stamp;
+			tcp_tso_set_push(skb);
 			err = tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC));
 			if (!err) {
 				update_send_head(sk, tp, skb);
#1 lore raw
Quoted 21 lines · Hubert Tonneau

Sorry, it still does not work, unless I made a mistake:
Linux 2.6.9 takes 15 seconds to copy 105 MB to Mac OSX
Linux 2.6.10 with the TCP patch below still takes 325 seconds to do the same.

You can pick the new tcpdump report, created through:
tcpdump -i eth1 ip host 10.107.96.230 -w /tmp/dump-2.6.10-tcp2 at http://fullpliant.org/pliant/browse/file/archive/dump-2.6.10-tcp2.gz

Here is the connection summary:

Dell PowerEdge 2600 (dual Xeon with hyper threading) running libsmbclient on Linux 2.6.x, IP for eth1 (Intel pro 1000) is 10.107.96.7 (full duplex, flow control is enabled)

     |
     |
gigabit switch
     |
     |
100 Mbps switch
     |
     |
Quoted 2 lines

Mac running Samba server on OSX,
IP is 10.107.96.230

"Cooking" the trace with tcpdump -ttt to give the relative timestamdps makes things look like Mac OSX has an ACK avoidance heuristic in it? I figured there was one in their OX <= 9 stack that came from a third-party, wasn't sure if they put that into their OSX stack - IIRC that one is not from the third-party.

FWIW, there are two or three other stacks that have ACK avoidance heuristics as well, it isn't an OSX only thing.

000780 10.107.96.230.139 > 10.107.96.7.32801: P 753:822(69) ack 1556 win 65535 <nop,nop,timestamp 1709240657 534173> NBT Packet (DF) 000579 10.107.96.7.32801 > 10.107.96.230.139: . 1556:3004(1448) ack 822 win 1460 <nop,nop,timestamp 534175 1709240657> NBT Packet (DF) 000027 10.107.96.7.32801 > 10.107.96.230.139: . 3004:4452(1448) ack 822 win 1460 <nop,nop,timestamp 534175 1709240657> NBT Packet (DF) 000005 10.107.96.7.32801 > 10.107.96.230.139: . 4452:5900(1448) ack 822 win 1460 <nop,nop,timestamp 534175 1709240657> NBT Packet (DF) 074685 10.107.96.230.139 > 10.107.96.7.32801: . ack 5900 win 62268 <nop,nop,timestamp 1709240657 534175> (DF)

delack above

000012 10.107.96.7.32801 > 10.107.96.230.139: . 5900:7348(1448) ack 822 win 1460 <nop,nop,timestamp 534249 1709240657> NBT Packet (DF) 000003 10.107.96.7.32801 > 10.107.96.230.139: . 7348:8796(1448) ack 822 win 1460 <nop,nop,timestamp 534249 1709240657> NBT Packet (DF) 000002 10.107.96.7.32801 > 10.107.96.230.139: . 8796:10244(1448) ack 822 win 1460 <nop,nop,timestamp 534249 1709240657> NBT Packet (DF) 000002 10.107.96.7.32801 > 10.107.96.230.139: . 10244:11692(1448) ack 822 win 1460 <nop,nop,timestamp 534249 1709240657> NBT Packet (DF) 200024 10.107.96.230.139 > 10.107.96.7.32801: . ack 11692 win 56476 <nop,nop,timestamp 1709240658 534249> (DF)

and again above.

000010 10.107.96.7.32801 > 10.107.96.230.139: . 11692:13140(1448) ack 822 win 1460 <nop,nop,timestamp 534449 1709240658> NBT Packet (DF) 000004 10.107.96.7.32801 > 10.107.96.230.139: . 13140:14588(1448) ack 822 win 1460 <nop,nop,timestamp 534449 1709240658> NBT Packet (DF) 000002 10.107.96.7.32801 > 10.107.96.230.139: P 14588:16036(1448) ack 822 win 1460 <nop,nop,timestamp 534449 1709240658> NBT Packet (DF) 000022 10.107.96.7.32801 > 10.107.96.230.139: . 16036:17484(1448) ack 822 win 1460 <nop,nop,timestamp 534449 1709240658> NBT Packet (DF) 000004 10.107.96.7.32801 > 10.107.96.230.139: P 17484:18192(708) ack 822 win 1460 <nop,nop,timestamp 534449 1709240658> NBT Packet (DF) 000994 10.107.96.230.139 > 10.107.96.7.32801: . ack 18192 win 65535 <nop,nop,timestamp 1709240658 534449> (DF)
0

And then other cases where the ACK seems to take a rather long time to arrive, seems to correlate a bit with slowly increasing numbers of segments before the ACK is sent, and something along the lines of a 200 millisecond delayed ACK timer.

In some cases at least if the sender does not completely fill cwnd the ACKs will be delayed. And IIRC under 2.6.10 with TSO enabled, the sender does not always fill cwnd.

hth,

rick jones

#2 lore raw
Quoted 11 lines · Rick Jones

000010 10.107.96.7.32801 > 10.107.96.230.139: . 11692:13140(1448) ack 822 win 1460 <nop,nop,timestamp 534449 1709240658> NBT Packet (DF) 000004 10.107.96.7.32801 > 10.107.96.230.139: . 13140:14588(1448) ack 822 win 1460 <nop,nop,timestamp 534449 1709240658> NBT Packet (DF) 000002 10.107.96.7.32801 > 10.107.96.230.139: P 14588:16036(1448) ack 822 win 1460 <nop,nop,timestamp 534449 1709240658> NBT Packet (DF) 000022 10.107.96.7.32801 > 10.107.96.230.139: . 16036:17484(1448) ack 822 win 1460 <nop,nop,timestamp 534449 1709240658> NBT Packet (DF) 000004 10.107.96.7.32801 > 10.107.96.230.139: P 17484:18192(708) ack 822 win 1460 <nop,nop,timestamp 534449 1709240658> NBT Packet (DF) 000994 10.107.96.230.139 > 10.107.96.7.32801: . ack 18192 win 65535 <nop,nop,timestamp 1709240658 534449> (DF)
0

And then other cases where the ACK seems to take a rather long time to arrive, seems to correlate a bit with slowly increasing numbers of segments before the ACK is sent, and something along the lines of a 200 millisecond delayed ACK timer.

In some cases at least if the sender does not completely fill cwnd the ACKs will be delayed. And IIRC under 2.6.10 with TSO enabled, the sender does not always fill cwnd.

Er, how is this compliant with 2581 (yes, I know, it's only a SHOULD, not a MUST) - an ACK should be generated for at least every second full-sized segment received? Don't see that happening. In many cases it's receiving quite a few more packets. It should not be waiting for the delayed ack timer to go off, surely?

thanks,
Nivedita

#3 lore raw
Quoted 5 lines

Er, how is this compliant with 2581 (yes, I know, it's only a SHOULD, not a MUST) - an ACK should be generated for at least every second full-sized segment received? Don't see that happening. In many cases it's receiving quite a few more packets. It should not be waiting for the delayed ack timer to go off, surely?

Certainly it would make for an interesting disuscion. Indeed it is a
SHOULD which leaves-open the door to compliance of other ACK policies. Those might result in an ACK for more than two segments, or even an ACK for fewer than two segments, and there are folks in either camp/faction/sect/pick your favorite term.

I would say that it is still compliant with 2581. The must there is that no matter what, an ACK must be generated within 500 milliseconds.

I suspect that had a full cwnd's worth of data been sent there would have been no lengthy delay in ACKs even with fewer than ACK-every-other. I suspect that had TSO been disabled the full cwnd would have been sent and these delayed ACKs would not have happened and the transfer speed would have been happiness and joy.

FWIW, as the industry has added features such as CKO (ChecKsum Offload), copy-avoidance, and now TSO, the pie chart of time spent has been shifting more and more to ACK processing. If we go back far enough, the writeups talk about how delayed ACK to increase ACK piggybacking was added in the first place - specifically (IIRC) for the purpose of minimizing ACK overhead.

rick jones

BTW, I'd be happy to trim emails that are already on netdev to avoid message duplications, is netdev a "closed" list?

maintainer
#4 lore raw
In reply to Nivedita Singhvi
Quoted 3 lines · On Fri, 11 Feb 2005 15:09:11 -0800 Nivedita Singhvi <[email protected]> wrote:

Er, how is this compliant with 2581 (yes, I know, it's only a SHOULD, not a MUST) - an ACK should be generated for at least every second full-sized segment received?

It's compliant but stupid.

maintainer
#5 lore raw
In reply to Rick Jones
Quoted 3 lines · On Fri, 11 Feb 2005 14:54:27 -0800 Rick Jones <[email protected]> wrote:

In some cases at least if the sender does not completely fill cwnd the ACKs will be delayed. And IIRC under 2.6.10 with TSO enabled, the sender does not always fill cwnd.

At a maximum, "1/tcp_tso_win_divisor" of the cwnd will ever be left empty.

By default, this is 1/8 of the cwnd.

#6 lore raw

Hello!

Quoted 8 lines
Quoted 3 lines

In some cases at least if the sender does not completely fill cwnd the ACKs will be delayed. And IIRC under 2.6.10 with TSO enabled, the sender does not always fill cwnd.

At a maximum, "1/tcp_tso_win_divisor" of the cwnd will ever be left empty.

By default, this is 1/8 of the cwnd.

In any case, receiver cannot know sender cwnd, so that "fill" or "not fill" is is not a question.

What is broken in that implementation is that it does not feel slow start. ACK avoidance while slow start is certain disaster. Currrent theory is that MacOS X thinks that we do not do slow start.

Alexey

maintainer
#7 lore raw
Quoted 6 lines · On Sat, 12 Feb 2005 17:31:05 +0300 Alexey Kuznetsov <[email protected]>…

In any case, receiver cannot know sender cwnd, so that "fill" or "not fill" is is not a question.

What is broken in that implementation is that it does not feel slow start. ACK avoidance while slow start is certain disaster. Currrent theory is that MacOS X thinks that we do not do slow start.

It is correct. Although, I am still believing that setting PSH is the avenue of investigation.

#8 lore raw

Typically, a TSO engine sets PSH in the last packet that it builds for the TSO+PSH request.
Leonid

Quoted 27 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of David S. Miller
Sent: Saturday, February 12, 2005 11:28 AM
To: Alexey Kuznetsov
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: 2.6.10 TCP troubles -- suggested patch

Quoted 1 line · On Sat, 12 Feb 2005 17:31:05 +0300 Alexey Kuznetsov <[email protected]>…

In any case, receiver cannot know sender cwnd, so that

"fill" or "not fill"

Quoted 3 lines

is is not a question.

What is broken in that implementation is that it does not

feel slow start.

Quoted 1 line

ACK avoidance while slow start is certain disaster.

Currrent theory is

Quoted 1 line

that MacOS X thinks that we do not do slow start.

It is correct. Although, I am still believing that setting PSH is the avenue of investigation.

#9 lore raw
In reply to David S. Miller

Hello!

Quoted 2 lines

It is correct. Although, I am still believing that setting PSH is the avenue of investigation.

Exactly. That's why the next test should be with disabled TSO in 2.6.9. If too rare PSHs were a problem, it will show as the same disaster there.

[ And, to be honest, in this case, I daresay MacOS X may be left with its bugs
alone. Or we could help it with something like setting PSH when we are in slow start and each half of CWND after completion of slow start. Or just set PSH on each frame. ]

Alexey

maintainer
#10 lore raw
Quoted 7 lines · On Sat, 12 Feb 2005 22:52:46 +0300 Alexey Kuznetsov <[email protected]>…

Exactly. That's why the next test should be with disabled TSO in 2.6.9. If too rare PSHs were a problem, it will show as the same disaster there.

[ And, to be honest, in this case, I daresay MacOS X may be left with its bugs
alone. Or we could help it with something like setting PSH when we are in slow start and each half of CWND after completion of slow start. Or just set PSH on each frame. ]

Setting it every other frame would fix the problem, just forcing it to miss header prediction path is what is needed to avoid the silly delayed ACK behavior. And PSH is one way to do that.

#11 lore raw
In reply to Alexey Kuznetsov
Quoted 6 lines · Alexey Kuznetsov

Hello!

Quoted 4 lines
Quoted 3 lines

In some cases at least if the sender does not completely fill cwnd the ACKs will be delayed. And IIRC under 2.6.10 with TSO enabled, the sender does not always fill cwnd.

Quoted 7 lines
Quoted 4 lines

At a maximum, "1/tcp_tso_win_divisor" of the cwnd will ever be left empty.

By default, this is 1/8 of the cwnd.

In any case, receiver cannot know sender cwnd, so that "fill" or "not fill" is is not a question.

How is that? Isn't cwnd based on the ACKs the sender receives from the receiver?

Quoted 3 lines

What is broken in that implementation is that it does not feel slow start. ACK avoidance while slow start is certain disaster. Currrent theory is that MacOS X thinks that we do not do slow start.

Actually, it may think slow start is being done - there was enough small packet back and forth on the connection before the "heavy transfer" to get cwnd opened - I just didn't quote that in the "cooked" output. All the stacks with ACK avoidance with which I am familiar do not make the assumption that the sender is not doing slow-start. They make sure to send enough ACKs at the beginning (or after packet loss) to allow the sender's cwnd to grow.

rick jones
wisdom teeth are impacted, people are affected by the effects of events

maintainer
#12 lore raw
Quoted 2 lines · On Sat, 12 Feb 2005 12:19:35 -0800 rick jones <[email protected]> wrote:

How is that? Isn't cwnd based on the ACKs the sender receives from the receiver?

ACKs go from sender to receiver, first of all.

It is based upon congestion as seen "by receiver", something which is impossible for sender.

#13 lore raw
In reply to rick jones

Hello!

Quoted 3 lines

Actually, it may think slow start is being done - there was enough small packet back and forth on the connection before the "heavy transfer" to get cwnd opened

If receiver sent an ACK it still does not mean that sender used it to increase its cwnd. Particularly, small packet exchange definitely does not inflate cwnd.

Quoted 4 lines

output. All the stacks with ACK avoidance with which I am familiar do not make the assumption that the sender is not doing slow-start. They make sure to send enough ACKs at the beginning (or after packet loss) to allow the sender's cwnd to grow.

Well, we do similar thing with delayed ACKs. And it took a few of runs of testing to understand that we cannot detect even packet loss reliably enough. :-)

Actually, those receivers could use the first delayed ACK event as a sign of failure of their heuristics and block stretching acks for this connection.

Alexey

#14 lore raw
Quoted 3 lines · Alexey Kuznetsov

If receiver sent an ACK it still does not mean that sender used it to increase its cwnd. Particularly, small packet exchange definitely does not inflate cwnd.

Simplest way to go about this is simply compare it to the trace of the "good/fast" connection - Hubert, could you provide the "good" trace as well? That would show where the differences in time are taken up..

thanks,
Nivedita

#15 lore raw
In reply to Alexey Kuznetsov
Quoted 4 lines

If receiver sent an ACK it still does not mean that sender used it to increase its cwnd. Particularly, small packet exchange definitely does not inflate cwnd.

Is that in general, or in Linux?

Quoted 8 lines
Quoted 4 lines

output. All the stacks with ACK avoidance with which I am familiar do not make the assumption that the sender is not doing slow-start. They make sure to send enough ACKs at the beginning (or after packet loss) to allow the sender's cwnd to grow.

Well, we do similar thing with delayed ACKs. And it took a few of runs of testing to understand that we cannot detect even packet loss reliably enough. :-)

I never claimed it was easy :)

Quoted 3 lines

Actually, those receivers could use the first delayed ACK event as a sign of failure of their heuristics and block stretching acks for this connection.

The ones with which I am familiar do - after N delayed ACK events where N is something other than one though. And they still send immediate ACKs to the senders upon out of order data and all that.

rick jones
Wisdom teeth are impacted, people are affected by the effects of events

#16 lore raw

Hello!

Quoted 1 line

Is that in general, or in Linux?

Any which follows some of congestion window validation recommendations. Even canonical bsd restarts slow start after rtt.

Quoted 1 line

N is something other than one though.

Well, 1 is quite enough to be sure that something is very wrong. You see a proof here.

Alexey

#17 lore raw
Quoted 1 line · Alexey Kuznetsov

Any which follows some of congestion window validation recommendations.

If you could point me at the chapter and verse that would be great.

Quoted 1 line

Even canonical bsd restarts slow start after rtt.

Did we have >= one RTT of idle in the packet trace?

Quoted 4 lines
Quoted 1 line

N is something other than one though.

Well, 1 is quite enough to be sure that something is very wrong. You see a proof here.

The debate of course is what :)

In and of _itself_, a delayed ACK does not guarantee something is very wrong. For example, in a request/response situation when the response takes longer than the delayed ACK interval to generate. And if it was not request/response, and the sender simply didn't have any more to send at that point.

Going back to the quantity of cwnd which may be left unused when TSO is enabled. If when TSO is enabled, the sender does not take full advantage of the cwnd doesn't that then mean that to deal with the same bandwidth delay product, one needs a larger TCP window when TSO is enabled than when it is not? In the default case of tcp_tso_win_divisor being 8 that would be another 12.5% right?

rick jones
there is no rest for the wicked, yet the virtuous have no pillows

#18 lore raw
In reply to Hubert Tonneau
Quoted 7 lines · On Fri, 11 Feb 2005 21:55:49 GMT Hubert Tonneau…

Sorry, it still does not work, unless I made a mistake:
Linux 2.6.9 takes 15 seconds to copy 105 MB to Mac OSX
Linux 2.6.10 with the TCP patch below still takes 325 seconds to do the same.

You can pick the new tcpdump report, created through:
tcpdump -i eth1 ip host 10.107.96.230 -w /tmp/dump-2.6.10-tcp2 at http://fullpliant.org/pliant/browse/file/archive/dump-2.6.10-tcp2.gz

Still not setting Push sufficiently to keep MacOSX happy.

13:40:35.027124 IP 10.107.96.230.netbios-ssn > 10.107.96.7.32801: P 924:975(51) ack 67344 win 50728 13:40:35.027186 IP 10.107.96.230.netbios-ssn > 10.107.96.7.32801: . ack 67344 win 65535 13:40:35.027328 IP 10.107.96.230.netbios-ssn > 10.107.96.7.32801: P 975:1026(51) ack 67344 win 65535 13:40:35.027363 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 67344:68792(1448) ack 1026 win 1460 13:40:35.027367 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 68792:70240(1448) ack 1026 win 1460 13:40:35.027370 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 70240:71688(1448) ack 1026 win 1460 13:40:35.027373 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 71688:73136(1448) ack 1026 win 1460 13:40:35.027375 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 73136:74584(1448) ack 1026 win 1460 13:40:35.027378 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 74584:76032(1448) ack 1026 win 1460 13:40:35.027381 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 76032:77480(1448) ack 1026 win 1460 13:40:35.027384 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 77480:78928(1448) ack 1026 win 1460 13:40:35.027387 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 78928:80376(1448) ack 1026 win 1460 13:40:35.027390 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 80376:81824(1448) ack 1026 win 1460 13:40:35.027393 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 81824:83272(1448) ack 1026 win 1460 13:40:35.027397 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: P 83272:83980(708) ack 1026 win 1460

okay burst with push

13:40:35.034930 IP 10.107.96.230.netbios-ssn > 10.107.96.7.32801: P 1179:1230(51) ack 133132 win 65535 13:40:35.035304 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 133132:134580(1448) ack 1230 win 1460 13:40:35.035312 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 134580:136028(1448) ack 1230 win 1460

Big gap... because of missing P

13:40:35.219175 IP 10.107.96.230.netbios-ssn > 10.107.96.7.32801: . ack 136028 win 63716 13:40:35.219193 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 136028:137476(1448) ack 1230 win 1460 13:40:35.219197 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 137476:138924(1448) ack 1230 win 1460 13:40:35.419193 IP 10.107.96.230.netbios-ssn > 10.107.96.7.32801: . ack 138924 win 60820 13:40:35.419202 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 138924:140372(1448) ack 1230 win 1460 13:40:35.419205 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 140372:141820(1448) ack 1230 win 1460 13:40:35.419207 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 141820:143268(1448) ack 1230 win 1460

maintainer
#19 lore raw
Quoted 1 line · On Fri, 11 Feb 2005 15:04:20 -0800 Stephen Hemminger <[email protected]>…

Still not setting Push sufficiently to keep MacOSX happy.

I don't think it's the kernel's fault in this case.

This set of data frames you quoted are all full, and are tightly interspaced. It looks exactly like a TSO frame, which we certainly set PSH on, but the TSO engine is dropping it aparently.

I guess this is e1000. Any e1000 internals experts reading here who can comment on how e1000's TSO engine treats the PSH flag?

#20 lore raw
Quoted 4 lines · David S. Miller

I guess this is e1000. Any e1000 internals experts reading here who can comment on how e1000's TSO engine treats the PSH flag?

If that is the problem it should be easy to test for. Just disable TSO with ethtool -K ethX tso off

Hubert, does that make the problem go away?

-Andi

maintainer
#21 lore raw
Quoted 10 lines · On Sat, 12 Feb 2005 13:11:43 +0100 Andi Kleen <[email protected]> wrote:
Quoted 4 lines · David S. Miller

I guess this is e1000. Any e1000 internals experts reading here who can comment on how e1000's TSO engine treats the PSH flag?

If that is the problem it should be easy to test for. Just disable TSO with ethtool -K ethX tso off

Hubert, does that make the problem go away?

We're testing the new code that sets PSH on every TSO frame. If we disable TSO, the new code won't be exercised nor tested. :-)

#22 lore raw
Quoted 3 lines

We're testing the new code that sets PSH on every TSO frame. If we disable TSO, the new code won't be exercised nor tested. :-)

Sorry, I read the thread out of order (shouldn't do that) Ignore my mail.

-Andi

#23 lore raw
In reply to David S. Miller

Hello!

Quoted 8 lines

This set of data frames you quoted are all full, and are tightly interspaced. It looks exactly like a TSO frame, which we certainly set PSH on, but the TSO engine is dropping it aparently.

I guess this is e1000. Any e1000 internals experts reading here who can comment on how e1000's TSO engine treats the PSH flag?

Or it was two one-segment frames.

Before blaming on e1000 it would be easier to confirm that linux never worked with MacOS X, except for those kernels which had congestion avoidance mostly supppressed.

I.e. let's disable TSO in 2.6.9 and look.

Alexey

maintainer
#24 lore raw
Quoted 4 lines · On Sat, 12 Feb 2005 17:16:41 +0300 Alexey Kuznetsov <[email protected]>…
Quoted 4 lines

This set of data frames you quoted are all full, and are tightly interspaced. It looks exactly like a TSO frame, which we certainly set PSH on, but the TSO engine is dropping it aparently.

...

Quoted 1 line

Or it was two one-segment frames.

Even ignoring my TSO changes, we should be seeing at a minimum 1/2 window PSH settings which we're not as far as I can tell. (this is due to the forced_push() test in net/ipv4/tcp.c)

This also points out a bug in my TSO PSH patch, I should be updating tp->pushed_seq shouldn't I? Question is, what to set it to? I think correct value is TCP_SKB_CB(skb)->end_seq.

Quoted 1 line

I.e. let's disable TSO in 2.6.9 and look.

I believe this experiment had been performed already. Stephen, isn't that the case?

#25 lore raw

Hello!

Quoted 1 line

set it to? I think correct value is TCP_SKB_CB(skb)->end_seq.

Yup. But it does not matter. When it is not advanced, it does not make PSHs more rare.

Actually, that anti-MacOS never worked well. If segment with forced PSH was not transmitted in time, even forced PSHs could be deleted. Your patch with setting PSH right before (or in) tcp_transmit_skb() must work. Unless these segments are not tso.

Quoted 3 lines
Quoted 1 line

I.e. let's disable TSO in 2.6.9 and look.

I believe this experiment had been performed already.

I saw only tests with TSO. And 2.6.9 showed exactly the same weird behaviour. Only 2.6.9 did not slow start and we had only a few of 200msec gaps.

Alexey

maintainer
#26 lore raw
Quoted 4 lines · On Sat, 12 Feb 2005 23:03:18 +0300 Alexey Kuznetsov <[email protected]>…

Actually, that anti-MacOS never worked well. If segment with forced PSH was not transmitted in time, even forced PSHs could be deleted. Your patch with setting PSH right before (or in) tcp_transmit_skb() must work. Unless these segments are not tso.

Yes, it never did work well. But now we understand more deeply the nature of this beast, we can probably refine it.

In short, for properly working TCP stream with no drops and no reordering, Darwin delays ACKs until delack timer fires or PSH is seen :-)

#27 lore raw
Quoted 4 lines

In short, for properly working TCP stream with no drops and no reordering, Darwin delays ACKs until delack timer fires or PSH is seen :-)

As a supporter of ACK avoidance heuristics in general, I will come-out and say that the heuristic above does indeed sound quite broken. It is not the heuristic with which I am familiar, which has a configurable maximum number of segments for which to delay the ACK.

rick jones

maintainer
#28 lore raw
In reply to Stephen Hemminger
Quoted 1 line · On Fri, 11 Feb 2005 15:04:20 -0800 Stephen Hemminger <[email protected]>…

Still not setting Push sufficiently to keep MacOSX happy.

...

Quoted 7 lines

13:40:35.034930 IP 10.107.96.230.netbios-ssn > 10.107.96.7.32801: P 1179:1230(51) ack 133132 win 65535 13:40:35.035304 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 133132:134580(1448) ack 1230 win 1460 13:40:35.035312 IP 10.107.96.7.32801 > 10.107.96.230.netbios-ssn: . 134580:136028(1448) ack 1230 win 1460

Big gap... because of missing P

13:40:35.219175 IP 10.107.96.230.netbios-ssn > 10.107.96.7.32801: . ack 136028 win 63716

I am starting to understand Darwin's logic. If header prediction fast path is hit, ACK is always delayed when delack sysctl is enabled.

One way to miss fast path is for PSH to be set.

This will make ACK not get delayed if ACK is pending already.

At least that is how it looks, and it makes sense given this trace.

How mind boggling a heuristic. I bet it works by accident rather than intention and purposeful design.

#29 lore raw

Hello!

Quoted 2 lines

How mind boggling a heuristic. I bet it works by accident rather than intention and purposeful design.

Yup. It is definitely not an "ack avoidance algorithm" :-) :-)

BTW it is still a puzzle why 2.6.9 works. With disabled TSO it should insert PSHs quite rarely, similarly to tso.

And it is still a puzzle how that bunch of PSHless segments not followed by PSH appeared in TSO case.

Alexey

maintainer
#30 lore raw
Quoted 2 lines · On Wed, 16 Feb 2005 12:13:23 +0300 Alexey Kuznetsov <[email protected]>…

BTW it is still a puzzle why 2.6.9 works. With disabled TSO it should insert PSHs quite rarely, similarly to tso.

Yes.

Hubert, do you have netfilter enabled in the 2.6.10 kernel you are running?

I'm asking because the TCP changes in 2.6.10 are pretty benign (attached for the curious who want to review along), whereas netfilter had major updates particularly in the TCP connection tracking code.

I also reviewed 2.6.10-ac11 for anything interesting wrt. TCP and the only thing in there is the tcp_retrans_try_collapse() missing check to avoid collapsing TSO segments.