From patchwork Mon May 21 17:36:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 160400 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 8F47EB6F62 for ; Tue, 22 May 2012 04:00:07 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932680Ab2EUR7k (ORCPT ); Mon, 21 May 2012 13:59:40 -0400 Received: from rcsinet15.oracle.com ([148.87.113.117]:38899 "EHLO rcsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759351Ab2EURnN (ORCPT ); Mon, 21 May 2012 13:43:13 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q4LHh6kR009402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 21 May 2012 17:43:07 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q4LHh5nO015219 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 May 2012 17:43:06 GMT Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q4LHh5Tt009612; Mon, 21 May 2012 12:43:05 -0500 Received: from phenom.dumpdata.com (/209.6.85.33) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 21 May 2012 10:43:04 -0700 Received: by phenom.dumpdata.com (Postfix, from userid 1000) id E6B55402FB; Mon, 21 May 2012 13:36:38 -0400 (EDT) From: Konrad Rzeszutek Wilk To: xen-devel@lists.xensource.com, ian.campbell@citrix.com, netdev@vger.kernel.org, davem@davemloft.net, linux-kernel@vger.kernel.org Cc: Adnan Misherfi , Konrad Rzeszutek Wilk Subject: [PATCH] xen/netback: calculate correctly the SKB slots. Date: Mon, 21 May 2012 13:36:33 -0400 Message-Id: <1337621793-12486-1-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 1.7.7.5 X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Adnan Misherfi A programming error cause the calculation of receive SKB slots to be wrong, which caused the RX ring to be erroneously declared full, and the receive queue to be stopped. The problem shows up when two guest running on the same server tries to communicates using large MTUs. Each guest is connected to a bridge with VLAN over bond interface, so traffic from one guest leaves the server on one bridge and comes back to the second guest on the second bridge. This can be reproduces using ping, and one guest as follow: - Create active-back bond (bond0) - Set up VLAN 5 on bond0 (bond0.5) - Create a bridge (br1) - Add bond0.5 to a bridge (br1) - Start a guest and connect it to br1 - Set MTU of 9000 across the link Ping the guest from an external host using packet sizes of 3991, and 4054; ping -s 3991 -c 128 "Guest-IP-Address" At the beginning ping works fine, but after a while ping packets do not reach the guest because the RX ring becomes full, and the queue get stopped. Once the problem accrued, the only way to get out of it is to reboot the guest, or use xm network-detach/network-attach. ping works for packets sizes 3990,3992, and many other sizes including 4000,5000,9000, and 1500 ..etc. MTU size of 3991,4054 are the sizes that quickly reproduce this problem. Signed-off-by: Adnan Misherfi Signed-off-by: Konrad Rzeszutek Wilk --- drivers/net/xen-netback/netback.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index 957cf9d..e382e5b 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -212,7 +212,7 @@ unsigned int xenvif_count_skb_slots(struct xenvif *vif, struct sk_buff *skb) int i, copy_off; count = DIV_ROUND_UP( - offset_in_page(skb->data)+skb_headlen(skb), PAGE_SIZE); + offset_in_page(skb->data + skb_headlen(skb)), PAGE_SIZE); copy_off = skb_headlen(skb) % PAGE_SIZE;