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 4468B43BAE; Fri, 1 Mar 2024 00:04:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 42B74433B2; Fri, 1 Mar 2024 00:01:28 +0100 (CET) Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by mails.dpdk.org (Postfix) with ESMTP id 67F8742FE9 for ; Fri, 1 Mar 2024 00:00:36 +0100 (CET) Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-5dbf7b74402so1133027a12.0 for ; Thu, 29 Feb 2024 15:00:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709247635; x=1709852435; 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=Lljb+1wj6arEIBJ106E6tVhupRiTKw1SnP7s8xLrElnSJAznVVckApuOwcqCwC3Ziv TrWrIjoagYO0STL9UMjJiRf0l3gMU4GgwfOQk9GstALPjcXtzCTixbME5qwBLCWMSUmv MkcyzDS3Zz0CeyU7JsbGyce6Zh2S3Nk+6P0C1dGr03LVAXWtvKi/fwZRJeIxw1BTS0Mf pNr/yjJ6izYiuvbEFMtNNmChSz7mkL2Zfy6/A16sasQnmFHi1hgr8YPotiDLAH5KU6kH gTQPcos3x4zSkgxzYWENl/gR/yNL4JvhmYzHZGt+hBlKtdBXkQuGWZWb7sTWhUEb8Hrn F+Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709247635; x=1709852435; 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=MGo0nndP5t0wHBlfd6z/Lr+ZzBCR5HdNhfc92nHjvP8m/RepDXmYePLHAkRfaBsNSq y6XVRmq9pTFjHSJ3r8qH0c0ve8smer3F9iYOVWYfyHhwAGr3JLjYRaj8TH9+6czRVw6r 1Y5ykfk0uvKsaecxZOZ4z/f+wBMTxFBBdR+8M9PUSbk5yFBdi6PpajZi5VmU7uP9rTJj ctRUbtRXn1EZhle80HKN/iHdcndsbYcBMJQIpeM4sjnenT8Gz5bbnO2xCOakbp50Krz8 g7Q7EOpOwONuMqXRBkjMcg0z1GrWFN7oWWHPO46oU+jLOsCTdBQuDtNKPc4xOaHYE24w phkQ== X-Gm-Message-State: AOJu0YyGAOO3ABe0+6INu/TsGdaVD/lb8uoNinQQ055RkSj20nWqPV/D IXfYcibzluUwcz8Pxc8NcHek+MlcBHTy9OEEnUnbeDJfd7ydOnig7g4UOooQdJsu4lGkvIyoR9N n X-Google-Smtp-Source: AGHT+IFsnu+a7O7NT1Ymq9pT3HTMmpVLCyo91ovOZ2chC8Ey3D8Ptm2TWrYrFge/J5OwnSP6tDnVBw== X-Received: by 2002:a17:90a:4a83:b0:29b:1018:87cc with SMTP id f3-20020a17090a4a8300b0029b101887ccmr19718pjh.44.1709247635580; Thu, 29 Feb 2024 15:00:35 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id l22-20020a17090b079600b0029a8e5355fcsm1965578pjz.53.2024.02.29.15.00.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 15:00:35 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Kai Ji Subject: [PATCH 42/71] crypto/qat: replace use of fixed size rte_memcpy Date: Thu, 29 Feb 2024 14:58:29 -0800 Message-ID: <20240229225936.483472-43-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240229225936.483472-1-stephen@networkplumber.org> References: <20240229225936.483472-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