From patchwork Tue Sep 18 16:56:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 184761 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 5B4682C007D for ; Wed, 19 Sep 2012 02:56:41 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752230Ab2IRQ4j (ORCPT ); Tue, 18 Sep 2012 12:56:39 -0400 Received: from gw1.transmode.se ([195.58.98.146]:51997 "EHLO gw1.transmode.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751386Ab2IRQ4g (ORCPT ); Tue, 18 Sep 2012 12:56:36 -0400 Received: from mail1.transmode.se (mail1.transmode.se [192.168.201.18]) by gw1.transmode.se (Postfix) with ESMTP id 0C5512581E1 for ; Tue, 18 Sep 2012 18:56:34 +0200 (CEST) Received: from gentoo-jocke.transmode.se ([172.20.4.10]) by mail1.transmode.se (Lotus Domino Release 8.5.3FP1) with ESMTP id 2012091818563370-88091 ; Tue, 18 Sep 2012 18:56:33 +0200 Received: from gentoo-jocke.transmode.se (localhost [127.0.0.1]) by gentoo-jocke.transmode.se (8.14.4/8.14.4) with ESMTP id q8IGuXZj019121; Tue, 18 Sep 2012 18:56:33 +0200 Received: (from jocke@localhost) by gentoo-jocke.transmode.se (8.14.4/8.14.4/Submit) id q8IGuXVS019120; Tue, 18 Sep 2012 18:56:33 +0200 From: Joakim Tjernlund To: netdev@vger.kernel.org Cc: Joakim Tjernlund Subject: [PATCH 1/5] ucc_geth: Reduce IRQ off in xmit path Date: Tue, 18 Sep 2012 18:56:21 +0200 Message-Id: <1347987385-19071-1-git-send-email-Joakim.Tjernlund@transmode.se> X-Mailer: git-send-email 1.7.8.6 X-MIMETrack: Itemize by SMTP Server on mail1/Transmode(Release 8.5.3FP1|March 07, 2012) at 18/09/2012 18:56:33, Serialize by Router on mail1/Transmode(Release 8.5.3FP1|March 07, 2012) at 18/09/2012 18:56:33, Serialize complete at 18/09/2012 18:56:33 X-TNEFEvaluated: 1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Currently ucc_geth_start_xmit wraps IRQ off for the whole body just to be safe. Reduce the IRQ off period to a minimum. Signed-off-by: Joakim Tjernlund --- drivers/net/ethernet/freescale/ucc_geth.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 9ac14f8..e609c93 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -3181,8 +3181,6 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev) ugeth_vdbg("%s: IN", __func__); - spin_lock_irqsave(&ugeth->lock, flags); - dev->stats.tx_bytes += skb->len; /* Start from the next BD that should be filled */ @@ -3196,6 +3194,7 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev) (ugeth->skb_curtx[txQ] + 1) & TX_RING_MOD_MASK(ugeth->ug_info->bdRingLenTx[txQ]); + spin_lock_irqsave(&ugeth->lock, flags); /* set up the buffer descriptor */ out_be32(&((struct qe_bd __iomem *)bd)->buf, dma_map_single(ugeth->dev, skb->data, @@ -3207,6 +3206,8 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev) /* set bd status and length */ out_be32((u32 __iomem *)bd, bd_status); + spin_unlock_irqrestore(&ugeth->lock, flags); + /* Move to next BD in the ring */ if (!(bd_status & T_W)) @@ -3238,8 +3239,6 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev) uccf = ugeth->uccf; out_be16(uccf->p_utodr, UCC_FAST_TOD); #endif - spin_unlock_irqrestore(&ugeth->lock, flags); - return NETDEV_TX_OK; }