From patchwork Wed Oct 15 00:50:42 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Fitzhardinge X-Patchwork-Id: 4539 X-Patchwork-Delegate: jgarzik@pobox.com 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.176.167]) by ozlabs.org (Postfix) with ESMTP id 65B57DDE31 for ; Wed, 15 Oct 2008 11:56:41 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751753AbYJOA4a (ORCPT ); Tue, 14 Oct 2008 20:56:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751564AbYJOA43 (ORCPT ); Tue, 14 Oct 2008 20:56:29 -0400 Received: from gw.goop.org ([64.81.55.164]:36863 "EHLO mail.goop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751309AbYJOA42 (ORCPT ); Tue, 14 Oct 2008 20:56:28 -0400 Received: by lurch.goop.org (Postfix, from userid 223) id 371852C8053; Tue, 14 Oct 2008 17:56:26 -0700 (PDT) MIME-Version: 1.0 Subject: [PATCH 3 of 5] xen-netfront: Avoid unaligned accesses to IP header X-Mercurial-Node: d3d2ad0d95db689f77abec9af20b271f30ad3910 Message-Id: In-Reply-To: Date: Tue, 14 Oct 2008 17:50:42 -0700 From: Jeremy Fitzhardinge To: Jeff Garzik Cc: linux-kernel@vger.kernel.org, Isaku Yamahata , NetDev , Ingo Molnar Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Isaku Yamahata Align ip header to a 16 byte boundary to avoid unaligned access like other drivers. Without this patch, xen-netfront doesn't work well on ia64. [ Jeff, this is the only patch in the series which is in your territory. -J ] Signed-off-by: Isaku Yamahata Signed-off-by: Jeremy Fitzhardinge --- drivers/net/xen-netfront.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 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 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -239,10 +239,13 @@ */ batch_target = np->rx_target - (req_prod - np->rx.rsp_cons); for (i = skb_queue_len(&np->rx_batch); i < batch_target; i++) { - skb = __netdev_alloc_skb(dev, RX_COPY_THRESHOLD, + skb = __netdev_alloc_skb(dev, RX_COPY_THRESHOLD + NET_IP_ALIGN, GFP_ATOMIC | __GFP_NOWARN); if (unlikely(!skb)) goto no_skb; + + /* Align ip header to a 16 bytes boundary */ + skb_reserve(skb, NET_IP_ALIGN); page = alloc_page(GFP_ATOMIC | __GFP_NOWARN); if (!page) {