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 DD96943C12; Fri, 1 Mar 2024 18:22:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 12C6F43362; Fri, 1 Mar 2024 18:18:14 +0100 (CET) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id 8B55F43409 for ; Fri, 1 Mar 2024 18:17:50 +0100 (CET) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1dc96f64c10so23323035ad.1 for ; Fri, 01 Mar 2024 09:17:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709313470; x=1709918270; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MHqrO9fXLJb4/sDGY+8nwb3fjJ8wMgosGzfPhvDHLOw=; b=XXfopfhBX8u4JTR6D0SBmO6aVAo78h+L1+/nGU3Is1B3hSdmTmZ4Ybj61fVFH3MN1W xjlPq6j0bnhwT61E9+Zg1P5/aPyyUxM0mnJkZf7WJzkU98FUkquHH+Uw3TskBGslkSlv Af4aWtaeFBEs2TXxO+QId8yQOt/V9JGt1V33jzZVtlLsuegA9kc31S1mX2p29/j7De+3 /ZhXhzgQCl3BzrEO3ZNZyTIcSEseUdYWtPifDps9kSNXFod8SVjplAjRRd1bD4yeaOts nFtTzJDYwUJ8XsFP1lqFKEayGfW9QHipwl+PJ2ONjEOeCaAy6XnthSSixWInDvZnwO99 j1BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709313470; x=1709918270; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MHqrO9fXLJb4/sDGY+8nwb3fjJ8wMgosGzfPhvDHLOw=; b=AH0ie516GTa+z0QrEDAXyEkIE9NxmYkkf49mBqFryUOR1IcDeNX0vkZez4otaUQQW4 dQcWUE8ta1xRqeNOcicsT4KG02Bc3m0XwweRR8j2v7GVPsxLEJV+IQPb5dVSD+mYJuqJ sbR3wINcAILZtu4XceY0BXKL90A97crlZHd00nj7rr1KLKob0MrkHSGAbDm7FsVAhpWV YJG+kdAsUoiO11MnMATWt6k8t/fLcl0z7wpOsm1w2LZaKf0dXSJsMCDV/GNYqME0SEsc qJRcWU3rxbqkMVO7ZcKeFWyg6L4QryfFu6lbGKuSZgkJ4PYjKo9MSpYPJQMzq7Z8v1Oe NyfQ== X-Gm-Message-State: AOJu0YwAnYMzNsmK9zKnEWCKnHQAYgijM2K8TiFYR6CYfUloY1pXhkgO IWrzTsaIelXqAkDCb9vqEMW7vTYOzS4H6ZLwlMBKkB5hNrpSdLUPW7q0oBXhBA5L3JfFwNWPUdT Q7vFwbQ== X-Google-Smtp-Source: AGHT+IFwasPgcFvj24Sf1JBcgyEY3NgVvxFG2yKAWvi/KFnePMHeOsizNDkWaIVrQALk2yGPqtwktg== X-Received: by 2002:a17:903:288:b0:1dc:df18:c5c1 with SMTP id j8-20020a170903028800b001dcdf18c5c1mr2395335plr.33.1709313469753; Fri, 01 Mar 2024 09:17:49 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id j14-20020a170902da8e00b001dc8d6a9d40sm3695764plx.144.2024.03.01.09.17.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 09:17:49 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Kai Ji Subject: [PATCH v2 42/71] crypto/qat: replace use of fixed size rte_memcpy Date: Fri, 1 Mar 2024 09:15:38 -0800 Message-ID: <20240301171707.95242-43-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240301171707.95242-1-stephen@networkplumber.org> References: <20240229225936.483472-1-stephen@networkplumber.org> <20240301171707.95242-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Automatically generated by devtools/cocci/rte_memcpy.cocci Signed-off-by: Stephen Hemminger --- drivers/crypto/qat/qat_sym_session.c | 52 +++++++++++++--------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c index 9f4f6c3d93e0..8d7809bbec11 100644 --- a/drivers/crypto/qat/qat_sym_session.c +++ b/drivers/crypto/qat/qat_sym_session.c @@ -1310,7 +1310,7 @@ static int partial_hash_sha1(uint8_t *data_in, uint8_t *data_out) if (!SHA1_Init(&ctx)) return -EFAULT; SHA1_Transform(&ctx, data_in); - rte_memcpy(data_out, &ctx, SHA_DIGEST_LENGTH); + memcpy(data_out, &ctx, SHA_DIGEST_LENGTH); return 0; } @@ -1321,7 +1321,7 @@ static int partial_hash_sha224(uint8_t *data_in, uint8_t *data_out) if (!SHA224_Init(&ctx)) return -EFAULT; SHA256_Transform(&ctx, data_in); - rte_memcpy(data_out, &ctx, SHA256_DIGEST_LENGTH); + memcpy(data_out, &ctx, SHA256_DIGEST_LENGTH); return 0; } @@ -1332,7 +1332,7 @@ static int partial_hash_sha256(uint8_t *data_in, uint8_t *data_out) if (!SHA256_Init(&ctx)) return -EFAULT; SHA256_Transform(&ctx, data_in); - rte_memcpy(data_out, &ctx, SHA256_DIGEST_LENGTH); + memcpy(data_out, &ctx, SHA256_DIGEST_LENGTH); return 0; } @@ -1343,7 +1343,7 @@ static int partial_hash_sha384(uint8_t *data_in, uint8_t *data_out) if (!SHA384_Init(&ctx)) return -EFAULT; SHA512_Transform(&ctx, data_in); - rte_memcpy(data_out, &ctx, SHA512_DIGEST_LENGTH); + memcpy(data_out, &ctx, SHA512_DIGEST_LENGTH); return 0; } @@ -1354,7 +1354,7 @@ static int partial_hash_sha512(uint8_t *data_in, uint8_t *data_out) if (!SHA512_Init(&ctx)) return -EFAULT; SHA512_Transform(&ctx, data_in); - rte_memcpy(data_out, &ctx, SHA512_DIGEST_LENGTH); + memcpy(data_out, &ctx, SHA512_DIGEST_LENGTH); return 0; } @@ -1365,7 +1365,7 @@ static int partial_hash_md5(uint8_t *data_in, uint8_t *data_out) if (!MD5_Init(&ctx)) return -EFAULT; MD5_Transform(&ctx, data_in); - rte_memcpy(data_out, &ctx, MD5_DIGEST_LENGTH); + memcpy(data_out, &ctx, MD5_DIGEST_LENGTH); return 0; } @@ -1486,8 +1486,7 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg, return -ENOMEM; } - rte_memcpy(in, AES_CMAC_SEED, - ICP_QAT_HW_AES_128_KEY_SZ); + memcpy(in, AES_CMAC_SEED, ICP_QAT_HW_AES_128_KEY_SZ); rte_memcpy(p_state_buf, auth_key, auth_keylen); if (AES_set_encrypt_key(auth_key, auth_keylen << 3, @@ -1531,8 +1530,8 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg, return -ENOMEM; } - rte_memcpy(in, qat_aes_xcbc_key_seed, - ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ); + memcpy(in, qat_aes_xcbc_key_seed, + ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ); for (x = 0; x < HASH_XCBC_PRECOMP_KEY_NUM; x++) { if (AES_set_encrypt_key(auth_key, auth_keylen << 3, @@ -1795,8 +1794,8 @@ static int qat_sym_do_precomputes_ipsec_mb(enum icp_qat_hw_auth_algo hash_alg, uint8_t *input = in; uint8_t *out = p_state_buf; - rte_memcpy(input, qat_aes_xcbc_key_seed, - ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ); + memcpy(input, qat_aes_xcbc_key_seed, + ICP_QAT_HW_AES_XCBC_MAC_STATE2_SZ); for (i = 0; i < HASH_XCBC_PRECOMP_KEY_NUM; i++) { if (aes_ipsecmb_job(input, out, m, auth_key, auth_keylen)) { memset(input - @@ -2265,8 +2264,8 @@ int qat_sym_cd_auth_set(struct qat_sym_session *cdesc, cdesc->cd_cur_ptr += sizeof(struct icp_qat_hw_auth_setup); switch (cdesc->qat_hash_alg) { case ICP_QAT_HW_AUTH_ALGO_SM3: - rte_memcpy(cdesc->cd_cur_ptr, sm3InitialState, - sizeof(sm3InitialState)); + memcpy(cdesc->cd_cur_ptr, sm3InitialState, + sizeof(sm3InitialState)); state1_size = qat_hash_get_state1_size( cdesc->qat_hash_alg); state2_size = ICP_QAT_HW_SM3_STATE2_SZ; @@ -2277,9 +2276,8 @@ int qat_sym_cd_auth_set(struct qat_sym_session *cdesc, hash_2->auth_config.config = ICP_QAT_HW_AUTH_CONFIG_BUILD(ICP_QAT_HW_AUTH_MODE2, cdesc->qat_hash_alg, digestsize); - rte_memcpy(cdesc->cd_cur_ptr + state1_size + state2_size + - sizeof(*hash_2), sm3InitialState, - sizeof(sm3InitialState)); + memcpy(cdesc->cd_cur_ptr + state1_size + state2_size + sizeof(*hash_2), + sm3InitialState, sizeof(sm3InitialState)); hash_cd_ctrl->inner_state1_sz = state1_size; hash_cd_ctrl->inner_state2_sz = state2_size; hash_cd_ctrl->inner_state2_offset = @@ -2316,8 +2314,8 @@ int qat_sym_cd_auth_set(struct qat_sym_session *cdesc, case ICP_QAT_HW_AUTH_ALGO_SHA1: if (cdesc->auth_mode == ICP_QAT_HW_AUTH_MODE0) { /* Plain SHA-1 */ - rte_memcpy(cdesc->cd_cur_ptr, sha1InitialState, - sizeof(sha1InitialState)); + memcpy(cdesc->cd_cur_ptr, sha1InitialState, + sizeof(sha1InitialState)); state1_size = qat_hash_get_state1_size( cdesc->qat_hash_alg); break; @@ -2343,8 +2341,8 @@ int qat_sym_cd_auth_set(struct qat_sym_session *cdesc, case ICP_QAT_HW_AUTH_ALGO_SHA224: if (cdesc->auth_mode == ICP_QAT_HW_AUTH_MODE0) { /* Plain SHA-224 */ - rte_memcpy(cdesc->cd_cur_ptr, sha224InitialState, - sizeof(sha224InitialState)); + memcpy(cdesc->cd_cur_ptr, sha224InitialState, + sizeof(sha224InitialState)); state1_size = qat_hash_get_state1_size( cdesc->qat_hash_alg); break; @@ -2368,8 +2366,8 @@ int qat_sym_cd_auth_set(struct qat_sym_session *cdesc, case ICP_QAT_HW_AUTH_ALGO_SHA256: if (cdesc->auth_mode == ICP_QAT_HW_AUTH_MODE0) { /* Plain SHA-256 */ - rte_memcpy(cdesc->cd_cur_ptr, sha256InitialState, - sizeof(sha256InitialState)); + memcpy(cdesc->cd_cur_ptr, sha256InitialState, + sizeof(sha256InitialState)); state1_size = qat_hash_get_state1_size( cdesc->qat_hash_alg); break; @@ -2393,8 +2391,8 @@ int qat_sym_cd_auth_set(struct qat_sym_session *cdesc, case ICP_QAT_HW_AUTH_ALGO_SHA384: if (cdesc->auth_mode == ICP_QAT_HW_AUTH_MODE0) { /* Plain SHA-384 */ - rte_memcpy(cdesc->cd_cur_ptr, sha384InitialState, - sizeof(sha384InitialState)); + memcpy(cdesc->cd_cur_ptr, sha384InitialState, + sizeof(sha384InitialState)); state1_size = qat_hash_get_state1_size( cdesc->qat_hash_alg); break; @@ -2418,8 +2416,8 @@ int qat_sym_cd_auth_set(struct qat_sym_session *cdesc, case ICP_QAT_HW_AUTH_ALGO_SHA512: if (cdesc->auth_mode == ICP_QAT_HW_AUTH_MODE0) { /* Plain SHA-512 */ - rte_memcpy(cdesc->cd_cur_ptr, sha512InitialState, - sizeof(sha512InitialState)); + memcpy(cdesc->cd_cur_ptr, sha512InitialState, + sizeof(sha512InitialState)); state1_size = qat_hash_get_state1_size( cdesc->qat_hash_alg); break; -- 2.43.0