From patchwork Thu Jun 11 22:59:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rusty Russell X-Patchwork-Id: 28609 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id E5710B7199 for ; Fri, 12 Jun 2009 08:59:40 +1000 (EST) Received: by ozlabs.org (Postfix) id D4E5DDDDE1; Fri, 12 Jun 2009 08:59:40 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 69690DDDD4 for ; Fri, 12 Jun 2009 08:59:40 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762180AbZFKW73 (ORCPT ); Thu, 11 Jun 2009 18:59:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761626AbZFKW73 (ORCPT ); Thu, 11 Jun 2009 18:59:29 -0400 Received: from ozlabs.org ([203.10.76.45]:37895 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760644AbZFKW72 (ORCPT ); Thu, 11 Jun 2009 18:59:28 -0400 Received: from vivaldi.localnet (unknown [150.101.102.135]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPSA id D861CDDDB6; Fri, 12 Jun 2009 08:59:29 +1000 (EST) From: Rusty Russell To: Herbert Xu Subject: [PATCH] virtio_net: Fix IP alignment on non-mergeable RX path Date: Fri, 12 Jun 2009 08:29:22 +0930 User-Agent: KMail/1.11.2 (Linux/2.6.28-11-generic; KDE/4.2.2; i686; ; ) Cc: Sridhar Samudrala , Mark McLoughlin , Danielius Kudinskas , aliguori@linux.vnet.ibm.com, Paul T Knowles , netdev@vger.kernel.org References: <1244743266.9669.64.camel@w-sridhar.beaverton.ibm.com> <20090611205003.GA8677@gondor.apana.org.au> In-Reply-To: <20090611205003.GA8677@gondor.apana.org.au> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200906120829.23999.rusty@rustcorp.com.au> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Herbert Xu We need to enforce the IP alignment on the non-mergeable RX path just like the other RX path. Not doing so results in misaligned IP headers. Signed-off-by: Herbert Xu Signed-off-by: Rusty Russell --- 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/virtio_net.c b/drivers/net/virtio_net.c index 4d1d479..52fba8e 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -283,10 +283,11 @@ static void try_fill_recv_maxbufs(struct virtnet_info *vi) for (;;) { struct virtio_net_hdr *hdr; - skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN); + skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN + NET_IP_ALIGN); if (unlikely(!skb)) break; + skb_reserve(skb, NET_IP_ALIGN); skb_put(skb, MAX_PACKET_LEN); hdr = skb_vnet_hdr(skb);