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 C12F2A05D3 for ; Tue, 26 Mar 2019 06:35:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0202411A4; Tue, 26 Mar 2019 06:35:42 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 8066B5A; Tue, 26 Mar 2019 06:35:39 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Mar 2019 22:35:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,271,1549958400"; d="scan'208";a="130184829" Received: from dpdk6.bj.intel.com ([172.16.182.192]) by orsmga006.jf.intel.com with ESMTP; 25 Mar 2019 22:35:36 -0700 From: Wei Zhao To: dev@dpdk.org Cc: stable@dpdk.org, qi.z.zhang@intel.com, Wei Zhao Date: Tue, 26 Mar 2019 13:07:59 +0800 Message-Id: <1553576879-8824-1-git-send-email-wei.zhao1@intel.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1553568050-13343-1-git-send-email-wei.zhao1@intel.com> References: <1553568050-13343-1-git-send-email-wei.zhao1@intel.com> Subject: [dpdk-dev] [PATCH v4] net/iavf: fix Tx interrupt vertor 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: <20190326050759.XZesMSHkVhT7pstIFacDGJmPcci0xMnhR04EG1_LZB8@z> There is need to align to kernel iavf code when setting Tx queue interrupt vector in messge VIRTCHNL_OP_CONFIG_IRQ_MAP, if not it maybe cause restart iavf port error 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 v3: update git comment and change fix code as suggestion v4: add txq_map in struct avf_info to keep vector mapping info --- drivers/net/iavf/iavf.h | 1 + drivers/net/iavf/iavf_ethdev.c | 9 +++++++++ drivers/net/iavf/iavf_vchnl.c | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index e6e3e8d..81d0054 100644 --- a/drivers/net/iavf/iavf.h +++ b/drivers/net/iavf/iavf.h @@ -107,6 +107,7 @@ struct iavf_info { uint16_t msix_base; /* msix vector base from */ /* queue bitmask for each vector */ uint16_t rxq_map[IAVF_MAX_MSIX_VECTORS]; + uint16_t txq_map[IAVF_MAX_MSIX_VECTORS]; }; #define IAVF_MAX_PKT_TYPE 256 diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 846e604..187a31c 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -336,6 +336,8 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, /* map all queues to the same interrupt */ for (i = 0; i < dev->data->nb_rx_queues; i++) vf->rxq_map[vf->msix_base] |= 1 << i; + for (i = 0; i < dev->data->nb_tx_queues; i++) + vf->txq_map[vf->msix_base] |= 1 << i; } else { if (!rte_intr_allow_others(intr_handle)) { vf->nb_msix = 1; @@ -344,6 +346,8 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, vf->rxq_map[vf->msix_base] |= 1 << i; intr_handle->intr_vec[i] = IAVF_MISC_VEC_ID; } + for (i = 0; i < dev->data->nb_tx_queues; i++) + vf->txq_map[vf->msix_base] |= 1 << i; PMD_DRV_LOG(DEBUG, "vector %u are mapping to all Rx queues", vf->msix_base); @@ -361,6 +365,11 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev, if (vec >= vf->nb_msix) vec = IAVF_RX_VEC_START; } + for (i = 0; i < dev->data->nb_tx_queues; i++) { + vf->txq_map[vec++] |= 1 << i; + if (vec >= vf->nb_msix) + vec = IAVF_RX_VEC_START; + } PMD_DRV_LOG(DEBUG, "%u vectors are mapping to %u Rx queues", vf->nb_msix, dev->data->nb_rx_queues); diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 6381fb6..620e011 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -614,7 +614,7 @@ iavf_config_irq_map(struct iavf_adapter *adapter) 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->txq_map = vf->txq_map[vf->msix_base + i]; vecmap->rxq_map = vf->rxq_map[vf->msix_base + i]; } -- 2.7.5