From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4A9B1A0A02; Wed, 5 May 2021 16:45:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1EE5541106; Wed, 5 May 2021 16:45:25 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 38FFB41104 for ; Wed, 5 May 2021 16:45:22 +0200 (CEST) IronPort-SDR: +lgX6E3YJG3dEYuUBz3ooZVvfQ4OsmIBkxvHObcumg56KACWFbzDAIBOdfeVuuZ7oWLix6Tr3n tWw2LrVsgL5Q== X-IronPort-AV: E=McAfee;i="6200,9189,9975"; a="262167771" X-IronPort-AV: E=Sophos;i="5.82,275,1613462400"; d="scan'208";a="262167771" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2021 07:45:17 -0700 IronPort-SDR: KI6XjEfHgzEt9iuCHlq9gj1bzou86C2qPqjJuR4ACEx5ygpN9ZDprKtNN2ZMDeuazhDDUgPSRH IEgadRVd0jmg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,275,1613462400"; d="scan'208";a="451805401" Received: from silpixa00400272.ir.intel.com (HELO silpixa00400272.ger.corp.intel.com) ([10.237.223.111]) by fmsmga004.fm.intel.com with ESMTP; 05 May 2021 07:45:16 -0700 From: Kai Ji To: dev@dpdk.org Cc: adamx.dybkowski@intel.com, roy.fan.zhang@intel.com, Kai Ji Date: Wed, 5 May 2021 15:45:13 +0100 Message-Id: <20210505144513.9851-1-kai.ji@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210504232653.12741-1-kai.ji@intel.com> References: <20210504232653.12741-1-kai.ji@intel.com> Subject: [dpdk-dev] [dpdk-dev v2] test/crypto: copy offset data to oop dst buffer X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Copy over the offset data required for auth in out-of-place op when auth offset and cipher offset are not aligned. Fixes: e847fc512817 ("test/crypto: add encrypted digest case for AES-CTR-CMAC") Cc: adamx.dybkowski@intel.com Signed-off-by: Kai Ji --- v2: - rebase to head of for-main branch app/test/test_cryptodev.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index a677a21e36..2bd4ff96cb 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -2629,6 +2629,21 @@ create_wireless_algo_auth_cipher_operation( iv_ptr += cipher_iv_len; rte_memcpy(iv_ptr, auth_iv, auth_iv_len); + /* Only copy over the offset data needed from src to dst in OOP, + * if the auth and cipher offsets are not aligned + */ + if (op_mode == OUT_OF_PLACE) { + if (cipher_offset > auth_offset) + rte_memcpy( + rte_pktmbuf_mtod_offset( + sym_op->m_dst, + uint8_t *, auth_offset >> 3), + rte_pktmbuf_mtod_offset( + sym_op->m_src, + uint8_t *, auth_offset >> 3), + ((cipher_offset >> 3) - (auth_offset >> 3))); + } + if (cipher_algo == RTE_CRYPTO_CIPHER_SNOW3G_UEA2 || cipher_algo == RTE_CRYPTO_CIPHER_KASUMI_F8 || cipher_algo == RTE_CRYPTO_CIPHER_ZUC_EEA3) { -- 2.17.1 -------------------------------------------------------------- Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.