From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 698DBC433ED for ; Tue, 4 May 2021 23:27:04 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id D093761157 for ; Tue, 4 May 2021 23:27:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D093761157 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org 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.