From patchwork Thu Jan 28 21:26:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 8154281 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C59FA9F9A0 for ; Thu, 28 Jan 2016 21:43:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EA47B2020F for ; Thu, 28 Jan 2016 21:43:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 258AD201C8 for ; Thu, 28 Jan 2016 21:43:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOuKR-0004Kx-6f; Thu, 28 Jan 2016 21:42:11 +0000 Received: from mail-pf0-x233.google.com ([2607:f8b0:400e:c00::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOu87-0006Cc-Sk for linux-arm-kernel@lists.infradead.org; Thu, 28 Jan 2016 21:29:29 +0000 Received: by mail-pf0-x233.google.com with SMTP id 65so29733185pfd.2 for ; Thu, 28 Jan 2016 13:29:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boundarydevices-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4D4E9xw3IbIC/Qp8f3VdCHuWr2YN/BP2R+h68MUdWno=; b=rhDECTjpC3vMQVdlDzYqIo4s8ht/5GnkQ/DuNbEQ5MhSSvjhibD0SuEjCAD7DKvG5K pSscnNq1Nt77X3sI0zrZad1uXNTLTqkdbvUh9ruOW6FMG6X/1+MiEVpPzmeiE9Uv7ocV TvQJ9d9b1fmKF6jSJljcXX+vWrO/3Kr2QasUsTjvE4Yw9+rxGWfFy+PVctzNPiJcABwi oMfvw3D55aGjtERkFfcipx5gKnrVuozaFezYH2GDMxcmO4zEPDQd+BPsACWUbmQUlQKi nix1iFv7wpHv3cOgSrFq+tJs66Z9P4d+/YQl70k4MzxrpI72/3t9MdjGyIcs+dpYJoKi VLyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4D4E9xw3IbIC/Qp8f3VdCHuWr2YN/BP2R+h68MUdWno=; b=JfnbN7Y5wLzFzv8vd4p3KjhsA2gEQ0Xw7U9i0MKTd7KHiP6suMgsseXgfPANvEvh8O /k/BCaGNnTKc3PoG7fhSazdySjH7W6JcDYJJ8PoQZt8inPGYna5XnKlIwnp6DTpX8AQS dyHyEtwCuWn9GU0CfVQG/2ojZvGwIxiqUXdnUIDRqit/bRYh9dZXONolsV5xf0Pnu23r VQ9SBcTZU3Q9xoP2WOGWm9QLFImxfp8BFbA7V0nPNWJ4QS7Gnygq7sQisMhUfF+gmUyG di/KtjEnzwoixmqVl8jF/15c3bP86SZ6WkOncvmc15qw41MZ8rHNUN4lCFguzJEUJlHA 15pA== X-Gm-Message-State: AG10YOR7u4z4BQx4Dd3dUVHiBcPR/uVmYckZBinKpEkHHykotJUuQllqJkNsHmATl16dvQ== X-Received: by 10.98.0.86 with SMTP id 83mr8042141pfa.84.1454016552194; Thu, 28 Jan 2016 13:29:12 -0800 (PST) Received: from localhost.localdomain (wsip-70-184-93-199.ph.ph.cox.net. [70.184.93.199]) by smtp.googlemail.com with ESMTPSA id c90sm18583190pfd.31.2016.01.28.13.29.10 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jan 2016 13:29:11 -0800 (PST) From: Troy Kisky To: netdev@vger.kernel.org, davem@davemloft.net, B38611@freescale.com Subject: [PATCH net-next 38/40] net: fec: recover from lost rxf_0 interrupt Date: Thu, 28 Jan 2016 14:26:02 -0700 Message-Id: <1454016364-30985-39-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454016364-30985-1-git-send-email-troy.kisky@boundarydevices.com> References: <1454016364-30985-1-git-send-email-troy.kisky@boundarydevices.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160128_132928_145566_5229347A X-CRM114-Status: GOOD ( 12.63 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fabio.estevam@freescale.com, andrew@lunn.ch, linux@arm.linux.org.uk, Troy Kisky , laci@boundarydevices.com, l.stach@pengutronix.de, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org, tremyfr@gmail.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The following is true of linux-3.14. I have not been able to verify on mainline, because I cannot get the cpuidle driver to work. If gpio6 workaround is not used for interrupts, then it is possible for the entire receive queue to become full without an interrupt. If that happens, and the last rxf_0 interrupt is lost, then the FEC can no longer receive packets. However packet transmission is still fine, so the tx watchdog will never fire. The only way to recover before this is a ifconfig down/up. Skipping the FEC_ENET_RXF_0 check will allow the rx queue to recover from the condition when the next packet is transmitted. This patch also has the advantage of increasing iperf speed. Signed-off-by: Troy Kisky --- drivers/net/ethernet/freescale/fec_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 00c9b7e..8372d9b 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1608,9 +1608,10 @@ static int fec_enet_napi_q1(struct napi_struct *napi, int budget) } writel(events, fep->hwp + FEC_IEVENT); - if (events & FEC_ENET_RXF_0) - pkts += fec_rxq(ndev, fep, fep->rx_queue[0], - budget - pkts); + /* don't check FEC_ENET_RXF_0, to recover from a full queue + * but bit clear condition + */ + pkts += fec_rxq(ndev, fep, fep->rx_queue[0], budget - pkts); if (events & FEC_ENET_TXF_0) fec_txq(ndev, fep, fep->tx_queue[0]); } while (pkts < budget);