linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Stone <ahs3@redhat.com>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Al Stone <ahs3@redhat.com>,
	Iyappan Subramanian <isubramanian@apm.com>,
	Keyur Chudgar <kchudgar@apm.com>, Quan Nguyen <qnguyen@apm.com>,
	"David S . Miller" <davem@davemloft.net>
Subject: [PATCH] net: apm: xgene: force XGene enet driver to re-balance IRQ usage
Date: Mon, 17 Sep 2018 17:35:33 -0600	[thread overview]
Message-ID: <20180917233533.28626-1-ahs3@redhat.com> (raw)

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 <isubramanian@apm.com>
Cc: Keyur Chudgar <kchudgar@apm.com>
Cc: Quan Nguyen <qnguyen@apm.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Al Stone <ahs3@redhat.com>
---
 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


             reply	other threads:[~2018-09-17 23:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-17 23:35 Al Stone [this message]
2018-09-18  2:35 ` [PATCH] net: apm: xgene: force XGene enet driver to re-balance IRQ usage David Miller
2018-09-18 20:21   ` Al Stone
2018-09-18 23:09   ` Lendacky, Thomas
2018-09-18 23:15     ` Al Stone
2018-09-18 23:21       ` Florian Fainelli
2018-09-18 23:27         ` Eric Dumazet
2018-09-18 23:56           ` Eric Dumazet
2018-09-19  0:03             ` Florian Fainelli
2018-09-19  2:32               ` Eric Dumazet
2018-09-18 23:25       ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180917233533.28626-1-ahs3@redhat.com \
    --to=ahs3@redhat.com \
    --cc=davem@davemloft.net \
    --cc=isubramanian@apm.com \
    --cc=kchudgar@apm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=qnguyen@apm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).