From patchwork Sat Jan 22 00:58:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Fitzhardinge X-Patchwork-Id: 79970 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C6115B70EE for ; Sat, 22 Jan 2011 11:59:09 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752813Ab1AVA7E (ORCPT ); Fri, 21 Jan 2011 19:59:04 -0500 Received: from claw.goop.org ([74.207.240.146]:41978 "EHLO claw.goop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750791Ab1AVA7C (ORCPT ); Fri, 21 Jan 2011 19:59:02 -0500 Received: from abulafia.goop.org (c-98-210-109-72.hsd1.ca.comcast.net [98.210.109.72]) (Authenticated sender: jeremy) by claw.goop.org (Postfix) with ESMTPSA id A6697D5FC; Fri, 21 Jan 2011 19:59:00 -0500 (EST) Message-ID: <4D3A2BD2.5030802@goop.org> Date: Fri, 21 Jan 2011 16:58:58 -0800 From: Jeremy Fitzhardinge User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.7 MIME-Version: 1.0 To: Ian Campbell CC: netdev@vger.kernel.org, xen-devel@lists.xensource.com Subject: Re: [PATCH] xen: netfront: Drop GSO SKBs which do not have csum_blank. References: <1294233811-28123-1-git-send-email-ian.campbell@citrix.com> In-Reply-To: <1294233811-28123-1-git-send-email-ian.campbell@citrix.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 01/05/2011 05:23 AM, Ian Campbell wrote: > The Linux network stack expects all GSO SKBs to have ip_summed == > CHECKSUM_PARTIAL (which implies that the frame contains a partial > checksum) and the Xen network ring protocol similarly expects an SKB > which has GSO set to also have NETRX_csum_blank (which also implies a > partial checksum). Therefore drop such frames on receive otherwise > they will trigger the warning in skb_gso_segment. > > Signed-off-by: Ian Campbell > Cc: Jeremy Fitzhardinge > Cc: xen-devel@lists.xensource.com > Cc: netdev@vger.kernel.org > --- > drivers/net/xen-netfront.c | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c > index cdbeec9..8b8c480 100644 > --- a/drivers/net/xen-netfront.c > +++ b/drivers/net/xen-netfront.c > @@ -836,6 +836,11 @@ static int handle_incoming_queue(struct net_device *dev, > dev->stats.rx_errors++; > continue; > } > + } else if (skb_is_gso(skb)) { > + kfree_skb(skb); > + packets_dropped++; > + dev->stats.rx_errors++; > + continue; This looks redundant; why not something like: Thanks, J --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 47e6a71..c1b8f64 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -852,13 +852,12 @@ static int handle_incoming_queue(struct net_device *dev, /* Ethernet work: Delayed to here as it peeks the header. */ skb->protocol = eth_type_trans(skb, dev); - if (skb->ip_summed == CHECKSUM_PARTIAL) { - if (skb_checksum_setup(skb)) { - kfree_skb(skb); - packets_dropped++; - dev->stats.rx_errors++; - continue; - } + if (skb->ip_summed != CHECKSUM_PARTIAL || + skb_checksum_setup(skb)) { + kfree_skb(skb); + packets_dropped++; + dev->stats.rx_errors++; + continue; } dev->stats.rx_packets++;