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 024FBA0524; Mon, 24 Feb 2020 08:27:27 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D06681BFB5; Mon, 24 Feb 2020 08:27:26 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 4C8DC1BFB1; Mon, 24 Feb 2020 08:27:24 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Feb 2020 23:27:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,479,1574150400"; d="scan'208";a="409791006" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by orsmga005.jf.intel.com with ESMTP; 23 Feb 2020 23:27:21 -0800 Date: Mon, 24 Feb 2020 15:25:31 +0800 From: Ye Xiaolong To: Marvin Liu Cc: maxime.coquelin@redhat.com, dev@dpdk.org, tiwei.bie@intel.com, zhihong.wang@intel.com, stable@dpdk.org Message-ID: <20200224072531.GA87591@intel.com> References: <20200224145025.84899-1-yong.liu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200224145025.84899-1-yong.liu@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH] vhost: fix zmbuf buffer id invalid 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" For the subject, what about: vhost: fix invalid zmbuf buffer id On 02/24, Marvin Liu wrote: >zc mbufs should record available buffer id when doing dequeue zcopy. >There's no guarantee that local queue avail index equal to buffer index. s/equal to/is equal to > >Fixes: d1eafb532268 ("vhost: add packed ring zcopy batch and single dequeue") >Cc: stable@dpdk.org > >Signed-off-by: Marvin Liu >Reported-by: Yinan Wang > >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, > > vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) { > zmbufs[i]->mbuf = pkts[i]; >- zmbufs[i]->desc_idx = avail_idx + i; >+ zmbufs[i]->desc_idx = ids[i]; > zmbufs[i]->desc_count = 1; > } > >@@ -2045,7 +2045,7 @@ virtio_dev_tx_single_packed_zmbuf(struct virtio_net *dev, > return -1; > } > zmbuf->mbuf = *pkts; >- zmbuf->desc_idx = vq->last_avail_idx; >+ zmbuf->desc_idx = buf_id; > zmbuf->desc_count = desc_count; > > rte_mbuf_refcnt_update(*pkts, 1); >-- >2.17.1 > Apart from above, Reviewed-by: Xiaolong Ye