From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Kai Ji <kai.ji@intel.com>, Fan Zhang <fanzhang.oss@gmail.com>,
Ashish Gupta <ashishg@marvell.com>
Subject: [PATCH 54/61] drivers/*/qat: use memcpy for fixed size data
Date: Wed, 19 Aug 2026 22:12:44 -0700 [thread overview]
Message-ID: <20260820052251.1453273-55-stephen@networkplumber.org> (raw)
In-Reply-To: <20260820052251.1453273-1-stephen@networkplumber.org>
The regular libc memcpy is inline for fix sizes and has
better analysis coverage.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/common/qat/qat_qp.c | 10 ++++-----
drivers/compress/qat/qat_comp.c | 8 +++----
drivers/crypto/qat/qat_sym_session.c | 33 ++++++++++++++--------------
3 files changed, 24 insertions(+), 27 deletions(-)
diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c
index fe28cb160d..6ea4548bba 100644
--- a/drivers/common/qat/qat_qp.c
+++ b/drivers/common/qat/qat_qp.c
@@ -871,9 +871,8 @@ qat_cq_get_fw_cipher_crc_cap(struct qat_qp *qp)
return -EINVAL;
}
- rte_memcpy(src_data_addr,
- cipher_crc_cap_check_plaintext,
- sizeof(cipher_crc_cap_check_plaintext));
+ memcpy(src_data_addr, cipher_crc_cap_check_plaintext,
+ sizeof(cipher_crc_cap_check_plaintext));
phy_src_addr = rte_mem_virt2iova(src_data_addr);
if (phy_src_addr == 0 || phy_src_addr == RTE_BAD_IOVA) {
@@ -892,9 +891,8 @@ qat_cq_get_fw_cipher_crc_cap(struct qat_qp *qp)
auth_param = (void *)((uint8_t *)cipher_param +
ICP_QAT_FW_HASH_REQUEST_PARAMETERS_OFFSET);
- rte_memcpy(cipher_param->u.cipher_IV_array,
- cipher_crc_cap_check_iv,
- sizeof(cipher_crc_cap_check_iv));
+ memcpy(cipher_param->u.cipher_IV_array, cipher_crc_cap_check_iv,
+ sizeof(cipher_crc_cap_check_iv));
cipher_param->cipher_offset = cipher_crc_cap_check_cipher_offset;
cipher_param->cipher_length =
diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c
index 559948a46a..5bcbefe395 100644
--- a/drivers/compress/qat/qat_comp.c
+++ b/drivers/compress/qat/qat_comp.c
@@ -375,7 +375,7 @@ qat_comp_build_multiple_requests(void *in_op, struct qat_qp *qp,
QAT_DP_LOG(DEBUG, "op %p, parent_cookie %p", op, parent_cookie);
/* copy original op to the local variable for restoring later */
- rte_memcpy(&op_backup, op, sizeof(op_backup));
+ memcpy(&op_backup, op, sizeof(op_backup));
parent_cookie->nb_child_responses = 0;
parent_cookie->nb_children = 0;
@@ -401,7 +401,7 @@ qat_comp_build_multiple_requests(void *in_op, struct qat_qp *qp,
}
/* prepare local dst mbuf */
- rte_memcpy(&dst_mbuf, op->m_dst, sizeof(dst_mbuf));
+ memcpy(&dst_mbuf, op->m_dst, sizeof(dst_mbuf));
rte_pktmbuf_reset(&dst_mbuf);
dst_mbuf.buf_len = dst_data_size;
dst_mbuf.data_len = dst_data_size;
@@ -457,7 +457,7 @@ qat_comp_build_multiple_requests(void *in_op, struct qat_qp *qp,
if (ret < 0) {
QAT_DP_LOG(WARNING, "Failed to build child descriptor");
/* restore op and clear cookie */
- rte_memcpy(op, &op_backup, sizeof(op_backup));
+ memcpy(op, &op_backup, sizeof(op_backup));
parent_cookie->split_op = 0;
parent_cookie->nb_children = 0;
return ret;
@@ -468,7 +468,7 @@ qat_comp_build_multiple_requests(void *in_op, struct qat_qp *qp,
}
/* restore backed up original op */
- rte_memcpy(op, &op_backup, sizeof(op_backup));
+ memcpy(op, &op_backup, sizeof(op_backup));
if (nb_descr != num_descriptors_built)
QAT_DP_LOG(ERR, "split op. expected %d, built %d",
diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index d89c20cad6..1197537545 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -1585,8 +1585,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 -
@@ -2101,8 +2101,8 @@ static 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;
@@ -2113,9 +2113,8 @@ static 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 =
@@ -2154,8 +2153,8 @@ static 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;
@@ -2174,8 +2173,8 @@ static 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;
@@ -2193,8 +2192,8 @@ static 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;
@@ -2212,8 +2211,8 @@ static 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;
@@ -2231,8 +2230,8 @@ static 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.53.0
next prev parent reply other threads:[~2026-08-20 5:28 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 5:11 [PATCH 00/61] reduce use of rte_memcpy Stephen Hemminger
2026-08-20 5:11 ` [PATCH 01/61] devtools/cocci: add script to replace fixed size rte_memcpy Stephen Hemminger
2026-08-20 5:11 ` [PATCH 02/61] app/testpmd: replace rte_memcpy with memcpy Stephen Hemminger
2026-08-20 5:11 ` [PATCH 03/61] test: use memcpy instead of rte_memcpy Stephen Hemminger
2026-08-20 6:22 ` Morten Brørup
2026-08-20 5:11 ` [PATCH 04/61] app/graph: replace rte_memcpy with memcpy Stephen Hemminger
2026-08-20 5:11 ` [PATCH 05/61] lpm: remove unnecessary include of rte_memcpy.h Stephen Hemminger
2026-08-20 5:11 ` [PATCH 06/61] acl: " Stephen Hemminger
2026-08-20 5:11 ` [PATCH 07/61] drivers/bus: " Stephen Hemminger
2026-08-20 5:11 ` [PATCH 08/61] security: replace fixed size rte_memcpy Stephen Hemminger
2026-08-20 5:11 ` [PATCH 09/61] ethdev: replace use of rte_memcpy Stephen Hemminger
2026-08-20 5:12 ` [PATCH 10/61] net: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 11/61] pdcp: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 12/61] eventdev: replace fixed size rte_memcpy Stephen Hemminger
2026-08-20 5:12 ` [PATCH 13/61] eal: replace rte_memcpy of cpuset Stephen Hemminger
2026-08-20 5:12 ` [PATCH 14/61] cryptodev: replace use of rte_memcpy Stephen Hemminger
2026-08-20 5:12 ` [PATCH 15/61] drivers/raw: use memcpy for fixed size data Stephen Hemminger
2026-08-20 5:12 ` [PATCH 16/61] test-pipeline: replace use of rte_memcpy Stephen Hemminger
2026-08-20 5:12 ` [PATCH 17/61] net/af_xdp: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 18/61] net/avp: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 19/61] net/axgbe: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 20/61] net/bnx2x: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 21/61] net/bnxt: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 22/61] net/bonding: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 23/61] net/cnxk: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 24/61] net/cxgbe: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 25/61] net/dpaa2: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 26/61] net/enic: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 27/61] net/failsafe: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 28/61] net/gve: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 29/61] net/hinic: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 30/61] net/hns3: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 31/61] net/mlx5: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 32/61] net/mvpp2: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 33/61] net/netvsc: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 34/61] net/nfp: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 35/61] net/ngbe: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 36/61] net/ntnic: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 37/61] net/null: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 38/61] net/qede: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 39/61] net/ring: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 40/61] net/sfc: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 41/61] net/txgbe: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 42/61] net/vhost: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 43/61] net/virtio: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 44/61] net/sxe2: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 45/61] net/zxdh: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 46/61] net/memif: use memcpy for fixed size data Stephen Hemminger
2026-08-20 5:12 ` [PATCH 47/61] net/ice: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 48/61] test-bbdev: remove unnecessary include rte_memcpy.h Stephen Hemminger
2026-08-20 5:12 ` [PATCH 49/61] drivers/mempool: use memcpy for fixed size data Stephen Hemminger
2026-08-20 5:12 ` [PATCH 50/61] ml/cnxk: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 51/61] drivers/event: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 52/61] baseband/la12xx: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 53/61] baseband/acc: replace use of rte_memcpy Stephen Hemminger
2026-08-20 5:12 ` Stephen Hemminger [this message]
2026-08-20 5:12 ` [PATCH 55/61] hash: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 56/61] rib: remove rte_memcpy include Stephen Hemminger
2026-08-20 5:12 ` [PATCH 57/61] pcapng: replace use of rte_memcpy Stephen Hemminger
2026-08-20 5:12 ` [PATCH 58/61] efd: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 59/61] net/xsc: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 60/61] net/pcap: " Stephen Hemminger
2026-08-20 5:12 ` [PATCH 61/61] power: " Stephen Hemminger
2026-08-20 7:31 ` [PATCH 00/61] reduce " Morten Brørup
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260820052251.1453273-55-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=ashishg@marvell.com \
--cc=dev@dpdk.org \
--cc=fanzhang.oss@gmail.com \
--cc=kai.ji@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox