From patchwork Wed Oct 10 12:29:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 190631 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 7D4892C008A for ; Wed, 10 Oct 2012 23:30:00 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755537Ab2JJM3x (ORCPT ); Wed, 10 Oct 2012 08:29:53 -0400 Received: from smtp.eu.citrix.com ([62.200.22.115]:14847 "EHLO SMTP.EU.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754940Ab2JJM3m (ORCPT ); Wed, 10 Oct 2012 08:29:42 -0400 X-IronPort-AV: E=Sophos;i="4.80,564,1344211200"; d="scan'208";a="15073845" Received: from lonpmailmx01.citrite.net ([10.30.203.162]) by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5; 10 Oct 2012 12:29:10 +0000 Received: from [10.80.2.42] (10.80.2.42) by LONPMAILMX01.citrite.net (10.30.203.162) with Microsoft SMTP Server id 8.3.279.1; Wed, 10 Oct 2012 13:29:10 +0100 Message-ID: <1349872149.10070.31.camel@zakaz.uk.xensource.com> Subject: Re: [Xen-devel] compound skb frag pages appearing in start_xmit From: Ian Campbell To: Sander Eikelenboom CC: Eric Dumazet , "netdev@vger.kernel.org" , Eric Dumazet , "Konrad Rzeszutek Wilk" , xen-devel Date: Wed, 10 Oct 2012 13:29:09 +0100 In-Reply-To: <1622789731.20121010142428@eikelenboom.it> References: <1349790467.21847.185.camel@zakaz.uk.xensource.com> <1349790863.21172.4406.camel@edumazet-glaptop> <1349792241.21847.199.camel@zakaz.uk.xensource.com> <1349792847.21172.4479.camel@edumazet-glaptop> <1349793630.21847.208.camel@zakaz.uk.xensource.com> <1349863984.10070.26.camel@zakaz.uk.xensource.com> <1622789731.20121010142428@eikelenboom.it> Organization: Citrix Systems, Inc. X-Mailer: Evolution 3.4.3-1 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, 2012-10-10 at 13:24 +0100, Sander Eikelenboom wrote: > Wednesday, October 10, 2012, 12:13:04 PM, you wrote: > > > On Tue, 2012-10-09 at 15:40 +0100, Ian Campbell wrote: > >> On Tue, 2012-10-09 at 15:27 +0100, Eric Dumazet wrote: > >> > On Tue, 2012-10-09 at 15:17 +0100, Ian Campbell wrote: > >> > > >> > > Does the higher order pages effectively reduce the number of frags which > >> > > are in use? e.g if MAX_SKB_FRAGS is 16, then for order-0 pages you could > >> > > have 64K worth of frag data. > >> > > > >> > > If we switch to order-3 pages everywhere then can the skb contain 512K > >> > > of data, or does the effective maximum number of frags in an skb reduce > >> > > to 2? > >> > > >> > effective number of frags reduce to 2 or 3 > >> > > >> > (We still limit GSO packets to ~63536 bytes) > >> > >> Great! Then I think the fix is more/less trivial... > > > The following seems to work for me. > > But it doesn't seem to work for me ... dmesg attached. > [ 191.777994] ------------[ cut here ]------------ > [ 191.784245] kernel BUG at drivers/net/xen-netback/netback.c:481! Looks like that BUG_ON is a little aggressive. It'll trigger if the data happens to end on a frame boundary. Hopefully this will fix it for you: --- 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-netback/netback.c b/drivers/net/xen-netback/netback.c index d747e30..f2d6b78 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -477,7 +477,7 @@ static void netbk_gop_frag_copy(struct xenvif *vif, struct sk_buff *skb, size -= bytes; /* Next frame */ - if (offset == PAGE_SIZE) { + if (offset == PAGE_SIZE && size) { BUG_ON(!PageCompound(page)); page++; offset = 0;