Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp879442imj; Fri, 15 Feb 2019 08:17:17 -0800 (PST) X-Google-Smtp-Source: AHgI3IYohj8QR1fIV+WJtj99191s3CCSJZGitrBQeksCrGIvY4WLpfyjClDfZNIN3RATqb+5KnYm X-Received: by 2002:a62:6e05:: with SMTP id j5mr10832504pfc.158.1550247437884; Fri, 15 Feb 2019 08:17:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550247437; cv=none; d=google.com; s=arc-20160816; b=cDXNlDOWwm31osPytkjJRSK+Suq4gzQY36iPukGIAS2jOWBZuBTOTaMPTa8h0cjZ5F ZX4p1SC+wrwxR9MOxbtSfE6+r8ESu7zxnsUvS7gni9rnDjFte4HScQl+03ryoa3G9B6y 6wVz7j8k4pj9J5QaWbPJi2U5gsbr0v1J7tIADb866ToUCgQEqu3q7kNmApmu3r4M8ADI wkVOjdEbaXbQnX1h8eUwkWtg3Z+bXA9daZF6cflO3E597Ozn7Vh0uEwpJIUfQQqrV6o7 wl9DctclW6WwoE6bG2kIpn0rybAEVO5e2zdFpuN4um5Me0GxRP25GieoiXstAb88aKQx WnmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=eeQPm5rdnc3tO/3fPNiOFxvUTH4Cu5KMoLN2k+hJS8o=; b=ltCpGBzFuJBK43ph1+lIB5uqX5srLVPHvmImYjutXA6lZec1pZd4tJODh4YHgSmriR JHaHf7u+uVTK9DkbIJA1jztREnj8TKclz1hLRcMxuv1TUsPBU4VFud8jaQMgqaU0CnFv DR1AzIyZEQhlrYARzCNh9Dj8CplxFYDrtrymIGZvk2HjSBSofxlFz4uloSfWRqjTEJl9 a/WNNiIP24Z6gn0f1YDgrFl+7TY8sgaFZEd14ZPs8zmEFhFcrYVet8Uhol8MGfIf4Cnv V7g8XdZ1/AfZcGEy/gzIoJ/DhgznERMh5sv5LNvxniI6ImK4i7UKZ9HLLCfCR9ZZAA2O Hm9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=i5Z7czdL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p31si5940414pgb.440.2019.02.15.08.17.01; Fri, 15 Feb 2019 08:17:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=i5Z7czdL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437155AbfBONm4 (ORCPT + 99 others); Fri, 15 Feb 2019 08:42:56 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:43904 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726906AbfBONmy (ORCPT ); Fri, 15 Feb 2019 08:42:54 -0500 Received: from mailhost1.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 4CCA810C054F; Fri, 15 Feb 2019 05:42:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1550238174; bh=Ov8YlC2lWgVVrMBMhFClxVkRw59bMNUxJGwN+PVozqw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=i5Z7czdLEFz2cH+QXdche2/OwtJB1W2nm7bqBzBsossy0Xth6ukjCktXok4395w6z zgZ63sBqaMIXhB36YRE3VWT+GlW6vPn9L2Bn+eyx7dBHPnCI8qh3GcZzIKz7r46IMs uN7bU7OuIWNyvCfBllQVk4B1RF16vAvCcse1GAn2VqnKpR/XohXMxoLTZ8eV8LzakS l5d0TxLhpnyat3CKh4JB8lyCwe2NAjECSOvbiFG9ZgnymqPSBYT6meKoHMVJ4o51qD xw4up1Nl3bit1fsk0xzVEf1EV2RWqnh1Zrdq1EnFeReDMc5Dj7wRGrpqY7kSWLREgl /f5P58iHi57Cw== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost1.synopsys.com (Postfix) with ESMTP id AB33D534C; Fri, 15 Feb 2019 05:42:22 -0800 (PST) From: Jose Abreu To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jose Abreu , Joao Pinto , "David S . Miller" , Giuseppe Cavallaro , Alexandre Torgue Subject: [PATCH net-next 3/3] net: stmmac: dwxgmac2: Also use TBU interrupt to clean TX path Date: Fri, 15 Feb 2019 14:42:07 +0100 Message-Id: <3fd9188875c502aeff3648be199289009bcf9055.1550237884.git.joabreu@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org TBU interrupt is a normal interrupt and can be used to trigger the cleaning of TX path. Lets check if it's active in DMA interrupt handler. While at it, refactor a little bit the function: - Don't check if RI is enabled because at function exit we will only clear the interrupts that are enabled so, no event will be missed. In my tests withe XGMAC2 this increased performance. Signed-off-by: Jose Abreu Cc: Joao Pinto Cc: David S. Miller Cc: Giuseppe Cavallaro Cc: Alexandre Torgue --- drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h | 4 +++- drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c | 8 +++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h index d6bb953685fa..37d5e6fe7473 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h @@ -193,9 +193,10 @@ #define XGMAC_AIE BIT(14) #define XGMAC_RBUE BIT(7) #define XGMAC_RIE BIT(6) +#define XGMAC_TBUE BIT(2) #define XGMAC_TIE BIT(0) #define XGMAC_DMA_INT_DEFAULT_EN (XGMAC_NIE | XGMAC_AIE | XGMAC_RBUE | \ - XGMAC_RIE | XGMAC_TIE) + XGMAC_RIE | XGMAC_TBUE | XGMAC_TIE) #define XGMAC_DMA_CH_Rx_WATCHDOG(x) (0x0000313c + (0x80 * (x))) #define XGMAC_RWT GENMASK(7, 0) #define XGMAC_DMA_CH_STATUS(x) (0x00003160 + (0x80 * (x))) @@ -204,6 +205,7 @@ #define XGMAC_FBE BIT(12) #define XGMAC_RBU BIT(7) #define XGMAC_RI BIT(6) +#define XGMAC_TBU BIT(2) #define XGMAC_TPS BIT(1) #define XGMAC_TI BIT(0) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c index c5e25580a43f..2ba712b48a89 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c @@ -283,12 +283,10 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr, x->normal_irq_n++; if (likely(intr_status & XGMAC_RI)) { - if (likely(intr_en & XGMAC_RIE)) { - x->rx_normal_irq_n++; - ret |= handle_rx; - } + x->rx_normal_irq_n++; + ret |= handle_rx; } - if (likely(intr_status & XGMAC_TI)) { + if (likely(intr_status & (XGMAC_TI | XGMAC_TBU))) { x->tx_normal_irq_n++; ret |= handle_tx; } -- 2.7.4