From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D8215A0564 for ; Mon, 23 Mar 2020 06:40:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B82691C02B; Mon, 23 Mar 2020 06:40:41 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id EDE2D1E34; Mon, 23 Mar 2020 06:40:37 +0100 (CET) IronPort-SDR: 1YI8zecZZws8RvFXuuIyZ7oEZ0LzGOXqJCm6nylnOdhEpQUtDnDzn4ROpMiXK4dmMU3+9raf7y UWaAKXIkSpBA== X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2020 22:40:36 -0700 IronPort-SDR: n6xaBI96AkQ8h58mwb/7SKV3vPm1IGUYWrfT/cpj27Gd31epteWOek/0k11LHFXnq4bIx19Fs+ dVaO/tain8Pw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,295,1580803200"; d="log'?scan'208";a="237821012" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga007.fm.intel.com with ESMTP; 22 Mar 2020 22:40:36 -0700 Received: from shsmsx602.ccr.corp.intel.com (10.109.6.142) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 22 Mar 2020 22:40:36 -0700 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX602.ccr.corp.intel.com (10.109.6.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 23 Mar 2020 13:40:33 +0800 Received: from shsmsx606.ccr.corp.intel.com ([10.109.6.216]) by SHSMSX606.ccr.corp.intel.com ([10.109.6.216]) with mapi id 15.01.1713.004; Mon, 23 Mar 2020 13:40:33 +0800 From: "Xiao, QimaiX" To: "Liu, Yong" , "maxime.coquelin@redhat.com" , "Wang, Zhihong" , "Ye, Xiaolong" CC: "dev@dpdk.org" , "stable@dpdk.org" , "Liu, Yong" Thread-Topic: [dpdk-dev] [PATCH] vhost: fix packed ring zero-copy Thread-Index: AQHV+2k+zM4hdbUuxk6VFoJTJe2Ki6hVs8pA Date: Mon, 23 Mar 2020 05:40:33 +0000 Message-ID: <7fb0f1b6f17943368251628e16150486@intel.com> References: <20200316153822.113182-1-yong.liu@intel.com> In-Reply-To: <20200316153822.113182-1-yong.liu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] vhost: fix packed ring zero-copy X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Tested-by: Xiao, QimaiX Regards, Xiao Qimai > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Marvin Liu > Sent: Monday, March 16, 2020 11:38 PM > To: maxime.coquelin@redhat.com; Wang, Zhihong > ; Ye, Xiaolong > Cc: dev@dpdk.org; stable@dpdk.org; Liu, Yong > Subject: [dpdk-dev] [PATCH] vhost: fix packed ring zero-copy >=20 > Available buffer ID should be stored in the zmbuf in the packed-ring > dequeue path. There's no guarantee that local queue avail index is equal = to > buffer ID. >=20 > Fixes: d1eafb532268 ("vhost: add packed ring zcopy batch and single > dequeue") > Cc: stable@dpdk.org >=20 > Signed-off-by: Marvin Liu > Reported-by: Yinan Wang > Reviewed-by: Maxime Coquelin >=20 > diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.= c index > 37c47c7dc..210415904 100644 > --- a/lib/librte_vhost/virtio_net.c > +++ b/lib/librte_vhost/virtio_net.c > @@ -2004,7 +2004,7 @@ virtio_dev_tx_batch_packed_zmbuf(struct > virtio_net *dev, >=20 > vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) { > zmbufs[i]->mbuf =3D pkts[i]; > - zmbufs[i]->desc_idx =3D avail_idx + i; > + zmbufs[i]->desc_idx =3D ids[i]; > zmbufs[i]->desc_count =3D 1; > } >=20 > @@ -2045,7 +2045,7 @@ virtio_dev_tx_single_packed_zmbuf(struct > virtio_net *dev, > return -1; > } > zmbuf->mbuf =3D *pkts; > - zmbuf->desc_idx =3D vq->last_avail_idx; > + zmbuf->desc_idx =3D buf_id; > zmbuf->desc_count =3D desc_count; >=20 > rte_mbuf_refcnt_update(*pkts, 1); > -- > 2.17.1