From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 079CCA00C2 for ; Sat, 7 May 2022 04:09:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D899C4014F; Sat, 7 May 2022 04:09:08 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 46A254014F for ; Sat, 7 May 2022 04:09:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651889347; x=1683425347; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=NDvzFW84/h2hdWi3AwQFMfasqUqXwJfQAZC47fE7OsQ=; b=XAsJ/keNwmIK6OiF20bmHzwu8Et5fe9dL5vsXj3YjSqwNVXSQv5QgBBy gZQNZ7Q4cYMGQQcWLCaY4+9aHHb54FupPbX0IIQT4ZGATOisVFxAlJ173 /rAN/la4vKAnnNGOmMadQz1WGWIjhxZzUTLF6hDXtZHVBSrjIzQmIGYMp OgA6nxjM7Ciwhfqapve5XZ/XCE4c97Y2/O/FRD2Rc3e8wCC15CaQw9sjY 2QTwBmydkI/WupD0dtOLdgRdVmgENzPxH5qmRiOC4Z5Tk6pmt2JDt1z69 Wz1fXIvrZbeko3yqbC3pY4H7lKNVc91t8v0wzQCEf+J/eNFXIouf3UNdA A==; X-IronPort-AV: E=McAfee;i="6400,9594,10339"; a="256116167" X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="256116167" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 19:09:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="709721133" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga001.fm.intel.com with ESMTP; 06 May 2022 19:09:06 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 6 May 2022 19:09:05 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 6 May 2022 19:09:05 -0700 Received: from fmsmsx612.amr.corp.intel.com ([10.18.126.92]) by fmsmsx612.amr.corp.intel.com ([10.18.126.92]) with mapi id 15.01.2308.027; Fri, 6 May 2022 19:09:05 -0700 From: "Zhang, Qi Z" To: "Zhou, YidingX" , "Wu, Jingjing" , "Xing, Beilei" CC: "Yang, Qiming" , "stable@dpdk.org" , "Yeleswarapu, Ramamani" Subject: RE: [PATCH] net/iavf: fix mismatch between rx_pkt_burst and RX descriptor Thread-Topic: [PATCH] net/iavf: fix mismatch between rx_pkt_burst and RX descriptor Thread-Index: AQHYYbGy46ANB84hV0yBJDJqsDIB0a0Sqh2g Date: Sat, 7 May 2022 02:09:04 +0000 Message-ID: References: <20220507093429.127530-1-yidingx.zhou@intel.com> In-Reply-To: <20220507093429.127530-1-yidingx.zhou@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.401.20 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org > -----Original Message----- > From: Zhou, YidingX > Sent: Saturday, May 7, 2022 5:34 PM > To: Wu, Jingjing ; Xing, Beilei > Cc: Yang, Qiming ; Zhang, Qi Z > ; stable@dpdk.org; Yeleswarapu, Ramamani > > Subject: [PATCH] net/iavf: fix mismatch between rx_pkt_burst and RX > descriptor >=20 > Some kernel drivers return the capability > VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC when IAVF_RXDID_COMMS_OVS_1 is > not supported. This causes PMD to use rx_pkt_burst that handles the Flex > Receive Descriptor format, but actually configures the RXDID into > IAVF_RXDID_LEGACY_1, then the fields of rte_mbuf Will be filled with wron= g > values in rx_pkt_burst, which will eventually lead to coredump. >=20 > This patch fixes mismatch between rx_pkt_burst and rx descriptor. >=20 > Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction") > Cc: stable@dpdk.org >=20 > Signed-off-by: Yiding Zhou > --- > drivers/net/iavf/iavf_rxtx.c | 20 ++++++++++++++------ > 1 file changed, 14 insertions(+), 6 deletions(-) >=20 > diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c = index > 345f6aeebc..69584264de 100644 > --- a/drivers/net/iavf/iavf_rxtx.c > +++ b/drivers/net/iavf/iavf_rxtx.c > @@ -2908,6 +2908,18 @@ iavf_set_rx_function(struct rte_eth_dev *dev) > bool use_avx512 =3D false; > bool use_flex =3D false; >=20 > + if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) > + use_flex =3D true; No need this check, we can init use_flex as true; > + > + for (i =3D 0; i < dev->data->nb_rx_queues; i++) { > + rxq =3D dev->data->rx_queues[i]; > + if (rxq->rxdid <=3D IAVF_RXDID_LEGACY_1 || > + !(vf->supported_rxdid & BIT(rxq->rxdid))) { Check if rxq->rxdid is in supported list is not necessary, this has been g= uaranteed when we set it. Also its better to print some warning message here, if we saw some rxq->rx= did is flex and some rxq->rxdid is legacy as we have to set rx_burst as leg= acy for all , this is something not be expected by user