netdev
[Top] [All Lists]

TSO and MSS

To: <davem@xxxxxxxxxxxxx>
Subject: TSO and MSS
From: John Heffner <jheffner@xxxxxxx>
Date: Wed, 29 Sep 2004 18:38:52 -0400 (EDT)
Cc: <netdev@xxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
While playing with TSO I noticed that two machines on the same ethernet
with dissimilar MTUs don't work with TSO enabled.  One could argue the
incorrecness of this situation, but I think it's still important.  Looks
like the segment size is only set from the path MTU, and the TCP MSS is
ignored.  Here's the offending code.

net/ipv4/ip_output.c:ip_queue_xmit():

        mtu = dst_pmtu(&rt->u.dst);
        if (skb->len > mtu && (sk->sk_route_caps & NETIF_F_TSO)) {
                unsigned int hlen;

                /* Hack zone: all this must be done by TCP. */
                hlen = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2));
                skb_shinfo(skb)->tso_size = mtu - hlen;
                skb_shinfo(skb)->tso_segs =
                        (skb->len - hlen + skb_shinfo(skb)->tso_size - 1)/
                                skb_shinfo(skb)->tso_size - 1;
        }

Does the "Hack zone" comment indicate this case has already been
considered?

Thanks,
  -John


<Prev in Thread] Current Thread [Next in Thread>