From patchwork Tue Dec 15 11:03:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 67590 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 nBFB9XoM008014 for ; Tue, 15 Dec 2009 11:09:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757767AbZLOLJc (ORCPT ); Tue, 15 Dec 2009 06:09:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757873AbZLOLJc (ORCPT ); Tue, 15 Dec 2009 06:09:32 -0500 Received: from mail-yx0-f187.google.com ([209.85.210.187]:46433 "EHLO mail-yx0-f187.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757767AbZLOLJb (ORCPT ); Tue, 15 Dec 2009 06:09:31 -0500 Received: by yxe17 with SMTP id 17so3520127yxe.33 for ; Tue, 15 Dec 2009 03:09:30 -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=Df5RgAs/sNQmEqkw+kWlMGgUF72wX752OAAU1Fh0kx8=; b=uokgCvIY3IIQyWxqfa+AwLcwCnfvZKpZ14cFMtOrSCrQVgcVHY7PyznuY7SO7lMk/4 4WarvVuJ73Bai4F2IeLNIWYO2Mot+mQbqJMOQJkR+QEojrFotQPsWWAd0tb3BJzjXEmy GkxuBhImiof+t/4Tkm5F/n6P0FQE7S3SXq0ZU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=D/puzre7ZcmKUqFvOVMFVtOk2krwjndJOdiBFYUiPagyuuyLfDGYANR7HaEJ6Vp0zV CcVdEZhLuqQ1qS7p+p1ivhNVzDNlcnMVBPcqmHHNo1ag5JiNT4k0J/pES+Y/2X1NeMta eASrhxhDxKrdQ40znv5NsBUdKc6emynlCSJIY= Received: by 10.91.105.17 with SMTP id h17mr2211285agm.62.1260875369974; Tue, 15 Dec 2009 03:09:29 -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 16sm2548597gxk.3.2009.12.15.03.09.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 15 Dec 2009 03:09:29 -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: Tue, 15 Dec 2009 20:03:44 +0900 Message-Id: <20091215110344.13016.27379.sendpatchset@rxone.opensource.se> Subject: [PATCH] net: sh_eth alignment fix for sh7724 using NET_IP_ALIGN V2 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-15 19:58:55.000000000 +0900 @@ -84,6 +84,8 @@ static struct sh_eth_cpu_data sh_eth_my_ .mpr = 1, .tpauser = 1, .hw_swap = 1, + .rpadir = 1, + .rpadir_value = 0x00020000, /* NET_IP_ALIGN assumed to be 2 */ }; #elif defined(CONFIG_CPU_SUBTYPE_SH7763) @@ -175,7 +177,6 @@ static struct sh_eth_cpu_data sh_eth_my_ .tpauser = 1, .bculr = 1, .hw_swap = 1, - .rpadir = 1, .no_trimd = 1, .no_ade = 1, }; @@ -501,6 +502,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 +718,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);