From patchwork Tue Mar 19 17:40:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Manoil X-Patchwork-Id: 229158 X-Patchwork-Delegate: davem@davemloft.net 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.180.67]) by ozlabs.org (Postfix) with ESMTP id 341062C00C6 for ; Wed, 20 Mar 2013 04:41:55 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933140Ab3CSRlv (ORCPT ); Tue, 19 Mar 2013 13:41:51 -0400 Received: from db3ehsobe006.messaging.microsoft.com ([213.199.154.144]:40147 "EHLO db3outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757206Ab3CSRlu (ORCPT ); Tue, 19 Mar 2013 13:41:50 -0400 Received: from mail7-db3-R.bigfish.com (10.3.81.248) by DB3EHSOBE004.bigfish.com (10.3.84.24) with Microsoft SMTP Server id 14.1.225.23; Tue, 19 Mar 2013 17:41:48 +0000 Received: from mail7-db3 (localhost [127.0.0.1]) by mail7-db3-R.bigfish.com (Postfix) with ESMTP id 79490C0162; Tue, 19 Mar 2013 17:41:48 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1ee6h1de0h1202h1e76h1d1ah1d2ahzz8275bhz2dh2a8h668h839hd24he5bhf0ah107ah11b5h121eh1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h14afh1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1155h) Received: from mail7-db3 (localhost.localdomain [127.0.0.1]) by mail7-db3 (MessageSwitch) id 1363714905471319_20480; Tue, 19 Mar 2013 17:41:45 +0000 (UTC) Received: from DB3EHSMHS020.bigfish.com (unknown [10.3.81.242]) by mail7-db3.bigfish.com (Postfix) with ESMTP id 6EDFA1E004C; Tue, 19 Mar 2013 17:41:45 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS020.bigfish.com (10.3.87.156) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 19 Mar 2013 17:41:45 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.328.11; Tue, 19 Mar 2013 17:41:43 +0000 Received: from zro04cle141.ea.freescale.net (udp157456uds.ea.freescale.net [140.101.223.141]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id r2JHfg61024193; Tue, 19 Mar 2013 10:41:42 -0700 Received: by zro04cle141.ea.freescale.net (Postfix, from userid 23113) id A3DF740081; Tue, 19 Mar 2013 19:40:05 +0200 (EET) From: Claudiu Manoil To: CC: Paul Gortmaker , "David S. Miller" Subject: [PATCH 4/4][net-next] gianfar: Refactor config coalescing calls for all queues Date: Tue, 19 Mar 2013 19:40:05 +0200 Message-ID: <1363714805-9142-5-git-send-email-claudiu.manoil@freescale.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1363714805-9142-1-git-send-email-claudiu.manoil@freescale.com> References: <1363714805-9142-1-git-send-email-claudiu.manoil@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.net Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The only place where gfar_configure_coalescing is called with an actual bitmask (other than 0xff) is in gfar_poll (on the hot path). So make gfar_configure_coalescing() static for the buffer processing path, and export gfar_configure_coalescing_all() for the remaining cases that require to set coalescing for all the queues at once (on the slow path). Signed-off-by: Claudiu Manoil --- drivers/net/ethernet/freescale/gianfar.c | 11 ++++++++--- drivers/net/ethernet/freescale/gianfar.h | 3 +-- drivers/net/ethernet/freescale/gianfar_ethtool.c | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index e28b3e6..49ce83b 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c @@ -341,7 +341,7 @@ static void gfar_init_mac(struct net_device *ndev) gfar_init_tx_rx_base(priv); /* Configure the coalescing support */ - gfar_configure_coalescing(priv, 0xFF, 0xFF); + gfar_configure_coalescing_all(priv); /* set this when rx hw offload (TOE) functions are being used */ priv->uses_rxfcb = 0; @@ -1816,7 +1816,7 @@ void gfar_start(struct net_device *dev) dev->trans_start = jiffies; /* prevent tx timeout */ } -void gfar_configure_coalescing(struct gfar_private *priv, +static void gfar_configure_coalescing(struct gfar_private *priv, unsigned long tx_mask, unsigned long rx_mask) { struct gfar __iomem *regs = priv->gfargrp[0].regs; @@ -1851,6 +1851,11 @@ void gfar_configure_coalescing(struct gfar_private *priv, } } +void gfar_configure_coalescing_all(struct gfar_private *priv) +{ + gfar_configure_coalescing(priv, 0xFF, 0xFF); +} + static int register_grp_irqs(struct gfar_priv_grp *grp) { struct gfar_private *priv = grp->priv; @@ -1940,7 +1945,7 @@ int startup_gfar(struct net_device *ndev) phy_start(priv->phydev); - gfar_configure_coalescing(priv, 0xFF, 0xFF); + gfar_configure_coalescing_all(priv); return 0; diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h index b1d0c1c..eec87ea 100644 --- a/drivers/net/ethernet/freescale/gianfar.h +++ b/drivers/net/ethernet/freescale/gianfar.h @@ -1182,8 +1182,7 @@ extern void stop_gfar(struct net_device *dev); extern void gfar_halt(struct net_device *dev); extern void gfar_phy_test(struct mii_bus *bus, struct phy_device *phydev, int enable, u32 regnum, u32 read); -extern void gfar_configure_coalescing(struct gfar_private *priv, - unsigned long tx_mask, unsigned long rx_mask); +extern void gfar_configure_coalescing_all(struct gfar_private *priv); void gfar_init_sysfs(struct net_device *dev); int gfar_set_features(struct net_device *dev, netdev_features_t features); extern void gfar_check_rx_parser_mode(struct gfar_private *priv); diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c index 75e89ac..8248df7 100644 --- a/drivers/net/ethernet/freescale/gianfar_ethtool.c +++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c @@ -436,7 +436,7 @@ static int gfar_scoalesce(struct net_device *dev, gfar_usecs2ticks(priv, cvals->tx_coalesce_usecs)); } - gfar_configure_coalescing(priv, 0xFF, 0xFF); + gfar_configure_coalescing_all(priv); return 0; }