From patchwork Mon Dec 14 10:34:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 67255 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nBEAeVxk000589 for ; Mon, 14 Dec 2009 10:40:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756728AbZLNKka (ORCPT ); Mon, 14 Dec 2009 05:40:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756735AbZLNKka (ORCPT ); Mon, 14 Dec 2009 05:40:30 -0500 Received: from mail-yx0-f187.google.com ([209.85.210.187]:49625 "EHLO mail-yx0-f187.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756728AbZLNKk3 (ORCPT ); Mon, 14 Dec 2009 05:40:29 -0500 Received: by yxe17 with SMTP id 17so2476959yxe.33 for ; Mon, 14 Dec 2009 02:40:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=UhBgtZenXdHPq/8yx9vfKJbMkzo+tM0GoqWGGNtKZtU=; b=dl+3VT9CObQ38X4/e+bTJe/MbKIaLsWRqYz8zw591y0Llpa28mVRN63VPvfKVfPvZo ZVSt7AXhLUMlyYDD5n7S+W7Sl3ZDmXB2Cr70ZQCeibvwgMCB/5KeGXM+qyxkYtRLM1XJ zBV5IHc3a1Og+6yI9lVFlsTK5bsR6cNHYC6mE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=Lo6NHsAytJKdprKVULE+co7UCRq4jXh1U5S65y6liX8f7Bzep2MOLIZAUDTBcRu2b5 b/rkJawP4+NNJMhAxPpd1Ztr/3bStvG3Z5vCKZsn7E0jdRdcVWqkMNMZq7hL8N3d91lV ZOYB6+yUr5fofBTGGQ9zFRCTsBMPhIuvRc/Do= Received: by 10.101.214.34 with SMTP id r34mr2983anq.140.1260787228207; Mon, 14 Dec 2009 02:40:28 -0800 (PST) Received: from rxone.opensource.se (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 15sm1802313yxh.22.2009.12.14.02.40.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 14 Dec 2009 02:40:27 -0800 (PST) From: Magnus Damm To: netdev@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org, davem@davemloft.net, linux-sh@vger.kernel.org Date: Mon, 14 Dec 2009 19:34:43 +0900 Message-Id: <20091214103443.13082.84079.sendpatchset@rxone.opensource.se> Subject: [PATCH] net: sh_eth alignment fix for sh7724 using NET_IP_ALIGN Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org --- 0001/drivers/net/sh_eth.c +++ work/drivers/net/sh_eth.c 2009-12-14 15:27:25.000000000 +0900 @@ -84,6 +84,10 @@ static struct sh_eth_cpu_data sh_eth_my_ .mpr = 1, .tpauser = 1, .hw_swap = 1, +#if NET_IP_ALIGN == 2 + .rpadir = 1, + .rpadir_value = 0x00020000, +#endif }; #elif defined(CONFIG_CPU_SUBTYPE_SH7763) @@ -501,6 +505,8 @@ static int sh_eth_ring_init(struct net_d */ mdp->rx_buf_sz = (ndev->mtu <= 1492 ? PKT_BUF_SZ : (((ndev->mtu + 26 + 7) & ~7) + 2 + 16)); + if (mdp->cd->rpadir) + mdp->rx_buf_sz += NET_IP_ALIGN; /* Allocate RX and TX skb rings */ mdp->rx_skbuff = kmalloc(sizeof(*mdp->rx_skbuff) * RX_RING_SIZE, @@ -715,6 +721,8 @@ static int sh_eth_rx(struct net_device * pkt_len + 2); skb = mdp->rx_skbuff[entry]; mdp->rx_skbuff[entry] = NULL; + if (mdp->cd->rpadir) + skb_reserve(skb, NET_IP_ALIGN); skb_put(skb, pkt_len); skb->protocol = eth_type_trans(skb, ndev); netif_rx(skb);