From patchwork Tue Apr 2 21:50:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 139053 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 64DA343DC8; Tue, 2 Apr 2024 23:58:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D8E140E09; Tue, 2 Apr 2024 23:56:10 +0200 (CEST) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id CB14040A7D for ; Tue, 2 Apr 2024 23:55:58 +0200 (CEST) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1e034607879so45947505ad.0 for ; Tue, 02 Apr 2024 14:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1712094958; x=1712699758; 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=ut8oidQqPtJvnNB8dOnwX4A7dlMCwCUZCPkF9PxWdxA=; b=BfmPGJDpqIj9qcfgPBh2aPVyAi5jiPwkn4/xCkSFKZJaEBI2hjKvF7mHeBArzNQKY0 cGF/VtWFMFrOQyK141tuQ3n80VUxxhu3Y2GS5UQNcEdRC8ezuE5xb4UGaMwKCUleLy8+ xG66k0hZPkVSgBH8vvtScc1vHuE75mmRbqAa0E+IaDzOEwhfIFI1Oh8jLQMlvJ6zpztm +a7+PtsdcJ+CigclKae4mD6gdDUKXDTZ+D27vPpN0ieqYz5l+d8L1vPCGjPR6X6ud5wF fXj1DuSyibQeiOenmRIMxO+CW+0bl/6La5aUmGbuy3vTSO9QLjICgU5k/291JTojRJBq bOPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712094958; x=1712699758; 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=ut8oidQqPtJvnNB8dOnwX4A7dlMCwCUZCPkF9PxWdxA=; b=qtgo28qjwOPP16Ri0lZqybeUYXWOx+xk66aRSJLrNUFxrRXl1/TlU5QIZGKe9xk1Ek Oss+g2m9R8v3uevFXNRjmUk4IaUAZRH7Nfq34YA8e+SATWA/WHWbWMlk9o6e8XrkgJjy brPtTjcObunC28d2BsSt6/f3VdJ/9A+TdDzjHSLrXRlHH5GyAJ2mggBCpU9lnOdEWRho YjSqYk9KiM4/SzYGFUwRdCYm13URCsFxku0g3TY+vGPNSdilm0MHwnZF9iHau1jTSgVE ewlCPlfO0y18VJcYnAYum9oZnBOe9+CFwOuUrbxbetpa8ePXfGKFneqOOaf3IcbnX2Nx 7wPQ== X-Gm-Message-State: AOJu0YwsHjq8rX9X2d9rG96Rty0N9mNbHDIUBBNJ6n0LEOrOzUI7LVo9 aNdwAfwKIXztA90Paf2XbV2nVzlH7C0XBeVZLGKfftiqddXRC9FI/Gx7mLFSyIJh4jCKlaimezd FemA= X-Google-Smtp-Source: AGHT+IFf/wtiBl6fMnSFYXm9x8aPkLDouyO6LqFooYD302ZrbXdSkJQ7+PFDjUvtVAlxh7vsAmcSUg== X-Received: by 2002:a17:902:d2c8:b0:1e0:2344:e8fa with SMTP id n8-20020a170902d2c800b001e02344e8famr18378932plc.66.1712094958079; Tue, 02 Apr 2024 14:55:58 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id x15-20020a170902820f00b001dddf29b6e8sm11609381pln.299.2024.04.02.14.55.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 14:55:57 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Sunil Uttarwar , Ankur Dwivedi , Anoob Joseph , Tejasree Kondoj Subject: [PATCH v3 19/30] crypto: replace use of fixed size rte_memcpy Date: Tue, 2 Apr 2024 14:50:35 -0700 Message-ID: <20240402215502.278838-20-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240402215502.278838-1-stephen@networkplumber.org> References: <20240229225936.483472-1-stephen@networkplumber.org> <20240402215502.278838-1-stephen@networkplumber.org> MIME-Version: 1.0 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/ccp/ccp_crypto.c | 14 +++++--------- drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +- drivers/crypto/cnxk/cnxk_se.h | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/crypto/ccp/ccp_crypto.c b/drivers/crypto/ccp/ccp_crypto.c index 4b84b3303e..4a70bc5d6e 100644 --- a/drivers/crypto/ccp/ccp_crypto.c +++ b/drivers/crypto/ccp/ccp_crypto.c @@ -168,7 +168,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; } @@ -179,8 +179,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; } @@ -191,8 +190,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; } @@ -203,8 +201,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; } @@ -215,8 +212,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; } diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c index 1dd1dbac9a..a67af3ec35 100644 --- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c +++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c @@ -959,7 +959,7 @@ cnxk_crypto_cn10k_submit(void *qptr, void *inst, uint16_t nb_inst) lmt_dst = PLT_PTR_CAST(lmt_base); for (j = 0; j < i; j++) { - rte_memcpy(lmt_dst, inst, sizeof(struct cpt_inst_s)); + memcpy(lmt_dst, inst, sizeof(struct cpt_inst_s)); inst = RTE_PTR_ADD(inst, sizeof(struct cpt_inst_s)); lmt_dst = RTE_PTR_ADD(lmt_dst, 2 * sizeof(struct cpt_inst_s)); } diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h index c211884dda..e6c1e1586b 100644 --- a/drivers/crypto/cnxk/cnxk_se.h +++ b/drivers/crypto/cnxk/cnxk_se.h @@ -1161,7 +1161,7 @@ cpt_sm_prep(uint32_t flags, uint64_t d_offs, uint64_t d_lens, struct roc_se_fc_p void *dst = PLT_PTR_ADD(offset_vaddr, ROC_SE_OFF_CTRL_LEN); const uint64_t *src = fc_params->iv_buf; - rte_memcpy(dst, src, 16); + memcpy(dst, src, 16); } inst->w4.u64 = cpt_inst_w4.u64; } else {