From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 8CF178E81 for ; Thu, 24 Sep 2015 07:34:19 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 23 Sep 2015 22:34:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,579,1437462000"; d="scan'208";a="812049256" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 23 Sep 2015 22:34:17 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t8O5YF4c027625; Thu, 24 Sep 2015 13:34:15 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t8O5YBlN019164; Thu, 24 Sep 2015 13:34:13 +0800 Received: (from cliang18@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t8O5YBLf019160; Thu, 24 Sep 2015 13:34:11 +0800 From: Cunming Liang To: dev@dpdk.org Date: Thu, 24 Sep 2015 13:33:47 +0800 Message-Id: <1443072831-19065-8-git-send-email-cunming.liang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1443072831-19065-1-git-send-email-cunming.liang@intel.com> References: <1443072831-19065-1-git-send-email-cunming.liang@intel.com> Subject: [dpdk-dev] [PATCH v1 07/11] ixgbevf: cleanup unnecessary interrupt handler X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2015 05:34:20 -0000 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 --- 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 f180d75..1d46320 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, @@ -2670,30 +2666,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. * @@ -2789,18 +2761,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 @@ -2863,16 +2823,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) { @@ -3466,11 +3416,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 = @@ -3484,16 +3434,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 */ @@ -3539,7 +3479,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(); @@ -3551,12 +3490,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) @@ -4082,7 +4015,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); @@ -4098,7 +4032,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; @@ -4234,7 +4169,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. @@ -4251,7 +4186,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