From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 8189D1DBD; Tue, 19 Mar 2019 05:00:45 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Mar 2019 21:00:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,496,1544515200"; d="scan'208";a="329851930" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga005.fm.intel.com with ESMTP; 18 Mar 2019 21:00:43 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 18 Mar 2019 21:00:43 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 18 Mar 2019 21:00:43 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.134]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.158]) with mapi id 14.03.0415.000; Tue, 19 Mar 2019 12:00:41 +0800 From: "Zhang, Qi Z" To: "Zhao1, Wei" , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [PATCH] net/iavf: fix vertor interrupt number configuration error Thread-Index: AQHU3gRprSWxe0ARfky40VxYdcGhx6YSU0vw Date: Tue, 19 Mar 2019 04:00:40 +0000 Message-ID: <039ED4275CED7440929022BC67E706115334EC3D@SHSMSX103.ccr.corp.intel.com> References: <1552964680-45860-1-git-send-email-wei.zhao1@intel.com> In-Reply-To: <1552964680-45860-1-git-send-email-wei.zhao1@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzVmZjg1ZjctNTk5MC00Y2U5LTkzNDctNzM2ZDY2MWM5OTFjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoia0JMdDhiR3FPejVUS0ttU0Ftbm81UEd4bDN2NGcyNEVvT3lEQm5hZzlwTXFaQXN5U25SNU1YQ1lGTk9GMjcrQSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] 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: Tue, 19 Mar 2019 04:00:46 -0000 > -----Original Message----- > From: Zhao1, Wei > Sent: Tuesday, March 19, 2019 11:05 AM > To: dev@dpdk.org > Cc: stable@dpdk.org; Zhang, Qi Z ; Zhao1, Wei > > Subject: [PATCH] net/iavf: fix vertor interrupt number configuration erro= r >=20 > There is a issue when iavf do vertor interrupt configuration, it will mis= s one > interrupt vector which set admin queue interrupt when communicate with ho= st > pf. >=20 > Fixes: 69dd4c3d0898 ("net/avf: enable queue and device") > Cc: stable@dpdk.org >=20 > Signed-off-by: Wei Zhao > Signed-off-by: Zhao Wei > --- > drivers/net/iavf/iavf_ethdev.c | 4 ++-- drivers/net/iavf/iavf_vchnl.c = | 8 > +++++++- > 2 files changed, 9 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethde= v.c index > 846e604..49c9499 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 =3D 1; > + vf->nb_msix =3D 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] |=3D 1 << i; > } else { > if (!rte_intr_allow_others(intr_handle)) { > - vf->nb_msix =3D 1; > + vf->nb_msix =3D 2; > vf->msix_base =3D IAVF_MISC_VEC_ID; > for (i =3D 0; i < dev->data->nb_rx_queues; i++) { > vf->rxq_map[vf->msix_base] |=3D 1 << i; diff --git Looks like something missing in below else branch } else { /* If Rx interrupt is reuquired, and we can use * multi interrupts, then the vec is from 1 */ vf->nb_msix =3D RTE_MIN(vf->vf_res->max_vectors, intr_handle->nb_efd); vf->msix_base =3D IAVF_RX_VEC_START; vec =3D IAVF_RX_VEC_START; for (i =3D 0; i < dev->data->nb_rx_queues; i++) { vf->rxq_map[vec] |=3D 1 << i; intr_handle->intr_vec[i] =3D vec++; if (vec >=3D vf->nb_msix) vec =3D IAVF_RX_VEC_START; } PMD_DRV_LOG(DEBUG, "%u vectors are mapping to %u Rx queues= ", vf->nb_msix, dev->data->nb_rx_queues); } Should we also reserve 1 vector for admin queue in this case,=20 or looks like some Rx queue will share the irq vector with admin queue duri= ng iavf_config_irq_map which is not expected? > a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index > 6381fb6..d9a376e 100644 > --- a/drivers/net/iavf/iavf_vchnl.c > +++ b/drivers/net/iavf/iavf_vchnl.c > @@ -609,7 +609,7 @@ iavf_config_irq_map(struct iavf_adapter *adapter) > return -ENOMEM; >=20 > map_info->num_vectors =3D vf->nb_msix; > - for (i =3D 0; i < vf->nb_msix; i++) { > + for (i =3D 0; i < vf->nb_msix - 1; i++) { > vecmap =3D &map_info->vecmap[i]; > vecmap->vsi_id =3D vf->vsi_res->vsi_id; > vecmap->rxitr_idx =3D IAVF_ITR_INDEX_DEFAULT; @@ -618,6 +618,12 > @@ iavf_config_irq_map(struct iavf_adapter *adapter) > vecmap->rxq_map =3D vf->rxq_map[vf->msix_base + i]; > } >=20 > + vecmap =3D &map_info->vecmap[i]; > + vecmap->vsi_id =3D vf->vsi_res->vsi_id; > + vecmap->vector_id =3D 0; > + vecmap->txq_map =3D 0; > + vecmap->rxq_map =3D 0; > + > args.ops =3D VIRTCHNL_OP_CONFIG_IRQ_MAP; > args.in_args =3D (u8 *)map_info; > args.in_args_size =3D 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 9F720A05FE for ; Tue, 19 Mar 2019 05:00:48 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 525CB44C3; Tue, 19 Mar 2019 05:00:47 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 8189D1DBD; Tue, 19 Mar 2019 05:00:45 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Mar 2019 21:00:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,496,1544515200"; d="scan'208";a="329851930" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga005.fm.intel.com with ESMTP; 18 Mar 2019 21:00:43 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 18 Mar 2019 21:00:43 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 18 Mar 2019 21:00:43 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.134]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.158]) with mapi id 14.03.0415.000; Tue, 19 Mar 2019 12:00:41 +0800 From: "Zhang, Qi Z" To: "Zhao1, Wei" , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [PATCH] net/iavf: fix vertor interrupt number configuration error Thread-Index: AQHU3gRprSWxe0ARfky40VxYdcGhx6YSU0vw Date: Tue, 19 Mar 2019 04:00:40 +0000 Message-ID: <039ED4275CED7440929022BC67E706115334EC3D@SHSMSX103.ccr.corp.intel.com> References: <1552964680-45860-1-git-send-email-wei.zhao1@intel.com> In-Reply-To: <1552964680-45860-1-git-send-email-wei.zhao1@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzVmZjg1ZjctNTk5MC00Y2U5LTkzNDctNzM2ZDY2MWM5OTFjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoia0JMdDhiR3FPejVUS0ttU0Ftbm81UEd4bDN2NGcyNEVvT3lEQm5hZzlwTXFaQXN5U25SNU1YQ1lGTk9GMjcrQSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] 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" Message-ID: <20190319040040.IPiA0Xi4xcMbKMNBhpjo0ZXx9eZxkAfMEHsdvaelIds@z> > -----Original Message----- > From: Zhao1, Wei > Sent: Tuesday, March 19, 2019 11:05 AM > To: dev@dpdk.org > Cc: stable@dpdk.org; Zhang, Qi Z ; Zhao1, Wei > > Subject: [PATCH] net/iavf: fix vertor interrupt number configuration erro= r >=20 > There is a issue when iavf do vertor interrupt configuration, it will mis= s one > interrupt vector which set admin queue interrupt when communicate with ho= st > pf. >=20 > Fixes: 69dd4c3d0898 ("net/avf: enable queue and device") > Cc: stable@dpdk.org >=20 > Signed-off-by: Wei Zhao > Signed-off-by: Zhao Wei > --- > drivers/net/iavf/iavf_ethdev.c | 4 ++-- drivers/net/iavf/iavf_vchnl.c = | 8 > +++++++- > 2 files changed, 9 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethde= v.c index > 846e604..49c9499 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 =3D 1; > + vf->nb_msix =3D 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] |=3D 1 << i; > } else { > if (!rte_intr_allow_others(intr_handle)) { > - vf->nb_msix =3D 1; > + vf->nb_msix =3D 2; > vf->msix_base =3D IAVF_MISC_VEC_ID; > for (i =3D 0; i < dev->data->nb_rx_queues; i++) { > vf->rxq_map[vf->msix_base] |=3D 1 << i; diff --git Looks like something missing in below else branch } else { /* If Rx interrupt is reuquired, and we can use * multi interrupts, then the vec is from 1 */ vf->nb_msix =3D RTE_MIN(vf->vf_res->max_vectors, intr_handle->nb_efd); vf->msix_base =3D IAVF_RX_VEC_START; vec =3D IAVF_RX_VEC_START; for (i =3D 0; i < dev->data->nb_rx_queues; i++) { vf->rxq_map[vec] |=3D 1 << i; intr_handle->intr_vec[i] =3D vec++; if (vec >=3D vf->nb_msix) vec =3D IAVF_RX_VEC_START; } PMD_DRV_LOG(DEBUG, "%u vectors are mapping to %u Rx queues= ", vf->nb_msix, dev->data->nb_rx_queues); } Should we also reserve 1 vector for admin queue in this case,=20 or looks like some Rx queue will share the irq vector with admin queue duri= ng iavf_config_irq_map which is not expected? > a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index > 6381fb6..d9a376e 100644 > --- a/drivers/net/iavf/iavf_vchnl.c > +++ b/drivers/net/iavf/iavf_vchnl.c > @@ -609,7 +609,7 @@ iavf_config_irq_map(struct iavf_adapter *adapter) > return -ENOMEM; >=20 > map_info->num_vectors =3D vf->nb_msix; > - for (i =3D 0; i < vf->nb_msix; i++) { > + for (i =3D 0; i < vf->nb_msix - 1; i++) { > vecmap =3D &map_info->vecmap[i]; > vecmap->vsi_id =3D vf->vsi_res->vsi_id; > vecmap->rxitr_idx =3D IAVF_ITR_INDEX_DEFAULT; @@ -618,6 +618,12 > @@ iavf_config_irq_map(struct iavf_adapter *adapter) > vecmap->rxq_map =3D vf->rxq_map[vf->msix_base + i]; > } >=20 > + vecmap =3D &map_info->vecmap[i]; > + vecmap->vsi_id =3D vf->vsi_res->vsi_id; > + vecmap->vector_id =3D 0; > + vecmap->txq_map =3D 0; > + vecmap->rxq_map =3D 0; > + > args.ops =3D VIRTCHNL_OP_CONFIG_IRQ_MAP; > args.in_args =3D (u8 *)map_info; > args.in_args_size =3D len; > -- > 2.7.5