From: Ian Campbell Subject: Re: [PATCH] netfront/back: do not mark packets of length < MSS as GSO Date: Tue, 13 Jan 2009 12:51:37 +0000 Message-ID: <1231851097.7263.9.camel@zakaz.uk.xensource.com> References: <5b29f1081b2061cf56fa.1231847973@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5b29f1081b2061cf56fa.1231847973@localhost.localdomain> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Should clear gso_type too: changeset: 774:cb5ad51f5206cb2b756ac1c5731ee47f7e3b8273 tag: tip user: Ian Campbell date: Tue Jan 13 12:50:26 2009 +0000 files: drivers/xen/netback/netback.c drivers/xen/netfront/netfront.c description: 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 diff -r 28acedb66302a29c9ef14a3084b4736d3fc192f1 -r cb5ad51f5206cb2b756ac1c5731ee47f7e3b8273 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 12:50:26 2009 +0000 @@ -1345,6 +1345,11 @@ 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_shinfo(skb)->gso_type = 0; + } + __skb_queue_tail(&tx_queue, skb); pending_cons++; diff -r 28acedb66302a29c9ef14a3084b4736d3fc192f1 -r cb5ad51f5206cb2b756ac1c5731ee47f7e3b8273 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 12:50:26 2009 +0000 @@ -1439,6 +1439,14 @@ err: np->stats.rx_packets++; np->stats.rx_bytes += skb->len; +#if HAVE_TSO + if (skb->data_len < skb_shinfo(skb)->gso_size) { + skb_shinfo(skb)->gso_size = 0; +#if HAVE_GSO + skb_shinfo(skb)->gso_type = 0; +#endif + } +#endif __skb_queue_tail(&rxq, skb); np->rx.rsp_cons = ++i;