DPDK patches and discussions
 help / color / mirror / Atom feed
From: Cunming Liang <cunming.liang@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 07/11] ixgbevf: cleanup unnecessary interrupt handler
Date: Fri, 30 Oct 2015 13:27:49 +0800	[thread overview]
Message-ID: <1446182873-28814-8-git-send-email-cunming.liang@intel.com> (raw)
In-Reply-To: <1446182873-28814-1-git-send-email-cunming.liang@intel.com>

As ixgbe vf doesn't support lsc, the patch removes those unused code.
In addition, it does some tiny cleanup.

Signed-off-by: Cunming Liang <cunming.liang@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 85 +++++-----------------------------------
 1 file changed, 10 insertions(+), 75 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 366923f..794171c 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -206,8 +206,6 @@ static void ixgbe_dcb_init(struct ixgbe_hw *hw,struct ixgbe_dcb_config *dcb_conf
 /* For Virtual Function support */
 static int eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev);
 static int eth_ixgbevf_dev_uninit(struct rte_eth_dev *eth_dev);
-static int ixgbevf_dev_interrupt_get_status(struct rte_eth_dev *dev);
-static int ixgbevf_dev_interrupt_action(struct rte_eth_dev *dev);
 static int  ixgbevf_dev_configure(struct rte_eth_dev *dev);
 static int  ixgbevf_dev_start(struct rte_eth_dev *dev);
 static void ixgbevf_dev_stop(struct rte_eth_dev *dev);
@@ -223,8 +221,6 @@ static void ixgbevf_vlan_strip_queue_set(struct rte_eth_dev *dev,
 		uint16_t queue, int on);
 static void ixgbevf_vlan_offload_set(struct rte_eth_dev *dev, int mask);
 static void ixgbevf_set_vfta_all(struct rte_eth_dev *dev, bool on);
-static void ixgbevf_dev_interrupt_handler(struct rte_intr_handle *handle,
-					  void *param);
 static int ixgbevf_dev_rx_queue_intr_enable(struct rte_eth_dev *dev,
 					    uint16_t queue_id);
 static int ixgbevf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev,
@@ -2681,30 +2677,6 @@ ixgbe_dev_interrupt_get_status(struct rte_eth_dev *dev)
 	return 0;
 }
 
-static int
-ixgbevf_dev_interrupt_get_status(struct rte_eth_dev *dev)
-{
-	uint32_t eicr;
-	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	struct ixgbe_interrupt *intr =
-		IXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
-
-	/* clear all cause mask */
-	ixgbevf_intr_disable(hw);
-
-	/* read-on-clear nic registers here */
-	eicr = IXGBE_READ_REG(hw, IXGBE_VTEICR);
-	PMD_DRV_LOG(INFO, "eicr %x", eicr);
-
-	intr->flags = 0;
-
-	/* set flag for async link update */
-	if (eicr & IXGBE_EICR_LSC)
-		intr->flags |= IXGBE_FLAG_NEED_LINK_UPDATE;
-
-	return 0;
-}
-
 /**
  * It gets and then prints the link status.
  *
@@ -2800,18 +2772,6 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev)
 	return 0;
 }
 
-static int
-ixgbevf_dev_interrupt_action(struct rte_eth_dev *dev)
-{
-	struct ixgbe_hw *hw =
-		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-
-	PMD_DRV_LOG(DEBUG, "enable intr immediately");
-	ixgbevf_intr_enable(hw);
-	rte_intr_enable(&dev->pci_dev->intr_handle);
-	return 0;
-}
-
 /**
  * Interrupt handler which shall be registered for alarm callback for delayed
  * handling specific interrupt to wait for the stable nic state. As the
@@ -2874,16 +2834,6 @@ ixgbe_dev_interrupt_handler(__rte_unused struct rte_intr_handle *handle,
 	ixgbe_dev_interrupt_action(dev);
 }
 
-static void
-ixgbevf_dev_interrupt_handler(__rte_unused struct rte_intr_handle *handle,
-			      void *param)
-{
-	struct rte_eth_dev *dev = (struct rte_eth_dev *)param;
-
-	ixgbevf_dev_interrupt_get_status(dev);
-	ixgbevf_dev_interrupt_action(dev);
-}
-
 static int
 ixgbe_dev_led_on(struct rte_eth_dev *dev)
 {
@@ -3492,11 +3442,11 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 	ixgbevf_dev_rxtx_start(dev);
 
 	/* check and configure queue intr-vector mapping */
-	if (dev->data->dev_conf.intr_conf.rxq != 0)
+	if (dev->data->dev_conf.intr_conf.rxq != 0) {
 		intr_vector = dev->data->nb_rx_queues;
-
-	if (rte_intr_efd_enable(intr_handle, intr_vector))
-		return -1;
+		if (rte_intr_efd_enable(intr_handle, intr_vector))
+			return -1;
+	}
 
 	if (rte_intr_dp_is_en(intr_handle) && !intr_handle->intr_vec) {
 		intr_handle->intr_vec =
@@ -3510,16 +3460,6 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 	}
 	ixgbevf_configure_msix(dev);
 
-	if (dev->data->dev_conf.intr_conf.lsc != 0) {
-		if (rte_intr_allow_others(intr_handle))
-			rte_intr_callback_register(intr_handle,
-					ixgbevf_dev_interrupt_handler,
-					(void *)dev);
-		else
-			PMD_INIT_LOG(INFO, "lsc won't enable because of"
-				     " no intr multiplex\n");
-	}
-
 	rte_intr_enable(intr_handle);
 
 	/* Re-enable interrupt for VF */
@@ -3565,7 +3505,6 @@ static void
 ixgbevf_dev_close(struct rte_eth_dev *dev)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	struct rte_pci_device *pci_dev;
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -3577,12 +3516,6 @@ ixgbevf_dev_close(struct rte_eth_dev *dev)
 
 	/* reprogram the RAR[0] in case user changed it. */
 	ixgbe_set_rar(hw, 0, hw->mac.addr, 0, IXGBE_RAH_AV);
-
-	pci_dev = dev->pci_dev;
-	if (pci_dev->intr_handle.intr_vec) {
-		rte_free(pci_dev->intr_handle.intr_vec);
-		pci_dev->intr_handle.intr_vec = NULL;
-	}
 }
 
 static void ixgbevf_set_vfta_all(struct rte_eth_dev *dev, bool on)
@@ -4108,7 +4041,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 << MISC_VEC_ID);
+	RTE_SET_USED(queue_id);
 	IXGBE_WRITE_REG(hw, IXGBE_VTEIMS, mask);
 
 	rte_intr_enable(&dev->pci_dev->intr_handle);
@@ -4124,7 +4058,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 << MISC_VEC_ID);
+	RTE_SET_USED(queue_id);
 	IXGBE_WRITE_REG(hw, IXGBE_VTEIMS, mask);
 
 	return 0;
@@ -4260,7 +4195,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 = MISC_VEC_ID;
 
 	/* won't configure msix register if no mapping is done
 	 * between intr vector and event fd.
@@ -4277,7 +4212,7 @@ ixgbevf_configure_msix(struct rte_eth_dev *dev)
 		intr_handle->intr_vec[q_idx] = vector_idx;
 	}
 
-	/* Configure VF Rx queue ivar */
+	/* Configure VF other cause ivar */
 	ixgbevf_set_ivar_map(hw, -1, 1, vector_idx);
 }
 
-- 
2.4.3

  parent reply	other threads:[~2015-10-30  5:28 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       ` [dpdk-dev] [PATCH v3 02/13] ixgbe: reserve intr vector zero for misc cause Cunming Liang
2015-11-04  6:07       ` [dpdk-dev] [PATCH v3 03/13] igb: " 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   ` Cunming Liang [this message]
2015-11-02 16:06     ` [dpdk-dev] [PATCH v2 07/11] ixgbevf: cleanup unnecessary interrupt handler 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=1446182873-28814-8-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).