From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 538151B3F0 for ; Fri, 4 Jan 2019 05:09:19 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) 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; 03 Jan 2019 20:09:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,437,1539673200"; d="scan'208";a="288727274" Received: from dpdk-tbie.sh.intel.com ([10.67.104.173]) by orsmga005.jf.intel.com with ESMTP; 03 Jan 2019 20:09:17 -0800 From: Tiwei Bie To: maxime.coquelin@redhat.com, zhihong.wang@intel.com, dev@dpdk.org Date: Fri, 4 Jan 2019 12:06:37 +0800 Message-Id: <20190104040642.27463-2-tiwei.bie@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190104040642.27463-1-tiwei.bie@intel.com> References: <20190104040642.27463-1-tiwei.bie@intel.com> Subject: [dpdk-dev] [PATCH 1/6] vhost: fix desc access in relay helpers 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: Fri, 04 Jan 2019 04:09:19 -0000 Descs in desc table should be indexed using the desc idx instead of the idx of avail ring and used ring. Fixes: b13ad2decc83 ("vhost: provide helpers for virtio ring relay") Signed-off-by: Tiwei Bie --- lib/librte_vhost/vdpa.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/librte_vhost/vdpa.c b/lib/librte_vhost/vdpa.c index 240a1fe3a..77d92f9ad 100644 --- a/lib/librte_vhost/vdpa.c +++ b/lib/librte_vhost/vdpa.c @@ -190,10 +190,10 @@ rte_vdpa_relay_vring_avail(int vid, uint16_t qid, void *vring_m) if (unlikely(!desc_ring)) return -1; - if (unlikely(dlen < vq->desc[idx].len)) { + if (unlikely(dlen < vq->desc[desc_id].len)) { idesc = alloc_copy_ind_table(dev, vq, - vq->desc[idx].addr, - vq->desc[idx].len); + vq->desc[desc_id].addr, + vq->desc[desc_id].len); if (unlikely(!idesc)) return -1; @@ -279,10 +279,10 @@ rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m) if (unlikely(!desc_ring)) return -1; - if (unlikely(dlen < vq->desc[idx].len)) { + if (unlikely(dlen < vq->desc[desc_id].len)) { idesc = alloc_copy_ind_table(dev, vq, - vq->desc[idx].addr, - vq->desc[idx].len); + vq->desc[desc_id].addr, + vq->desc[desc_id].len); if (unlikely(!idesc)) return -1; -- 2.17.1