[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1461656126-22226-4-git-send-email-noamca@mellanox.com>
Date: Tue, 26 Apr 2016 10:35:26 +0300
From: Noam Camus <noamca@...lanox.com>
To: <davem@...emloft.net>
CC: <noamca@...lanox.com>, <linux-kernel@...r.kernel.org>,
<abrodkin@...opsys.com>, <eladkan@...lanox.com>,
<talz@...lanox.com>
Subject: [PATCH 3/3] net: nps_enet: bug fix - handle lost tx interrupts
From: Elad Kanfi <eladkan@...lanox.com>
The tx interrupt is of edge type, and in case such interrupt is triggered
while it is masked it will not be handled even after tx interrupts are
re-enabled in the end of NAPI poll.
This will cause tx network to stop in the following scenario:
* Rx is being handled, hence interrupts are masked.
* Tx interrupt is triggered after checking if there is some tx to handle
and before re-enabling the interrupts.
In this situation only rx transaction will release tx requests.
In order to handle the tx that was missed( if there was one ),
a NAPI reschdule was added after enabling the interrupts.
Signed-off-by: Elad Kanfi <eladkan@...lanox.com>
Acked-by: Noam Camus <noamca@...lanox.com>
---
drivers/net/ethernet/ezchip/nps_enet.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/ezchip/nps_enet.c b/drivers/net/ethernet/ezchip/nps_enet.c
index 8cf3cde..5eaede1 100644
--- a/drivers/net/ethernet/ezchip/nps_enet.c
+++ b/drivers/net/ethernet/ezchip/nps_enet.c
@@ -199,6 +199,18 @@ static int nps_enet_poll(struct napi_struct *napi, int budget)
nps_enet_reg_set(priv, NPS_ENET_REG_BUF_INT_ENABLE,
buf_int_enable_value);
+
+ /* in case we will get a tx interrupt while interrupts
+ * are masked, we will lose it since the tx is edge interrupt.
+ * specifically, while executing the code section above,
+ * between nps_enet_tx_handler and the interrupts enable, all
+ * tx requests will be stuck until we will get an rx interrupt.
+ * the two code lines below will solve this situation by
+ * re-adding ourselves to the poll list.
+ */
+
+ if (nps_enet_is_tx_pending(priv))
+ napi_reschedule(napi);
}
return work_done;
--
1.7.1
Powered by blists - more mailing lists