Skip to contentSkip to conversation

LRO fix needed

DISCUSSION David Miller 2 participants 3 messages Aug 31, 2006 – Sep 1, 2006

Subsystems (2)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

Ananda, Herbert Xu recently found a problem in the TCP stack input path for LRO capable receive paths.

The issue is that the receive MSS estimator in
tcp_measure_rcv_mss() uses skb->len for the MSS
estimation. This is wrong for LRO frames.

Herbert noticed this using Xen which pused TSO frames on output back into the destination TCP stack on input so it looks exactly like LRO.

His fix to tcp_measure_rcv_mss() is to use skb_shared_info(skb)->gso_size if it is non-zero, else skb->len, in the assignment to "len".

So could you please make the S2io driver LRO path set skb_shared_info(skb)->gso_size appropriately? Probably the easiest is to use the length of the first frag of a multiple frag LRO sequence.

Also, could we have a linux/MAINTAINERS entry added for the S2io driver?

Thanks.

#1 lore raw
Quoted 5 lines · David Miller

So could you please make the S2io driver LRO path
set skb_shared_info(skb)->gso_size appropriately?
Probably the easiest is to use the length of the
first frag of a multiple frag LRO sequence.

It might be better to set it to the biggest frag you see rather than the first.

Cheers,

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#2 lore raw
Quoted 3 lines · herbert

It might be better to set it to the biggest frag you see rather than the first.

I've coded it up.

BTW Ananda, what hardware assistance do your chips currently provide for LRO? What are the timeouts used before it gives up on aggregating a session?

[NETDRV] s2io: Set gso_size for LRO to TCP stack

Now that the TCP stack uses gso_size to estimate the receive MSS, it helps to actually set it :)

Unlike the sending side, there is no single MSS that naturally pops up for LRO. However, for our purposes the maximal TCP payload size is the most appropriate for estimating MSS.

Cheers,

Signature · 5 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
drivers/net/s2io.c +4 -0
index e72e0e0..3ebc789 100644
@@ -6522,6 +6522,8 @@ static int rx_osm_handler(ring_info_t *r
 						&tcp_len, &lro, rxdp, sp);
 				switch (ret) {
 					case 3: /* Begin anew */
+						skb_shinfo(skb)->gso_size =
+							tcp_len;
 						lro->parent = skb;
 						goto aggregate;
 					case 1: /* Aggregate */
@@ -7556,6 +7558,8 @@ static void lro_append_pkt(nic_t *sp, lr
 {
 	struct sk_buff *first = lro->parent;
 
+	if (tcp_len > skb_shinfo(first)->gso_size)
+		skb_shinfo(first)->gso_size = tcp_len;
 	first->len += tcp_len;
 	first->data_len = lro->frags_len;
 	skb_pull(skb, (skb->len - tcp_len));