DPDK patches and discussions
 help / color / mirror / Atom feed
From: Qi Zhang <qi.z.zhang@intel.com>
To: jingjing.wu@intel.com, helin.zhang@intel.com
Cc: dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2] net/i40e: fix wrong handle when enable interrupt
Date: Tue, 21 Mar 2017 08:09:53 -0400	[thread overview]
Message-ID: <20170321120953.73051-1-qi.z.zhang@intel.com> (raw)
In-Reply-To: <1486670573-5447-1-git-send-email-qi.z.zhang@intel.com>

In i40e_dev_interrupt_handler, when call rte_intr_enable,
the intr_handle is the copy when we registered.
According to interrupt handle framework, if the requirement
of intr_handle is changed, we need to unregister then register
a new copy. This happens on i40e driver when bind to vfio-pci,
the rte_intr_efd_enable function will modify the max_intr according
the queue number, so a new copy of intr_handle need to be registered.
Without this fix, we saw lw3fwd-power does not work due to wrong
interrupt count in vfio_irq_set when set vfio interrupt.

Fixes: 2ce7a1ed09fc ("net/i40e: localize mapping of ethdev to PCI device")

Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
v2:
- follow current design, when intr_handle is modified, unregister
  the old one and register the new one.
- there should be a patch set to fix on other devices.

 drivers/net/i40e/i40e_ethdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 9c76baa..e7bbea5 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1886,6 +1886,14 @@ i40e_dev_start(struct rte_eth_dev *dev)
 		ret = rte_intr_efd_enable(intr_handle, intr_vector);
 		if (ret)
 			return ret;
+		 /**
+		  * intr_handle may be modified in rte_intr_efd_enable
+		  * so unregster the old one and register the new one.
+		  */
+		rte_intr_callback_unregister(intr_handle,
+			i40e_dev_interrupt_handler, dev);
+		rte_intr_callback_register(intr_handle,
+			i40e_dev_interrupt_handler, dev);
 	}
 
 	if (rte_intr_dp_is_en(intr_handle) && !intr_handle->intr_vec) {
-- 
2.9.3

  parent reply	other threads:[~2017-03-21 11:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-09 20:02 [dpdk-dev] [PATCH] " Qi Zhang
2017-02-10 10:03 ` Ferruh Yigit
2017-03-21 12:09 ` Qi Zhang [this message]
2017-03-21 11:34   ` [dpdk-dev] [PATCH v2] " Zhang, Qi Z
2017-03-30 12:26     ` Wu, Jingjing
2017-04-11 11:00       ` Ferruh Yigit

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=20170321120953.73051-1-qi.z.zhang@intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=stable@dpdk.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;
as well as URLs for NNTP newsgroup(s).