DPDK patches and discussions
 help / color / mirror / Atom feed
From: Cunming Liang <cunming.liang@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v3 02/13] ixgbe: reserve intr vector zero for misc cause
Date: Wed,  4 Nov 2015 14:07:32 +0800	[thread overview]
Message-ID: <1446617263-7448-3-git-send-email-cunming.liang@intel.com> (raw)
In-Reply-To: <1446617263-7448-1-git-send-email-cunming.liang@intel.com>

According to the VFIO interrupt mapping, the interrupt vector id for rxq starts from RX_VEC_START.
It doesn't impact the UIO cases.

v3 changes:
  - macro renaming according to the EAL change

Signed-off-by: Cunming Liang <cunming.liang@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 22 ++++++++++++++--------
 drivers/net/ixgbe/ixgbe_ethdev.h |  3 +++
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 25966ef..153ba98 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4478,7 +4478,8 @@ ixgbevf_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
 		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
 	mask = IXGBE_READ_REG(hw, IXGBE_VTEIMS);
-	mask |= (1 << queue_id);
+	mask |= (1 << IXGBE_MISC_VEC_ID);
+	RTE_SET_USED(queue_id);
 	IXGBE_WRITE_REG(hw, IXGBE_VTEIMS, mask);
 
 	rte_intr_enable(&dev->pci_dev->intr_handle);
@@ -4494,7 +4495,8 @@ ixgbevf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id)
 		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
 	mask = IXGBE_READ_REG(hw, IXGBE_VTEIMS);
-	mask &= ~(1 << queue_id);
+	mask &= ~(1 << IXGBE_MISC_VEC_ID);
+	RTE_SET_USED(queue_id);
 	IXGBE_WRITE_REG(hw, IXGBE_VTEIMS, mask);
 
 	return 0;
@@ -4630,7 +4632,7 @@ ixgbevf_configure_msix(struct rte_eth_dev *dev)
 	struct ixgbe_hw *hw =
 		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t q_idx;
-	uint32_t vector_idx = 0;
+	uint32_t vector_idx = IXGBE_MISC_VEC_ID;
 
 	/* won't configure msix register if no mapping is done
 	 * between intr vector and event fd.
@@ -4662,7 +4664,8 @@ ixgbe_configure_msix(struct rte_eth_dev *dev)
 	struct rte_intr_handle *intr_handle = &dev->pci_dev->intr_handle;
 	struct ixgbe_hw *hw =
 		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	uint32_t queue_id, vec = 0;
+	uint32_t queue_id, base = IXGBE_MISC_VEC_ID;
+	uint32_t vec = IXGBE_MISC_VEC_ID;
 	uint32_t mask;
 	uint32_t gpie;
 
@@ -4672,6 +4675,9 @@ ixgbe_configure_msix(struct rte_eth_dev *dev)
 	if (!rte_intr_dp_is_en(intr_handle))
 		return;
 
+	if (rte_intr_allow_others(intr_handle))
+		vec = base = IXGBE_RX_VEC_START;
+
 	/* setup GPIE for MSI-x mode */
 	gpie = IXGBE_READ_REG(hw, IXGBE_GPIE);
 	gpie |= IXGBE_GPIE_MSIX_MODE | IXGBE_GPIE_PBA_SUPPORT |
@@ -4695,23 +4701,23 @@ ixgbe_configure_msix(struct rte_eth_dev *dev)
 		/* by default, 1:1 mapping */
 		ixgbe_set_ivar_map(hw, 0, queue_id, vec);
 		intr_handle->intr_vec[queue_id] = vec;
-		if (vec < intr_handle->nb_efd - 1)
+		if (vec < base + intr_handle->nb_efd - 1)
 			vec++;
 	}
 
 	switch (hw->mac.type) {
 	case ixgbe_mac_82598EB:
 		ixgbe_set_ivar_map(hw, -1, IXGBE_IVAR_OTHER_CAUSES_INDEX,
-				   intr_handle->max_intr - 1);
+				   IXGBE_MISC_VEC_ID);
 		break;
 	case ixgbe_mac_82599EB:
 	case ixgbe_mac_X540:
-		ixgbe_set_ivar_map(hw, -1, 1, intr_handle->max_intr - 1);
+		ixgbe_set_ivar_map(hw, -1, 1, IXGBE_MISC_VEC_ID);
 		break;
 	default:
 		break;
 	}
-	IXGBE_WRITE_REG(hw, IXGBE_EITR(queue_id),
+	IXGBE_WRITE_REG(hw, IXGBE_EITR(IXGBE_MISC_VEC_ID),
 			IXGBE_MIN_INTER_INTERRUPT_INTERVAL_DEFAULT & 0xFFF);
 
 	/* set up to autoclear timer, and the vectors */
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
index 569d678..1856c42 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/ixgbe/ixgbe_ethdev.h
@@ -123,6 +123,9 @@
 #define IXGBE_VF_IRQ_ENABLE_MASK        3          /* vf irq enable mask */
 #define IXGBE_VF_MAXMSIVECTOR           1
 
+#define IXGBE_MISC_VEC_ID               RTE_INTR_VEC_ZERO_OFFSET
+#define IXGBE_RX_VEC_START              RTE_INTR_VEC_RXTX_OFFSET
+
 /*
  * Information about the fdir mode.
  */
-- 
2.4.3

  parent reply	other threads:[~2015-11-04  6:07 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24  5:33 [dpdk-dev] [PATCH v1 00/11] interrupt mode for i40e Cunming Liang
2015-09-24  5:33 ` [dpdk-dev] [PATCH v1 01/11] eal/linux: vfio map misc intr to vector zero Cunming Liang
2015-09-24  5:33 ` [dpdk-dev] [PATCH v1 02/11] ixgbe: reserve intr vector zero for misc cause Cunming Liang
2015-09-24  5:33 ` [dpdk-dev] [PATCH v1 03/11] igb: " Cunming Liang
2015-09-24  5:33 ` [dpdk-dev] [PATCH v1 04/11] eal/linux: not allow to enable zero intr efd Cunming Liang
2015-09-24  5:33 ` [dpdk-dev] [PATCH v1 05/11] eal/linux: add intr api to report multi-vector capability Cunming Liang
2015-09-24  5:33 ` [dpdk-dev] [PATCH v1 06/11] ixgbe: fix rx intr compatible issue with PF mbox Cunming Liang
2015-11-02 16:03   ` David Marchand
2015-11-02 16:09     ` Ananyev, Konstantin
2015-11-02 16:22       ` David Marchand
     [not found]         ` <2601191342CEEE43887BDE71AB97725836AB862D@irsmsx105.ger.corp.intel.com>
2015-11-02 16:41           ` Ananyev, Konstantin
2015-11-02 17:06             ` David Marchand
2015-11-02 17:23               ` Ananyev, Konstantin
2015-11-02 17:45                 ` David Marchand
2015-09-24  5:33 ` [dpdk-dev] [PATCH v1 07/11] ixgbevf: cleanup unnecessary interrupt handler Cunming Liang
2015-09-24  5:33 ` [dpdk-dev] [PATCH v1 08/11] igb: fix rx intr compatible issue with PF mbox Cunming Liang
2015-09-24  5:33 ` [dpdk-dev] [PATCH v1 09/11] i40e: add rx interrupt support Cunming Liang
2015-09-24  5:33 ` [dpdk-dev] [PATCH v1 10/11] i40evf: " Cunming Liang
2015-09-24  5:33 ` [dpdk-dev] [PATCH v1 11/11] doc: release note update for intr mode Cunming Liang
2015-10-30  5:27 ` [dpdk-dev] [PATCH v2 00/11] interrupt mode for i40e Cunming Liang
2015-10-30  5:27   ` [dpdk-dev] [PATCH v2 01/11] eal/linux: vfio map misc intr to vector zero Cunming Liang
2015-10-30  7:11     ` He, Shaopeng
2015-10-30  7:33     ` Zhang, Helin
2015-10-30 14:22     ` Liang, Cunming
2015-11-02 15:53     ` David Marchand
2015-11-04  1:17       ` Liang, Cunming
2015-11-04  6:07     ` [dpdk-dev] [PATCH v3 00/13] interrupt mode for i40e Cunming Liang
2015-11-04  6:07       ` [dpdk-dev] [PATCH v3 01/13] eal: vfio map misc intr to vector zero Cunming Liang
2015-11-04  6:07       ` Cunming Liang [this message]
2015-11-04  6:07       ` [dpdk-dev] [PATCH v3 03/13] igb: reserve intr vector zero for misc cause Cunming Liang
2015-11-04  6:07       ` [dpdk-dev] [PATCH v3 04/13] eal/linux: not allow to enable zero intr efd Cunming Liang
2015-11-04  6:07       ` [dpdk-dev] [PATCH v3 05/13] ixgbe: fix efd_enable with zero number Cunming Liang
2015-11-04  6:07       ` [dpdk-dev] [PATCH v3 06/13] igb: " Cunming Liang
2015-11-04  6:07       ` [dpdk-dev] [PATCH v3 07/13] eal: add intr api to report multi-vector capability Cunming Liang
2015-11-04  6:07       ` [dpdk-dev] [PATCH v3 08/13] ixgbe: fix rx intr compatible issue with PF mbox Cunming Liang
2015-11-04  6:07       ` [dpdk-dev] [PATCH v3 09/13] ixgbe: fix unnecessary intr_vec free in dev_close Cunming Liang
2015-11-04  6:07       ` [dpdk-dev] [PATCH v3 10/13] ixgbevf: cleanup unnecessary interrupt handler Cunming Liang
2015-11-04  6:07       ` [dpdk-dev] [PATCH v3 11/13] igb: fix rx intr compatible issue with PF mbox Cunming Liang
2015-11-04  6:07       ` [dpdk-dev] [PATCH v3 12/13] i40e: add rx interrupt support Cunming Liang
2015-11-04  6:07       ` [dpdk-dev] [PATCH v3 13/13] i40evf: " Cunming Liang
2015-11-04  8:45       ` [dpdk-dev] [PATCH v4 00/13] interrupt mode for i40e Cunming Liang
2015-11-04  8:45         ` [dpdk-dev] [PATCH v4 01/13] eal: vfio map misc intr to vector zero Cunming Liang
2015-11-04 13:06           ` David Marchand
2015-11-04  8:45         ` [dpdk-dev] [PATCH v4 02/13] ixgbe: reserve intr vector zero for misc cause Cunming Liang
2015-11-04  8:45         ` [dpdk-dev] [PATCH v4 03/13] igb: " Cunming Liang
2015-11-04  8:45         ` [dpdk-dev] [PATCH v4 04/13] eal/linux: not allow to enable zero intr efd Cunming Liang
2015-11-04 13:06           ` David Marchand
2015-11-04  8:45         ` [dpdk-dev] [PATCH v4 05/13] ixgbe: fix efd_enable with zero number Cunming Liang
2015-11-04  8:45         ` [dpdk-dev] [PATCH v4 06/13] igb: " Cunming Liang
2015-11-04  8:45         ` [dpdk-dev] [PATCH v4 07/13] eal: add intr api to report multi-vector capability Cunming Liang
2015-11-04 13:07           ` David Marchand
2015-11-04  8:45         ` [dpdk-dev] [PATCH v4 08/13] ixgbe: fix rx intr compatible issue with PF mbox Cunming Liang
2015-11-04  8:45         ` [dpdk-dev] [PATCH v4 09/13] ixgbe: fix unnecessary intr_vec free in dev_close Cunming Liang
2015-11-04  8:45         ` [dpdk-dev] [PATCH v4 10/13] ixgbevf: cleanup unnecessary interrupt handler Cunming Liang
2015-11-04  8:45         ` [dpdk-dev] [PATCH v4 11/13] igb: fix rx intr compatible issue with PF mbox Cunming Liang
2015-11-04  8:45         ` [dpdk-dev] [PATCH v4 12/13] i40e: add rx interrupt support Cunming Liang
2015-11-04  8:45         ` [dpdk-dev] [PATCH v4 13/13] i40evf: " Cunming Liang
2015-11-04 14:29         ` [dpdk-dev] [PATCH v4 00/13] interrupt mode for i40e Thomas Monjalon
2015-10-30  5:27   ` [dpdk-dev] [PATCH v2 02/11] ixgbe: reserve intr vector zero for misc cause Cunming Liang
2015-10-30  5:27   ` [dpdk-dev] [PATCH v2 03/11] igb: " Cunming Liang
2015-10-30  5:27   ` [dpdk-dev] [PATCH v2 04/11] eal/linux: not allow to enable zero intr efd Cunming Liang
2015-10-30  7:11     ` He, Shaopeng
2015-10-30  5:27   ` [dpdk-dev] [PATCH v2 05/11] eal/linux: add intr api to report multi-vector capability Cunming Liang
2015-10-30  7:13     ` He, Shaopeng
2015-11-02 15:59     ` David Marchand
2015-11-04  1:21       ` Liang, Cunming
2015-10-30  5:27   ` [dpdk-dev] [PATCH v2 06/11] ixgbe: fix rx intr compatible issue with PF mbox Cunming Liang
2015-10-30  5:27   ` [dpdk-dev] [PATCH v2 07/11] ixgbevf: cleanup unnecessary interrupt handler Cunming Liang
2015-11-02 16:06     ` David Marchand
2015-11-04  1:37       ` Liang, Cunming
2015-10-30  5:27   ` [dpdk-dev] [PATCH v2 08/11] igb: fix rx intr compatible issue with PF mbox Cunming Liang
2015-10-30  5:27   ` [dpdk-dev] [PATCH v2 09/11] i40e: add rx interrupt support Cunming Liang
2015-10-30  7:33     ` Zhang, Helin
2015-10-30  7:35     ` Wu, Jingjing
2015-10-30  5:27   ` [dpdk-dev] [PATCH v2 10/11] i40evf: " Cunming Liang
2015-10-30  7:36     ` Wu, Jingjing
2015-10-30  7:38     ` Zhang, Helin
2015-10-30  5:27   ` [dpdk-dev] [PATCH 11/11] doc: release note update for intr mode Cunming Liang
2015-10-30  8:21   ` [dpdk-dev] [PATCH v2 00/11] interrupt mode for i40e Zhang, Helin

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=1446617263-7448-3-git-send-email-cunming.liang@intel.com \
    --to=cunming.liang@intel.com \
    --cc=dev@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).