From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B06CEA0A01; Mon, 4 Jan 2021 03:01:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3F0C71606B7; Mon, 4 Jan 2021 03:01:56 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id C7C2A1606B0; Mon, 4 Jan 2021 03:01:53 +0100 (CET) IronPort-SDR: RtpLEE84pMqU036cl/qYCF0PmCxh/waLLi7rDd/JYaxaFwOC6MWRAAITfw0/+VvdlX2LLkVZxK 25vRUUEz/0nw== X-IronPort-AV: E=McAfee;i="6000,8403,9853"; a="177001667" X-IronPort-AV: E=Sophos;i="5.78,472,1599548400"; d="scan'208";a="177001667" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2021 18:01:52 -0800 IronPort-SDR: eX2rPww3gekyqa7blNa0RH8AP79PxtZesAwKgmbR6gX4UIi9BoMFgv+TQvD5O4yS59yfkoRm9R uCB9I58Bbdgg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,472,1599548400"; d="scan'208";a="421182815" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga001.jf.intel.com with ESMTP; 03 Jan 2021 18:01:52 -0800 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 3 Jan 2021 18:01:51 -0800 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by SHSMSX603.ccr.corp.intel.com (10.109.6.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 4 Jan 2021 10:01:49 +0800 Received: from shsmsx603.ccr.corp.intel.com ([10.109.6.143]) by SHSMSX603.ccr.corp.intel.com ([10.109.6.143]) with mapi id 15.01.1713.004; Mon, 4 Jan 2021 10:01:49 +0800 From: "Yu, DapengX" To: "Zhang, Qi Z" , "Wu, Jingjing" , "Xing, Beilei" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/iavf: fix vector id assignment Thread-Index: AQHW3niNwiU9Aex5OkiIEAB/XvgsLaoWHUoAgACfzOA= Date: Mon, 4 Jan 2021 02:01:49 +0000 Message-ID: References: <20201230065347.90115-1-dapengx.yu@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/iavf: fix vector id assignment X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Hi Qi, By checking the running i40e vf PMD(function:i40evf_config_irq_map()), foun= d that the vector_id actually can be a value that is equal to nb_msix as th= e following.=20 map_info->num_vectors is just equal to nb_msix(which is 2), the max vector_= id is also 2. The map_info which contains vecmap[0], and vectmap[1] is sent= to PF with opcode VIRTCHNL_OP_CONFIG_IRQ_MAP to setup the cause of interru= pt mapping in iavf_config_irq_map(), these are valid parameters and effecti= ve at last. The interrupt can run as expected. So I deduce that vector_id can be equal to nb_msix in iavf PMD too. (gdb) p *map_info $6 =3D {num_vectors =3D 2, vecmap =3D {{vsi_id =3D 10, vector_id =3D 1, rxq= _map =3D 1, txq_map =3D 0, rxitr_idx =3D 0, txitr_idx =3D 0}}} (gdb) p map_info->vecmap[1] $7 =3D {vsi_id =3D 10, vector_id =3D 2, rxq_map =3D 2, txq_map =3D 0, rxitr= _idx =3D 0, txitr_idx =3D 0} (gdb) p map_info->vecmap[0] $8 =3D {vsi_id =3D 10, vector_id =3D 1, rxq_map =3D 1, txq_map =3D 0, rxitr= _idx =3D 0, txitr_idx =3D 0} -----Original Message----- From: Zhang, Qi Z=20 Sent: Monday, January 4, 2021 8:26 AM To: Yu, DapengX ; Wu, Jingjing ; Xing, Beilei Cc: dev@dpdk.org; Yu, DapengX ; stable@dpdk.org Subject: RE: [dpdk-dev] [PATCH] net/iavf: fix vector id assignment > -----Original Message----- > From: dev On Behalf Of dapengx.yu@intel.com > Sent: Wednesday, December 30, 2020 2:54 PM > To: Wu, Jingjing ; Xing, Beilei=20 > > Cc: dev@dpdk.org; Yu, DapengX ; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] net/iavf: fix vector id assignment >=20 > From: YU DAPENG >=20 > When the interrupt handle instance allows none packet I/O interrupts,=20 > the max value of vector_id is set to be less than the number of msix=20 > interrupts, but not equal to it. Which may cause same vector_id is=20 > sent to PF with opcode VIRTCHNL_OP_CONFIG_IRQ_MAP to setup the cause=20 > of interrupt mapping in iavf_config_irq_map(), these are invalid paramete= rs, cause error: > VIRTCHNL_STATUS_ERR_PARAM(-5). So add code to set the max value of=20 > vector_id to be equal to the number of msix interrupts. >=20 > Fixes: d6bde6b5eae9 ("net/avf: enable Rx interrupt") > Cc: stable@dpdk.org >=20 > Signed-off-by: YU DAPENG > --- > drivers/net/iavf/iavf_ethdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/net/iavf/iavf_ethdev.c=20 > b/drivers/net/iavf/iavf_ethdev.c index 7e3c26a94..54ea3a36c 100644 > --- a/drivers/net/iavf/iavf_ethdev.c > +++ b/drivers/net/iavf/iavf_ethdev.c > @@ -578,7 +578,7 @@ static int iavf_config_rx_queues_irqs(struct=20 > rte_eth_dev *dev, > qv_map[i].queue_id =3D i; > qv_map[i].vector_id =3D vec; > intr_handle->intr_vec[i] =3D vec++; > - if (vec >=3D vf->nb_msix) > + if (vec > vf->nb_msix) This is not correct, the nb_msix should already include the vector 0, we sh= ould not set a vector_id to a value that >=3D nb_msix,=20 > vec =3D IAVF_RX_VEC_START; > } > vf->qv_map =3D qv_map; > -- > 2.27.0