WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] netfront/back: do not mark packets of length < MSS a

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] netfront/back: do not mark packets of length < MSS as GSO
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Tue, 13 Jan 2009 11:59:33 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Tue, 13 Jan 2009 04:00:07 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1231847296 0
# Node ID 5b29f1081b2061cf56fa57ed67fef25cc1426a57
# Parent  28acedb66302a29c9ef14a3084b4736d3fc192f1
netfront/back: do not mark packets of length < MSS as GSO

Linux assumes that skbs marked for GSO are longer than MSS. In
particular tcp_tso_segment assumes that skb_segment will return a
chain of at least 2 skbs.

Both netfront and back should therefor not pass such a packet up the
stack.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 28acedb66302 -r 5b29f1081b20 drivers/xen/netback/netback.c
--- a/drivers/xen/netback/netback.c     Wed Jan 07 12:21:54 2009 +0900
+++ b/drivers/xen/netback/netback.c     Tue Jan 13 11:48:16 2009 +0000
@@ -1345,6 +1345,9 @@ static void net_tx_action(unsigned long 
                        skb_shinfo(skb)->frags[0].page = (void *)~0UL;
                }
 
+               if (skb->data_len < skb_shinfo(skb)->gso_size)
+                       skb_shinfo(skb)->gso_size = 0;
+
                __skb_queue_tail(&tx_queue, skb);
 
                pending_cons++;
diff -r 28acedb66302 -r 5b29f1081b20 drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c   Wed Jan 07 12:21:54 2009 +0900
+++ b/drivers/xen/netfront/netfront.c   Tue Jan 13 11:48:16 2009 +0000
@@ -1439,6 +1439,10 @@ err:
                np->stats.rx_packets++;
                np->stats.rx_bytes += skb->len;
 
+#ifdef HAVE_TSO
+               if (skb->data_len < skb_shinfo(skb)->gso_size)
+                       skb_shinfo(skb)->gso_size = 0;
+#endif
                __skb_queue_tail(&rxq, skb);
 
                np->rx.rsp_cons = ++i;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

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