From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Srikanth Yalavarthi <syalavarthi@marvell.com>
Subject: [PATCH 50/61] ml/cnxk: use memcpy for fixed size data
Date: Wed, 19 Aug 2026 22:12:40 -0700 [thread overview]
Message-ID: <20260820052251.1453273-51-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/ml/cnxk/cn10k_ml_model.c | 8 +++++---
drivers/ml/cnxk/cn10k_ml_ops.c | 8 +++++---
drivers/ml/cnxk/tvmrt_ml_model.c | 9 +++++----
drivers/ml/cnxk/tvmrt_ml_ops.c | 6 +++---
4 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/drivers/ml/cnxk/cn10k_ml_model.c b/drivers/ml/cnxk/cn10k_ml_model.c
index fa978529f5..7e2c460fb4 100644
--- a/drivers/ml/cnxk/cn10k_ml_model.c
+++ b/drivers/ml/cnxk/cn10k_ml_model.c
@@ -564,7 +564,7 @@ cn10k_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo
/* Set model info */
memset(info, 0, sizeof(struct rte_ml_model_info));
- rte_memcpy(info->name, metadata->model.name, MRVL_ML_MODEL_NAME_LEN);
+ memcpy(info->name, metadata->model.name, MRVL_ML_MODEL_NAME_LEN);
snprintf(info->version, RTE_ML_STR_MAX, "%u.%u.%u.%u", metadata->model.version[0],
metadata->model.version[1], metadata->model.version[2],
metadata->model.version[3]);
@@ -583,7 +583,8 @@ cn10k_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo
/* Set input info */
for (i = 0; i < info->nb_inputs; i++) {
- rte_memcpy(input[i].name, io_info->input[i].name, MRVL_ML_INPUT_NAME_LEN);
+ memcpy(input[i].name, io_info->input[i].name,
+ MRVL_ML_INPUT_NAME_LEN);
input[i].nb_dims = io_info->input[i].nb_dims;
input[i].shape = &io_info->input[i].shape[0];
input[i].type = io_info->input[i].qtype;
@@ -596,7 +597,8 @@ cn10k_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo
/* Set output info */
for (i = 0; i < info->nb_outputs; i++) {
- rte_memcpy(output[i].name, io_info->output[i].name, MRVL_ML_INPUT_NAME_LEN);
+ memcpy(output[i].name, io_info->output[i].name,
+ MRVL_ML_INPUT_NAME_LEN);
output[i].nb_dims = io_info->output[i].nb_dims;
output[i].shape = &io_info->output[i].shape[0];
output[i].type = io_info->output[i].qtype;
diff --git a/drivers/ml/cnxk/cn10k_ml_ops.c b/drivers/ml/cnxk/cn10k_ml_ops.c
index 597806b787..79a03dc10b 100644
--- a/drivers/ml/cnxk/cn10k_ml_ops.c
+++ b/drivers/ml/cnxk/cn10k_ml_ops.c
@@ -668,7 +668,8 @@ cn10k_ml_layer_load(void *device, uint16_t model_id, const char *layer_name, uin
}
/* Copy metadata to internal buffer */
- rte_memcpy(&layer->glow.metadata, buffer, sizeof(struct cn10k_ml_model_metadata));
+ memcpy(&layer->glow.metadata, buffer,
+ sizeof(struct cn10k_ml_model_metadata));
cn10k_ml_model_metadata_update(&layer->glow.metadata);
/* Enable support for batch_size of 256 */
@@ -745,11 +746,12 @@ cn10k_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *
model->subtype = ML_CNXK_MODEL_SUBTYPE_GLOW_MRVL;
/* Copy metadata to internal buffer */
- rte_memcpy(&model->glow.metadata, params->addr, sizeof(struct cn10k_ml_model_metadata));
+ memcpy(&model->glow.metadata, params->addr,
+ sizeof(struct cn10k_ml_model_metadata));
cn10k_ml_model_metadata_update(&model->glow.metadata);
/* Set model name */
- rte_memcpy(model->name, (char *)model->glow.metadata.model.name, 64);
+ memcpy(model->name, (char *)model->glow.metadata.model.name, 64);
/* Enable support for batch_size of 256 */
if (model->glow.metadata.model.batch_size == 0)
diff --git a/drivers/ml/cnxk/tvmrt_ml_model.c b/drivers/ml/cnxk/tvmrt_ml_model.c
index 319c53a05b..f0bc616148 100644
--- a/drivers/ml/cnxk/tvmrt_ml_model.c
+++ b/drivers/ml/cnxk/tvmrt_ml_model.c
@@ -848,7 +848,7 @@ tvmrt_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo
if (model->subtype == ML_CNXK_MODEL_SUBTYPE_TVM_MRVL)
goto tvm_mrvl_model;
- rte_memcpy(info->name, model->name, RTE_ML_STR_MAX);
+ memcpy(info->name, model->name, RTE_ML_STR_MAX);
snprintf(info->version, RTE_ML_STR_MAX, "%u.%u.%u.%u", 0, 0, 0, 0);
info->model_id = model->model_id;
info->device_id = cnxk_mldev->mldev->data->dev_id;
@@ -863,7 +863,8 @@ tvmrt_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo
/* Set input info */
for (i = 0; i < info->nb_inputs; i++) {
- rte_memcpy(input[i].name, model->tvmrt.info.input[i].name, MRVL_ML_INPUT_NAME_LEN);
+ memcpy(input[i].name, model->tvmrt.info.input[i].name,
+ MRVL_ML_INPUT_NAME_LEN);
input[i].nb_dims = model->tvmrt.info.input[i].nb_dims;
input[i].shape = &model->tvmrt.info.input[i].shape[0];
input[i].type = model->tvmrt.info.input[i].qtype;
@@ -876,8 +877,8 @@ tvmrt_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo
/* Set output info */
for (i = 0; i < info->nb_outputs; i++) {
- rte_memcpy(output[i].name, model->tvmrt.info.output[i].name,
- MRVL_ML_OUTPUT_NAME_LEN);
+ memcpy(output[i].name, model->tvmrt.info.output[i].name,
+ MRVL_ML_OUTPUT_NAME_LEN);
output[i].nb_dims = model->tvmrt.info.output[i].nb_dims;
output[i].shape = &model->tvmrt.info.output[i].shape[0];
output[i].type = model->tvmrt.info.output[i].qtype;
diff --git a/drivers/ml/cnxk/tvmrt_ml_ops.c b/drivers/ml/cnxk/tvmrt_ml_ops.c
index f6b3a51c51..191f93486a 100644
--- a/drivers/ml/cnxk/tvmrt_ml_ops.c
+++ b/drivers/ml/cnxk/tvmrt_ml_ops.c
@@ -229,7 +229,7 @@ tvmrt_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *
/* Copy mod.so */
model->tvmrt.so.buffer = mz->addr;
model->tvmrt.so.size = object[0].size;
- rte_memcpy(model->tvmrt.so.name, object[0].name, RTE_ML_STR_MAX);
+ memcpy(model->tvmrt.so.name, object[0].name, RTE_ML_STR_MAX);
rte_memcpy(model->tvmrt.so.buffer, object[0].buffer, object[0].size);
rte_free(object[0].buffer);
@@ -238,7 +238,7 @@ tvmrt_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *
RTE_PTR_ADD(model->tvmrt.so.buffer,
RTE_ALIGN_CEIL(model->tvmrt.so.size, RTE_CACHE_LINE_MIN_SIZE));
model->tvmrt.json.size = object[1].size;
- rte_memcpy(model->tvmrt.json.name, object[1].name, RTE_ML_STR_MAX);
+ memcpy(model->tvmrt.json.name, object[1].name, RTE_ML_STR_MAX);
rte_memcpy(model->tvmrt.json.buffer, object[1].buffer, object[1].size);
rte_free(object[1].buffer);
@@ -247,7 +247,7 @@ tvmrt_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *
RTE_PTR_ADD(model->tvmrt.json.buffer,
RTE_ALIGN_CEIL(model->tvmrt.json.size, RTE_CACHE_LINE_MIN_SIZE));
model->tvmrt.params.size = object[2].size;
- rte_memcpy(model->tvmrt.params.name, object[2].name, RTE_ML_STR_MAX);
+ memcpy(model->tvmrt.params.name, object[2].name, RTE_ML_STR_MAX);
rte_memcpy(model->tvmrt.params.buffer, object[2].buffer, object[2].size);
rte_free(object[2].buffer);
--
2.53.0
next prev parent reply other threads:[~2026-08-20 5:27 UTC|newest]
Thread overview: 71+ 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 16:22 ` Stephen Hemminger
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 9:05 ` Hyong Youb Kim (hyonkim)
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 ` Stephen Hemminger [this message]
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 ` [PATCH 54/61] drivers/*/qat: use memcpy for fixed size data Stephen Hemminger
2026-08-20 5:12 ` [PATCH 55/61] hash: replace use of rte_memcpy 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
2026-08-20 8:16 ` Bruce Richardson
2026-08-20 8:46 ` Konstantin Ananyev
2026-08-20 9:03 ` Morten Brørup
2026-08-20 13:07 ` Konstantin Ananyev
2026-08-20 14:00 ` 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-51-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=syalavarthi@marvell.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.