From patchwork Thu Jul 26 10:15:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Arnaud Patard (Rtp)" X-Patchwork-Id: 1241151 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 01EB83FC5A for ; Thu, 26 Jul 2012 10:21:03 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SuL8A-0007PL-Mg; Thu, 26 Jul 2012 10:17:19 +0000 Received: from [2a01:e0b:1:135:62eb:69ff:fe08:4532] (helo=lebrac.rtp-net.org) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SuL85-0007Ny-Ix for linux-arm-kernel@lists.infradead.org; Thu, 26 Jul 2012 10:17:14 +0000 Received: by lebrac.rtp-net.org (Postfix, from userid 1000) id 5E95029252; Thu, 26 Jul 2012 12:16:58 +0200 (CEST) Message-Id: <20120726101601.284809510@rtp-net.org> User-Agent: quilt/0.60-1 Date: Thu, 26 Jul 2012 12:15:46 +0200 From: Arnaud Patard (Rtp) To: linux-arm-kernel@lists.infradead.org Subject: [patch v2 1/1] ARM: Orion: Set eth packet size csum offload limit Content-Disposition: inline; filename=mtu.patch X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.1 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.8 RDNS_NONE Delivered to internal network by a host with no rDNS Cc: Andrew Lunn , Jason Cooper X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The mv643xx ethernet controller limits the packet size for the TX checksum offloading. This patch sets this limits for Kirkwood and Dove which have smaller limits that the default. As a side note, this patch is an updated version of a patch sent some years ago: http://lists.infradead.org/pipermail/linux-arm-kernel/2010-June/017320.html which seems to have been lost. Signed-off-by: Arnaud Patard Index: alunn/arch/arm/mach-dove/common.c =================================================================== --- alunn.orig/arch/arm/mach-dove/common.c 2012-07-26 12:04:52.433913851 +0200 +++ alunn/arch/arm/mach-dove/common.c 2012-07-26 12:05:11.321913026 +0200 @@ -102,7 +102,8 @@ void __init dove_ehci1_init(void) void __init dove_ge00_init(struct mv643xx_eth_platform_data *eth_data) { orion_ge00_init(eth_data, DOVE_GE00_PHYS_BASE, - IRQ_DOVE_GE00_SUM, IRQ_DOVE_GE00_ERR); + IRQ_DOVE_GE00_SUM, IRQ_DOVE_GE00_ERR, + 1600); } /***************************************************************************** Index: alunn/arch/arm/mach-kirkwood/common.c =================================================================== --- alunn.orig/arch/arm/mach-kirkwood/common.c 2012-07-26 12:04:52.433913851 +0200 +++ alunn/arch/arm/mach-kirkwood/common.c 2012-07-26 12:05:11.341913018 +0200 @@ -301,7 +301,7 @@ void __init kirkwood_ge00_init(struct mv { orion_ge00_init(eth_data, GE00_PHYS_BASE, IRQ_KIRKWOOD_GE00_SUM, - IRQ_KIRKWOOD_GE00_ERR); + IRQ_KIRKWOOD_GE00_ERR, 1600); /* The interface forgets the MAC address assigned by u-boot if the clock is turned off, so claim the clk now. */ clk_prepare_enable(ge0); @@ -315,7 +315,7 @@ void __init kirkwood_ge01_init(struct mv { orion_ge01_init(eth_data, GE01_PHYS_BASE, IRQ_KIRKWOOD_GE01_SUM, - IRQ_KIRKWOOD_GE01_ERR); + IRQ_KIRKWOOD_GE01_ERR, 1600); clk_prepare_enable(ge1); } Index: alunn/arch/arm/mach-mv78xx0/common.c =================================================================== --- alunn.orig/arch/arm/mach-mv78xx0/common.c 2012-07-26 12:04:52.433913851 +0200 +++ alunn/arch/arm/mach-mv78xx0/common.c 2012-07-26 12:05:11.365913016 +0200 @@ -213,7 +213,8 @@ void __init mv78xx0_ge00_init(struct mv6 { orion_ge00_init(eth_data, GE00_PHYS_BASE, IRQ_MV78XX0_GE00_SUM, - IRQ_MV78XX0_GE_ERR); + IRQ_MV78XX0_GE_ERR, + MV643XX_TX_CSUM_DEFAULT_LIMIT); } @@ -224,7 +225,8 @@ void __init mv78xx0_ge01_init(struct mv6 { orion_ge01_init(eth_data, GE01_PHYS_BASE, IRQ_MV78XX0_GE01_SUM, - NO_IRQ); + NO_IRQ, + MV643XX_TX_CSUM_DEFAULT_LIMIT); } Index: alunn/arch/arm/mach-orion5x/common.c =================================================================== --- alunn.orig/arch/arm/mach-orion5x/common.c 2012-07-26 12:04:52.433913851 +0200 +++ alunn/arch/arm/mach-orion5x/common.c 2012-07-26 12:05:11.365913016 +0200 @@ -109,7 +109,8 @@ void __init orion5x_eth_init(struct mv64 { orion_ge00_init(eth_data, ORION5X_ETH_PHYS_BASE, IRQ_ORION5X_ETH_SUM, - IRQ_ORION5X_ETH_ERR); + IRQ_ORION5X_ETH_ERR, + MV643XX_TX_CSUM_DEFAULT_LIMIT); } Index: alunn/arch/arm/plat-orion/common.c =================================================================== --- alunn.orig/arch/arm/plat-orion/common.c 2012-07-26 12:04:52.433913851 +0200 +++ alunn/arch/arm/plat-orion/common.c 2012-07-26 12:05:11.369913016 +0200 @@ -291,10 +291,12 @@ static struct platform_device orion_ge00 void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data, unsigned long mapbase, unsigned long irq, - unsigned long irq_err) + unsigned long irq_err, + unsigned int tx_csum_limit) { fill_resources(&orion_ge00_shared, orion_ge00_shared_resources, mapbase + 0x2000, SZ_16K - 1, irq_err); + orion_ge00_shared_data.tx_csum_limit = tx_csum_limit; ge_complete(&orion_ge00_shared_data, orion_ge00_resources, irq, &orion_ge00_shared, eth_data, &orion_ge00); @@ -343,10 +345,12 @@ static struct platform_device orion_ge01 void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data, unsigned long mapbase, unsigned long irq, - unsigned long irq_err) + unsigned long irq_err, + unsigned int tx_csum_limit) { fill_resources(&orion_ge01_shared, orion_ge01_shared_resources, mapbase + 0x2000, SZ_16K - 1, irq_err); + orion_ge01_shared_data.tx_csum_limit = tx_csum_limit; ge_complete(&orion_ge01_shared_data, orion_ge01_resources, irq, &orion_ge01_shared, eth_data, &orion_ge01); Index: alunn/arch/arm/plat-orion/include/plat/common.h =================================================================== --- alunn.orig/arch/arm/plat-orion/include/plat/common.h 2012-07-26 12:04:52.433913851 +0200 +++ alunn/arch/arm/plat-orion/include/plat/common.h 2012-07-26 12:05:11.369913016 +0200 @@ -39,12 +39,14 @@ void __init orion_rtc_init(unsigned long void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data, unsigned long mapbase, unsigned long irq, - unsigned long irq_err); + unsigned long irq_err, + unsigned int tx_csum_limit); void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data, unsigned long mapbase, unsigned long irq, - unsigned long irq_err); + unsigned long irq_err, + unsigned int tx_csum_limit); void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data, unsigned long mapbase, Index: alunn/include/linux/mv643xx_eth.h =================================================================== --- alunn.orig/include/linux/mv643xx_eth.h 2012-07-26 12:04:52.433913851 +0200 +++ alunn/include/linux/mv643xx_eth.h 2012-07-26 12:05:11.369913016 +0200 @@ -15,6 +15,8 @@ #define MV643XX_ETH_SIZE_REG_4 0x2224 #define MV643XX_ETH_BASE_ADDR_ENABLE_REG 0x2290 +#define MV643XX_TX_CSUM_DEFAULT_LIMIT 0 + struct mv643xx_eth_shared_platform_data { struct mbus_dram_target_info *dram; struct platform_device *shared_smi;