From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 56D471B574; Fri, 22 Mar 2019 07:54:50 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2019 23:54:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,255,1549958400"; d="scan'208";a="124872475" Received: from dpdk6.bj.intel.com ([172.16.182.192]) by orsmga007.jf.intel.com with ESMTP; 21 Mar 2019 23:54:47 -0700 From: Wei Zhao To: dev@dpdk.org Cc: stable@dpdk.org, qi.z.zhang@intel.com, Wei Zhao Date: Fri, 22 Mar 2019 14:27:14 +0800 Message-Id: <1553236034-45852-1-git-send-email-wei.zhao1@intel.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1552964680-45860-1-git-send-email-wei.zhao1@intel.com> References: <1552964680-45860-1-git-send-email-wei.zhao1@intel.com> Subject: [dpdk-dev] [PATCH v2] net/iavf: fix vertor interrupt number configuration error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Mar 2019 06:54:51 -0000 There is a issue when iavf do vertor interrupt configuration, it will miss one interrupt vector which set admin queue interrupt when communicate with host PF. The AVF driver needs to send an extra vector number to the Linux PF to work around an issue with interrupt vector mapping. The admin queue needs to be added to the number of queues sent to the PF. This patch also set tx queue interrupt vector as a work around, but it maybe cause tx function receive interrupt in some scenario. Fixes: 69dd4c3d0898 ("net/avf: enable queue and device") Cc: stable@dpdk.org Signed-off-by: Wei Zhao --- v2: update git log and add new work around --- drivers/net/iavf/iavf_ethdev.c | 6 +++--- drivers/net/iavf/iavf_vchnl.c | 10 ++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 846e604..e8582f6 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -308,7 +308,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, if (!dev->data->dev_conf.intr_conf.rxq || !rte_intr_dp_is_en(intr_handle)) { /* Rx interrupt disabled, Map interrupt only for writeback */ - vf->nb_msix = 1; + vf->nb_msix = 2; if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) { /* If WB_ON_ITR supports, enable it */ @@ -338,7 +338,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, vf->rxq_map[vf->msix_base] |= 1 << i; } else { if (!rte_intr_allow_others(intr_handle)) { - vf->nb_msix = 1; + vf->nb_msix = 2; vf->msix_base = IAVF_MISC_VEC_ID; for (i = 0; i < dev->data->nb_rx_queues; i++) { vf->rxq_map[vf->msix_base] |= 1 << i; @@ -352,7 +352,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, * multi interrupts, then the vec is from 1 */ vf->nb_msix = RTE_MIN(vf->vf_res->max_vectors, - intr_handle->nb_efd); + intr_handle->nb_efd + 1); vf->msix_base = IAVF_RX_VEC_START; vec = IAVF_RX_VEC_START; for (i = 0; i < dev->data->nb_rx_queues; i++) { diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 6381fb6..b6c55e5 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -609,15 +609,21 @@ iavf_config_irq_map(struct iavf_adapter *adapter) return -ENOMEM; map_info->num_vectors = vf->nb_msix; - for (i = 0; i < vf->nb_msix; i++) { + for (i = 0; i < vf->nb_msix - 1; i++) { vecmap = &map_info->vecmap[i]; vecmap->vsi_id = vf->vsi_res->vsi_id; vecmap->rxitr_idx = IAVF_ITR_INDEX_DEFAULT; vecmap->vector_id = vf->msix_base + i; - vecmap->txq_map = 0; vecmap->rxq_map = vf->rxq_map[vf->msix_base + i]; + vecmap->txq_map = vecmap->rxq_map; } + vecmap = &map_info->vecmap[i]; + vecmap->vsi_id = vf->vsi_res->vsi_id; + vecmap->vector_id = 0; + vecmap->txq_map = 0; + vecmap->rxq_map = 0; + args.ops = VIRTCHNL_OP_CONFIG_IRQ_MAP; args.in_args = (u8 *)map_info; args.in_args_size = len; -- 2.7.5 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 5CABEA00E6 for ; Fri, 22 Mar 2019 07:54:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 983521B579; Fri, 22 Mar 2019 07:54:52 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 56D471B574; Fri, 22 Mar 2019 07:54:50 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2019 23:54:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,255,1549958400"; d="scan'208";a="124872475" Received: from dpdk6.bj.intel.com ([172.16.182.192]) by orsmga007.jf.intel.com with ESMTP; 21 Mar 2019 23:54:47 -0700 From: Wei Zhao To: dev@dpdk.org Cc: stable@dpdk.org, qi.z.zhang@intel.com, Wei Zhao Date: Fri, 22 Mar 2019 14:27:14 +0800 Message-Id: <1553236034-45852-1-git-send-email-wei.zhao1@intel.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1552964680-45860-1-git-send-email-wei.zhao1@intel.com> References: <1552964680-45860-1-git-send-email-wei.zhao1@intel.com> Subject: [dpdk-dev] [PATCH v2] net/iavf: fix vertor interrupt number configuration error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190322062714.LPklua7yMVlSXXhNvxNmK1nd48DZRxpjdnWN-rPPccg@z> There is a issue when iavf do vertor interrupt configuration, it will miss one interrupt vector which set admin queue interrupt when communicate with host PF. The AVF driver needs to send an extra vector number to the Linux PF to work around an issue with interrupt vector mapping. The admin queue needs to be added to the number of queues sent to the PF. This patch also set tx queue interrupt vector as a work around, but it maybe cause tx function receive interrupt in some scenario. Fixes: 69dd4c3d0898 ("net/avf: enable queue and device") Cc: stable@dpdk.org Signed-off-by: Wei Zhao --- v2: update git log and add new work around --- drivers/net/iavf/iavf_ethdev.c | 6 +++--- drivers/net/iavf/iavf_vchnl.c | 10 ++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 846e604..e8582f6 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -308,7 +308,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, if (!dev->data->dev_conf.intr_conf.rxq || !rte_intr_dp_is_en(intr_handle)) { /* Rx interrupt disabled, Map interrupt only for writeback */ - vf->nb_msix = 1; + vf->nb_msix = 2; if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) { /* If WB_ON_ITR supports, enable it */ @@ -338,7 +338,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, vf->rxq_map[vf->msix_base] |= 1 << i; } else { if (!rte_intr_allow_others(intr_handle)) { - vf->nb_msix = 1; + vf->nb_msix = 2; vf->msix_base = IAVF_MISC_VEC_ID; for (i = 0; i < dev->data->nb_rx_queues; i++) { vf->rxq_map[vf->msix_base] |= 1 << i; @@ -352,7 +352,7 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, * multi interrupts, then the vec is from 1 */ vf->nb_msix = RTE_MIN(vf->vf_res->max_vectors, - intr_handle->nb_efd); + intr_handle->nb_efd + 1); vf->msix_base = IAVF_RX_VEC_START; vec = IAVF_RX_VEC_START; for (i = 0; i < dev->data->nb_rx_queues; i++) { diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 6381fb6..b6c55e5 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -609,15 +609,21 @@ iavf_config_irq_map(struct iavf_adapter *adapter) return -ENOMEM; map_info->num_vectors = vf->nb_msix; - for (i = 0; i < vf->nb_msix; i++) { + for (i = 0; i < vf->nb_msix - 1; i++) { vecmap = &map_info->vecmap[i]; vecmap->vsi_id = vf->vsi_res->vsi_id; vecmap->rxitr_idx = IAVF_ITR_INDEX_DEFAULT; vecmap->vector_id = vf->msix_base + i; - vecmap->txq_map = 0; vecmap->rxq_map = vf->rxq_map[vf->msix_base + i]; + vecmap->txq_map = vecmap->rxq_map; } + vecmap = &map_info->vecmap[i]; + vecmap->vsi_id = vf->vsi_res->vsi_id; + vecmap->vector_id = 0; + vecmap->txq_map = 0; + vecmap->rxq_map = 0; + args.ops = VIRTCHNL_OP_CONFIG_IRQ_MAP; args.in_args = (u8 *)map_info; args.in_args_size = len; -- 2.7.5