From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 173561B53A; Fri, 5 Apr 2019 17:34:04 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2019 08:34:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,313,1549958400"; d="scan'208";a="335308945" Received: from silpixa00398673.ir.intel.com (HELO silpixa00398673.ger.corp.intel.com) ([10.237.223.136]) by fmsmga005.fm.intel.com with ESMTP; 05 Apr 2019 08:34:03 -0700 From: Fan Zhang To: dev@dpdk.org Cc: akhil.goyal@nxp.com, Fan Zhang , stable@dpdk.org Date: Fri, 5 Apr 2019 16:31:12 +0100 Message-Id: <20190405153112.60248-1-roy.fan.zhang@intel.com> X-Mailer: git-send-email 2.14.5 Subject: [dpdk-dev] [PATCH] crypto/virtio: fix iv offset 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, 05 Apr 2019 15:34:05 -0000 This patch fixes the incorrect iv offset calculation. Fixes: b063e843fa03 ("crypto/virtio: fix IV physical address") Cc: stable@dpdk.org Signed-off-by: Fan Zhang --- drivers/crypto/virtio/virtio_rxtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/virtio/virtio_rxtx.c b/drivers/crypto/virtio/virtio_rxtx.c index e32a1ecd6..dcb0055b4 100644 --- a/drivers/crypto/virtio/virtio_rxtx.c +++ b/drivers/crypto/virtio/virtio_rxtx.c @@ -203,8 +203,8 @@ virtqueue_crypto_sym_enqueue_xmit( uint16_t req_data_len = sizeof(struct virtio_crypto_op_data_req); uint32_t indirect_vring_addr_offset = req_data_len + sizeof(struct virtio_crypto_inhdr); - uint32_t indirect_iv_addr_offset = indirect_vring_addr_offset + - sizeof(struct vring_desc) * NUM_ENTRY_VIRTIO_CRYPTO_OP; + uint32_t indirect_iv_addr_offset = + offsetof(struct virtio_crypto_op_cookie *, iv); struct rte_crypto_sym_op *sym_op = cop->sym; struct virtio_crypto_session *session = (struct virtio_crypto_session *)get_sym_session_private_data( -- 2.14.5 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 1FB36A0679 for ; Fri, 5 Apr 2019 17:34:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BAA0A1B55F; Fri, 5 Apr 2019 17:34:06 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 173561B53A; Fri, 5 Apr 2019 17:34:04 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Apr 2019 08:34:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,313,1549958400"; d="scan'208";a="335308945" Received: from silpixa00398673.ir.intel.com (HELO silpixa00398673.ger.corp.intel.com) ([10.237.223.136]) by fmsmga005.fm.intel.com with ESMTP; 05 Apr 2019 08:34:03 -0700 From: Fan Zhang To: dev@dpdk.org Cc: akhil.goyal@nxp.com, Fan Zhang , stable@dpdk.org Date: Fri, 5 Apr 2019 16:31:12 +0100 Message-Id: <20190405153112.60248-1-roy.fan.zhang@intel.com> X-Mailer: git-send-email 2.14.5 Subject: [dpdk-dev] [PATCH] crypto/virtio: fix iv offset 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190405153112.O3Sf5pGgwBXBUmi1R2XGivmc3wDf_LgjWpPbLXiujsg@z> This patch fixes the incorrect iv offset calculation. Fixes: b063e843fa03 ("crypto/virtio: fix IV physical address") Cc: stable@dpdk.org Signed-off-by: Fan Zhang --- drivers/crypto/virtio/virtio_rxtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/virtio/virtio_rxtx.c b/drivers/crypto/virtio/virtio_rxtx.c index e32a1ecd6..dcb0055b4 100644 --- a/drivers/crypto/virtio/virtio_rxtx.c +++ b/drivers/crypto/virtio/virtio_rxtx.c @@ -203,8 +203,8 @@ virtqueue_crypto_sym_enqueue_xmit( uint16_t req_data_len = sizeof(struct virtio_crypto_op_data_req); uint32_t indirect_vring_addr_offset = req_data_len + sizeof(struct virtio_crypto_inhdr); - uint32_t indirect_iv_addr_offset = indirect_vring_addr_offset + - sizeof(struct vring_desc) * NUM_ENTRY_VIRTIO_CRYPTO_OP; + uint32_t indirect_iv_addr_offset = + offsetof(struct virtio_crypto_op_cookie *, iv); struct rte_crypto_sym_op *sym_op = cop->sym; struct virtio_crypto_session *session = (struct virtio_crypto_session *)get_sym_session_private_data( -- 2.14.5