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 E0021A04C3 for ; Mon, 28 Sep 2020 12:59:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 450A01D904; Mon, 28 Sep 2020 12:59:37 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id A807E1D8ED; Mon, 28 Sep 2020 12:59:33 +0200 (CEST) IronPort-SDR: +/CU8vvZhWoGIEPTt7YuKX7ujR039aEbT2SeBXrRlupp42kCQdEFQytg08FKczQPcC0lxaFg2+ Sq2kqF9VO6aQ== X-IronPort-AV: E=McAfee;i="6000,8403,9757"; a="226122043" X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="226122043" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 03:59:33 -0700 IronPort-SDR: Z50+fTv56pyAIc3ULBZlNuEYblYwO3BkS9bczmobgZ1xuCVvbdn3rA6YNyro9q8qlpLZv/XlIT 8IDiKwvm5gpA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="514212884" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by fmsmga005.fm.intel.com with ESMTP; 28 Sep 2020 03:59:31 -0700 From: Ferruh Yigit To: Maxime Coquelin , Chenbo Xia , Zhihong Wang , Fan Zhang Cc: dev@dpdk.org, Ferruh Yigit , stable@dpdk.org Date: Mon, 28 Sep 2020 11:59:16 +0100 Message-Id: <20200928105918.740807-4-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200928105918.740807-1-ferruh.yigit@intel.com> References: <20200928105918.740807-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH 4/6] vhost/crypto: fix incorrect write back source 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" From: Fan Zhang This patch fixes vhost crypto library for the incorrect source and destination buffer calculation in the copy mode. Fixes: cd1e8f03abf0 ("vhost/crypto: fix packet copy in chaining mode") Cc: stable@dpdk.org Signed-off-by: Fan Zhang Acked-by: Chenbo Xia --- lib/librte_vhost/vhost_crypto.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_vhost/vhost_crypto.c b/lib/librte_vhost/vhost_crypto.c index 494f49084b..f1cc32a9b2 100644 --- a/lib/librte_vhost/vhost_crypto.c +++ b/lib/librte_vhost/vhost_crypto.c @@ -749,14 +749,14 @@ prepare_write_back_data(struct vhost_crypto_data_req *vc_req, wb_data->src = src + offset; dlen = desc->len; dst = IOVA_TO_VVA(uint8_t *, vc_req, desc->addr, - &dlen, VHOST_ACCESS_RW) + offset; + &dlen, VHOST_ACCESS_RW); if (unlikely(!dst || dlen != desc->len)) { VC_LOG_ERR("Failed to map descriptor"); goto error_exit; } - wb_data->dst = dst; - wb_data->len = RTE_MIN(desc->len - offset, write_back_len); + wb_data->dst = dst + offset; + wb_data->len = RTE_MIN(dlen - offset, write_back_len); write_back_len -= wb_data->len; src += offset + wb_data->len; offset = 0; @@ -801,7 +801,7 @@ prepare_write_back_data(struct vhost_crypto_data_req *vc_req, goto error_exit; } - wb_data->src = src; + wb_data->src = src + offset; wb_data->dst = dst; wb_data->len = RTE_MIN(desc->len - offset, write_back_len); write_back_len -= wb_data->len; -- 2.26.2