Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4561042imm; Mon, 17 Sep 2018 16:36:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaeC4HxROcUY8OmOdj5asQN6ZJYVwsFL6aYO8fLMIs3T7sc12AncyNvNGfqOla4+aaruzNZ X-Received: by 2002:a62:4898:: with SMTP id q24-v6mr28296314pfi.22.1537227383712; Mon, 17 Sep 2018 16:36:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537227383; cv=none; d=google.com; s=arc-20160816; b=TPHqGvuDFBiLiweb4bCLPuYcvFRmUAOO36CzNZZAmz3OkB9kEA5f/ic28FJod/kCjw rirTh4icvOiZnGoPPCwQ48Zgf4ImPJp1Om/xaQjam7NEhBKYmZZ6fH140oQRe9bAytby RFbLk2Ebvtc6d4lRSYnyUHI3DWSHh8Ulgn4ly+EcdWRUkiqM0oSlHCLEPqtJ+dQvirUj WfWATwrBniZmWdGOQyW6+1KsMyDquPOV3Y9sxZln6lAC6QsQ256dQ7JnqNqd0SoxdaGy pRe0usnS+PfthPwEU2tShOofJLpciyQXH6GoOjkQLd0ws65oLz/Ynw6eMo2d836D/GSz aUfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=sMXXsd4wPYtqsJTEpWkncJg+dLRS52vumcP+gVNnm8E=; b=nvLUaon1Tn5thwDSKcqHzZPAbi6i5+Ql5QYpHAdPKe6Subg+GOxBIB2vJbCDnMHEJt 8tuuFi/yH7ryrQ9DQfc2GDLi+fTNUxP/OOAwzUXnZXpZVK4zwDem6jwkSurxtTTo/o7T hsnvO8LLcI5HGboF1AJUbTDbJytVI10HKbK5fns1laky9HwLdrF4pv53QQOjOqJ/srTu 9c/aeSPBY3YLXh0jXHq81b2sZfkeGXIn6aRv8GASYWF1a9yXl33g8Vgg6nXWaA6+t8GA QXP4lStc3d1eMp/rKEvhzZIBC1b4yu/Mo4UdNXU6g3+6ZO2DIsLiLhe2mLZGF/mpeRsu 4KLg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1-v6si17702926pld.322.2018.09.17.16.36.08; Mon, 17 Sep 2018 16:36:23 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728840AbeIRFFU (ORCPT + 99 others); Tue, 18 Sep 2018 01:05:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57862 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727252AbeIRFFU (ORCPT ); Tue, 18 Sep 2018 01:05:20 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E6906308427C; Mon, 17 Sep 2018 23:35:42 +0000 (UTC) Received: from masetto.com (ovpn-117-142.phx2.redhat.com [10.3.117.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8DD5382218; Mon, 17 Sep 2018 23:35:40 +0000 (UTC) From: Al Stone To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Al Stone , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , "David S . Miller" Subject: [PATCH] net: apm: xgene: force XGene enet driver to re-balance IRQ usage Date: Mon, 17 Sep 2018 17:35:33 -0600 Message-Id: <20180917233533.28626-1-ahs3@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 17 Sep 2018 23:35:43 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When using the user-space command 'tuned-adm profile network-latency', the XGene enet driver will cause a hang trying to enable IRQs while the system is trying to tune itself to be more responsive to network traffic; dmesg will even tell us that the enables/disables are not in balance. With this fix, we force the driver to only enable_irq() when there has been a previous disable_irq() -- i.e., force the number of calls to each to be balanced. This allows the kernel to continue operating. In an ideal world, the XGene enet driver would be restructured to avoid this problem (it seems to be an artifact of when additional packets arrive and differences of opinion in how the NIC responds under those circumstances, some of which is controlled by firmware). In the XGene2 driver, this is not an issue. However, the XGene (aka Mustang) where this NIC is used is most likely at the end of its useful life (APM which originally created the XGene has completely morphed into a new company). It is unlikely the driver restructuring that is needed will ever be done. There are, however, a bunch of these machines out in the real world, and there are many of us still using them daily (me, for example). So, while this patch is not the ideal way to repair the NIC driver, it does work and allows us to continue using these boxes for a while longer. Cc: Iyappan Subramanian Cc: Keyur Chudgar Cc: Quan Nguyen Cc: David S. Miller Signed-off-by: Al Stone --- drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c index 3b889efddf78..90fb87f7e24e 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c @@ -866,8 +866,11 @@ static int xgene_enet_napi(struct napi_struct *napi, const int budget) processed = xgene_enet_process_ring(ring, budget); if (processed != budget) { + struct irq_desc *desc = irq_to_desc(ring->irq); + napi_complete_done(napi, processed); - enable_irq(ring->irq); + if (desc && desc->depth > 0) + enable_irq(ring->irq); } return processed; -- 2.17.1