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 41B3CA0A02; Wed, 5 May 2021 01:27:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A8F2A40143; Wed, 5 May 2021 01:27:02 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id E88844003C for ; Wed, 5 May 2021 01:27:00 +0200 (CEST) IronPort-SDR: RBHsrvj8eQDAOika6uJzWIDuC/maECsiCsf/a+gE0fE8oprSZXWsslE61XfQhG+SUpaOBX3Eg/ 6+QJsoTm6gRA== X-IronPort-AV: E=McAfee;i="6200,9189,9974"; a="198153136" X-IronPort-AV: E=Sophos;i="5.82,273,1613462400"; d="scan'208";a="198153136" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2021 16:26:57 -0700 IronPort-SDR: eGS7VO4NH9Ne7Yl3PhQhsc9MmiM/jMUtCsrvJF0TbUqVQgkpbEO9THfSaBcIFxU6xPRW0ddnQl W8Vs/kLG2DIA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,273,1613462400"; d="scan'208";a="433525007" Received: from silpixa00400272.ir.intel.com (HELO silpixa00400272.ger.corp.intel.com) ([10.237.223.111]) by orsmga008.jf.intel.com with ESMTP; 04 May 2021 16:26:56 -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 00:26:53 +0100 Message-Id: <20210504232653.12741-1-kai.ji@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] 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 --- 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 d6956f9c2e..366d06becc 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -2386,6 +2386,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.