mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin Poirier <bpoirier@suse.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Manish Chopra <manishc@marvell.com>,
	GR-Linux-NIC-Dev@marvell.com, netdev@vger.kernel.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 01/17] staging: qlge: Fix irq masking in INTx mode
Date: Fri, 27 Sep 2019 19:11:55 +0900	[thread overview]
Message-ID: <20190927101210.23856-2-bpoirier@suse.com> (raw)
In-Reply-To: <20190927101210.23856-1-bpoirier@suse.com>

Tracing the driver operation reveals that the INTR_EN_EN bit (per-queue
interrupt control) does not immediately prevent rx completion interrupts
when the device is operating in INTx mode. This leads to interrupts being
raised while napi is scheduled/running. Those interrupts are ignored by
qlge_isr() and falsely reported as IRQ_NONE thanks to the irq_cnt scheme.
This in turn can cause frames to loiter in the receive queue until a later
frame leads to another rx interrupt that will schedule napi.

Use the INTR_EN_EI bit (master interrupt control) instead.

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
---
 drivers/staging/qlge/qlge_main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
index 6cae33072496..d7b64d360ea8 100644
--- a/drivers/staging/qlge/qlge_main.c
+++ b/drivers/staging/qlge/qlge_main.c
@@ -3366,6 +3366,7 @@ static void ql_enable_msix(struct ql_adapter *qdev)
 		}
 	}
 	qlge_irq_type = LEG_IRQ;
+	set_bit(QL_LEGACY_ENABLED, &qdev->flags);
 	netif_printk(qdev, ifup, KERN_DEBUG, qdev->ndev,
 		     "Running with legacy interrupts.\n");
 }
@@ -3509,6 +3510,16 @@ static void ql_resolve_queues_to_irqs(struct ql_adapter *qdev)
 		intr_context->intr_dis_mask =
 		    INTR_EN_TYPE_MASK | INTR_EN_INTR_MASK |
 		    INTR_EN_TYPE_DISABLE;
+		if (test_bit(QL_LEGACY_ENABLED, &qdev->flags)) {
+			/* Experience shows that when using INTx interrupts,
+			 * the device does not always auto-mask INTR_EN_EN.
+			 * Moreover, masking INTR_EN_EN manually does not
+			 * immediately prevent interrupt generation.
+			 */
+			intr_context->intr_en_mask |= INTR_EN_EI << 16 |
+				INTR_EN_EI;
+			intr_context->intr_dis_mask |= INTR_EN_EI << 16;
+		}
 		intr_context->intr_read_mask =
 		    INTR_EN_TYPE_MASK | INTR_EN_INTR_MASK | INTR_EN_TYPE_READ;
 		/*
-- 
2.23.0


  reply	other threads:[~2019-09-27 10:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-27 10:11 [PATCH v2 0/17] staging: qlge: Fix rx stall in case of allocation failures Benjamin Poirier
2019-09-27 10:11 ` Benjamin Poirier [this message]
2019-09-27 10:11 ` [PATCH v2 02/17] staging: qlge: Remove irq_cnt Benjamin Poirier
2019-09-27 10:11 ` [PATCH v2 03/17] staging: qlge: Remove page_chunk.last_flag Benjamin Poirier
2019-09-27 10:11 ` [PATCH v2 04/17] staging: qlge: Deduplicate lbq_buf_size Benjamin Poirier
2019-09-27 10:11 ` [PATCH v2 05/17] staging: qlge: Remove bq_desc.maplen Benjamin Poirier
2019-09-27 10:12 ` [PATCH v2 06/17] staging: qlge: Remove rx_ring.sbq_buf_size Benjamin Poirier
2019-09-27 10:12 ` [PATCH v2 07/17] staging: qlge: Remove useless dma synchronization calls Benjamin Poirier
2019-09-27 10:12 ` [PATCH v2 08/17] staging: qlge: Deduplicate rx buffer queue management Benjamin Poirier
2019-09-27 10:12 ` [PATCH v2 09/17] staging: qlge: Fix dma_sync_single calls Benjamin Poirier
2019-09-27 10:12 ` [PATCH v2 10/17] staging: qlge: Remove rx_ring.type Benjamin Poirier
2019-09-27 10:12 ` [PATCH v2 11/17] staging: qlge: Factor out duplicated expression Benjamin Poirier
2019-09-27 10:12 ` [PATCH v2 12/17] staging: qlge: Remove qlge_bq.len & size Benjamin Poirier
2019-09-27 10:12 ` [PATCH v2 13/17] staging: qlge: Remove useless memset Benjamin Poirier
2019-09-27 10:12 ` [PATCH v2 14/17] staging: qlge: Replace memset with assignment Benjamin Poirier
2019-09-27 10:12 ` [PATCH v2 15/17] staging: qlge: Update buffer queue prod index despite oom Benjamin Poirier
2019-09-27 10:12 ` [PATCH v2 16/17] staging: qlge: Refill rx buffers up to multiple of 16 Benjamin Poirier
2019-09-27 10:12 ` [PATCH v2 17/17] staging: qlge: Refill empty buffer queues from wq Benjamin Poirier
2019-10-04  8:19 ` [PATCH v2 0/17] staging: qlge: Fix rx stall in case of allocation failures Greg Kroah-Hartman
2019-10-04  9:15   ` Benjamin Poirier
2019-10-04 15:19     ` Greg Kroah-Hartman

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=20190927101210.23856-2-bpoirier@suse.com \
    --to=bpoirier@suse.com \
    --cc=GR-Linux-NIC-Dev@marvell.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manishc@marvell.com \
    --cc=netdev@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®