DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v3] net/ixgbe: fix interrupt block issue
@ 2017-01-16 19:23 Qi Zhang
  2017-01-17 20:49 ` Thomas Monjalon
  2017-01-20 17:10 ` Ferruh Yigit
  0 siblings, 2 replies; 3+ messages in thread
From: Qi Zhang @ 2017-01-16 19:23 UTC (permalink / raw)
  To: wenzhuo.lu, helin.zhang; +Cc: dev, Qi Zhang

When handle link status change interrupt, interrupt
will be blocked until delayed handler finish, the
duration is at least 1 second, this may cause following
VF to PF mailbox traffic be blocked and sometimes PF
can't ack to VF in time before VF think it's time out.
This patch remove this limitation, during the period
after interrupt handler finish and before delayed handler
only lsc interrupt will be disabled.

Fixes: 0a45657a6794 ("pci: rework interrupt handling")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
v3:
- during the period after interrupt handler finish and before delayed handler only lsc interrupt will be disabled.

v2:
- rebase to dpdk-next-net

 drivers/net/ixgbe/ixgbe_ethdev.c | 24 ++++++++++++++----------
 drivers/net/ixgbe/ixgbe_ethdev.h |  2 ++
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index c66f432..a05a956 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3762,7 +3762,6 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev,
 		IXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
 	int64_t timeout;
 	struct rte_eth_link link;
-	int intr_enable_delay = false;
 	struct ixgbe_hw *hw =
 		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
@@ -3795,20 +3794,19 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev,
 			timeout = IXGBE_LINK_DOWN_CHECK_TIMEOUT;
 
 		ixgbe_dev_link_status_print(dev);
-
-		intr_enable_delay = true;
-	}
-
-	if (intr_enable_delay) {
+		intr->mask_original = intr->mask;
+		/* only disable lsc interrupt */
+		intr->mask &= ~IXGBE_EIMS_LSC;
 		if (rte_eal_alarm_set(timeout * 1000,
 				      ixgbe_dev_interrupt_delayed_handler, (void *)dev) < 0)
 			PMD_DRV_LOG(ERR, "Error setting alarm");
-	} else {
-		PMD_DRV_LOG(DEBUG, "enable intr immediately");
-		ixgbe_enable_intr(dev);
-		rte_intr_enable(intr_handle);
+		else
+			intr->mask = intr->mask_original;
 	}
 
+	PMD_DRV_LOG(DEBUG, "enable intr immediately");
+	ixgbe_enable_intr(dev);
+	rte_intr_enable(intr_handle);
 
 	return 0;
 }
@@ -3839,6 +3837,8 @@ ixgbe_dev_interrupt_delayed_handler(void *param)
 		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t eicr;
 
+	ixgbe_disable_intr(hw);
+
 	eicr = IXGBE_READ_REG(hw, IXGBE_EICR);
 	if (eicr & IXGBE_EICR_MAILBOX)
 		ixgbe_pf_mbx_process(dev);
@@ -3861,6 +3861,10 @@ ixgbe_dev_interrupt_delayed_handler(void *param)
 		intr->flags &= ~IXGBE_FLAG_MACSEC;
 	}
 
+	/* restore original mask */
+	intr->mask = intr->mask_original;
+	intr->mask_original = 0;
+
 	PMD_DRV_LOG(DEBUG, "enable intr in delayed handler S[%08x]", eicr);
 	ixgbe_enable_intr(dev);
 	rte_intr_enable(intr_handle);
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
index 6695b68..680d5d9 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/ixgbe/ixgbe_ethdev.h
@@ -200,6 +200,8 @@ struct ixgbe_hw_fdir_info {
 struct ixgbe_interrupt {
 	uint32_t flags;
 	uint32_t mask;
+	/*to save original mask during delayed handler */
+	uint32_t mask_original;
 };
 
 struct ixgbe_stat_mapping_registers {
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v3] net/ixgbe: fix interrupt block issue
  2017-01-16 19:23 [dpdk-dev] [PATCH v3] net/ixgbe: fix interrupt block issue Qi Zhang
@ 2017-01-17 20:49 ` Thomas Monjalon
  2017-01-20 17:10 ` Ferruh Yigit
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2017-01-17 20:49 UTC (permalink / raw)
  To: Qi Zhang; +Cc: dev, wenzhuo.lu, helin.zhang

2017-01-16 14:23, Qi Zhang:
> v3:
> - during the period after interrupt handler finish and before delayed handler only lsc interrupt will be disabled.
> 
> v2:
> - rebase to dpdk-next-net

Please, use --in-reply-to to keep revisions in the same thread.
It will help to compare (and will sort things in archives).

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v3] net/ixgbe: fix interrupt block issue
  2017-01-16 19:23 [dpdk-dev] [PATCH v3] net/ixgbe: fix interrupt block issue Qi Zhang
  2017-01-17 20:49 ` Thomas Monjalon
@ 2017-01-20 17:10 ` Ferruh Yigit
  1 sibling, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-01-20 17:10 UTC (permalink / raw)
  To: Qi Zhang, wenzhuo.lu, helin.zhang; +Cc: dev

On 1/16/2017 7:23 PM, Qi Zhang wrote:
> When handle link status change interrupt, interrupt
> will be blocked until delayed handler finish, the
> duration is at least 1 second, this may cause following
> VF to PF mailbox traffic be blocked and sometimes PF
> can't ack to VF in time before VF think it's time out.
> This patch remove this limitation, during the period
> after interrupt handler finish and before delayed handler
> only lsc interrupt will be disabled.
> 
> Fixes: 0a45657a6794 ("pci: rework interrupt handling")
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-20 17:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-16 19:23 [dpdk-dev] [PATCH v3] net/ixgbe: fix interrupt block issue Qi Zhang
2017-01-17 20:49 ` Thomas Monjalon
2017-01-20 17:10 ` Ferruh Yigit

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).