* [PATCH 00/71] replace use of fixed size rte_memcpy
@ 2024-02-29 22:57 Stephen Hemminger
2024-02-29 22:57 ` [PATCH 01/71] cocci/rte_memcpy: add script to eliminate " Stephen Hemminger
` (76 more replies)
0 siblings, 77 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:57 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
The DPDK has a lot of "cargo cult" usage of rte_memcpy.
This patch set replaces cases where rte_memcpy is used with a fixed
size constant size.
Typical example is:
rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
which can be replaced with:
memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
This has two benefits. Gcc (and clang) are smart enough that for
all small fixed size values, they just generate the necessary instructions
to do it inline. It also means that fortify, Coverity, and ASAN
analyzers can check these memcpy's.
So faster, better, safer.
The first patch is a simple coccinelle script to do the replacement
and the rest are the results broken out by module.
The coccinelle script can be used again to make sure more bad
usage doesn't creep in with new drivers.
Stephen Hemminger (71):
cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
eal: replace use of fixed size rte_memcpy
ethdev: replace use of fixed size rte_memcpy
eventdev: replace use of fixed size rte_memcpy
cryptodev: replace use of fixed size rte_memcpy
ip_frag: replace use of fixed size rte_memcpy
net: replace use of fixed size rte_memcpy
lpm: replace use of fixed size rte_memcpy
node: replace use of fixed size rte_memcpy
pdcp: replace use of fixed size rte_memcpy
pipeline: replace use of fixed size rte_memcpy
rib: replace use of fixed size rte_memcpy
security: replace use of fixed size rte_memcpy
net/mlx5: replace use of fixed size rte_memcpy
net/nfp: replace use of fixed size rte_memcpy
net/ngbe: replace use of fixed size rte_memcpy
net/null: replace use of fixed size rte_memcpy
net/pcap: replace use of fixed size rte_memcpy
net/sfc: replace use of fixed size rte_memcpy
net/tap: replace use of fixed size rte_memcpy
net/txgbe: replace use of fixed size rte_memcpy
raw/ifpga: replace use of fixed size rte_memcpy
raw/skeleton: replace use of fixed size rte_memcpy
net/hns3: replace use of fixed size rte_memcpy
net/i40e: replace use of fixed size rte_memcpy
net/iavf: replace use of fixed size rte_memcpy
net/ice: replace use of fixed size rte_memcpy
net/idpf: replace use of fixed size rte_memcpy
net/ipn3ke: replace use of fixed size rte_memcpy
net/ixgbe: replace use of fixed size rte_memcpy
net/memif: replace use of fixed size rte_memcpy
net/qede: replace use of fixed size rte_memcpy
baseband/acc: replace use of fixed size rte_memcpy
baseband/la12xx: replace use of fixed size rte_memcpy
common/idpf: replace use of fixed size rte_memcpy
common/qat: replace use of fixed size rte_memcpy
compress/qat: replace use of fixed size rte_memcpy
crypto/ccp: replace use of fixed size rte_memcpy
crypto/cnxk: replace use of fixed size rte_memcpy
crypto/dpaa_sec: replace use of fixed size rte_memcpy
crypto/ipsec_mb: replace use of fixed size rte_memcpy
crypto/qat: replace use of fixed size rte_memcpy
crypto/scheduler: replace use of fixed size rte_memcpy
event/cnxk: replace use of fixed size rte_memcpy
event/dlb2: replace use of fixed size rte_memcpy
event/dpaa2: replace use of fixed size rte_memcpy
event/octeontx: replace use of fixed size rte_memcpy
mempool/dpaa: replace use of fixed size rte_memcpy
mempool/dpaa2: replace use of fixed size rte_memcpy
ml/cnxk: replace use of fixed size rte_memcpy
net/af_xdp: replace use of fixed size rte_memcpy
net/avp: replace use of fixed size rte_memcpy
net/axgbe: replace use of fixed size rte_memcpy
net/bnx2x: replace use of fixed size rte_memcpy
net/bnxt: replace use of fixed size rte_memcpy
net/bonding: replace use of fixed size rte_memcpy
net/cnxk: replace use of fixed size rte_memcpy
net/cpfl: replace use of fixed size rte_memcpy
net/cxgbe: replace use of fixed size rte_memcpy
net/dpaa2: replace use of fixed size rte_memcpy
net/e1000: replace use of fixed size rte_memcpy
net/enic: replace use of fixed size rte_memcpy
net/failsafe: replace use of fixed size rte_memcpy
net/gve/base: replace use of fixed size rte_memcpy
net/hinic: replace use of fixed size rte_memcpy
net/mvpp2: replace use of fixed size rte_memcpy
app/test-pmd: replace use of fixed size rte_memcpy
app/graph: replace use of fixed size rte_memcpy
app/test-eventdev: replace use of fixed size rte_memcpy
app/test: replace use of fixed size rte_memcpy
examples: replace use of fixed size rte_memcpy
app/graph/neigh.c | 8 +-
app/test-eventdev/test_pipeline_common.c | 19 ++-
app/test-pmd/cmdline.c | 48 ++++----
app/test-pmd/cmdline_flow.c | 24 ++--
app/test-pmd/config.c | 8 +-
app/test/packet_burst_generator.c | 4 +-
app/test/test_crc.c | 4 +-
app/test/test_cryptodev.c | 18 ++-
app/test/test_event_crypto_adapter.c | 12 +-
app/test/test_event_dma_adapter.c | 4 +-
app/test/test_ipsec.c | 6 +-
app/test/test_link_bonding_mode4.c | 8 +-
app/test/test_security_inline_proto.c | 36 +++---
app/test/virtual_pmd.c | 2 +-
devtools/cocci/rte_memcpy.cocci | 11 ++
drivers/baseband/acc/rte_acc100_pmd.c | 19 ++-
drivers/baseband/acc/rte_vrb_pmd.c | 21 ++--
drivers/baseband/la12xx/bbdev_la12xx.c | 4 +-
drivers/common/idpf/idpf_common_device.c | 4 +-
drivers/common/idpf/idpf_common_virtchnl.c | 8 +-
drivers/common/qat/qat_qp.c | 10 +-
drivers/compress/qat/qat_comp.c | 8 +-
drivers/crypto/ccp/ccp_crypto.c | 14 +--
drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +-
drivers/crypto/cnxk/cnxk_se.h | 2 +-
drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +-
drivers/crypto/qat/qat_sym_session.c | 52 ++++-----
.../scheduler/rte_cryptodev_scheduler.c | 6 +-
drivers/crypto/scheduler/scheduler_failover.c | 12 +-
drivers/event/cnxk/cnxk_tim_evdev.c | 4 +-
drivers/event/dlb2/dlb2.c | 6 +-
drivers/event/dpaa2/dpaa2_eventdev.c | 6 +-
drivers/event/octeontx/timvf_evdev.c | 4 +-
drivers/mempool/dpaa/dpaa_mempool.c | 4 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 +-
drivers/ml/cnxk/cn10k_ml_model.c | 8 +-
drivers/ml/cnxk/cn10k_ml_ops.c | 11 +-
drivers/ml/cnxk/cnxk_ml_ops.c | 2 +-
drivers/ml/cnxk/mvtvm_ml_model.c | 8 +-
drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +-
drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
drivers/net/avp/avp_ethdev.c | 4 +-
drivers/net/axgbe/axgbe_ethdev.c | 4 +-
drivers/net/bnx2x/bnx2x.c | 32 +++---
drivers/net/bnx2x/bnx2x_stats.c | 10 +-
drivers/net/bnx2x/bnx2x_vfpf.c | 19 +--
drivers/net/bnxt/bnxt_flow.c | 34 +++---
drivers/net/bonding/rte_eth_bond_8023ad.c | 4 +-
drivers/net/bonding/rte_eth_bond_flow.c | 2 +-
drivers/net/cnxk/cnxk_ethdev_ops.c | 2 +-
drivers/net/cnxk/cnxk_tm.c | 5 +-
drivers/net/cpfl/cpfl_ethdev.c | 3 +-
drivers/net/cpfl/cpfl_vchnl.c | 4 +-
drivers/net/cxgbe/clip_tbl.c | 2 +-
drivers/net/cxgbe/cxgbe_filter.c | 8 +-
drivers/net/cxgbe/l2t.c | 4 +-
drivers/net/cxgbe/smt.c | 20 ++--
drivers/net/dpaa2/dpaa2_tm.c | 2 +-
drivers/net/e1000/igb_flow.c | 22 ++--
drivers/net/e1000/igb_pf.c | 6 +-
drivers/net/enic/enic_main.c | 8 +-
drivers/net/failsafe/failsafe_ops.c | 6 +-
drivers/net/gve/base/gve_adminq.c | 2 +-
drivers/net/hinic/hinic_pmd_flow.c | 40 +++----
drivers/net/hns3/hns3_fdir.c | 2 +-
drivers/net/hns3/hns3_flow.c | 4 +-
drivers/net/i40e/i40e_ethdev.c | 108 ++++++++----------
drivers/net/i40e/i40e_fdir.c | 28 +++--
drivers/net/i40e/i40e_flow.c | 56 +++++----
drivers/net/i40e/i40e_pf.c | 2 +-
drivers/net/i40e/i40e_tm.c | 11 +-
drivers/net/i40e/rte_pmd_i40e.c | 34 +++---
drivers/net/iavf/iavf_fdir.c | 93 +++++++--------
drivers/net/iavf/iavf_fsub.c | 50 ++++----
drivers/net/iavf/iavf_generic_flow.c | 2 +-
drivers/net/iavf/iavf_tm.c | 11 +-
drivers/net/iavf/iavf_vchnl.c | 9 +-
drivers/net/ice/ice_dcf.c | 5 +-
drivers/net/ice/ice_dcf_parent.c | 2 +-
drivers/net/ice/ice_dcf_sched.c | 11 +-
drivers/net/ice/ice_diagnose.c | 4 +-
drivers/net/ice/ice_ethdev.c | 14 +--
drivers/net/ice/ice_fdir_filter.c | 37 +++---
drivers/net/ice/ice_generic_flow.c | 2 +-
drivers/net/ice/ice_hash.c | 2 +-
drivers/net/ice/ice_tm.c | 11 +-
drivers/net/idpf/idpf_ethdev.c | 7 +-
drivers/net/idpf/idpf_rxtx.c | 10 +-
drivers/net/ipn3ke/ipn3ke_flow.c | 32 +++---
drivers/net/ipn3ke/ipn3ke_representor.c | 16 +--
drivers/net/ipn3ke/ipn3ke_tm.c | 6 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 9 +-
drivers/net/ixgbe/ixgbe_fdir.c | 7 +-
drivers/net/ixgbe/ixgbe_flow.c | 65 +++++------
drivers/net/ixgbe/ixgbe_ipsec.c | 8 +-
drivers/net/ixgbe/ixgbe_pf.c | 4 +-
drivers/net/ixgbe/ixgbe_tm.c | 11 +-
drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +-
drivers/net/memif/memif_socket.c | 4 +-
drivers/net/mlx5/mlx5_devx.c | 4 +-
drivers/net/mlx5/mlx5_flow.c | 38 +++---
drivers/net/mlx5/mlx5_flow_aso.c | 6 +-
drivers/net/mlx5/mlx5_flow_hw.c | 16 +--
drivers/net/mlx5/mlx5_rx.c | 6 +-
drivers/net/mlx5/mlx5_rxtx_vec.c | 8 +-
drivers/net/mvpp2/mrvl_tm.c | 2 +-
drivers/net/nfp/flower/nfp_conntrack.c | 2 +-
drivers/net/nfp/flower/nfp_flower_flow.c | 16 +--
.../net/nfp/flower/nfp_flower_representor.c | 2 +-
drivers/net/nfp/nfp_mtr.c | 10 +-
drivers/net/ngbe/ngbe_pf.c | 4 +-
drivers/net/null/rte_eth_null.c | 6 +-
drivers/net/pcap/pcap_ethdev.c | 2 +-
drivers/net/pcap/pcap_osdep_freebsd.c | 2 +-
drivers/net/pcap/pcap_osdep_linux.c | 2 +-
drivers/net/qede/qede_main.c | 2 +-
drivers/net/sfc/sfc.c | 2 +-
drivers/net/sfc/sfc_ef10_tx.c | 2 +-
drivers/net/sfc/sfc_ethdev.c | 11 +-
drivers/net/sfc/sfc_flow.c | 20 ++--
drivers/net/sfc/sfc_flow_rss.c | 2 +-
drivers/net/sfc/sfc_mae.c | 2 +-
drivers/net/sfc/sfc_rx.c | 2 +-
drivers/net/sfc/sfc_tso.c | 2 +-
drivers/net/sfc/sfc_tso.h | 9 +-
drivers/net/tap/rte_eth_tap.c | 14 +--
drivers/net/txgbe/txgbe_ethdev.c | 9 +-
drivers/net/txgbe/txgbe_fdir.c | 6 +-
drivers/net/txgbe/txgbe_flow.c | 65 +++++------
drivers/net/txgbe/txgbe_ipsec.c | 8 +-
drivers/net/txgbe/txgbe_pf.c | 4 +-
drivers/net/txgbe/txgbe_tm.c | 11 +-
drivers/raw/ifpga/afu_pmd_he_hssi.c | 2 +-
drivers/raw/ifpga/afu_pmd_he_lpbk.c | 2 +-
drivers/raw/ifpga/afu_pmd_he_mem.c | 2 +-
drivers/raw/ifpga/afu_pmd_n3000.c | 8 +-
drivers/raw/ifpga/ifpga_rawdev.c | 10 +-
drivers/raw/skeleton/skeleton_rawdev.c | 7 +-
examples/bbdev_app/main.c | 2 +-
examples/l2fwd-cat/cat.c | 3 +-
examples/ptpclient/ptpclient.c | 11 +-
examples/vhost/main.c | 5 +-
examples/vmdq/main.c | 5 +-
examples/vmdq_dcb/main.c | 14 +--
lib/cryptodev/rte_cryptodev.c | 2 +-
lib/eal/common/eal_common_options.c | 7 +-
lib/ethdev/rte_ethdev.c | 3 +-
lib/ethdev/rte_flow.c | 5 +-
lib/eventdev/rte_event_crypto_adapter.c | 2 +-
lib/eventdev/rte_event_dma_adapter.c | 4 +-
lib/eventdev/rte_event_timer_adapter.c | 2 +-
lib/fib/trie.c | 2 +-
lib/ip_frag/rte_ipv6_fragmentation.c | 4 +-
lib/ip_frag/rte_ipv6_reassembly.c | 6 +-
lib/lpm/rte_lpm6.c | 3 +-
lib/net/rte_ether.c | 2 +-
lib/node/ip6_lookup.c | 8 +-
lib/pdcp/pdcp_process.c | 36 +++---
lib/pipeline/rte_table_action.c | 8 +-
lib/rib/rte_rib6.h | 3 +-
lib/security/rte_security.c | 4 +-
162 files changed, 880 insertions(+), 960 deletions(-)
create mode 100644 devtools/cocci/rte_memcpy.cocci
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 01/71] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
@ 2024-02-29 22:57 ` Stephen Hemminger
2024-03-01 8:07 ` Morten Brørup
2024-02-29 22:57 ` [PATCH 02/71] eal: replace use of " Stephen Hemminger
` (75 subsequent siblings)
76 siblings, 1 reply; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:57 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Rte_memcpy should not be used for the simple case of copying
a fix size structure because it is slower and will hide problems
from code analysis tools. Coverity, fortify and other analyzers
special case memcpy().
Gcc (and Clang) are smart enough to inline copies which
will be faster.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
devtools/cocci/rte_memcpy.cocci | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 devtools/cocci/rte_memcpy.cocci
diff --git a/devtools/cocci/rte_memcpy.cocci b/devtools/cocci/rte_memcpy.cocci
new file mode 100644
index 000000000000..fa1038fc066d
--- /dev/null
+++ b/devtools/cocci/rte_memcpy.cocci
@@ -0,0 +1,11 @@
+//
+// rte_memcpy should not be used for simple fixed size structure
+// because compiler's are smart enough to inline these.
+//
+@@
+expression src, dst; constant size;
+@@
+(
+- rte_memcpy(dst, src, size)
++ memcpy(dst, src, size)
+)
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 02/71] eal: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
2024-02-29 22:57 ` [PATCH 01/71] cocci/rte_memcpy: add script to eliminate " Stephen Hemminger
@ 2024-02-29 22:57 ` Stephen Hemminger
2024-02-29 22:57 ` [PATCH 03/71] ethdev: " Stephen Hemminger
` (74 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:57 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/eal/common/eal_common_options.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index e541f0793964..07bfaffdac76 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -30,7 +30,6 @@
#include <rte_tailq.h>
#include <rte_version.h>
#include <rte_devargs.h>
-#include <rte_memcpy.h>
#ifndef RTE_EXEC_ENV_WINDOWS
#include <rte_telemetry.h>
#endif
@@ -1253,7 +1252,7 @@ eal_parse_lcores(const char *lcores)
/* without '@', by default using lcore_set as cpuset */
if (*lcores != '@')
- rte_memcpy(&cpuset, &lcore_set, sizeof(cpuset));
+ memcpy(&cpuset, &lcore_set, sizeof(cpuset));
set_count = CPU_COUNT(&lcore_set);
/* start to update lcore_set */
@@ -1275,8 +1274,8 @@ eal_parse_lcores(const char *lcores)
if (check_cpuset(&cpuset) < 0)
goto err;
- rte_memcpy(&lcore_config[idx].cpuset, &cpuset,
- sizeof(rte_cpuset_t));
+ memcpy(&lcore_config[idx].cpuset, &cpuset,
+ sizeof(rte_cpuset_t));
}
/* some cores from the lcore_set can't be handled by EAL */
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 03/71] ethdev: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
2024-02-29 22:57 ` [PATCH 01/71] cocci/rte_memcpy: add script to eliminate " Stephen Hemminger
2024-02-29 22:57 ` [PATCH 02/71] eal: replace use of " Stephen Hemminger
@ 2024-02-29 22:57 ` Stephen Hemminger
2024-02-29 22:57 ` [PATCH 04/71] eventdev: " Stephen Hemminger
` (73 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:57 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Thomas Monjalon, Ferruh Yigit,
Andrew Rybchenko, Ori Kam
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/ethdev/rte_ethdev.c | 3 +--
lib/ethdev/rte_flow.c | 5 ++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index f1c658f49e80..ef62a0260747 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -15,7 +15,6 @@
#include <rte_log.h>
#include <rte_interrupts.h>
#include <rte_kvargs.h>
-#include <rte_memcpy.h>
#include <rte_common.h>
#include <rte_mempool.h>
#include <rte_malloc.h>
@@ -618,7 +617,7 @@ rte_eth_dev_owner_get(const uint16_t port_id, struct rte_eth_dev_owner *owner)
rte_spinlock_lock(rte_mcfg_ethdev_get_lock());
if (eth_dev_shared_data_prepare() != NULL) {
- rte_memcpy(owner, ðdev->data->owner, sizeof(*owner));
+ memcpy(owner, ðdev->data->owner, sizeof(*owner));
ret = 0;
} else {
ret = -ENOMEM;
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 7ab1100ea049..9b831486eb5e 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -994,9 +994,8 @@ rte_flow_conv_rule(struct rte_flow_conv_rule *dst,
if (src->attr_ro) {
off = RTE_ALIGN_CEIL(off, sizeof(double));
if (size && size >= off + sizeof(*dst->attr))
- dst->attr = rte_memcpy
- ((void *)((uintptr_t)dst + off),
- src->attr_ro, sizeof(*dst->attr));
+ dst->attr = memcpy((void *)((uintptr_t)dst + off),
+ src->attr_ro, sizeof(*dst->attr));
off += sizeof(*dst->attr);
}
if (src->pattern_ro) {
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 04/71] eventdev: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (2 preceding siblings ...)
2024-02-29 22:57 ` [PATCH 03/71] ethdev: " Stephen Hemminger
@ 2024-02-29 22:57 ` Stephen Hemminger
2024-02-29 22:57 ` [PATCH 05/71] cryptodev: " Stephen Hemminger
` (72 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:57 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Abhinandan Gujjar, Jerin Jacob,
Amit Prakash Shukla, Erik Gabriel Carrillo
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/eventdev/rte_event_crypto_adapter.c | 2 +-
lib/eventdev/rte_event_dma_adapter.c | 4 ++--
lib/eventdev/rte_event_timer_adapter.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index d46595d19028..d974404abe21 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -647,7 +647,7 @@ eca_ops_enqueue_burst(struct event_crypto_adapter *adapter,
continue;
}
- rte_memcpy(ev, &m_data->response_info, sizeof(*ev));
+ memcpy(ev, &m_data->response_info, sizeof(*ev));
ev->event_ptr = ops[i];
ev->event_type = RTE_EVENT_TYPE_CRYPTODEV;
if (adapter->implicit_release_disabled)
diff --git a/lib/eventdev/rte_event_dma_adapter.c b/lib/eventdev/rte_event_dma_adapter.c
index 4196164305d9..c50b3d23da2d 100644
--- a/lib/eventdev/rte_event_dma_adapter.c
+++ b/lib/eventdev/rte_event_dma_adapter.c
@@ -447,7 +447,7 @@ rte_event_dma_adapter_create(uint8_t id, uint8_t evdev_id, struct rte_event_port
if (pc == NULL)
return -ENOMEM;
- rte_memcpy(pc, port_config, sizeof(struct rte_event_port_conf));
+ memcpy(pc, port_config, sizeof(struct rte_event_port_conf));
ret = rte_event_dma_adapter_create_ext(id, evdev_id, edma_default_config_cb, mode, pc);
if (ret != 0)
rte_free(pc);
@@ -668,7 +668,7 @@ edma_ops_enqueue_burst(struct event_dma_adapter *adapter, struct rte_event_dma_a
continue;
}
- rte_memcpy(ev, response_info, sizeof(struct rte_event));
+ memcpy(ev, response_info, sizeof(struct rte_event));
ev->event_ptr = ops[i];
ev->event_type = RTE_EVENT_TYPE_DMADEV;
if (adapter->implicit_release_disabled)
diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c
index e6d34920561b..d033a58c133d 100644
--- a/lib/eventdev/rte_event_timer_adapter.c
+++ b/lib/eventdev/rte_event_timer_adapter.c
@@ -549,7 +549,7 @@ event_buffer_add(struct event_buffer *bufp, struct rte_event *eventp)
/* Instead of modulus, bitwise AND with mask to get head_idx. */
head_idx = bufp->head & EVENT_BUFFER_MASK;
buf_eventp = &bufp->events[head_idx];
- rte_memcpy(buf_eventp, eventp, sizeof(struct rte_event));
+ memcpy(buf_eventp, eventp, sizeof(struct rte_event));
/* Wrap automatically when overflow occurs. */
bufp->head++;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 05/71] cryptodev: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (3 preceding siblings ...)
2024-02-29 22:57 ` [PATCH 04/71] eventdev: " Stephen Hemminger
@ 2024-02-29 22:57 ` Stephen Hemminger
2024-02-29 22:57 ` [PATCH 06/71] ip_frag: " Stephen Hemminger
` (71 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:57 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Akhil Goyal, Fan Zhang
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/cryptodev/rte_cryptodev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 886eb7adc4a9..1377777525dc 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -2854,7 +2854,7 @@ crypto_caps_array(struct rte_tel_data *d,
while ((dev_caps = &capabilities[i++])->op !=
RTE_CRYPTO_OP_TYPE_UNDEFINED) {
memset(&caps_val, 0, CRYPTO_CAPS_SZ * sizeof(caps_val[0]));
- rte_memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
+ memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
for (j = 0; j < CRYPTO_CAPS_SZ; j++)
rte_tel_data_add_array_uint(d, caps_val[j]);
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 06/71] ip_frag: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (4 preceding siblings ...)
2024-02-29 22:57 ` [PATCH 05/71] cryptodev: " Stephen Hemminger
@ 2024-02-29 22:57 ` Stephen Hemminger
2024-02-29 22:57 ` [PATCH 07/71] net: " Stephen Hemminger
` (70 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:57 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Konstantin Ananyev
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/ip_frag/rte_ipv6_fragmentation.c | 4 +---
lib/ip_frag/rte_ipv6_reassembly.c | 6 ++----
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/lib/ip_frag/rte_ipv6_fragmentation.c b/lib/ip_frag/rte_ipv6_fragmentation.c
index 56696f32f851..72ce6501c864 100644
--- a/lib/ip_frag/rte_ipv6_fragmentation.c
+++ b/lib/ip_frag/rte_ipv6_fragmentation.c
@@ -5,8 +5,6 @@
#include <stddef.h>
#include <errno.h>
-#include <rte_memcpy.h>
-
#include "ip_frag_common.h"
/**
@@ -23,7 +21,7 @@ __fill_ipv6hdr_frag(struct rte_ipv6_hdr *dst,
{
struct rte_ipv6_fragment_ext *fh;
- rte_memcpy(dst, src, sizeof(*dst));
+ memcpy(dst, src, sizeof(*dst));
dst->payload_len = rte_cpu_to_be_16(len);
dst->proto = IPPROTO_FRAGMENT;
diff --git a/lib/ip_frag/rte_ipv6_reassembly.c b/lib/ip_frag/rte_ipv6_reassembly.c
index 88863a98d1fe..663b1737a64e 100644
--- a/lib/ip_frag/rte_ipv6_reassembly.c
+++ b/lib/ip_frag/rte_ipv6_reassembly.c
@@ -4,8 +4,6 @@
#include <stddef.h>
-#include <rte_memcpy.h>
-
#include "ip_frag_common.h"
/**
@@ -143,8 +141,8 @@ rte_ipv6_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
int32_t ip_len;
int32_t trim;
- rte_memcpy(&key.src_dst[0], ip_hdr->src_addr, 16);
- rte_memcpy(&key.src_dst[2], ip_hdr->dst_addr, 16);
+ memcpy(&key.src_dst[0], ip_hdr->src_addr, 16);
+ memcpy(&key.src_dst[2], ip_hdr->dst_addr, 16);
key.id = frag_hdr->id;
key.key_len = IPV6_KEYLEN;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 07/71] net: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (5 preceding siblings ...)
2024-02-29 22:57 ` [PATCH 06/71] ip_frag: " Stephen Hemminger
@ 2024-02-29 22:57 ` Stephen Hemminger
2024-02-29 22:57 ` [PATCH 08/71] lpm: " Stephen Hemminger
` (69 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:57 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/net/rte_ether.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/net/rte_ether.c b/lib/net/rte_ether.c
index f59c20289d37..761b38f8053f 100644
--- a/lib/net/rte_ether.c
+++ b/lib/net/rte_ether.c
@@ -13,7 +13,7 @@ rte_eth_random_addr(uint8_t *addr)
uint64_t rand = rte_rand();
uint8_t *p = (uint8_t *)&rand;
- rte_memcpy(addr, p, RTE_ETHER_ADDR_LEN);
+ memcpy(addr, p, RTE_ETHER_ADDR_LEN);
addr[0] &= (uint8_t)~RTE_ETHER_GROUP_ADDR; /* clear multicast bit */
addr[0] |= RTE_ETHER_LOCAL_ADMIN_ADDR; /* set local assignment bit */
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 08/71] lpm: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (6 preceding siblings ...)
2024-02-29 22:57 ` [PATCH 07/71] net: " Stephen Hemminger
@ 2024-02-29 22:57 ` Stephen Hemminger
2024-02-29 22:57 ` [PATCH 09/71] node: " Stephen Hemminger
` (68 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:57 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Bruce Richardson, Vladimir Medvedkin
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/lpm/rte_lpm6.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c
index 271bc480dc60..3303463fbd0a 100644
--- a/lib/lpm/rte_lpm6.c
+++ b/lib/lpm/rte_lpm6.c
@@ -10,7 +10,6 @@
#include <rte_log.h>
#include <rte_common.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_eal_memconfig.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
@@ -138,7 +137,7 @@ ip6_mask_addr(uint8_t *ip, uint8_t depth)
static inline void
ip6_copy_addr(uint8_t *dst, const uint8_t *src)
{
- rte_memcpy(dst, src, RTE_LPM6_IPV6_ADDR_SIZE);
+ memcpy(dst, src, RTE_LPM6_IPV6_ADDR_SIZE);
}
/*
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 09/71] node: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (7 preceding siblings ...)
2024-02-29 22:57 ` [PATCH 08/71] lpm: " Stephen Hemminger
@ 2024-02-29 22:57 ` Stephen Hemminger
2024-02-29 22:57 ` [PATCH 10/71] pdcp: " Stephen Hemminger
` (67 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:57 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Nithin Dabilpuram, Pavan Nikhilesh
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/node/ip6_lookup.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/node/ip6_lookup.c b/lib/node/ip6_lookup.c
index 309964f60fd6..b8e567ccd92d 100644
--- a/lib/node/ip6_lookup.c
+++ b/lib/node/ip6_lookup.c
@@ -112,28 +112,28 @@ ip6_lookup_node_process_scalar(struct rte_graph *graph, struct rte_node *node,
sizeof(struct rte_ether_hdr));
/* Extract hop_limits as ipv6 hdr is in cache */
node_mbuf_priv1(mbuf0, dyn)->ttl = ipv6_hdr->hop_limits;
- rte_memcpy(ip_batch[0], ipv6_hdr->dst_addr, 16);
+ memcpy(ip_batch[0], ipv6_hdr->dst_addr, 16);
/* Extract DIP of mbuf1 */
ipv6_hdr = rte_pktmbuf_mtod_offset(mbuf1, struct rte_ipv6_hdr *,
sizeof(struct rte_ether_hdr));
/* Extract hop_limits as ipv6 hdr is in cache */
node_mbuf_priv1(mbuf1, dyn)->ttl = ipv6_hdr->hop_limits;
- rte_memcpy(ip_batch[1], ipv6_hdr->dst_addr, 16);
+ memcpy(ip_batch[1], ipv6_hdr->dst_addr, 16);
/* Extract DIP of mbuf2 */
ipv6_hdr = rte_pktmbuf_mtod_offset(mbuf2, struct rte_ipv6_hdr *,
sizeof(struct rte_ether_hdr));
/* Extract hop_limits as ipv6 hdr is in cache */
node_mbuf_priv1(mbuf2, dyn)->ttl = ipv6_hdr->hop_limits;
- rte_memcpy(ip_batch[2], ipv6_hdr->dst_addr, 16);
+ memcpy(ip_batch[2], ipv6_hdr->dst_addr, 16);
/* Extract DIP of mbuf3 */
ipv6_hdr = rte_pktmbuf_mtod_offset(mbuf3, struct rte_ipv6_hdr *,
sizeof(struct rte_ether_hdr));
/* Extract hop_limits as ipv6 hdr is in cache */
node_mbuf_priv1(mbuf3, dyn)->ttl = ipv6_hdr->hop_limits;
- rte_memcpy(ip_batch[3], ipv6_hdr->dst_addr, 16);
+ memcpy(ip_batch[3], ipv6_hdr->dst_addr, 16);
rte_lpm6_lookup_bulk_func(lpm6, ip_batch, next_hop, 4);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 10/71] pdcp: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (8 preceding siblings ...)
2024-02-29 22:57 ` [PATCH 09/71] node: " Stephen Hemminger
@ 2024-02-29 22:57 ` Stephen Hemminger
2024-02-29 22:57 ` [PATCH 11/71] pipeline: " Stephen Hemminger
` (66 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:57 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anoob Joseph, Volodymyr Fialko
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/pdcp/pdcp_process.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/lib/pdcp/pdcp_process.c b/lib/pdcp/pdcp_process.c
index 9b9b881124b8..6c0693f66629 100644
--- a/lib/pdcp/pdcp_process.c
+++ b/lib/pdcp/pdcp_process.c
@@ -60,7 +60,7 @@ pdcp_iv_gen_null_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv *e
m = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(m_ptr, &m, 8);
+ memcpy(m_ptr, &m, 8);
}
static void
@@ -72,10 +72,10 @@ pdcp_iv_gen_null_zs(struct rte_crypto_op *cop, const struct entity_priv *en_priv
iv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET);
iv_u64[0] = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64[0], 8);
+ memcpy(iv, &iv_u64[0], 8);
iv_u64[1] = iv_u64[0] ^ en_priv->auth_iv_part.u64[1];
- rte_memcpy(iv + 8, &iv_u64[1], 8);
+ memcpy(iv + 8, &iv_u64[1], 8);
}
static void
@@ -89,7 +89,7 @@ pdcp_iv_gen_aes_ctr_null(struct rte_crypto_op *cop, const struct entity_priv *en
iv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
iv_u64[1] = 0;
- rte_memcpy(iv, iv_u64, 16);
+ memcpy(iv, iv_u64, 16);
}
static void
@@ -101,8 +101,8 @@ pdcp_iv_gen_zs_null(struct rte_crypto_op *cop, const struct entity_priv *en_priv
iv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET);
iv_u64 = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64, 8);
- rte_memcpy(iv + 8, &iv_u64, 8);
+ memcpy(iv, &iv_u64, 8);
+ memcpy(iv + 8, &iv_u64, 8);
}
static void
@@ -115,17 +115,17 @@ pdcp_iv_gen_zs_zs(struct rte_crypto_op *cop, const struct entity_priv *en_priv,
/* Generating cipher IV */
iv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64[0], 8);
- rte_memcpy(iv + 8, &iv_u64[0], 8);
+ memcpy(iv, &iv_u64[0], 8);
+ memcpy(iv + 8, &iv_u64[0], 8);
iv += PDCP_IV_LEN;
/* Generating auth IV */
iv_u64[0] = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64[0], 8);
+ memcpy(iv, &iv_u64[0], 8);
iv_u64[1] = iv_u64[0] ^ en_priv->auth_iv_part.u64[1];
- rte_memcpy(iv + 8, &iv_u64[1], 8);
+ memcpy(iv + 8, &iv_u64[1], 8);
}
static void
@@ -140,12 +140,12 @@ pdcp_iv_gen_zs_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv *en_
iv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET);
iv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64[0], 8);
- rte_memcpy(iv + 8, &iv_u64[0], 8);
+ memcpy(iv, &iv_u64[0], 8);
+ memcpy(iv + 8, &iv_u64[0], 8);
m_ptr = (uint8_t *)rte_pktmbuf_prepend(mb, 8);
m = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(m_ptr, &m, 8);
+ memcpy(m_ptr, &m, 8);
}
static void
@@ -162,11 +162,11 @@ pdcp_iv_gen_aes_ctr_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv
iv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
iv_u64[1] = 0;
- rte_memcpy(iv, iv_u64, PDCP_IV_LEN);
+ memcpy(iv, iv_u64, PDCP_IV_LEN);
m_ptr = (uint8_t *)rte_pktmbuf_prepend(mb, 8);
m = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(m_ptr, &m, 8);
+ memcpy(m_ptr, &m, 8);
}
static void
@@ -179,15 +179,15 @@ pdcp_iv_gen_aes_ctr_zs(struct rte_crypto_op *cop, const struct entity_priv *en_p
iv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
iv_u64[1] = 0;
- rte_memcpy(iv, iv_u64, PDCP_IV_LEN);
+ memcpy(iv, iv_u64, PDCP_IV_LEN);
iv += PDCP_IV_LEN;
iv_u64[0] = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64[0], 8);
+ memcpy(iv, &iv_u64[0], 8);
iv_u64[1] = iv_u64[0] ^ en_priv->auth_iv_part.u64[1];
- rte_memcpy(iv + 8, &iv_u64[1], 8);
+ memcpy(iv + 8, &iv_u64[1], 8);
}
static int
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 11/71] pipeline: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (9 preceding siblings ...)
2024-02-29 22:57 ` [PATCH 10/71] pdcp: " Stephen Hemminger
@ 2024-02-29 22:57 ` Stephen Hemminger
2024-02-29 22:57 ` [PATCH 12/71] rib: " Stephen Hemminger
` (65 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:57 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Cristian Dumitrescu
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/pipeline/rte_table_action.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/pipeline/rte_table_action.c b/lib/pipeline/rte_table_action.c
index dfdbc66b087c..c2312dc803a1 100644
--- a/lib/pipeline/rte_table_action.c
+++ b/lib/pipeline/rte_table_action.c
@@ -1441,7 +1441,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip,
tcp->src_port,
data->port);
- rte_memcpy(ip->src_addr, data->addr, 16);
+ memcpy(ip->src_addr, data->addr, 16);
tcp->src_port = data->port;
tcp->cksum = tcp_cksum;
} else {
@@ -1454,7 +1454,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip,
udp->src_port,
data->port);
- rte_memcpy(ip->src_addr, data->addr, 16);
+ memcpy(ip->src_addr, data->addr, 16);
udp->src_port = data->port;
udp->dgram_cksum = udp_cksum;
}
@@ -1469,7 +1469,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip,
tcp->dst_port,
data->port);
- rte_memcpy(ip->dst_addr, data->addr, 16);
+ memcpy(ip->dst_addr, data->addr, 16);
tcp->dst_port = data->port;
tcp->cksum = tcp_cksum;
} else {
@@ -1482,7 +1482,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip,
udp->dst_port,
data->port);
- rte_memcpy(ip->dst_addr, data->addr, 16);
+ memcpy(ip->dst_addr, data->addr, 16);
udp->dst_port = data->port;
udp->dgram_cksum = udp_cksum;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 12/71] rib: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (10 preceding siblings ...)
2024-02-29 22:57 ` [PATCH 11/71] pipeline: " Stephen Hemminger
@ 2024-02-29 22:57 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 13/71] security: " Stephen Hemminger
` (64 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:57 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Vladimir Medvedkin
Mostly automatically generated by devtools/cocci/rte_memcpy.cocci
The fib/trie.c was relying on headers
rte_rib6 -> rte_memcpy -> rte_vect
since rib6 is no longer using rte_memcpy need to get rte_vect.h
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/fib/trie.c | 2 +-
lib/rib/rte_rib6.h | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/fib/trie.c b/lib/fib/trie.c
index 09470e7287cc..a77f6c758b0d 100644
--- a/lib/fib/trie.c
+++ b/lib/fib/trie.c
@@ -9,7 +9,7 @@
#include <rte_debug.h>
#include <rte_malloc.h>
#include <rte_errno.h>
-
+#include <rte_vect.h>
#include <rte_rib6.h>
#include <rte_fib6.h>
#include "trie.h"
diff --git a/lib/rib/rte_rib6.h b/lib/rib/rte_rib6.h
index 775286f965f2..8fa5752bddec 100644
--- a/lib/rib/rte_rib6.h
+++ b/lib/rib/rte_rib6.h
@@ -14,7 +14,6 @@
* Level compressed tree implementation for IPv6 Longest Prefix Match
*/
-#include <rte_memcpy.h>
#include <rte_common.h>
#ifdef __cplusplus
@@ -61,7 +60,7 @@ rte_rib6_copy_addr(uint8_t *dst, const uint8_t *src)
{
if ((dst == NULL) || (src == NULL))
return;
- rte_memcpy(dst, src, RTE_RIB6_IPV6_ADDR_SIZE);
+ memcpy(dst, src, RTE_RIB6_IPV6_ADDR_SIZE);
}
/**
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 13/71] security: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (11 preceding siblings ...)
2024-02-29 22:57 ` [PATCH 12/71] rib: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 14/71] net/mlx5: " Stephen Hemminger
` (63 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Akhil Goyal, Anoob Joseph
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/security/rte_security.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
index e5c862f5f570..28d59ef38831 100644
--- a/lib/security/rte_security.c
+++ b/lib/security/rte_security.c
@@ -384,7 +384,7 @@ crypto_caps_array(struct rte_tel_data *d,
while ((dev_caps = &capabilities[i++])->op !=
RTE_CRYPTO_OP_TYPE_UNDEFINED) {
memset(&caps_val, 0, CRYPTO_CAPS_SZ * sizeof(caps_val[0]));
- rte_memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
+ memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
for (j = 0; j < CRYPTO_CAPS_SZ; j++)
rte_tel_data_add_array_uint(d, caps_val[j]);
}
@@ -409,7 +409,7 @@ sec_caps_array(struct rte_tel_data *d,
while ((dev_caps = &capabilities[i++])->action !=
RTE_SECURITY_ACTION_TYPE_NONE) {
memset(&caps_val, 0, SEC_CAPS_SZ * sizeof(caps_val[0]));
- rte_memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
+ memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
for (j = 0; j < SEC_CAPS_SZ; j++)
rte_tel_data_add_array_uint(d, caps_val[j]);
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 14/71] net/mlx5: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (12 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 13/71] security: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 15/71] net/nfp: " Stephen Hemminger
` (62 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Dariusz Sosnowski, Viacheslav Ovsiienko,
Ori Kam, Suanming Mou, Matan Azrad
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/mlx5/mlx5_devx.c | 4 ++--
drivers/net/mlx5/mlx5_flow.c | 38 ++++++++++++++++----------------
drivers/net/mlx5/mlx5_flow_aso.c | 6 ++---
drivers/net/mlx5/mlx5_flow_hw.c | 16 +++++++-------
drivers/net/mlx5/mlx5_rx.c | 6 ++---
drivers/net/mlx5/mlx5_rxtx_vec.c | 8 +++----
6 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c
index 9fa400fc48ef..6380a5c83cd3 100644
--- a/drivers/net/mlx5/mlx5_devx.c
+++ b/drivers/net/mlx5/mlx5_devx.c
@@ -512,7 +512,7 @@ mlx5_rxq_obj_hairpin_new(struct mlx5_rxq_priv *rxq)
* during queue setup.
*/
MLX5_ASSERT(hca_attr->hairpin_data_buffer_locked);
- rte_memcpy(&locked_attr, &unlocked_attr, sizeof(locked_attr));
+ memcpy(&locked_attr, &unlocked_attr, sizeof(locked_attr));
locked_attr.hairpin_data_buffer_type =
MLX5_RQC_HAIRPIN_DATA_BUFFER_TYPE_LOCKED_INTERNAL_BUFFER;
tmpl->rq = mlx5_devx_cmd_create_rq(priv->sh->cdev->ctx, &locked_attr,
@@ -1289,7 +1289,7 @@ mlx5_txq_obj_hairpin_new(struct rte_eth_dev *dev, uint16_t idx)
*/
MLX5_ASSERT(hca_attr->hairpin_sq_wq_in_host_mem);
MLX5_ASSERT(hca_attr->hairpin_sq_wqe_bb_size > 0);
- rte_memcpy(&host_mem_attr, &dev_mem_attr, sizeof(host_mem_attr));
+ memcpy(&host_mem_attr, &dev_mem_attr, sizeof(host_mem_attr));
umem_size = MLX5_WQE_SIZE *
RTE_BIT32(host_mem_attr.wq_attr.log_hairpin_num_packets);
umem_dbrec = RTE_ALIGN(umem_size, MLX5_DBR_SIZE);
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 2b2ae626186e..53c20592b91a 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -4495,8 +4495,8 @@ flow_action_handles_translate(struct rte_eth_dev *dev,
(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION_NUM,
NULL, "too many shared actions");
}
- rte_memcpy(&handle[copied_n].action, &actions[n].conf,
- sizeof(actions[n].conf));
+ memcpy(&handle[copied_n].action, &actions[n].conf,
+ sizeof(actions[n].conf));
handle[copied_n].index = n;
copied_n++;
}
@@ -5362,29 +5362,29 @@ flow_hairpin_split(struct rte_eth_dev *dev,
case RTE_FLOW_ACTION_TYPE_NVGRE_ENCAP:
case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN:
case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP:
- rte_memcpy(actions_tx, actions,
+ memcpy(actions_tx, actions,
sizeof(struct rte_flow_action));
actions_tx++;
break;
case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID:
if (push_vlan) {
- rte_memcpy(actions_tx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_tx, actions,
+ sizeof(struct rte_flow_action));
actions_tx++;
} else {
- rte_memcpy(actions_rx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions,
+ sizeof(struct rte_flow_action));
actions_rx++;
}
break;
case RTE_FLOW_ACTION_TYPE_COUNT:
if (encap) {
- rte_memcpy(actions_tx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_tx, actions,
+ sizeof(struct rte_flow_action));
actions_tx++;
} else {
- rte_memcpy(actions_rx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions,
+ sizeof(struct rte_flow_action));
actions_rx++;
}
break;
@@ -5396,8 +5396,8 @@ flow_hairpin_split(struct rte_eth_dev *dev,
actions_tx++;
encap = 1;
} else {
- rte_memcpy(actions_rx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions,
+ sizeof(struct rte_flow_action));
actions_rx++;
}
break;
@@ -5408,14 +5408,14 @@ flow_hairpin_split(struct rte_eth_dev *dev,
sizeof(struct rte_flow_action));
actions_tx++;
} else {
- rte_memcpy(actions_rx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions,
+ sizeof(struct rte_flow_action));
actions_rx++;
}
break;
default:
- rte_memcpy(actions_rx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions,
+ sizeof(struct rte_flow_action));
actions_rx++;
break;
}
@@ -5425,7 +5425,7 @@ flow_hairpin_split(struct rte_eth_dev *dev,
tag_action->type = (enum rte_flow_action_type)
MLX5_RTE_FLOW_ACTION_TYPE_TAG;
actions_rx++;
- rte_memcpy(actions_rx, actions, sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions, sizeof(struct rte_flow_action));
actions_rx++;
set_tag = (void *)actions_rx;
*set_tag = (struct mlx5_rte_flow_action_set_tag) {
@@ -5435,7 +5435,7 @@ flow_hairpin_split(struct rte_eth_dev *dev,
MLX5_ASSERT(set_tag->id > REG_NON);
tag_action->conf = set_tag;
/* Create Tx item list. */
- rte_memcpy(actions_tx, actions, sizeof(struct rte_flow_action));
+ memcpy(actions_tx, actions, sizeof(struct rte_flow_action));
addr = (void *)&pattern_tx[2];
item = pattern_tx;
item->type = (enum rte_flow_item_type)
diff --git a/drivers/net/mlx5/mlx5_flow_aso.c b/drivers/net/mlx5/mlx5_flow_aso.c
index f3114434729e..49de92c675cd 100644
--- a/drivers/net/mlx5/mlx5_flow_aso.c
+++ b/drivers/net/mlx5/mlx5_flow_aso.c
@@ -1327,9 +1327,9 @@ mlx5_aso_ct_status_update(struct mlx5_aso_sq *sq, uint16_t num)
MLX5_ASSERT(ct);
MLX5_ASO_CT_UPDATE_STATE(ct, ASO_CONNTRACK_READY);
if (sq->elts[idx].query_data)
- rte_memcpy(sq->elts[idx].query_data,
- (char *)((uintptr_t)sq->mr.addr + idx * 64),
- 64);
+ memcpy(sq->elts[idx].query_data,
+ (char *)((uintptr_t)sq->mr.addr + idx * 64),
+ 64);
}
}
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index bcf43f545779..04b12bba95a9 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -1970,7 +1970,7 @@ mlx5_tbl_translate_modify_header(struct rte_eth_dev *dev,
return rte_flow_error_set(error, ENOMEM,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL, "translate modify_header: no memory for modify header context");
- rte_memcpy(acts->mhdr, mhdr, sizeof(*mhdr));
+ memcpy(acts->mhdr, mhdr, sizeof(*mhdr));
pattern.data = (__be64 *)acts->mhdr->mhdr_cmds;
if (mhdr->shared) {
uint32_t flags = mlx5_hw_act_flag[!!attr->group][tbl_type] |
@@ -2823,9 +2823,9 @@ flow_hw_modify_field_construct(struct mlx5_hw_q_job *job,
mhdr_action->src.field != RTE_FLOW_FIELD_POINTER)
return 0;
if (mhdr_action->src.field == RTE_FLOW_FIELD_VALUE)
- rte_memcpy(values, &mhdr_action->src.value, sizeof(values));
+ memcpy(values, &mhdr_action->src.value, sizeof(values));
else
- rte_memcpy(values, mhdr_action->src.pvalue, sizeof(values));
+ memcpy(values, mhdr_action->src.pvalue, sizeof(values));
if (mhdr_action->dst.field == RTE_FLOW_FIELD_META ||
mhdr_action->dst.field == RTE_FLOW_FIELD_TAG ||
mhdr_action->dst.field == RTE_FLOW_FIELD_METER_COLOR ||
@@ -4467,7 +4467,7 @@ flow_hw_table_create(struct rte_eth_dev *dev,
rte_flow_error_set(error, err, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
"Failed to create template table");
else
- rte_memcpy(error, &sub_error, sizeof(sub_error));
+ memcpy(error, &sub_error, sizeof(sub_error));
}
return NULL;
}
@@ -7773,8 +7773,8 @@ flow_hw_create_tx_repr_tag_jump_acts_tmpl(struct rte_eth_dev *dev,
struct rte_flow_action actions_m[4] = { { 0 } };
unsigned int idx = 0;
- rte_memcpy(set_tag_v.src.value, &tag_value, sizeof(tag_value));
- rte_memcpy(set_tag_m.src.value, &tag_mask, sizeof(tag_mask));
+ memcpy(set_tag_v.src.value, &tag_value, sizeof(tag_value));
+ memcpy(set_tag_m.src.value, &tag_mask, sizeof(tag_mask));
flow_hw_update_action_mask(&actions_v[idx], &actions_m[idx],
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD,
&set_tag_v, &set_tag_m);
@@ -8181,8 +8181,8 @@ flow_hw_create_ctrl_regc_jump_actions_template(struct rte_eth_dev *dev,
};
set_reg_v.dst.offset = rte_bsf32(marker_mask);
- rte_memcpy(set_reg_v.src.value, &marker_bits, sizeof(marker_bits));
- rte_memcpy(set_reg_m.src.value, &marker_mask, sizeof(marker_mask));
+ memcpy(set_reg_v.src.value, &marker_bits, sizeof(marker_bits));
+ memcpy(set_reg_m.src.value, &marker_mask, sizeof(marker_mask));
return flow_hw_actions_template_create(dev, &attr, actions_v, actions_m, error);
}
diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c
index 5bf1a679b2d8..e35f9abd2064 100644
--- a/drivers/net/mlx5/mlx5_rx.c
+++ b/drivers/net/mlx5/mlx5_rx.c
@@ -761,9 +761,9 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
ret = check_cqe_iteration(next, rxq->cqe_n, rxq->cq_ci);
if (ret != MLX5_CQE_STATUS_SW_OWN ||
MLX5_CQE_FORMAT(next->op_own) == MLX5_COMPRESSED)
- rte_memcpy(&rxq->title_cqe,
- (const void *)(uintptr_t)cqe,
- sizeof(struct mlx5_cqe));
+ memcpy(&rxq->title_cqe,
+ (const void *)(uintptr_t)cqe,
+ sizeof(struct mlx5_cqe));
}
}
}
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec.c b/drivers/net/mlx5/mlx5_rxtx_vec.c
index 2363d7ed27a7..c3bcd3ef16de 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec.c
+++ b/drivers/net/mlx5/mlx5_rxtx_vec.c
@@ -349,8 +349,8 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
ret = check_cqe_iteration(next, rxq->cqe_n, rxq->cq_ci);
if (ret != MLX5_CQE_STATUS_SW_OWN ||
MLX5_CQE_FORMAT(next->op_own) == MLX5_COMPRESSED)
- rte_memcpy(&rxq->title_pkt, elts[nocmp_n - 1],
- sizeof(struct rte_mbuf));
+ memcpy(&rxq->title_pkt, elts[nocmp_n - 1],
+ sizeof(struct rte_mbuf));
}
/* Decompress the last CQE if compressed. */
if (comp_idx < MLX5_VPMD_DESCS_PER_LOOP) {
@@ -499,8 +499,8 @@ rxq_burst_mprq_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
ret = check_cqe_iteration(next, rxq->cqe_n, rxq->cq_ci);
if (ret != MLX5_CQE_STATUS_SW_OWN ||
MLX5_CQE_FORMAT(next->op_own) == MLX5_COMPRESSED)
- rte_memcpy(&rxq->title_pkt, elts[nocmp_n - 1],
- sizeof(struct rte_mbuf));
+ memcpy(&rxq->title_pkt, elts[nocmp_n - 1],
+ sizeof(struct rte_mbuf));
}
/* Decompress the last CQE if compressed. */
if (comp_idx < MLX5_VPMD_DESCS_PER_LOOP) {
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 15/71] net/nfp: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (13 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 14/71] net/mlx5: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 16/71] net/ngbe: " Stephen Hemminger
` (61 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Chaoyong He
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/nfp/flower/nfp_conntrack.c | 2 +-
drivers/net/nfp/flower/nfp_flower_flow.c | 16 ++++++++--------
drivers/net/nfp/flower/nfp_flower_representor.c | 2 +-
drivers/net/nfp/nfp_mtr.c | 10 +++++-----
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/net/nfp/flower/nfp_conntrack.c b/drivers/net/nfp/flower/nfp_conntrack.c
index f89003be8b40..279bf17eb3a5 100644
--- a/drivers/net/nfp/flower/nfp_conntrack.c
+++ b/drivers/net/nfp/flower/nfp_conntrack.c
@@ -1470,7 +1470,7 @@ nfp_ct_do_flow_merge(struct nfp_ct_zone_entry *ze,
merge_entry->ze = ze;
merge_entry->pre_ct_parent = pre_ct_entry;
merge_entry->post_ct_parent = post_ct_entry;
- rte_memcpy(merge_entry->cookie, new_cookie, sizeof(new_cookie));
+ memcpy(merge_entry->cookie, new_cookie, sizeof(new_cookie));
merge_entry->rule.items_cnt = pre_ct_entry->rule.items_cnt +
post_ct_entry->rule.items_cnt - cnt_same_item - 1;
merge_entry->rule.actions_cnt = pre_ct_entry->rule.actions_cnt +
diff --git a/drivers/net/nfp/flower/nfp_flower_flow.c b/drivers/net/nfp/flower/nfp_flower_flow.c
index e26be30d1833..3d07a4429b62 100644
--- a/drivers/net/nfp/flower/nfp_flower_flow.c
+++ b/drivers/net/nfp/flower/nfp_flower_flow.c
@@ -178,10 +178,10 @@ nfp_mask_id_alloc(struct nfp_flow_priv *priv,
return -ENOENT;
}
- rte_memcpy(&temp_id, &ring->buf[ring->tail], NFP_FLOWER_MASK_ELEMENT_RS);
+ memcpy(&temp_id, &ring->buf[ring->tail], NFP_FLOWER_MASK_ELEMENT_RS);
*mask_id = temp_id;
- rte_memcpy(&ring->buf[ring->tail], &freed_id, NFP_FLOWER_MASK_ELEMENT_RS);
+ memcpy(&ring->buf[ring->tail], &freed_id, NFP_FLOWER_MASK_ELEMENT_RS);
ring->tail = (ring->tail + NFP_FLOWER_MASK_ELEMENT_RS) %
(NFP_FLOWER_MASK_ENTRY_RS * NFP_FLOWER_MASK_ELEMENT_RS);
@@ -200,7 +200,7 @@ nfp_mask_id_free(struct nfp_flow_priv *priv,
if (CIRC_SPACE(ring->head, ring->tail, NFP_FLOWER_MASK_ENTRY_RS) == 0)
return -ENOBUFS;
- rte_memcpy(&ring->buf[ring->head], &mask_id, NFP_FLOWER_MASK_ELEMENT_RS);
+ memcpy(&ring->buf[ring->head], &mask_id, NFP_FLOWER_MASK_ELEMENT_RS);
ring->head = (ring->head + NFP_FLOWER_MASK_ELEMENT_RS) %
(NFP_FLOWER_MASK_ENTRY_RS * NFP_FLOWER_MASK_ELEMENT_RS);
@@ -2247,13 +2247,13 @@ nfp_flow_action_set_mac(char *act_data,
set_mac = action->conf;
if (mac_src_flag) {
- rte_memcpy(&set_eth->eth_addr[RTE_ETHER_ADDR_LEN],
- set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(&set_eth->eth_addr[RTE_ETHER_ADDR_LEN],
+ set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
set_eth->eth_addr_mask[RTE_ETHER_ADDR_LEN + i] = 0xff;
} else {
- rte_memcpy(&set_eth->eth_addr[0],
- set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(&set_eth->eth_addr[0], set_mac->mac_addr,
+ RTE_ETHER_ADDR_LEN);
for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
set_eth->eth_addr_mask[i] = 0xff;
}
@@ -2329,7 +2329,7 @@ nfp_flow_action_set_ipv6(char *act_data,
set_ip->reserved = 0;
for (i = 0; i < 4; i++) {
- rte_memcpy(&tmp, &set_ipv6->ipv6_addr[i * 4], 4);
+ memcpy(&tmp, &set_ipv6->ipv6_addr[i * 4], 4);
set_ip->ipv6[i].exact = tmp;
set_ip->ipv6[i].mask = RTE_BE32(0xffffffff);
}
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index 4f4df0cd2ee2..ce2b06611802 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -181,7 +181,7 @@ nfp_flower_repr_stats_get(struct rte_eth_dev *ethdev,
struct nfp_flower_representor *repr;
repr = ethdev->data->dev_private;
- rte_memcpy(stats, &repr->repr_stats, sizeof(struct rte_eth_stats));
+ memcpy(stats, &repr->repr_stats, sizeof(struct rte_eth_stats));
return 0;
}
diff --git a/drivers/net/nfp/nfp_mtr.c b/drivers/net/nfp/nfp_mtr.c
index 255977ec2236..1f173409b421 100644
--- a/drivers/net/nfp/nfp_mtr.c
+++ b/drivers/net/nfp/nfp_mtr.c
@@ -243,7 +243,7 @@ nfp_mtr_profile_mod(struct nfp_app_fw_flower *app_fw_flower,
struct nfp_profile_conf old_conf;
/* Get the old profile config */
- rte_memcpy(&old_conf, &mtr_profile->conf, sizeof(old_conf));
+ memcpy(&old_conf, &mtr_profile->conf, sizeof(old_conf));
memset(&mtr_profile->conf, 0, sizeof(struct nfp_profile_conf));
@@ -267,7 +267,7 @@ nfp_mtr_profile_mod(struct nfp_app_fw_flower *app_fw_flower,
return 0;
rollback:
- rte_memcpy(&mtr_profile->conf, &old_conf, sizeof(old_conf));
+ memcpy(&mtr_profile->conf, &old_conf, sizeof(old_conf));
return ret;
}
@@ -492,8 +492,8 @@ nfp_mtr_policy_add(struct rte_eth_dev *dev,
}
mtr_policy->policy_id = mtr_policy_id;
- rte_memcpy(&mtr_policy->policy, policy,
- sizeof(struct rte_mtr_meter_policy_params));
+ memcpy(&mtr_policy->policy, policy,
+ sizeof(struct rte_mtr_meter_policy_params));
/* Insert policy into policy list */
LIST_INSERT_HEAD(&priv->policies, mtr_policy, next);
@@ -1028,7 +1028,7 @@ nfp_mtr_stats_read(struct rte_eth_dev *dev,
*stats_mask = mtr->stats_mask;
rte_spinlock_lock(&priv->mtr_stats_lock);
- rte_memcpy(&curr, &mtr->mtr_stats.curr, sizeof(curr));
+ memcpy(&curr, &mtr->mtr_stats.curr, sizeof(curr));
rte_spinlock_unlock(&priv->mtr_stats_lock);
prev = &mtr->mtr_stats.prev;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 16/71] net/ngbe: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (14 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 15/71] net/nfp: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 17/71] net/null: " Stephen Hemminger
` (60 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jiawen Wu
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/ngbe/ngbe_pf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ngbe/ngbe_pf.c b/drivers/net/ngbe/ngbe_pf.c
index 947ae7fe942a..48f578b06626 100644
--- a/drivers/net/ngbe/ngbe_pf.c
+++ b/drivers/net/ngbe/ngbe_pf.c
@@ -347,7 +347,7 @@ ngbe_vf_reset(struct rte_eth_dev *eth_dev, uint16_t vf, uint32_t *msgbuf)
/* reply to reset with ack and vf mac address */
msgbuf[0] = NGBE_VF_RESET | NGBE_VT_MSGTYPE_ACK;
- rte_memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
+ memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
/*
* Piggyback the multicast filter type so VF can compute the
* correct vectors
@@ -369,7 +369,7 @@ ngbe_vf_set_mac_addr(struct rte_eth_dev *eth_dev,
struct rte_ether_addr *ea = (struct rte_ether_addr *)new_mac;
if (rte_is_valid_assigned_ether_addr(ea)) {
- rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
+ memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
return hw->mac.set_rar(hw, rar_entry, new_mac, vf, true);
}
return -1;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 17/71] net/null: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (15 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 16/71] net/ngbe: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 18/71] net/pcap: " Stephen Hemminger
` (59 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Tetsuya Mukawa
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/null/rte_eth_null.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 7c46004f1e33..fd8b01b2b17b 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -465,7 +465,7 @@ eth_rss_hash_update(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf)
rss_conf->rss_hf & internal->flow_type_rss_offloads;
if (rss_conf->rss_key)
- rte_memcpy(internal->rss_key, rss_conf->rss_key, 40);
+ memcpy(internal->rss_key, rss_conf->rss_key, 40);
rte_spinlock_unlock(&internal->rss_lock);
@@ -482,7 +482,7 @@ eth_rss_hash_conf_get(struct rte_eth_dev *dev,
rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf;
if (rss_conf->rss_key)
- rte_memcpy(rss_conf->rss_key, internal->rss_key, 40);
+ memcpy(rss_conf->rss_key, internal->rss_key, 40);
rte_spinlock_unlock(&internal->rss_lock);
@@ -577,7 +577,7 @@ eth_dev_null_create(struct rte_vdev_device *dev, struct pmd_options *args)
internals->flow_type_rss_offloads = RTE_ETH_RSS_PROTO_MASK;
internals->reta_size = RTE_DIM(internals->reta_conf) * RTE_ETH_RETA_GROUP_SIZE;
- rte_memcpy(internals->rss_key, default_rss_key, 40);
+ memcpy(internals->rss_key, default_rss_key, 40);
data = eth_dev->data;
data->nb_rx_queues = (uint16_t)nb_rx_queues;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 18/71] net/pcap: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (16 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 17/71] net/null: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 19/71] net/sfc: " Stephen Hemminger
` (58 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/pcap/pcap_ethdev.c | 2 +-
drivers/net/pcap/pcap_osdep_freebsd.c | 2 +-
drivers/net/pcap/pcap_osdep_linux.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/pcap/pcap_ethdev.c b/drivers/net/pcap/pcap_ethdev.c
index bfec0850456f..54f0dfffbdd0 100644
--- a/drivers/net/pcap/pcap_ethdev.c
+++ b/drivers/net/pcap/pcap_ethdev.c
@@ -1270,7 +1270,7 @@ eth_pcap_update_mac(const char *if_name, struct rte_eth_dev *eth_dev,
return -1;
PMD_LOG(INFO, "Setting phy MAC for %s", if_name);
- rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
+ memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
eth_dev->data->mac_addrs = mac_addrs;
return 0;
}
diff --git a/drivers/net/pcap/pcap_osdep_freebsd.c b/drivers/net/pcap/pcap_osdep_freebsd.c
index 20556b3e9215..d395a5957d56 100644
--- a/drivers/net/pcap/pcap_osdep_freebsd.c
+++ b/drivers/net/pcap/pcap_osdep_freebsd.c
@@ -52,7 +52,7 @@ osdep_iface_mac_get(const char *if_name, struct rte_ether_addr *mac)
ifm = (struct if_msghdr *)buf;
sdl = (struct sockaddr_dl *)(ifm + 1);
- rte_memcpy(mac->addr_bytes, LLADDR(sdl), RTE_ETHER_ADDR_LEN);
+ memcpy(mac->addr_bytes, LLADDR(sdl), RTE_ETHER_ADDR_LEN);
rte_free(buf);
return 0;
diff --git a/drivers/net/pcap/pcap_osdep_linux.c b/drivers/net/pcap/pcap_osdep_linux.c
index 97033f57c5d9..fc79ad6cdf9e 100644
--- a/drivers/net/pcap/pcap_osdep_linux.c
+++ b/drivers/net/pcap/pcap_osdep_linux.c
@@ -35,7 +35,7 @@ osdep_iface_mac_get(const char *if_name, struct rte_ether_addr *mac)
return -1;
}
- rte_memcpy(mac->addr_bytes, ifr.ifr_hwaddr.sa_data, RTE_ETHER_ADDR_LEN);
+ memcpy(mac->addr_bytes, ifr.ifr_hwaddr.sa_data, RTE_ETHER_ADDR_LEN);
close(if_fd);
return 0;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 19/71] net/sfc: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (17 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 18/71] net/pcap: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 20/71] net/tap: " Stephen Hemminger
` (57 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Andrew Rybchenko
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/sfc/sfc.c | 2 +-
drivers/net/sfc/sfc_ef10_tx.c | 2 +-
drivers/net/sfc/sfc_ethdev.c | 11 +++++------
drivers/net/sfc/sfc_flow.c | 20 ++++++++++----------
| 2 +-
drivers/net/sfc/sfc_mae.c | 2 +-
drivers/net/sfc/sfc_rx.c | 2 +-
drivers/net/sfc/sfc_tso.c | 2 +-
drivers/net/sfc/sfc_tso.h | 9 ++++-----
9 files changed, 25 insertions(+), 27 deletions(-)
diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c
index 2cfff20f4783..2fd160e99ed2 100644
--- a/drivers/net/sfc/sfc.c
+++ b/drivers/net/sfc/sfc.c
@@ -850,7 +850,7 @@ sfc_rss_attach(struct sfc_adapter *sa)
efx_ev_fini(sa->nic);
efx_intr_fini(sa->nic);
- rte_memcpy(rss->key, default_rss_key, sizeof(rss->key));
+ memcpy(rss->key, default_rss_key, sizeof(rss->key));
memset(&rss->dummy_ctx, 0, sizeof(rss->dummy_ctx));
rss->dummy_ctx.conf.qid_span = 1;
rss->dummy_ctx.dummy = true;
diff --git a/drivers/net/sfc/sfc_ef10_tx.c b/drivers/net/sfc/sfc_ef10_tx.c
index 116229382b68..0b78a9eaccd1 100644
--- a/drivers/net/sfc/sfc_ef10_tx.c
+++ b/drivers/net/sfc/sfc_ef10_tx.c
@@ -514,7 +514,7 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg,
first_m_seg->outer_l2_len);
th = (const struct rte_tcp_hdr *)(hdr_addr + tcph_off);
- rte_memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t));
+ memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t));
sent_seq = rte_be_to_cpu_32(sent_seq);
sfc_ef10_tx_qdesc_tso2_create(txq, *added, packet_id, outer_packet_id,
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 92ca5e7a60de..a6f0743f102c 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -1287,8 +1287,7 @@ sfc_set_mc_addr_list(struct rte_eth_dev *dev,
}
for (i = 0; i < nb_mc_addr; ++i) {
- rte_memcpy(mc_addrs, mc_addr_set[i].addr_bytes,
- EFX_MAC_ADDR_LEN);
+ memcpy(mc_addrs, mc_addr_set[i].addr_bytes, EFX_MAC_ADDR_LEN);
mc_addrs += EFX_MAC_ADDR_LEN;
}
@@ -1672,7 +1671,7 @@ sfc_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
rss_conf->rss_hf = sfc_rx_hf_efx_to_rte(rss, rss->hash_types);
rss_conf->rss_key_len = EFX_RSS_KEY_SIZE;
if (rss_conf->rss_key != NULL)
- rte_memcpy(rss_conf->rss_key, rss->key, EFX_RSS_KEY_SIZE);
+ memcpy(rss_conf->rss_key, rss->key, EFX_RSS_KEY_SIZE);
return 0;
}
@@ -1741,7 +1740,7 @@ sfc_dev_rss_hash_update(struct rte_eth_dev *dev,
}
}
- rte_memcpy(rss->key, rss_conf->rss_key, sizeof(rss->key));
+ memcpy(rss->key, rss_conf->rss_key, sizeof(rss->key));
}
rss->hash_types = efx_hash_types;
@@ -1840,7 +1839,7 @@ sfc_dev_rss_reta_update(struct rte_eth_dev *dev,
sfc_adapter_lock(sa);
- rte_memcpy(rss_tbl_new, rss->tbl, sizeof(rss->tbl));
+ memcpy(rss_tbl_new, rss->tbl, sizeof(rss->tbl));
for (entry = 0; entry < reta_size; entry++) {
int grp_idx = entry % RTE_ETH_RETA_GROUP_SIZE;
@@ -1864,7 +1863,7 @@ sfc_dev_rss_reta_update(struct rte_eth_dev *dev,
goto fail_scale_tbl_set;
}
- rte_memcpy(rss->tbl, rss_tbl_new, sizeof(rss->tbl));
+ memcpy(rss->tbl, rss_tbl_new, sizeof(rss->tbl));
fail_scale_tbl_set:
bad_reta_entry:
diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index 1b50aefe5c48..2bb98a443335 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -325,8 +325,8 @@ sfc_flow_parse_eth(const struct rte_flow_item *item,
efx_spec->efs_match_flags |= is_ifrm ?
EFX_FILTER_MATCH_IFRM_LOC_MAC :
EFX_FILTER_MATCH_LOC_MAC;
- rte_memcpy(loc_mac, spec->hdr.dst_addr.addr_bytes,
- EFX_MAC_ADDR_LEN);
+ memcpy(loc_mac, spec->hdr.dst_addr.addr_bytes,
+ EFX_MAC_ADDR_LEN);
} else if (memcmp(mask->hdr.dst_addr.addr_bytes, ig_mask,
EFX_MAC_ADDR_LEN) == 0) {
if (rte_is_unicast_ether_addr(&spec->hdr.dst_addr))
@@ -348,8 +348,8 @@ sfc_flow_parse_eth(const struct rte_flow_item *item,
*/
if (rte_is_same_ether_addr(&mask->hdr.src_addr, &supp_mask.hdr.src_addr)) {
efx_spec->efs_match_flags |= EFX_FILTER_MATCH_REM_MAC;
- rte_memcpy(efx_spec->efs_rem_mac, spec->hdr.src_addr.addr_bytes,
- EFX_MAC_ADDR_LEN);
+ memcpy(efx_spec->efs_rem_mac, spec->hdr.src_addr.addr_bytes,
+ EFX_MAC_ADDR_LEN);
} else if (!rte_is_zero_ether_addr(&mask->hdr.src_addr)) {
goto fail_bad_mask;
}
@@ -624,8 +624,8 @@ sfc_flow_parse_ipv6(const struct rte_flow_item *item,
RTE_BUILD_BUG_ON(sizeof(efx_spec->efs_rem_host) !=
sizeof(spec->hdr.src_addr));
- rte_memcpy(&efx_spec->efs_rem_host, spec->hdr.src_addr,
- sizeof(efx_spec->efs_rem_host));
+ memcpy(&efx_spec->efs_rem_host, spec->hdr.src_addr,
+ sizeof(efx_spec->efs_rem_host));
} else if (!sfc_flow_is_zero(mask->hdr.src_addr,
sizeof(mask->hdr.src_addr))) {
goto fail_bad_mask;
@@ -637,8 +637,8 @@ sfc_flow_parse_ipv6(const struct rte_flow_item *item,
RTE_BUILD_BUG_ON(sizeof(efx_spec->efs_loc_host) !=
sizeof(spec->hdr.dst_addr));
- rte_memcpy(&efx_spec->efs_loc_host, spec->hdr.dst_addr,
- sizeof(efx_spec->efs_loc_host));
+ memcpy(&efx_spec->efs_loc_host, spec->hdr.dst_addr,
+ sizeof(efx_spec->efs_loc_host));
} else if (!sfc_flow_is_zero(mask->hdr.dst_addr,
sizeof(mask->hdr.dst_addr))) {
goto fail_bad_mask;
@@ -889,8 +889,8 @@ sfc_flow_set_efx_spec_vni_or_vsid(efx_filter_spec_t *efx_spec,
if (memcmp(vni_or_vsid_mask, vni_or_vsid_full_mask,
EFX_VNI_OR_VSID_LEN) == 0) {
efx_spec->efs_match_flags |= EFX_FILTER_MATCH_VNI_OR_VSID;
- rte_memcpy(efx_spec->efs_vni_or_vsid, vni_or_vsid_val,
- EFX_VNI_OR_VSID_LEN);
+ memcpy(efx_spec->efs_vni_or_vsid, vni_or_vsid_val,
+ EFX_VNI_OR_VSID_LEN);
} else if (!sfc_flow_is_zero(vni_or_vsid_mask, EFX_VNI_OR_VSID_LEN)) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM, item,
--git a/drivers/net/sfc/sfc_flow_rss.c b/drivers/net/sfc/sfc_flow_rss.c
index e28c943335f3..a46ce1fa87e1 100644
--- a/drivers/net/sfc/sfc_flow_rss.c
+++ b/drivers/net/sfc/sfc_flow_rss.c
@@ -119,7 +119,7 @@ sfc_flow_rss_parse_conf(struct sfc_adapter *sa,
key = ethdev_rss->key;
}
- rte_memcpy(out->key, key, sizeof(out->key));
+ memcpy(out->key, key, sizeof(out->key));
switch (in->func) {
case RTE_ETH_HASH_FUNCTION_DEFAULT:
diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index 60ff6d21810a..1f243e798e00 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -547,7 +547,7 @@ sfc_mae_mac_addr_add(struct sfc_adapter *sa,
if (mac_addr == NULL)
return ENOMEM;
- rte_memcpy(mac_addr->addr_bytes, addr_bytes, EFX_MAC_ADDR_LEN);
+ memcpy(mac_addr->addr_bytes, addr_bytes, EFX_MAC_ADDR_LEN);
mac_addr->refcnt = 1;
mac_addr->fw_rsrc.mac_id.id = EFX_MAE_RSRC_ID_INVALID;
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index a19322926572..55aae9ef04f3 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -1526,7 +1526,7 @@ sfc_rx_process_adv_conf_rss(struct sfc_adapter *sa,
sizeof(rss->key));
return EINVAL;
}
- rte_memcpy(rss->key, conf->rss_key, sizeof(rss->key));
+ memcpy(rss->key, conf->rss_key, sizeof(rss->key));
}
rss->hash_types = efx_hash_types;
diff --git a/drivers/net/sfc/sfc_tso.c b/drivers/net/sfc/sfc_tso.c
index a0827d1c0dd6..5da2de3c3d49 100644
--- a/drivers/net/sfc/sfc_tso.c
+++ b/drivers/net/sfc/sfc_tso.c
@@ -159,7 +159,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,
/* Handle TCP header */
th = (const struct rte_tcp_hdr *)(tsoh + tcph_off);
- rte_memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t));
+ memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t));
sent_seq = rte_be_to_cpu_32(sent_seq);
efx_tx_qdesc_tso2_create(txq->common, packet_id, 0, sent_seq,
diff --git a/drivers/net/sfc/sfc_tso.h b/drivers/net/sfc/sfc_tso.h
index 9029ad159014..e914eae77ef8 100644
--- a/drivers/net/sfc/sfc_tso.h
+++ b/drivers/net/sfc/sfc_tso.h
@@ -35,7 +35,7 @@ sfc_tso_ip4_get_ipid(const uint8_t *pkt_hdrp, size_t ip_hdr_off)
uint16_t ipid;
ip_hdrp = (const struct rte_ipv4_hdr *)(pkt_hdrp + ip_hdr_off);
- rte_memcpy(&ipid, &ip_hdrp->packet_id, sizeof(ipid));
+ memcpy(&ipid, &ip_hdrp->packet_id, sizeof(ipid));
return rte_be_to_cpu_16(ipid);
}
@@ -46,9 +46,8 @@ sfc_tso_outer_udp_fix_len(const struct rte_mbuf *m, uint8_t *tsoh)
rte_be16_t len = rte_cpu_to_be_16(m->l2_len + m->l3_len + m->l4_len +
m->tso_segsz);
- rte_memcpy(tsoh + m->outer_l2_len + m->outer_l3_len +
- offsetof(struct rte_udp_hdr, dgram_len),
- &len, sizeof(len));
+ memcpy(tsoh + m->outer_l2_len + m->outer_l3_len + offsetof(struct rte_udp_hdr, dgram_len),
+ &len, sizeof(len));
}
static inline void
@@ -67,7 +66,7 @@ sfc_tso_innermost_ip_fix_len(const struct rte_mbuf *m, uint8_t *tsoh,
len = rte_cpu_to_be_16(ip_payload_len);
}
- rte_memcpy(tsoh + iph_ofst + field_ofst, &len, sizeof(len));
+ memcpy(tsoh + iph_ofst + field_ofst, &len, sizeof(len));
}
unsigned int sfc_tso_prepare_header(uint8_t *tsoh, size_t header_len,
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 20/71] net/tap: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (18 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 19/71] net/sfc: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 21/71] net/txgbe: " Stephen Hemminger
` (56 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/tap/rte_eth_tap.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 69d9da695bed..518619c53b4a 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -1404,11 +1404,11 @@ tap_mac_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)
mac_addr))
mode = LOCAL_AND_REMOTE;
ifr.ifr_hwaddr.sa_family = AF_LOCAL;
- rte_memcpy(ifr.ifr_hwaddr.sa_data, mac_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(ifr.ifr_hwaddr.sa_data, mac_addr, RTE_ETHER_ADDR_LEN);
ret = tap_ioctl(pmd, SIOCSIFHWADDR, &ifr, 1, mode);
if (ret < 0)
return ret;
- rte_memcpy(&pmd->eth_addr, mac_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(&pmd->eth_addr, mac_addr, RTE_ETHER_ADDR_LEN);
if (pmd->remote_if_index && !pmd->flow_isolate) {
/* Replace MAC redirection rule after a MAC change */
ret = tap_flow_implicit_destroy(pmd, TAP_REMOTE_LOCAL_MAC);
@@ -2010,7 +2010,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
if (rte_is_zero_ether_addr(mac_addr))
rte_eth_random_addr((uint8_t *)&pmd->eth_addr);
else
- rte_memcpy(&pmd->eth_addr, mac_addr, sizeof(*mac_addr));
+ memcpy(&pmd->eth_addr, mac_addr, sizeof(*mac_addr));
}
/*
@@ -2033,8 +2033,8 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
if (pmd->type == ETH_TUNTAP_TYPE_TAP) {
memset(&ifr, 0, sizeof(struct ifreq));
ifr.ifr_hwaddr.sa_family = AF_LOCAL;
- rte_memcpy(ifr.ifr_hwaddr.sa_data, &pmd->eth_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(ifr.ifr_hwaddr.sa_data, &pmd->eth_addr,
+ RTE_ETHER_ADDR_LEN);
if (tap_ioctl(pmd, SIOCSIFHWADDR, &ifr, 0, LOCAL_ONLY) < 0)
goto error_exit;
}
@@ -2091,8 +2091,8 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
pmd->name, pmd->remote_iface);
goto error_remote;
}
- rte_memcpy(&pmd->eth_addr, ifr.ifr_hwaddr.sa_data,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&pmd->eth_addr, ifr.ifr_hwaddr.sa_data,
+ RTE_ETHER_ADDR_LEN);
/* The desired MAC is already in ifreq after SIOCGIFHWADDR. */
if (tap_ioctl(pmd, SIOCSIFHWADDR, &ifr, 0, LOCAL_ONLY) < 0) {
TAP_LOG(ERR, "%s: failed to get %s MAC address.",
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 21/71] net/txgbe: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (19 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 20/71] net/tap: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 22/71] raw/ifpga: " Stephen Hemminger
` (55 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jiawen Wu, Jian Wang
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/txgbe/txgbe_ethdev.c | 9 ++---
drivers/net/txgbe/txgbe_fdir.c | 6 +--
drivers/net/txgbe/txgbe_flow.c | 65 ++++++++++++++------------------
drivers/net/txgbe/txgbe_ipsec.c | 8 ++--
drivers/net/txgbe/txgbe_pf.c | 4 +-
drivers/net/txgbe/txgbe_tm.c | 11 +++---
6 files changed, 46 insertions(+), 57 deletions(-)
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index b75e8898e2d4..1c42fd74b47d 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -4304,9 +4304,8 @@ txgbe_add_del_ntuple_filter(struct rte_eth_dev *dev,
sizeof(struct txgbe_5tuple_filter), 0);
if (filter == NULL)
return -ENOMEM;
- rte_memcpy(&filter->filter_info,
- &filter_5tuple,
- sizeof(struct txgbe_5tuple_filter_info));
+ memcpy(&filter->filter_info, &filter_5tuple,
+ sizeof(struct txgbe_5tuple_filter_info));
filter->queue = ntuple_filter->queue;
ret = txgbe_add_5tuple_filter(dev, filter);
if (ret < 0) {
@@ -5109,9 +5108,7 @@ txgbe_dev_l2_tunnel_filter_add(struct rte_eth_dev *dev,
if (!node)
return -ENOMEM;
- rte_memcpy(&node->key,
- &key,
- sizeof(struct txgbe_l2_tn_key));
+ memcpy(&node->key, &key, sizeof(struct txgbe_l2_tn_key));
node->pool = l2_tunnel->pool;
ret = txgbe_insert_l2_tn_filter(l2_tn_info, node);
if (ret < 0) {
diff --git a/drivers/net/txgbe/txgbe_fdir.c b/drivers/net/txgbe/txgbe_fdir.c
index a198b6781bad..00366ed87323 100644
--- a/drivers/net/txgbe/txgbe_fdir.c
+++ b/drivers/net/txgbe/txgbe_fdir.c
@@ -42,7 +42,7 @@
else \
ipv6_addr[i] = 0; \
} \
- rte_memcpy((ipaddr), ipv6_addr, sizeof(ipv6_addr));\
+ memcpy((ipaddr), ipv6_addr, sizeof(ipv6_addr));\
} while (0)
/**
@@ -858,8 +858,8 @@ txgbe_fdir_filter_program(struct rte_eth_dev *dev,
sizeof(struct txgbe_fdir_filter), 0);
if (!node)
return -ENOMEM;
- rte_memcpy(&node->input, &rule->input,
- sizeof(struct txgbe_atr_input));
+ memcpy(&node->input, &rule->input,
+ sizeof(struct txgbe_atr_input));
node->fdirflags = rule->fdirflags;
node->fdirhash = fdirhash;
node->queue = queue;
diff --git a/drivers/net/txgbe/txgbe_flow.c b/drivers/net/txgbe/txgbe_flow.c
index 7ef52d0b0fcd..c76fc0eed0e0 100644
--- a/drivers/net/txgbe/txgbe_flow.c
+++ b/drivers/net/txgbe/txgbe_flow.c
@@ -1834,10 +1834,10 @@ txgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev __rte_unused,
if (item->spec) {
rule->b_spec = TRUE;
ipv6_spec = item->spec;
- rte_memcpy(rule->input.src_ip,
- ipv6_spec->hdr.src_addr, 16);
- rte_memcpy(rule->input.dst_ip,
- ipv6_spec->hdr.dst_addr, 16);
+ memcpy(rule->input.src_ip, ipv6_spec->hdr.src_addr,
+ 16);
+ memcpy(rule->input.dst_ip, ipv6_spec->hdr.dst_addr,
+ 16);
}
/**
@@ -2756,9 +2756,9 @@ txgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&ntuple_filter_ptr->filter_info,
- &ntuple_filter,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter_ptr->filter_info,
+ &ntuple_filter,
+ sizeof(struct rte_eth_ntuple_filter));
TAILQ_INSERT_TAIL(&filter_ntuple_list,
ntuple_filter_ptr, entries);
flow->rule = ntuple_filter_ptr;
@@ -2782,9 +2782,9 @@ txgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(ðertype_filter_ptr->filter_info,
- ðertype_filter,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter_ptr->filter_info,
+ ðertype_filter,
+ sizeof(struct rte_eth_ethertype_filter));
TAILQ_INSERT_TAIL(&filter_ethertype_list,
ethertype_filter_ptr, entries);
flow->rule = ethertype_filter_ptr;
@@ -2806,9 +2806,8 @@ txgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&syn_filter_ptr->filter_info,
- &syn_filter,
- sizeof(struct rte_eth_syn_filter));
+ memcpy(&syn_filter_ptr->filter_info, &syn_filter,
+ sizeof(struct rte_eth_syn_filter));
TAILQ_INSERT_TAIL(&filter_syn_list,
syn_filter_ptr,
entries);
@@ -2827,9 +2826,8 @@ txgbe_flow_create(struct rte_eth_dev *dev,
if (fdir_rule.b_mask) {
if (!fdir_info->mask_added) {
/* It's the first time the mask is set. */
- rte_memcpy(&fdir_info->mask,
- &fdir_rule.mask,
- sizeof(struct txgbe_hw_fdir_mask));
+ memcpy(&fdir_info->mask, &fdir_rule.mask,
+ sizeof(struct txgbe_hw_fdir_mask));
fdir_info->flex_bytes_offset =
fdir_rule.flex_bytes_offset;
@@ -2873,9 +2871,9 @@ txgbe_flow_create(struct rte_eth_dev *dev,
"failed to allocate memory");
goto out;
}
- rte_memcpy(&fdir_rule_ptr->filter_info,
- &fdir_rule,
- sizeof(struct txgbe_fdir_rule));
+ memcpy(&fdir_rule_ptr->filter_info,
+ &fdir_rule,
+ sizeof(struct txgbe_fdir_rule));
TAILQ_INSERT_TAIL(&filter_fdir_list,
fdir_rule_ptr, entries);
flow->rule = fdir_rule_ptr;
@@ -2910,9 +2908,8 @@ txgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&l2_tn_filter_ptr->filter_info,
- &l2_tn_filter,
- sizeof(struct txgbe_l2_tunnel_conf));
+ memcpy(&l2_tn_filter_ptr->filter_info, &l2_tn_filter,
+ sizeof(struct txgbe_l2_tunnel_conf));
TAILQ_INSERT_TAIL(&filter_l2_tunnel_list,
l2_tn_filter_ptr, entries);
flow->rule = l2_tn_filter_ptr;
@@ -3038,9 +3035,8 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_NTUPLE:
ntuple_filter_ptr = (struct txgbe_ntuple_filter_ele *)
pmd_flow->rule;
- rte_memcpy(&ntuple_filter,
- &ntuple_filter_ptr->filter_info,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter, &ntuple_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ntuple_filter));
ret = txgbe_add_del_ntuple_filter(dev, &ntuple_filter, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_ntuple_list,
@@ -3051,9 +3047,8 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_ETHERTYPE:
ethertype_filter_ptr = (struct txgbe_ethertype_filter_ele *)
pmd_flow->rule;
- rte_memcpy(ðertype_filter,
- ðertype_filter_ptr->filter_info,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter, ðertype_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ethertype_filter));
ret = txgbe_add_del_ethertype_filter(dev,
ðertype_filter, FALSE);
if (!ret) {
@@ -3065,9 +3060,8 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_SYN:
syn_filter_ptr = (struct txgbe_eth_syn_filter_ele *)
pmd_flow->rule;
- rte_memcpy(&syn_filter,
- &syn_filter_ptr->filter_info,
- sizeof(struct rte_eth_syn_filter));
+ memcpy(&syn_filter, &syn_filter_ptr->filter_info,
+ sizeof(struct rte_eth_syn_filter));
ret = txgbe_syn_filter_set(dev, &syn_filter, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_syn_list,
@@ -3077,9 +3071,8 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
break;
case RTE_ETH_FILTER_FDIR:
fdir_rule_ptr = (struct txgbe_fdir_rule_ele *)pmd_flow->rule;
- rte_memcpy(&fdir_rule,
- &fdir_rule_ptr->filter_info,
- sizeof(struct txgbe_fdir_rule));
+ memcpy(&fdir_rule, &fdir_rule_ptr->filter_info,
+ sizeof(struct txgbe_fdir_rule));
ret = txgbe_fdir_filter_program(dev, &fdir_rule, TRUE, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_fdir_list,
@@ -3092,8 +3085,8 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_L2_TUNNEL:
l2_tn_filter_ptr = (struct txgbe_eth_l2_tunnel_conf_ele *)
pmd_flow->rule;
- rte_memcpy(&l2_tn_filter, &l2_tn_filter_ptr->filter_info,
- sizeof(struct txgbe_l2_tunnel_conf));
+ memcpy(&l2_tn_filter, &l2_tn_filter_ptr->filter_info,
+ sizeof(struct txgbe_l2_tunnel_conf));
ret = txgbe_dev_l2_tunnel_filter_del(dev, &l2_tn_filter);
if (!ret) {
TAILQ_REMOVE(&filter_l2_tunnel_list,
diff --git a/drivers/net/txgbe/txgbe_ipsec.c b/drivers/net/txgbe/txgbe_ipsec.c
index f9f8108fb894..000dd5ec6d39 100644
--- a/drivers/net/txgbe/txgbe_ipsec.c
+++ b/drivers/net/txgbe/txgbe_ipsec.c
@@ -658,10 +658,10 @@ txgbe_crypto_add_ingress_sa_from_flow(const void *sess,
const struct rte_flow_item_ipv6 *ipv6 = ip_spec;
ic_session->src_ip.type = IPv6;
ic_session->dst_ip.type = IPv6;
- rte_memcpy(ic_session->src_ip.ipv6,
- ipv6->hdr.src_addr, 16);
- rte_memcpy(ic_session->dst_ip.ipv6,
- ipv6->hdr.dst_addr, 16);
+ memcpy(ic_session->src_ip.ipv6, ipv6->hdr.src_addr,
+ 16);
+ memcpy(ic_session->dst_ip.ipv6, ipv6->hdr.dst_addr,
+ 16);
} else {
const struct rte_flow_item_ipv4 *ipv4 = ip_spec;
ic_session->src_ip.type = IPv4;
diff --git a/drivers/net/txgbe/txgbe_pf.c b/drivers/net/txgbe/txgbe_pf.c
index 176f79005cde..a0f5a67d9c78 100644
--- a/drivers/net/txgbe/txgbe_pf.c
+++ b/drivers/net/txgbe/txgbe_pf.c
@@ -435,7 +435,7 @@ txgbe_vf_reset(struct rte_eth_dev *eth_dev, uint16_t vf, uint32_t *msgbuf)
/* reply to reset with ack and vf mac address */
msgbuf[0] = TXGBE_VF_RESET | TXGBE_VT_MSGTYPE_ACK;
- rte_memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
+ memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
/*
* Piggyback the multicast filter type so VF can compute the
* correct vectors
@@ -457,7 +457,7 @@ txgbe_vf_set_mac_addr(struct rte_eth_dev *eth_dev,
struct rte_ether_addr *ea = (struct rte_ether_addr *)new_mac;
if (rte_is_valid_assigned_ether_addr(ea)) {
- rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
+ memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
return hw->mac.set_rar(hw, rar_entry, new_mac, vf, true);
}
return -1;
diff --git a/drivers/net/txgbe/txgbe_tm.c b/drivers/net/txgbe/txgbe_tm.c
index 3171be73d05d..7d77b01dfef2 100644
--- a/drivers/net/txgbe/txgbe_tm.c
+++ b/drivers/net/txgbe/txgbe_tm.c
@@ -280,8 +280,8 @@ txgbe_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&tm_conf->shaper_profile_list,
shaper_profile, node);
@@ -625,8 +625,8 @@ txgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->no = 0;
tm_node->parent = NULL;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
tm_conf->root = tm_node;
/* increase the reference counter of the shaper profile */
@@ -706,8 +706,7 @@ txgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->reference_count = 0;
tm_node->parent = parent_node;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
if (parent_node_type == TXGBE_TM_NODE_TYPE_PORT) {
tm_node->no = parent_node->reference_count;
TAILQ_INSERT_TAIL(&tm_conf->tc_list,
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 22/71] raw/ifpga: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (20 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 21/71] net/txgbe: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 23/71] raw/skeleton: " Stephen Hemminger
` (54 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Rosen Xu
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/raw/ifpga/afu_pmd_he_hssi.c | 2 +-
drivers/raw/ifpga/afu_pmd_he_lpbk.c | 2 +-
drivers/raw/ifpga/afu_pmd_he_mem.c | 2 +-
drivers/raw/ifpga/afu_pmd_n3000.c | 8 ++++----
drivers/raw/ifpga/ifpga_rawdev.c | 10 +++++-----
5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/raw/ifpga/afu_pmd_he_hssi.c b/drivers/raw/ifpga/afu_pmd_he_hssi.c
index 859f28dcc1f0..1ff4b3f9d12a 100644
--- a/drivers/raw/ifpga/afu_pmd_he_hssi.c
+++ b/drivers/raw/ifpga/afu_pmd_he_hssi.c
@@ -314,7 +314,7 @@ static int he_hssi_config(struct afu_rawdev *dev, void *config,
if (cfg->port >= NUM_HE_HSSI_PORTS)
return -EINVAL;
- rte_memcpy(&priv->he_hssi_cfg, cfg, sizeof(priv->he_hssi_cfg));
+ memcpy(&priv->he_hssi_cfg, cfg, sizeof(priv->he_hssi_cfg));
return 0;
}
diff --git a/drivers/raw/ifpga/afu_pmd_he_lpbk.c b/drivers/raw/ifpga/afu_pmd_he_lpbk.c
index c7c5cda48c35..69644281774a 100644
--- a/drivers/raw/ifpga/afu_pmd_he_lpbk.c
+++ b/drivers/raw/ifpga/afu_pmd_he_lpbk.c
@@ -363,7 +363,7 @@ static int he_lpbk_config(struct afu_rawdev *dev, void *config,
if ((cfg->end < cfg->begin) || (cfg->end > MAX_CACHE_LINES))
return -EINVAL;
- rte_memcpy(&priv->he_lpbk_cfg, cfg, sizeof(priv->he_lpbk_cfg));
+ memcpy(&priv->he_lpbk_cfg, cfg, sizeof(priv->he_lpbk_cfg));
return 0;
}
diff --git a/drivers/raw/ifpga/afu_pmd_he_mem.c b/drivers/raw/ifpga/afu_pmd_he_mem.c
index a1db533eeb93..2332a33213c1 100644
--- a/drivers/raw/ifpga/afu_pmd_he_mem.c
+++ b/drivers/raw/ifpga/afu_pmd_he_mem.c
@@ -126,7 +126,7 @@ static int he_mem_tg_config(struct afu_rawdev *dev, void *config,
if (config_size != sizeof(struct rte_pmd_afu_he_mem_tg_cfg))
return -EINVAL;
- rte_memcpy(&priv->he_mem_tg_cfg, config, sizeof(priv->he_mem_tg_cfg));
+ memcpy(&priv->he_mem_tg_cfg, config, sizeof(priv->he_mem_tg_cfg));
return 0;
}
diff --git a/drivers/raw/ifpga/afu_pmd_n3000.c b/drivers/raw/ifpga/afu_pmd_n3000.c
index 67b394126595..9236c0b15371 100644
--- a/drivers/raw/ifpga/afu_pmd_n3000.c
+++ b/drivers/raw/ifpga/afu_pmd_n3000.c
@@ -1867,8 +1867,8 @@ static int n3000_afu_config(struct afu_rawdev *dev, void *config,
if ((cfg->nlb_cfg.end < cfg->nlb_cfg.begin) ||
(cfg->nlb_cfg.end > MAX_CACHE_LINES))
return -EINVAL;
- rte_memcpy(&priv->nlb_cfg, &cfg->nlb_cfg,
- sizeof(struct rte_pmd_afu_nlb_cfg));
+ memcpy(&priv->nlb_cfg, &cfg->nlb_cfg,
+ sizeof(struct rte_pmd_afu_nlb_cfg));
} else if (cfg->type == RTE_PMD_AFU_N3000_DMA) {
if (cfg->dma_cfg.index >= NUM_N3000_DMA)
return -EINVAL;
@@ -1887,8 +1887,8 @@ static int n3000_afu_config(struct afu_rawdev *dev, void *config,
cfg->dma_cfg.length);
}
}
- rte_memcpy(&priv->dma_cfg, &cfg->dma_cfg,
- sizeof(struct rte_pmd_afu_dma_cfg));
+ memcpy(&priv->dma_cfg, &cfg->dma_cfg,
+ sizeof(struct rte_pmd_afu_dma_cfg));
} else {
IFPGA_RAWDEV_PMD_ERR("Invalid type of N3000 AFU");
return -EINVAL;
diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index f89bd3f9e2c3..61b82c781b7d 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -258,7 +258,7 @@ static int ifpga_rawdev_fill_info(struct ifpga_rawdev *ifpga_dev)
if (point < 12)
return -1;
point -= 12;
- rte_memcpy(ifpga_dev->parent_bdf, &link[point], 12);
+ memcpy(ifpga_dev->parent_bdf, &link[point], 12);
point = strlen(link1);
if (point < 26)
@@ -948,10 +948,10 @@ ifpga_rawdev_pr(struct rte_rawdev *dev,
if (ret)
return ret;
- rte_memcpy(&afu_pr_conf->afu_id.uuid.uuid_low, uuid.b,
- sizeof(u64));
- rte_memcpy(&afu_pr_conf->afu_id.uuid.uuid_high, uuid.b + 8,
- sizeof(u64));
+ memcpy(&afu_pr_conf->afu_id.uuid.uuid_low, uuid.b,
+ sizeof(u64));
+ memcpy(&afu_pr_conf->afu_id.uuid.uuid_high, uuid.b + 8,
+ sizeof(u64));
IFPGA_RAWDEV_PMD_INFO("%s: uuid_l=0x%lx, uuid_h=0x%lx\n",
__func__,
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 23/71] raw/skeleton: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (21 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 22/71] raw/ifpga: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 24/71] net/hns3: " Stephen Hemminger
` (53 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Sachin Saxena, Hemant Agrawal
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/raw/skeleton/skeleton_rawdev.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
index 6e99d35536d7..967b3964f24a 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.c
+++ b/drivers/raw/skeleton/skeleton_rawdev.c
@@ -245,8 +245,8 @@ static int skeleton_rawdev_queue_def_conf(struct rte_rawdev *dev,
skelq = &skeldev->queues[queue_id];
if (queue_id < SKELETON_MAX_QUEUES)
- rte_memcpy(queue_conf, skelq,
- sizeof(struct skeleton_rawdev_queue));
+ memcpy(queue_conf, skelq,
+ sizeof(struct skeleton_rawdev_queue));
return 0;
}
@@ -281,8 +281,7 @@ static int skeleton_rawdev_queue_setup(struct rte_rawdev *dev,
if (skeldev->num_queues > queue_id &&
q->depth < SKELETON_QUEUE_MAX_DEPTH) {
- rte_memcpy(q, queue_conf,
- sizeof(struct skeleton_rawdev_queue));
+ memcpy(q, queue_conf, sizeof(struct skeleton_rawdev_queue));
clear_queue_bufs(queue_id);
} else {
SKELETON_PMD_ERR("Invalid queue configuration");
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 24/71] net/hns3: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (22 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 23/71] raw/skeleton: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 25/71] net/i40e: " Stephen Hemminger
` (52 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jie Hai, Yisen Zhuang
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/hns3/hns3_fdir.c | 2 +-
drivers/net/hns3/hns3_flow.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
index d100e58d102b..332cbb847be3 100644
--- a/drivers/net/hns3/hns3_fdir.c
+++ b/drivers/net/hns3/hns3_fdir.c
@@ -996,7 +996,7 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns,
return -ENOMEM;
}
- rte_memcpy(&node->fdir_conf, rule, sizeof(struct hns3_fdir_rule));
+ memcpy(&node->fdir_conf, rule, sizeof(struct hns3_fdir_rule));
ret = hns3_insert_fdir_filter(hw, fdir_info, node);
if (ret < 0) {
rte_free(node);
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 7fbe65313ca2..96b91bed6b18 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -2416,8 +2416,8 @@ hns3_flow_query(struct rte_eth_dev *dev, struct rte_flow *flow,
}
rss_conf = (struct rte_flow_action_rss *)data;
rss_rule = (struct hns3_rss_conf_ele *)flow->rule;
- rte_memcpy(rss_conf, &rss_rule->filter_info.conf,
- sizeof(struct rte_flow_action_rss));
+ memcpy(rss_conf, &rss_rule->filter_info.conf,
+ sizeof(struct rte_flow_action_rss));
break;
default:
return rte_flow_error_set(error, ENOTSUP,
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 25/71] net/i40e: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (23 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 24/71] net/hns3: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 26/71] net/iavf: " Stephen Hemminger
` (51 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Yuying Zhang
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/i40e/i40e_ethdev.c | 108 ++++++++++++++------------------
drivers/net/i40e/i40e_fdir.c | 28 ++++-----
drivers/net/i40e/i40e_flow.c | 56 ++++++++---------
drivers/net/i40e/i40e_pf.c | 2 +-
drivers/net/i40e/i40e_tm.c | 11 ++--
drivers/net/i40e/rte_pmd_i40e.c | 34 +++++-----
6 files changed, 108 insertions(+), 131 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4d21341382d8..7ed394862ffa 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -4310,7 +4310,7 @@ i40e_macaddr_add(struct rte_eth_dev *dev,
return -EINVAL;
}
- rte_memcpy(&mac_filter.mac_addr, mac_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(&mac_filter.mac_addr, mac_addr, RTE_ETHER_ADDR_LEN);
if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_VLAN_FILTER)
mac_filter.filter_type = I40E_MACVLAN_PERFECT_MATCH;
else
@@ -5195,7 +5195,7 @@ i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi,
vsi->info.valid_sections =
rte_cpu_to_le_16(I40E_AQ_VSI_PROP_VLAN_VALID);
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
hw = I40E_VSI_TO_HW(vsi);
@@ -5234,8 +5234,8 @@ i40e_vsi_update_tc_bandwidth(struct i40e_vsi *vsi, uint8_t enabled_tcmap)
return ret;
}
- rte_memcpy(vsi->info.qs_handle, tc_bw_data.qs_handles,
- sizeof(vsi->info.qs_handle));
+ memcpy(vsi->info.qs_handle, tc_bw_data.qs_handles,
+ sizeof(vsi->info.qs_handle));
return I40E_SUCCESS;
}
@@ -5492,8 +5492,7 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi)
if (vsi->type != I40E_VSI_MAIN)
return I40E_ERR_CONFIG;
memset(&def_filter, 0, sizeof(def_filter));
- rte_memcpy(def_filter.mac_addr, hw->mac.perm_addr,
- ETH_ADDR_LEN);
+ memcpy(def_filter.mac_addr, hw->mac.perm_addr, ETH_ADDR_LEN);
def_filter.vlan_tag = 0;
def_filter.flags = I40E_AQC_MACVLAN_DEL_PERFECT_MATCH |
I40E_AQC_MACVLAN_DEL_IGNORE_VLAN;
@@ -5511,16 +5510,15 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi)
return I40E_ERR_NO_MEMORY;
}
mac = &f->mac_info.mac_addr;
- rte_memcpy(&mac->addr_bytes, hw->mac.perm_addr,
- ETH_ADDR_LEN);
+ memcpy(&mac->addr_bytes, hw->mac.perm_addr, ETH_ADDR_LEN);
f->mac_info.filter_type = I40E_MACVLAN_PERFECT_MATCH;
TAILQ_INSERT_TAIL(&vsi->mac_list, f, next);
vsi->mac_num++;
return ret;
}
- rte_memcpy(&filter.mac_addr,
- (struct rte_ether_addr *)(hw->mac.perm_addr), ETH_ADDR_LEN);
+ memcpy(&filter.mac_addr, (struct rte_ether_addr *)(hw->mac.perm_addr),
+ ETH_ADDR_LEN);
filter.filter_type = I40E_MACVLAN_PERFECT_MATCH;
return i40e_vsi_add_mac(vsi, &filter);
}
@@ -5839,8 +5837,8 @@ i40e_vsi_setup(struct i40e_pf *pf,
PMD_DRV_LOG(ERR, "Failed to get VSI params");
goto fail_msix_alloc;
}
- rte_memcpy(&vsi->info, &ctxt.info,
- sizeof(struct i40e_aqc_vsi_properties_data));
+ memcpy(&vsi->info, &ctxt.info,
+ sizeof(struct i40e_aqc_vsi_properties_data));
vsi->vsi_id = ctxt.vsi_number;
vsi->info.valid_sections = 0;
@@ -5857,8 +5855,8 @@ i40e_vsi_setup(struct i40e_pf *pf,
rte_cpu_to_le_16(I40E_AQ_VSI_PROP_VLAN_VALID);
vsi->info.port_vlan_flags = I40E_AQ_VSI_PVLAN_MODE_ALL |
I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH;
- rte_memcpy(&ctxt.info, &vsi->info,
- sizeof(struct i40e_aqc_vsi_properties_data));
+ memcpy(&ctxt.info, &vsi->info,
+ sizeof(struct i40e_aqc_vsi_properties_data));
ret = i40e_vsi_config_tc_queue_mapping(vsi, &ctxt.info,
I40E_DEFAULT_TCMAP);
if (ret != I40E_SUCCESS) {
@@ -5878,16 +5876,15 @@ i40e_vsi_setup(struct i40e_pf *pf,
goto fail_msix_alloc;
}
- rte_memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
- sizeof(vsi->info.tc_mapping));
- rte_memcpy(&vsi->info.queue_mapping,
- &ctxt.info.queue_mapping,
- sizeof(vsi->info.queue_mapping));
+ memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
+ sizeof(vsi->info.tc_mapping));
+ memcpy(&vsi->info.queue_mapping, &ctxt.info.queue_mapping,
+ sizeof(vsi->info.queue_mapping));
vsi->info.mapping_flags = ctxt.info.mapping_flags;
vsi->info.valid_sections = 0;
- rte_memcpy(pf->dev_addr.addr_bytes, hw->mac.perm_addr,
- ETH_ADDR_LEN);
+ memcpy(pf->dev_addr.addr_bytes, hw->mac.perm_addr,
+ ETH_ADDR_LEN);
/**
* Updating default filter settings are necessary to prevent
@@ -6030,7 +6027,7 @@ i40e_vsi_setup(struct i40e_pf *pf,
if (vsi->type != I40E_VSI_FDIR) {
/* MAC/VLAN configuration for non-FDIR VSI*/
- rte_memcpy(&filter.mac_addr, &broadcast, RTE_ETHER_ADDR_LEN);
+ memcpy(&filter.mac_addr, &broadcast, RTE_ETHER_ADDR_LEN);
filter.filter_type = I40E_MACVLAN_PERFECT_MATCH;
ret = i40e_vsi_add_mac(vsi, &filter);
@@ -6143,7 +6140,7 @@ i40e_vsi_config_vlan_stripping(struct i40e_vsi *vsi, bool on)
vsi->info.port_vlan_flags &= ~(I40E_AQ_VSI_PVLAN_EMOD_MASK);
vsi->info.port_vlan_flags |= vlan_flags;
ctxt.seid = vsi->seid;
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL);
if (ret)
PMD_DRV_LOG(INFO, "Update VSI failed to %s vlan stripping",
@@ -7010,8 +7007,8 @@ i40e_add_macvlan_filters(struct i40e_vsi *vsi,
memset(req_list, 0, ele_buff_size);
for (i = 0; i < actual_num; i++) {
- rte_memcpy(req_list[i].mac_addr,
- &filter[num + i].macaddr, ETH_ADDR_LEN);
+ memcpy(req_list[i].mac_addr, &filter[num + i].macaddr,
+ ETH_ADDR_LEN);
req_list[i].vlan_tag =
rte_cpu_to_le_16(filter[num + i].vlan_id);
@@ -7086,8 +7083,8 @@ i40e_remove_macvlan_filters(struct i40e_vsi *vsi,
memset(req_list, 0, ele_buff_size);
for (i = 0; i < actual_num; i++) {
- rte_memcpy(req_list[i].mac_addr,
- &filter[num + i].macaddr, ETH_ADDR_LEN);
+ memcpy(req_list[i].mac_addr, &filter[num + i].macaddr,
+ ETH_ADDR_LEN);
req_list[i].vlan_tag =
rte_cpu_to_le_16(filter[num + i].vlan_id);
@@ -7243,8 +7240,8 @@ i40e_find_all_vlan_for_mac(struct i40e_vsi *vsi,
"vlan number doesn't match");
return I40E_ERR_PARAM;
}
- rte_memcpy(&mv_f[i].macaddr,
- addr, ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, addr,
+ ETH_ADDR_LEN);
mv_f[i].vlan_id =
j * I40E_UINT32_BIT_SIZE + k;
i++;
@@ -7272,8 +7269,7 @@ i40e_find_all_mac_for_vlan(struct i40e_vsi *vsi,
PMD_DRV_LOG(ERR, "buffer number not match");
return I40E_ERR_PARAM;
}
- rte_memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr, ETH_ADDR_LEN);
mv_f[i].vlan_id = vlan;
mv_f[i].filter_type = f->mac_info.filter_type;
i++;
@@ -7308,8 +7304,8 @@ i40e_vsi_remove_all_macvlan_filter(struct i40e_vsi *vsi)
i = 0;
if (vsi->vlan_num == 0) {
TAILQ_FOREACH(f, &vsi->mac_list, next) {
- rte_memcpy(&mv_f[i].macaddr,
- &f->mac_info.mac_addr, ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr,
+ ETH_ADDR_LEN);
mv_f[i].filter_type = f->mac_info.filter_type;
mv_f[i].vlan_id = 0;
i++;
@@ -7478,8 +7474,7 @@ i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter)
for (i = 0; i < vlan_num; i++) {
mv_f[i].filter_type = mac_filter->filter_type;
- rte_memcpy(&mv_f[i].macaddr, &mac_filter->mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &mac_filter->mac_addr, ETH_ADDR_LEN);
}
if (mac_filter->filter_type == I40E_MACVLAN_PERFECT_MATCH ||
@@ -7501,8 +7496,7 @@ i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter)
ret = I40E_ERR_NO_MEMORY;
goto DONE;
}
- rte_memcpy(&f->mac_info.mac_addr, &mac_filter->mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&f->mac_info.mac_addr, &mac_filter->mac_addr, ETH_ADDR_LEN);
f->mac_info.filter_type = mac_filter->filter_type;
TAILQ_INSERT_TAIL(&vsi->mac_list, f, next);
vsi->mac_num++;
@@ -7548,8 +7542,7 @@ i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct rte_ether_addr *addr)
for (i = 0; i < vlan_num; i++) {
mv_f[i].filter_type = filter_type;
- rte_memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr, ETH_ADDR_LEN);
}
if (filter_type == I40E_MACVLAN_PERFECT_MATCH ||
filter_type == I40E_MACVLAN_HASH_MATCH) {
@@ -7835,9 +7828,8 @@ i40e_tunnel_filter_convert(
tunnel_filter->input.flags = cld_filter->element.flags;
tunnel_filter->input.tenant_id = cld_filter->element.tenant_id;
tunnel_filter->queue = cld_filter->element.queue_number;
- rte_memcpy(tunnel_filter->input.general_fields,
- cld_filter->general_fields,
- sizeof(cld_filter->general_fields));
+ memcpy(tunnel_filter->input.general_fields,
+ cld_filter->general_fields, sizeof(cld_filter->general_fields));
return 0;
}
@@ -8384,9 +8376,8 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf,
ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV4;
ipv4_addr = rte_be_to_cpu_32(tunnel_filter->ip_addr.ipv4_addr);
ipv4_addr_le = rte_cpu_to_le_32(ipv4_addr);
- rte_memcpy(&pfilter->element.ipaddr.v4.data,
- &ipv4_addr_le,
- sizeof(pfilter->element.ipaddr.v4.data));
+ memcpy(&pfilter->element.ipaddr.v4.data, &ipv4_addr_le,
+ sizeof(pfilter->element.ipaddr.v4.data));
} else {
ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV6;
for (i = 0; i < 4; i++) {
@@ -8394,9 +8385,8 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf,
rte_cpu_to_le_32(rte_be_to_cpu_32(
tunnel_filter->ip_addr.ipv6_addr[i]));
}
- rte_memcpy(&pfilter->element.ipaddr.v6.data,
- &convert_ipv6,
- sizeof(pfilter->element.ipaddr.v6.data));
+ memcpy(&pfilter->element.ipaddr.v6.data, &convert_ipv6,
+ sizeof(pfilter->element.ipaddr.v6.data));
}
/* check tunneled type */
@@ -8641,7 +8631,7 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf,
return -ENOMEM;
}
- rte_memcpy(tunnel, &check_filter, sizeof(check_filter));
+ memcpy(tunnel, &check_filter, sizeof(check_filter));
ret = i40e_sw_tunnel_filter_insert(pf, tunnel);
if (ret < 0)
rte_free(tunnel);
@@ -9766,8 +9756,7 @@ static int
i40e_ethertype_filter_convert(const struct rte_eth_ethertype_filter *input,
struct i40e_ethertype_filter *filter)
{
- rte_memcpy(&filter->input.mac_addr, &input->mac_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&filter->input.mac_addr, &input->mac_addr, RTE_ETHER_ADDR_LEN);
filter->input.ether_type = input->ether_type;
filter->flags = input->flags;
filter->queue = input->queue;
@@ -9914,8 +9903,7 @@ i40e_ethertype_filter_set(struct i40e_pf *pf,
return -ENOMEM;
}
- rte_memcpy(ethertype_filter, &check_filter,
- sizeof(check_filter));
+ memcpy(ethertype_filter, &check_filter, sizeof(check_filter));
ret = i40e_sw_ethertype_filter_insert(pf, ethertype_filter);
if (ret < 0)
rte_free(ethertype_filter);
@@ -10795,11 +10783,10 @@ i40e_vsi_config_tc(struct i40e_vsi *vsi, uint8_t tc_map)
goto out;
}
/* update the local VSI info with updated queue map */
- rte_memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
- sizeof(vsi->info.tc_mapping));
- rte_memcpy(&vsi->info.queue_mapping,
- &ctxt.info.queue_mapping,
- sizeof(vsi->info.queue_mapping));
+ memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
+ sizeof(vsi->info.tc_mapping));
+ memcpy(&vsi->info.queue_mapping, &ctxt.info.queue_mapping,
+ sizeof(vsi->info.queue_mapping));
vsi->info.mapping_flags = ctxt.info.mapping_flags;
vsi->info.valid_sections = 0;
@@ -11551,9 +11538,8 @@ i40e_tunnel_filter_restore(struct i40e_pf *pf)
cld_filter.element.flags = f->input.flags;
cld_filter.element.tenant_id = f->input.tenant_id;
cld_filter.element.queue_number = f->queue;
- rte_memcpy(cld_filter.general_fields,
- f->input.general_fields,
- sizeof(f->input.general_fields));
+ memcpy(cld_filter.general_fields, f->input.general_fields,
+ sizeof(f->input.general_fields));
if (((f->input.flags &
I40E_AQC_ADD_CLOUD_FILTER_0X11) ==
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 47f79ecf11cc..554b763e9f84 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -464,10 +464,10 @@ fill_ip6_head(const struct i40e_fdir_input *fdir_input, unsigned char *raw_pkt,
* need to be presented in a reversed order with respect
* to the expected received packets.
*/
- rte_memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip,
- IPV6_ADDR_LEN);
- rte_memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,
- IPV6_ADDR_LEN);
+ memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip,
+ IPV6_ADDR_LEN);
+ memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,
+ IPV6_ADDR_LEN);
len += sizeof(struct rte_ipv6_hdr);
return len;
@@ -528,18 +528,16 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
[I40E_FILTER_PCTYPE_NONF_IPV6_OTHER] = IPPROTO_NONE,
};
- rte_memcpy(raw_pkt, &fdir_input->flow.l2_flow.dst,
- sizeof(struct rte_ether_addr));
- rte_memcpy(raw_pkt + sizeof(struct rte_ether_addr),
- &fdir_input->flow.l2_flow.src,
- sizeof(struct rte_ether_addr));
+ memcpy(raw_pkt, &fdir_input->flow.l2_flow.dst,
+ sizeof(struct rte_ether_addr));
+ memcpy(raw_pkt + sizeof(struct rte_ether_addr),
+ &fdir_input->flow.l2_flow.src, sizeof(struct rte_ether_addr));
raw_pkt += 2 * sizeof(struct rte_ether_addr);
if (vlan && fdir_input->flow_ext.vlan_tci) {
- rte_memcpy(raw_pkt, vlan_frame, sizeof(vlan_frame));
- rte_memcpy(raw_pkt + sizeof(uint16_t),
- &fdir_input->flow_ext.vlan_tci,
- sizeof(uint16_t));
+ memcpy(raw_pkt, vlan_frame, sizeof(vlan_frame));
+ memcpy(raw_pkt + sizeof(uint16_t),
+ &fdir_input->flow_ext.vlan_tci, sizeof(uint16_t));
raw_pkt += sizeof(vlan_frame);
len += sizeof(vlan_frame);
}
@@ -1003,7 +1001,7 @@ static int
i40e_fdir_filter_convert(const struct i40e_fdir_filter_conf *input,
struct i40e_fdir_filter *filter)
{
- rte_memcpy(&filter->fdir, input, sizeof(struct i40e_fdir_filter_conf));
+ memcpy(&filter->fdir, input, sizeof(struct i40e_fdir_filter_conf));
if (input->input.flow_ext.pkt_template) {
filter->fdir.input.flow.raw_flow.packet = NULL;
filter->fdir.input.flow.raw_flow.length =
@@ -1060,7 +1058,7 @@ i40e_sw_fdir_filter_insert(struct i40e_pf *pf, struct i40e_fdir_filter *filter)
return -1;
hash_filter = &fdir_info->fdir_filter_array[ret];
- rte_memcpy(hash_filter, filter, sizeof(*filter));
+ memcpy(hash_filter, filter, sizeof(*filter));
fdir_info->hash_map[ret] = hash_filter;
TAILQ_INSERT_TAIL(&fdir_info->fdir_list, hash_filter, rules);
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 92165c8422d5..9afb7a540d21 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -1175,7 +1175,7 @@ i40e_pattern_skip_void_item(struct rte_flow_item *items,
pb = pe + 1;
}
/* Copy the END item. */
- rte_memcpy(items, pe, sizeof(struct rte_flow_item));
+ memcpy(items, pe, sizeof(struct rte_flow_item));
}
/* Check if the pattern matches a supported item type array */
@@ -1986,10 +1986,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
filter->input.flow_ext.oip_type =
I40E_FDIR_IPTYPE_IPV6;
- rte_memcpy(filter->input.flow.ipv6_flow.src_ip,
- ipv6_spec->hdr.src_addr, 16);
- rte_memcpy(filter->input.flow.ipv6_flow.dst_ip,
- ipv6_spec->hdr.dst_addr, 16);
+ memcpy(filter->input.flow.ipv6_flow.src_ip,
+ ipv6_spec->hdr.src_addr, 16);
+ memcpy(filter->input.flow.ipv6_flow.dst_ip,
+ ipv6_spec->hdr.dst_addr, 16);
/* Check if it is fragment. */
if (ipv6_spec->hdr.proto ==
@@ -2926,14 +2926,14 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev,
}
if (!vxlan_flag) {
- rte_memcpy(&filter->outer_mac,
- ð_spec->hdr.dst_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&filter->outer_mac,
+ ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
filter_type |= RTE_ETH_TUNNEL_FILTER_OMAC;
} else {
- rte_memcpy(&filter->inner_mac,
- ð_spec->hdr.dst_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&filter->inner_mac,
+ ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
filter_type |= RTE_ETH_TUNNEL_FILTER_IMAC;
}
}
@@ -3026,8 +3026,8 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev,
return -rte_errno;
}
- rte_memcpy(((uint8_t *)&tenant_id_be + 1),
- vxlan_spec->hdr.vni, 3);
+ memcpy(((uint8_t *)&tenant_id_be + 1),
+ vxlan_spec->hdr.vni, 3);
filter->tenant_id =
rte_be_to_cpu_32(tenant_id_be);
filter_type |= RTE_ETH_TUNNEL_FILTER_TENID;
@@ -3156,14 +3156,14 @@ i40e_flow_parse_nvgre_pattern(__rte_unused struct rte_eth_dev *dev,
}
if (!nvgre_flag) {
- rte_memcpy(&filter->outer_mac,
- ð_spec->hdr.dst_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&filter->outer_mac,
+ ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
filter_type |= RTE_ETH_TUNNEL_FILTER_OMAC;
} else {
- rte_memcpy(&filter->inner_mac,
- ð_spec->hdr.dst_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&filter->inner_mac,
+ ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
filter_type |= RTE_ETH_TUNNEL_FILTER_IMAC;
}
}
@@ -3278,8 +3278,8 @@ i40e_flow_parse_nvgre_pattern(__rte_unused struct rte_eth_dev *dev,
"Invalid NVGRE item");
return -rte_errno;
}
- rte_memcpy(((uint8_t *)&tenant_id_be + 1),
- nvgre_spec->tni, 3);
+ memcpy(((uint8_t *)&tenant_id_be + 1),
+ nvgre_spec->tni, 3);
filter->tenant_id =
rte_be_to_cpu_32(tenant_id_be);
filter_type |= RTE_ETH_TUNNEL_FILTER_TENID;
@@ -3447,8 +3447,8 @@ i40e_flow_parse_mpls_pattern(__rte_unused struct rte_eth_dev *dev,
"Invalid MPLS label mask");
return -rte_errno;
}
- rte_memcpy(((uint8_t *)&label_be + 1),
- mpls_spec->label_tc_s, 3);
+ memcpy(((uint8_t *)&label_be + 1),
+ mpls_spec->label_tc_s, 3);
filter->tenant_id = rte_be_to_cpu_32(label_be) >> 4;
break;
default:
@@ -4051,9 +4051,8 @@ i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
cld_filter.element.flags = filter->input.flags;
cld_filter.element.tenant_id = filter->input.tenant_id;
cld_filter.element.queue_number = filter->queue;
- rte_memcpy(cld_filter.general_fields,
- filter->input.general_fields,
- sizeof(cld_filter.general_fields));
+ memcpy(cld_filter.general_fields, filter->input.general_fields,
+ sizeof(cld_filter.general_fields));
if (!filter->is_to_vf)
vsi = pf->main_vsi;
@@ -4271,9 +4270,8 @@ i40e_flow_query(struct rte_eth_dev *dev __rte_unused,
"action not supported");
return -rte_errno;
}
- rte_memcpy(rss_conf,
- &rss_rule->rss_filter_info.conf,
- sizeof(struct rte_flow_action_rss));
+ memcpy(rss_conf, &rss_rule->rss_filter_info.conf,
+ sizeof(struct rte_flow_action_rss));
break;
default:
return rte_flow_error_set(error, ENOTSUP,
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index 15d9ff868f3a..9a33afade3d3 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -869,7 +869,7 @@ i40e_pf_host_process_cmd_add_ether_address(struct i40e_pf_vf *vf,
for (i = 0; i < addr_list->num_elements; i++) {
mac = (struct rte_ether_addr *)(addr_list->list[i].addr);
- rte_memcpy(&filter.mac_addr, mac, RTE_ETHER_ADDR_LEN);
+ memcpy(&filter.mac_addr, mac, RTE_ETHER_ADDR_LEN);
filter.filter_type = I40E_MACVLAN_PERFECT_MATCH;
if (rte_is_zero_ether_addr(mac) ||
i40e_vsi_add_mac(vf->vsi, &filter)) {
diff --git a/drivers/net/i40e/i40e_tm.c b/drivers/net/i40e/i40e_tm.c
index cab296e1a4af..3f77a7b3a056 100644
--- a/drivers/net/i40e/i40e_tm.c
+++ b/drivers/net/i40e/i40e_tm.c
@@ -279,8 +279,8 @@ i40e_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&pf->tm_conf.shaper_profile_list,
shaper_profile, node);
@@ -526,8 +526,8 @@ i40e_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->reference_count = 0;
tm_node->parent = NULL;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
pf->tm_conf.root = tm_node;
/* increase the reference counter of the shaper profile */
@@ -600,8 +600,7 @@ i40e_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->reference_count = 0;
tm_node->parent = parent_node;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
if (parent_node_type == I40E_TM_NODE_TYPE_PORT) {
TAILQ_INSERT_TAIL(&pf->tm_conf.tc_list,
tm_node, node);
diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index 9d39984ea1fc..03d0b61902a9 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -90,7 +90,7 @@ rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on)
vsi->info.sec_flags &= ~I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK;
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
hw = I40E_VSI_TO_HW(vsi);
@@ -192,7 +192,7 @@ rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on)
vsi->info.sec_flags &= ~I40E_AQ_VSI_SEC_FLAG_ENABLE_VLAN_CHK;
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
hw = I40E_VSI_TO_HW(vsi);
@@ -237,9 +237,8 @@ i40e_vsi_rm_mac_filter(struct i40e_vsi *vsi)
for (i = 0; i < vlan_num; i++) {
mv_f[i].filter_type = filter_type;
- rte_memcpy(&mv_f[i].macaddr,
- &f->mac_info.mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr,
+ ETH_ADDR_LEN);
}
if (filter_type == I40E_MACVLAN_PERFECT_MATCH ||
filter_type == I40E_MACVLAN_HASH_MATCH) {
@@ -298,9 +297,8 @@ i40e_vsi_restore_mac_filter(struct i40e_vsi *vsi)
for (i = 0; i < vlan_num; i++) {
mv_f[i].filter_type = f->mac_info.filter_type;
- rte_memcpy(&mv_f[i].macaddr,
- &f->mac_info.mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr,
+ ETH_ADDR_LEN);
}
if (f->mac_info.filter_type == I40E_MACVLAN_PERFECT_MATCH ||
@@ -380,7 +378,7 @@ i40e_vsi_set_tx_loopback(struct i40e_vsi *vsi, uint8_t on)
vsi->info.switch_id &= ~I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB;
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL);
@@ -705,7 +703,7 @@ int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id,
vsi->info.port_vlan_flags &= ~I40E_AQ_VSI_PVLAN_INSERT_PVID;
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
hw = I40E_VSI_TO_HW(vsi);
@@ -767,7 +765,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id,
}
if (on) {
- rte_memcpy(&filter.mac_addr, &broadcast, RTE_ETHER_ADDR_LEN);
+ memcpy(&filter.mac_addr, &broadcast, RTE_ETHER_ADDR_LEN);
filter.filter_type = I40E_MACVLAN_PERFECT_MATCH;
ret = i40e_vsi_add_mac(vsi, &filter);
} else {
@@ -839,7 +837,7 @@ int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on)
}
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
hw = I40E_VSI_TO_HW(vsi);
@@ -2586,11 +2584,10 @@ i40e_vsi_update_queue_region_mapping(struct i40e_hw *hw,
return ret;
}
/* update the local VSI info with updated queue map */
- rte_memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
- sizeof(vsi->info.tc_mapping));
- rte_memcpy(&vsi->info.queue_mapping,
- &ctxt.info.queue_mapping,
- sizeof(vsi->info.queue_mapping));
+ memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
+ sizeof(vsi->info.tc_mapping));
+ memcpy(&vsi->info.queue_mapping, &ctxt.info.queue_mapping,
+ sizeof(vsi->info.queue_mapping));
vsi->info.mapping_flags = ctxt.info.mapping_flags;
vsi->info.valid_sections = 0;
@@ -2961,8 +2958,7 @@ i40e_queue_region_get_all_info(struct i40e_pf *pf,
{
struct i40e_queue_regions *info = &pf->queue_region;
- rte_memcpy(regions_ptr, info,
- sizeof(struct i40e_queue_regions));
+ memcpy(regions_ptr, info, sizeof(struct i40e_queue_regions));
return 0;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 26/71] net/iavf: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (24 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 25/71] net/i40e: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 27/71] net/ice: " Stephen Hemminger
` (50 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jingjing Wu
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/iavf/iavf_fdir.c | 93 +++++++++++++---------------
drivers/net/iavf/iavf_fsub.c | 50 +++++++--------
drivers/net/iavf/iavf_generic_flow.c | 2 +-
drivers/net/iavf/iavf_tm.c | 11 ++--
drivers/net/iavf/iavf_vchnl.c | 9 ++-
5 files changed, 77 insertions(+), 88 deletions(-)
diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c
index 811a10287b70..35257c43f135 100644
--- a/drivers/net/iavf/iavf_fdir.c
+++ b/drivers/net/iavf/iavf_fdir.c
@@ -374,7 +374,7 @@ iavf_fdir_create(struct iavf_adapter *ad,
if (filter->mark_flag == 1)
iavf_fdir_rx_proc_enable(ad, 1);
- rte_memcpy(rule, filter, sizeof(*rule));
+ memcpy(rule, filter, sizeof(*rule));
flow->rule = rule;
return 0;
@@ -672,15 +672,13 @@ iavf_fdir_refine_input_set(const uint64_t input_set,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV4, PROT);
memset(&ipv4_spec, 0, sizeof(ipv4_spec));
ipv4_spec.hdr.next_proto_id = proto_id;
- rte_memcpy(hdr->buffer, &ipv4_spec.hdr,
- sizeof(ipv4_spec.hdr));
+ memcpy(hdr->buffer, &ipv4_spec.hdr, sizeof(ipv4_spec.hdr));
return true;
case VIRTCHNL_PROTO_HDR_IPV6:
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV6, PROT);
memset(&ipv6_spec, 0, sizeof(ipv6_spec));
ipv6_spec.hdr.proto = proto_id;
- rte_memcpy(hdr->buffer, &ipv6_spec.hdr,
- sizeof(ipv6_spec.hdr));
+ memcpy(hdr->buffer, &ipv6_spec.hdr, sizeof(ipv6_spec.hdr));
return true;
default:
return false;
@@ -885,8 +883,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
ETHERTYPE);
}
- rte_memcpy(hdr1->buffer, eth_spec,
- sizeof(struct rte_ether_hdr));
+ memcpy(hdr1->buffer, eth_spec,
+ sizeof(struct rte_ether_hdr));
}
hdrs->count = ++layer;
@@ -976,8 +974,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
input_set |= IAVF_PROT_IPV4_INNER;
}
- rte_memcpy(hdr->buffer, &ipv4_spec->hdr,
- sizeof(ipv4_spec->hdr));
+ memcpy(hdr->buffer, &ipv4_spec->hdr,
+ sizeof(ipv4_spec->hdr));
hdrs->count = ++layer;
@@ -1066,8 +1064,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
input_set |= IAVF_PROT_IPV6_INNER;
}
- rte_memcpy(hdr->buffer, &ipv6_spec->hdr,
- sizeof(ipv6_spec->hdr));
+ memcpy(hdr->buffer, &ipv6_spec->hdr,
+ sizeof(ipv6_spec->hdr));
hdrs->count = ++layer;
break;
@@ -1101,8 +1099,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1, ETH,
ETHERTYPE);
- rte_memcpy(hdr->buffer, &ipv6_frag_spec->hdr,
- sizeof(ipv6_frag_spec->hdr));
+ memcpy(hdr->buffer, &ipv6_frag_spec->hdr,
+ sizeof(ipv6_frag_spec->hdr));
} else if (ipv6_frag_mask->hdr.id == UINT32_MAX) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
@@ -1153,13 +1151,11 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
}
if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
- rte_memcpy(hdr->buffer,
- &udp_spec->hdr,
- sizeof(udp_spec->hdr));
+ memcpy(hdr->buffer, &udp_spec->hdr,
+ sizeof(udp_spec->hdr));
else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
- rte_memcpy(hdr->buffer,
- &udp_spec->hdr,
- sizeof(udp_spec->hdr));
+ memcpy(hdr->buffer, &udp_spec->hdr,
+ sizeof(udp_spec->hdr));
}
hdrs->count = ++layer;
@@ -1210,13 +1206,11 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
}
if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
- rte_memcpy(hdr->buffer,
- &tcp_spec->hdr,
- sizeof(tcp_spec->hdr));
+ memcpy(hdr->buffer, &tcp_spec->hdr,
+ sizeof(tcp_spec->hdr));
else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
- rte_memcpy(hdr->buffer,
- &tcp_spec->hdr,
- sizeof(tcp_spec->hdr));
+ memcpy(hdr->buffer, &tcp_spec->hdr,
+ sizeof(tcp_spec->hdr));
}
hdrs->count = ++layer;
@@ -1256,13 +1250,11 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
}
if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
- rte_memcpy(hdr->buffer,
- &sctp_spec->hdr,
- sizeof(sctp_spec->hdr));
+ memcpy(hdr->buffer, &sctp_spec->hdr,
+ sizeof(sctp_spec->hdr));
else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
- rte_memcpy(hdr->buffer,
- &sctp_spec->hdr,
- sizeof(sctp_spec->hdr));
+ memcpy(hdr->buffer, &sctp_spec->hdr,
+ sizeof(sctp_spec->hdr));
}
hdrs->count = ++layer;
@@ -1291,8 +1283,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, GTPU_IP, TEID);
}
- rte_memcpy(hdr->buffer,
- gtp_spec, sizeof(*gtp_spec));
+ memcpy(hdr->buffer, gtp_spec,
+ sizeof(*gtp_spec));
}
tun_inner = 1;
@@ -1346,8 +1338,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
psc.qfi = gtp_psc_spec->hdr.qfi;
psc.type = gtp_psc_spec->hdr.type;
psc.next = 0;
- rte_memcpy(hdr->buffer, &psc,
- sizeof(struct iavf_gtp_psc_spec_hdr));
+ memcpy(hdr->buffer, &psc,
+ sizeof(struct iavf_gtp_psc_spec_hdr));
}
hdrs->count = ++layer;
@@ -1367,8 +1359,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, L2TPV3, SESS_ID);
}
- rte_memcpy(hdr->buffer, l2tpv3oip_spec,
- sizeof(*l2tpv3oip_spec));
+ memcpy(hdr->buffer, l2tpv3oip_spec,
+ sizeof(*l2tpv3oip_spec));
}
hdrs->count = ++layer;
@@ -1388,8 +1380,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, ESP, SPI);
}
- rte_memcpy(hdr->buffer, &esp_spec->hdr,
- sizeof(esp_spec->hdr));
+ memcpy(hdr->buffer, &esp_spec->hdr,
+ sizeof(esp_spec->hdr));
}
hdrs->count = ++layer;
@@ -1409,8 +1401,7 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, AH, SPI);
}
- rte_memcpy(hdr->buffer, ah_spec,
- sizeof(*ah_spec));
+ memcpy(hdr->buffer, ah_spec, sizeof(*ah_spec));
}
hdrs->count = ++layer;
@@ -1430,8 +1421,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, PFCP, S_FIELD);
}
- rte_memcpy(hdr->buffer, pfcp_spec,
- sizeof(*pfcp_spec));
+ memcpy(hdr->buffer, pfcp_spec,
+ sizeof(*pfcp_spec));
}
hdrs->count = ++layer;
@@ -1455,8 +1446,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
PC_RTC_ID);
}
- rte_memcpy(hdr->buffer, ecpri_spec,
- sizeof(*ecpri_spec));
+ memcpy(hdr->buffer, ecpri_spec,
+ sizeof(*ecpri_spec));
}
hdrs->count = ++layer;
@@ -1471,8 +1462,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, GRE);
if (gre_spec && gre_mask) {
- rte_memcpy(hdr->buffer, gre_spec,
- sizeof(*gre_spec));
+ memcpy(hdr->buffer, gre_spec,
+ sizeof(*gre_spec));
}
tun_inner = 1;
@@ -1520,8 +1511,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
SESS_ID);
}
- rte_memcpy(hdr->buffer, l2tpv2_spec,
- sizeof(*l2tpv2_spec));
+ memcpy(hdr->buffer, l2tpv2_spec,
+ sizeof(*l2tpv2_spec));
}
tun_inner = 1;
@@ -1538,8 +1529,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, PPP);
if (ppp_spec && ppp_mask) {
- rte_memcpy(hdr->buffer, ppp_spec,
- sizeof(*ppp_spec));
+ memcpy(hdr->buffer, ppp_spec,
+ sizeof(*ppp_spec));
}
hdrs->count = ++layer;
diff --git a/drivers/net/iavf/iavf_fsub.c b/drivers/net/iavf/iavf_fsub.c
index 74e1e7099b8c..d98cde0fa59d 100644
--- a/drivers/net/iavf/iavf_fsub.c
+++ b/drivers/net/iavf/iavf_fsub.c
@@ -92,7 +92,7 @@ iavf_fsub_create(struct iavf_adapter *ad, struct rte_flow *flow,
goto free_entry;
}
- rte_memcpy(rule, filter, sizeof(*rule));
+ memcpy(rule, filter, sizeof(*rule));
flow->rule = rule;
rte_free(meta);
@@ -272,10 +272,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
input_set_byte += 2;
}
- rte_memcpy(hdr1->buffer_spec, eth_spec,
- sizeof(struct rte_ether_hdr));
- rte_memcpy(hdr1->buffer_mask, eth_mask,
- sizeof(struct rte_ether_hdr));
+ memcpy(hdr1->buffer_spec, eth_spec,
+ sizeof(struct rte_ether_hdr));
+ memcpy(hdr1->buffer_mask, eth_mask,
+ sizeof(struct rte_ether_hdr));
} else {
/* flow subscribe filter will add dst mac in kernel */
input_set_byte += 6;
@@ -325,10 +325,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
input_set_byte++;
}
- rte_memcpy(hdr->buffer_spec, &ipv4_spec->hdr,
- sizeof(ipv4_spec->hdr));
- rte_memcpy(hdr->buffer_mask, &ipv4_mask->hdr,
- sizeof(ipv4_spec->hdr));
+ memcpy(hdr->buffer_spec, &ipv4_spec->hdr,
+ sizeof(ipv4_spec->hdr));
+ memcpy(hdr->buffer_mask, &ipv4_mask->hdr,
+ sizeof(ipv4_spec->hdr));
}
hdrs->count = ++layer;
@@ -388,10 +388,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
input_set_byte += 4;
}
- rte_memcpy(hdr->buffer_spec, &ipv6_spec->hdr,
- sizeof(ipv6_spec->hdr));
- rte_memcpy(hdr->buffer_mask, &ipv6_mask->hdr,
- sizeof(ipv6_spec->hdr));
+ memcpy(hdr->buffer_spec, &ipv6_spec->hdr,
+ sizeof(ipv6_spec->hdr));
+ memcpy(hdr->buffer_mask, &ipv6_mask->hdr,
+ sizeof(ipv6_spec->hdr));
}
hdrs->count = ++layer;
@@ -425,10 +425,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
input_set_byte += 2;
}
- rte_memcpy(hdr->buffer_spec, &udp_spec->hdr,
- sizeof(udp_spec->hdr));
- rte_memcpy(hdr->buffer_mask, &udp_mask->hdr,
- sizeof(udp_mask->hdr));
+ memcpy(hdr->buffer_spec, &udp_spec->hdr,
+ sizeof(udp_spec->hdr));
+ memcpy(hdr->buffer_mask, &udp_mask->hdr,
+ sizeof(udp_mask->hdr));
}
hdrs->count = ++layer;
@@ -466,10 +466,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
input_set_byte += 2;
}
- rte_memcpy(hdr->buffer_spec, &tcp_spec->hdr,
- sizeof(tcp_spec->hdr));
- rte_memcpy(hdr->buffer_mask, &tcp_mask->hdr,
- sizeof(tcp_mask->hdr));
+ memcpy(hdr->buffer_spec, &tcp_spec->hdr,
+ sizeof(tcp_spec->hdr));
+ memcpy(hdr->buffer_mask, &tcp_mask->hdr,
+ sizeof(tcp_mask->hdr));
}
hdrs->count = ++layer;
@@ -498,10 +498,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
return -rte_errno;
}
- rte_memcpy(hdr->buffer_spec, &vlan_spec->hdr,
- sizeof(vlan_spec->hdr));
- rte_memcpy(hdr->buffer_mask, &vlan_mask->hdr,
- sizeof(vlan_mask->hdr));
+ memcpy(hdr->buffer_spec, &vlan_spec->hdr,
+ sizeof(vlan_spec->hdr));
+ memcpy(hdr->buffer_mask, &vlan_mask->hdr,
+ sizeof(vlan_mask->hdr));
}
hdrs->count = ++layer;
diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c
index 6f6e95fc453f..0bcfb5bf242b 100644
--- a/drivers/net/iavf/iavf_generic_flow.c
+++ b/drivers/net/iavf/iavf_generic_flow.c
@@ -2019,7 +2019,7 @@ iavf_pattern_skip_void_item(struct rte_flow_item *items,
pb = pe + 1;
}
/* Copy the END item. */
- rte_memcpy(items, pe, sizeof(struct rte_flow_item));
+ memcpy(items, pe, sizeof(struct rte_flow_item));
}
/* Check if the pattern matches a supported item type array */
diff --git a/drivers/net/iavf/iavf_tm.c b/drivers/net/iavf/iavf_tm.c
index 32bb3be45e1b..a6ad6bb0a28d 100644
--- a/drivers/net/iavf/iavf_tm.c
+++ b/drivers/net/iavf/iavf_tm.c
@@ -342,8 +342,8 @@ iavf_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->id = node_id;
tm_node->parent = NULL;
tm_node->reference_count = 0;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
vf->tm_conf.root = tm_node;
return 0;
}
@@ -403,8 +403,7 @@ iavf_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->reference_count = 0;
tm_node->parent = parent_node;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
if (parent_node_type == IAVF_TM_NODE_TYPE_PORT) {
TAILQ_INSERT_TAIL(&vf->tm_conf.tc_list,
tm_node, node);
@@ -543,8 +542,8 @@ iavf_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&vf->tm_conf.shaper_profile_list,
shaper_profile, node);
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 1111d30f57d1..711186c1b552 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -920,7 +920,7 @@ iavf_get_vlan_offload_caps_v2(struct iavf_adapter *adapter)
return ret;
}
- rte_memcpy(&vf->vlan_v2_caps, vf->aq_resp, sizeof(vf->vlan_v2_caps));
+ memcpy(&vf->vlan_v2_caps, vf->aq_resp, sizeof(vf->vlan_v2_caps));
return 0;
}
@@ -1427,8 +1427,8 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add)
addr = &adapter->dev_data->mac_addrs[i];
if (rte_is_zero_ether_addr(addr))
continue;
- rte_memcpy(list->list[j].addr, addr->addr_bytes,
- sizeof(addr->addr_bytes));
+ memcpy(list->list[j].addr, addr->addr_bytes,
+ sizeof(addr->addr_bytes));
list->list[j].type = (j == 0 ?
VIRTCHNL_ETHER_ADDR_PRIMARY :
VIRTCHNL_ETHER_ADDR_EXTRA);
@@ -1547,8 +1547,7 @@ iavf_add_del_eth_addr(struct iavf_adapter *adapter, struct rte_ether_addr *addr,
list->vsi_id = vf->vsi_res->vsi_id;
list->num_elements = 1;
list->list[0].type = type;
- rte_memcpy(list->list[0].addr, addr->addr_bytes,
- sizeof(addr->addr_bytes));
+ memcpy(list->list[0].addr, addr->addr_bytes, sizeof(addr->addr_bytes));
args.ops = add ? VIRTCHNL_OP_ADD_ETH_ADDR : VIRTCHNL_OP_DEL_ETH_ADDR;
args.in_args = cmd_buffer;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 27/71] net/ice: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (25 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 26/71] net/iavf: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 28/71] net/idpf: " Stephen Hemminger
` (49 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/ice/ice_dcf.c | 5 ++--
drivers/net/ice/ice_dcf_parent.c | 2 +-
drivers/net/ice/ice_dcf_sched.c | 11 ++++-----
drivers/net/ice/ice_diagnose.c | 4 ++--
drivers/net/ice/ice_ethdev.c | 14 +++++------
drivers/net/ice/ice_fdir_filter.c | 37 +++++++++++++++---------------
drivers/net/ice/ice_generic_flow.c | 2 +-
drivers/net/ice/ice_hash.c | 2 +-
drivers/net/ice/ice_tm.c | 11 ++++-----
9 files changed, 43 insertions(+), 45 deletions(-)
diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c
index 7f8f5163acef..42e5b30b2b5e 100644
--- a/drivers/net/ice/ice_dcf.c
+++ b/drivers/net/ice/ice_dcf.c
@@ -731,7 +731,7 @@ dcf_get_vlan_offload_caps_v2(struct ice_dcf_hw *hw)
return ret;
}
- rte_memcpy(&hw->vlan_v2_caps, &vlan_v2_caps, sizeof(vlan_v2_caps));
+ memcpy(&hw->vlan_v2_caps, &vlan_v2_caps, sizeof(vlan_v2_caps));
return 0;
}
@@ -1407,8 +1407,7 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw,
return -ENOMEM;
}
- rte_memcpy(list->list[0].addr, addr->addr_bytes,
- sizeof(addr->addr_bytes));
+ memcpy(list->list[0].addr, addr->addr_bytes, sizeof(addr->addr_bytes));
PMD_DRV_LOG(DEBUG, "add/rm mac:" RTE_ETHER_ADDR_PRT_FMT,
RTE_ETHER_ADDR_BYTES(addr));
diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c
index 6e845f458acd..0c53755c9d04 100644
--- a/drivers/net/ice/ice_dcf_parent.c
+++ b/drivers/net/ice/ice_dcf_parent.c
@@ -407,7 +407,7 @@ ice_dcf_load_pkg(struct ice_adapter *adapter)
use_dsn = ice_dcf_execute_virtchnl_cmd(&dcf_adapter->real_hw, &vc_cmd) == 0;
if (use_dsn)
- rte_memcpy(&dsn, pkg_info.dsn, sizeof(dsn));
+ memcpy(&dsn, pkg_info.dsn, sizeof(dsn));
return ice_load_pkg(adapter, use_dsn, dsn);
}
diff --git a/drivers/net/ice/ice_dcf_sched.c b/drivers/net/ice/ice_dcf_sched.c
index b08bc5f1dee0..465ae75d5c97 100644
--- a/drivers/net/ice/ice_dcf_sched.c
+++ b/drivers/net/ice/ice_dcf_sched.c
@@ -308,8 +308,8 @@ ice_dcf_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->id = node_id;
tm_node->parent = NULL;
tm_node->reference_count = 0;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
hw->tm_conf.root = tm_node;
return 0;
@@ -373,8 +373,7 @@ ice_dcf_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->shaper_profile = shaper_profile;
tm_node->reference_count = 0;
tm_node->parent = parent_node;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
if (parent_node_type == ICE_DCF_TM_NODE_TYPE_PORT) {
TAILQ_INSERT_TAIL(&hw->tm_conf.tc_list,
tm_node, node);
@@ -520,8 +519,8 @@ ice_dcf_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&hw->tm_conf.shaper_profile_list,
shaper_profile, node);
diff --git a/drivers/net/ice/ice_diagnose.c b/drivers/net/ice/ice_diagnose.c
index 3be819d7f8f4..c22f71e48efa 100644
--- a/drivers/net/ice/ice_diagnose.c
+++ b/drivers/net/ice/ice_diagnose.c
@@ -362,13 +362,13 @@ ice_dump_pkg(struct rte_eth_dev *dev, uint8_t **buff, uint32_t *size)
count = *size / ICE_PKG_BUF_SIZE;
for (i = 0; i < count; i++) {
next_buff = (uint8_t *)(*buff) + i * ICE_PKG_BUF_SIZE;
- rte_memcpy(pkg_buff.buf, next_buff, ICE_PKG_BUF_SIZE);
+ memcpy(pkg_buff.buf, next_buff, ICE_PKG_BUF_SIZE);
if (ice_aq_upload_section(hw,
(struct ice_buf_hdr *)&pkg_buff.buf[0],
ICE_PKG_BUF_SIZE,
NULL))
return -EINVAL;
- rte_memcpy(next_buff, pkg_buff.buf, ICE_PKG_BUF_SIZE);
+ memcpy(next_buff, pkg_buff.buf, ICE_PKG_BUF_SIZE);
}
cache_size = sizeof(struct ice_package_header) + *size;
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index f07b236ad4b6..93e364811d2e 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -3387,11 +3387,11 @@ static int ice_init_rss(struct ice_pf *pf)
RTE_MIN(rss_conf->rss_key_len,
vsi->rss_key_size));
- rte_memcpy(key.standard_rss_key, vsi->rss_key,
- ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE);
- rte_memcpy(key.extended_hash_key,
- &vsi->rss_key[ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE],
- ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE);
+ memcpy(key.standard_rss_key, vsi->rss_key,
+ ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE);
+ memcpy(key.extended_hash_key,
+ &vsi->rss_key[ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE],
+ ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE);
ret = ice_aq_set_rss_key(hw, vsi->idx, &key);
if (ret)
goto out;
@@ -4483,7 +4483,7 @@ ice_vsi_config_vlan_filter(struct ice_vsi *vsi, bool on)
vsi->info.sw_flags2 &= ~sw_flags2;
vsi->info.sw_id = hw->port_info->sw_id;
- (void)rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.info.valid_sections =
rte_cpu_to_le_16(ICE_AQ_VSI_PROP_SW_VALID |
ICE_AQ_VSI_PROP_SECURITY_VALID);
@@ -5301,7 +5301,7 @@ ice_vsi_vlan_pvid_set(struct ice_vsi *vsi, struct ice_vsi_vlan_pvid_info *info)
ICE_AQ_VSI_INNER_VLAN_EMODE_M);
vsi->info.inner_vlan_flags |= vlan_flags;
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.info.valid_sections =
rte_cpu_to_le_16(ICE_AQ_VSI_PROP_VLAN_VALID);
ctxt.vsi_num = vsi->vsi_id;
diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 0b7920ad4475..de7b531aa023 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -1224,13 +1224,13 @@ ice_fdir_extract_fltr_key(struct ice_fdir_fltr_pattern *key,
memset(key, 0, sizeof(*key));
key->flow_type = input->flow_type;
- rte_memcpy(&key->ip, &input->ip, sizeof(key->ip));
- rte_memcpy(&key->mask, &input->mask, sizeof(key->mask));
- rte_memcpy(&key->ext_data, &input->ext_data, sizeof(key->ext_data));
- rte_memcpy(&key->ext_mask, &input->ext_mask, sizeof(key->ext_mask));
+ memcpy(&key->ip, &input->ip, sizeof(key->ip));
+ memcpy(&key->mask, &input->mask, sizeof(key->mask));
+ memcpy(&key->ext_data, &input->ext_data, sizeof(key->ext_data));
+ memcpy(&key->ext_mask, &input->ext_mask, sizeof(key->ext_mask));
- rte_memcpy(&key->gtpu_data, &input->gtpu_data, sizeof(key->gtpu_data));
- rte_memcpy(&key->gtpu_mask, &input->gtpu_mask, sizeof(key->gtpu_mask));
+ memcpy(&key->gtpu_data, &input->gtpu_data, sizeof(key->gtpu_data));
+ memcpy(&key->gtpu_mask, &input->gtpu_mask, sizeof(key->gtpu_mask));
key->tunnel_type = filter->tunnel_type;
}
@@ -1358,7 +1358,7 @@ ice_fdir_create_filter(struct ice_adapter *ad,
if (!entry)
goto error;
- rte_memcpy(entry, filter, sizeof(*filter));
+ memcpy(entry, filter, sizeof(*filter));
flow->rule = entry;
@@ -1419,7 +1419,7 @@ ice_fdir_create_filter(struct ice_adapter *ad,
if (filter->mark_flag == 1)
ice_fdir_rx_parsing_enable(ad, 1);
- rte_memcpy(entry, filter, sizeof(*entry));
+ memcpy(entry, filter, sizeof(*entry));
ret = ice_fdir_entry_insert(pf, entry, &key);
if (ret) {
rte_flow_error_set(error, -ret,
@@ -1720,8 +1720,8 @@ ice_fdir_parse_action(struct ice_adapter *ad,
act_count = actions->conf;
filter->input.cnt_ena = ICE_FXD_FLTR_QW0_STAT_ENA_PKTS;
- rte_memcpy(&filter->act_count, act_count,
- sizeof(filter->act_count));
+ memcpy(&filter->act_count, act_count,
+ sizeof(filter->act_count));
break;
default:
@@ -1978,12 +1978,13 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
p_ext_data = (tunnel_type && is_outer) ?
&filter->input.ext_data_outer :
&filter->input.ext_data;
- rte_memcpy(&p_ext_data->src_mac,
- ð_spec->hdr.src_addr, RTE_ETHER_ADDR_LEN);
- rte_memcpy(&p_ext_data->dst_mac,
- ð_spec->hdr.dst_addr, RTE_ETHER_ADDR_LEN);
- rte_memcpy(&p_ext_data->ether_type,
- ð_spec->hdr.ether_type, sizeof(eth_spec->hdr.ether_type));
+ memcpy(&p_ext_data->src_mac, ð_spec->hdr.src_addr,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(&p_ext_data->dst_mac, ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(&p_ext_data->ether_type,
+ ð_spec->hdr.ether_type,
+ sizeof(eth_spec->hdr.ether_type));
break;
case RTE_FLOW_ITEM_TYPE_IPV4:
flow_type = ICE_FLTR_PTYPE_NONF_IPV4_OTHER;
@@ -2108,8 +2109,8 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
if (ipv6_mask->hdr.hop_limits == UINT8_MAX)
*input_set |= ICE_INSET_IPV6_HOP_LIMIT;
- rte_memcpy(&p_v6->dst_ip, ipv6_spec->hdr.dst_addr, 16);
- rte_memcpy(&p_v6->src_ip, ipv6_spec->hdr.src_addr, 16);
+ memcpy(&p_v6->dst_ip, ipv6_spec->hdr.dst_addr, 16);
+ memcpy(&p_v6->src_ip, ipv6_spec->hdr.src_addr, 16);
vtc_flow_cpu = rte_be_to_cpu_32(ipv6_spec->hdr.vtc_flow);
p_v6->tc = (uint8_t)(vtc_flow_cpu >> ICE_FDIR_IPV6_TC_OFFSET);
p_v6->proto = ipv6_spec->hdr.proto;
diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c
index 50d760004f90..9e7de43575b9 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -1969,7 +1969,7 @@ ice_pattern_skip_void_item(struct rte_flow_item *items,
pb = pe + 1;
}
/* Copy the END item. */
- rte_memcpy(items, pe, sizeof(struct rte_flow_item));
+ memcpy(items, pe, sizeof(struct rte_flow_item));
}
/* Check if the pattern matches a supported item type array */
diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index f92364153376..80b44713a9d1 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -715,7 +715,7 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad,
pkt_len, ICE_BLK_RSS, true, &prof))
return -rte_errno;
- rte_memcpy(&meta->raw.prof, &prof, sizeof(prof));
+ memcpy(&meta->raw.prof, &prof, sizeof(prof));
rte_free(pkt_buf);
rte_free(msk_buf);
diff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c
index fbab0b8808b9..a8b20ef889fc 100644
--- a/drivers/net/ice/ice_tm.c
+++ b/drivers/net/ice/ice_tm.c
@@ -293,8 +293,8 @@ ice_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&pf->tm_conf.shaper_profile_list,
shaper_profile, node);
@@ -403,8 +403,8 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->shaper_profile = shaper_profile;
tm_node->children =
(void *)((uint8_t *)tm_node + sizeof(struct ice_tm_node));
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
pf->tm_conf.root = tm_node;
return 0;
}
@@ -480,8 +480,7 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,
PMD_DRV_LOG(WARNING, "weight != 1 not supported in level %d",
level_id);
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
tm_node->parent->reference_count++;
return 0;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 28/71] net/idpf: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (26 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 27/71] net/ice: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 29/71] net/ipn3ke: " Stephen Hemminger
` (48 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jingjing Wu
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/idpf/idpf_ethdev.c | 7 ++++---
drivers/net/idpf/idpf_rxtx.c | 10 ++++++----
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index 86151c9ec9fa..9cf33c4b7058 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -1088,8 +1088,8 @@ idpf_handle_virtchnl_msg(struct idpf_adapter_ext *adapter_ex)
return;
}
- rte_memcpy(adapter->mbx_resp, ctlq_msg.ctx.indirect.payload->va,
- IDPF_DFLT_MBX_BUF_SIZE);
+ memcpy(adapter->mbx_resp, ctlq_msg.ctx.indirect.payload->va,
+ IDPF_DFLT_MBX_BUF_SIZE);
mbx_op = rte_le_to_cpu_16(ctlq_msg.opcode);
vc_op = rte_le_to_cpu_32(ctlq_msg.cookie.mbx.chnl_opcode);
@@ -1202,7 +1202,8 @@ idpf_adapter_ext_init(struct rte_pci_device *pci_dev, struct idpf_adapter_ext *a
strncpy(adapter->name, pci_dev->device.name, PCI_PRI_STR_SIZE);
- rte_memcpy(&base->caps, &req_caps, sizeof(struct virtchnl2_get_capabilities));
+ memcpy(&base->caps, &req_caps,
+ sizeof(struct virtchnl2_get_capabilities));
ret = idpf_adapter_init(base);
if (ret != 0) {
diff --git a/drivers/net/idpf/idpf_rxtx.c b/drivers/net/idpf/idpf_rxtx.c
index 64f22355804e..da659e16531c 100644
--- a/drivers/net/idpf/idpf_rxtx.c
+++ b/drivers/net/idpf/idpf_rxtx.c
@@ -76,7 +76,7 @@ idpf_dma_zone_reserve(struct rte_eth_dev *dev, uint16_t queue_idx,
else
ring_size = RTE_ALIGN(len * sizeof(struct idpf_base_tx_desc),
IDPF_DMA_MEM_ALIGN);
- rte_memcpy(ring_name, "idpf Tx ring", sizeof("idpf Tx ring"));
+ memcpy(ring_name, "idpf Tx ring", sizeof("idpf Tx ring"));
break;
case VIRTCHNL2_QUEUE_TYPE_RX:
if (splitq)
@@ -85,17 +85,19 @@ idpf_dma_zone_reserve(struct rte_eth_dev *dev, uint16_t queue_idx,
else
ring_size = RTE_ALIGN(len * sizeof(struct virtchnl2_singleq_rx_buf_desc),
IDPF_DMA_MEM_ALIGN);
- rte_memcpy(ring_name, "idpf Rx ring", sizeof("idpf Rx ring"));
+ memcpy(ring_name, "idpf Rx ring", sizeof("idpf Rx ring"));
break;
case VIRTCHNL2_QUEUE_TYPE_TX_COMPLETION:
ring_size = RTE_ALIGN(len * sizeof(struct idpf_splitq_tx_compl_desc),
IDPF_DMA_MEM_ALIGN);
- rte_memcpy(ring_name, "idpf Tx compl ring", sizeof("idpf Tx compl ring"));
+ memcpy(ring_name, "idpf Tx compl ring",
+ sizeof("idpf Tx compl ring"));
break;
case VIRTCHNL2_QUEUE_TYPE_RX_BUFFER:
ring_size = RTE_ALIGN(len * sizeof(struct virtchnl2_splitq_rx_buf_desc),
IDPF_DMA_MEM_ALIGN);
- rte_memcpy(ring_name, "idpf Rx buf ring", sizeof("idpf Rx buf ring"));
+ memcpy(ring_name, "idpf Rx buf ring",
+ sizeof("idpf Rx buf ring"));
break;
default:
PMD_INIT_LOG(ERR, "Invalid queue type");
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 29/71] net/ipn3ke: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (27 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 28/71] net/idpf: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 30/71] net/ixgbe: " Stephen Hemminger
` (47 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Rosen Xu
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/ipn3ke/ipn3ke_flow.c | 32 ++++++++++++-------------
drivers/net/ipn3ke/ipn3ke_representor.c | 16 ++++++-------
drivers/net/ipn3ke/ipn3ke_tm.c | 6 ++---
3 files changed, 26 insertions(+), 28 deletions(-)
diff --git a/drivers/net/ipn3ke/ipn3ke_flow.c b/drivers/net/ipn3ke/ipn3ke_flow.c
index d20a29b9a2d6..eeb0ec55d9a6 100644
--- a/drivers/net/ipn3ke/ipn3ke_flow.c
+++ b/drivers/net/ipn3ke/ipn3ke_flow.c
@@ -100,15 +100,14 @@ ipn3ke_pattern_vxlan(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_ETH:
eth = item->spec;
- rte_memcpy(&parser->key[0],
- eth->hdr.src_addr.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&parser->key[0], eth->hdr.src_addr.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
break;
case RTE_FLOW_ITEM_TYPE_VXLAN:
vxlan = item->spec;
- rte_memcpy(&parser->key[6], vxlan->hdr.vni, 3);
+ memcpy(&parser->key[6], vxlan->hdr.vni, 3);
break;
default:
@@ -164,9 +163,8 @@ ipn3ke_pattern_mac(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_ETH:
eth = item->spec;
- rte_memcpy(parser->key,
- eth->hdr.src_addr.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(parser->key, eth->hdr.src_addr.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
break;
default:
@@ -369,13 +367,13 @@ ipn3ke_pattern_ip_tcp(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_IPV4:
ipv4 = item->spec;
- rte_memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
+ memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
break;
case RTE_FLOW_ITEM_TYPE_TCP:
tcp = item->spec;
- rte_memcpy(&parser->key[4], &tcp->hdr.src_port, 2);
+ memcpy(&parser->key[4], &tcp->hdr.src_port, 2);
break;
default:
@@ -434,13 +432,13 @@ ipn3ke_pattern_ip_udp(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_IPV4:
ipv4 = item->spec;
- rte_memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
+ memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
break;
case RTE_FLOW_ITEM_TYPE_UDP:
udp = item->spec;
- rte_memcpy(&parser->key[4], &udp->hdr.src_port, 2);
+ memcpy(&parser->key[4], &udp->hdr.src_port, 2);
break;
default:
@@ -502,19 +500,19 @@ ipn3ke_pattern_ip_nvgre(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_IPV4:
ipv4 = item->spec;
- rte_memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
+ memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
break;
case RTE_FLOW_ITEM_TYPE_UDP:
udp = item->spec;
- rte_memcpy(&parser->key[4], &udp->hdr.src_port, 2);
+ memcpy(&parser->key[4], &udp->hdr.src_port, 2);
break;
case RTE_FLOW_ITEM_TYPE_NVGRE:
nvgre = item->spec;
- rte_memcpy(&parser->key[6], nvgre->tni, 3);
+ memcpy(&parser->key[6], nvgre->tni, 3);
break;
default:
@@ -576,19 +574,19 @@ ipn3ke_pattern_vxlan_ip_udp(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_VXLAN:
vxlan = item->spec;
- rte_memcpy(&parser->key[0], vxlan->hdr.vni, 3);
+ memcpy(&parser->key[0], vxlan->hdr.vni, 3);
break;
case RTE_FLOW_ITEM_TYPE_IPV4:
ipv4 = item->spec;
- rte_memcpy(&parser->key[3], &ipv4->hdr.src_addr, 4);
+ memcpy(&parser->key[3], &ipv4->hdr.src_addr, 4);
break;
case RTE_FLOW_ITEM_TYPE_UDP:
udp = item->spec;
- rte_memcpy(&parser->key[7], &udp->hdr.src_port, 2);
+ memcpy(&parser->key[7], &udp->hdr.src_port, 2);
break;
default:
diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c
index 8145f1bb2a0e..99527d18793a 100644
--- a/drivers/net/ipn3ke/ipn3ke_representor.c
+++ b/drivers/net/ipn3ke/ipn3ke_representor.c
@@ -137,17 +137,17 @@ ipn3ke_rpst_dev_start(struct rte_eth_dev *dev)
if (hw->retimer.mac_type == IFPGA_RAWDEV_RETIMER_MAC_TYPE_10GE_XFI) {
/* Set mac address */
- rte_memcpy(((char *)(&val)),
- (char *)&dev->data->mac_addrs->addr_bytes[0],
- sizeof(uint32_t));
+ memcpy(((char *)(&val)),
+ (char *)&dev->data->mac_addrs->addr_bytes[0],
+ sizeof(uint32_t));
(*hw->f_mac_write)(hw,
val,
IPN3KE_MAC_PRIMARY_MAC_ADDR0,
rpst->port_id,
0);
- rte_memcpy(((char *)(&val)),
- (char *)&dev->data->mac_addrs->addr_bytes[4],
- sizeof(uint16_t));
+ memcpy(((char *)(&val)),
+ (char *)&dev->data->mac_addrs->addr_bytes[4],
+ sizeof(uint16_t));
(*hw->f_mac_write)(hw,
val,
IPN3KE_MAC_PRIMARY_MAC_ADDR1,
@@ -2753,13 +2753,13 @@ ipn3ke_rpst_mac_addr_set(struct rte_eth_dev *ethdev,
rte_ether_addr_copy(&mac_addr[0], &rpst->mac_addr);
/* Set mac address */
- rte_memcpy(((char *)(&val)), &mac_addr[0], sizeof(uint32_t));
+ memcpy(((char *)(&val)), &mac_addr[0], sizeof(uint32_t));
(*hw->f_mac_write)(hw,
val,
IPN3KE_MAC_PRIMARY_MAC_ADDR0,
rpst->port_id,
0);
- rte_memcpy(((char *)(&val)), &mac_addr[4], sizeof(uint16_t));
+ memcpy(((char *)(&val)), &mac_addr[4], sizeof(uint16_t));
(*hw->f_mac_write)(hw,
val,
IPN3KE_MAC_PRIMARY_MAC_ADDR0,
diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c b/drivers/net/ipn3ke/ipn3ke_tm.c
index 0260227900ae..b7097083d2d6 100644
--- a/drivers/net/ipn3ke/ipn3ke_tm.c
+++ b/drivers/net/ipn3ke/ipn3ke_tm.c
@@ -814,7 +814,7 @@ ipn3ke_tm_shaper_profile_add(struct rte_eth_dev *dev,
rte_strerror(EINVAL));
} else {
sp->valid = 1;
- rte_memcpy(&sp->params, profile, sizeof(sp->params));
+ memcpy(&sp->params, profile, sizeof(sp->params));
}
tm->h.n_shaper_profiles++;
@@ -960,7 +960,7 @@ ipn3ke_tm_tdrop_profile_add(struct rte_eth_dev *dev,
IPN3KE_TDROP_TH2_MASK);
tp->th1 = th1;
tp->th2 = th2;
- rte_memcpy(&tp->params, profile, sizeof(tp->params));
+ memcpy(&tp->params, profile, sizeof(tp->params));
/* Add to list */
tm->h.n_tdrop_profiles++;
@@ -1308,7 +1308,7 @@ ipn3ke_tm_node_add(struct rte_eth_dev *dev,
n->tdrop_profile = ipn3ke_hw_tm_tdrop_profile_search(hw,
params->leaf.wred.wred_profile_id);
- rte_memcpy(&n->params, params, sizeof(n->params));
+ memcpy(&n->params, params, sizeof(n->params));
return 0;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 30/71] net/ixgbe: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (28 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 29/71] net/ipn3ke: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 31/71] net/memif: " Stephen Hemminger
` (46 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/ixgbe/ixgbe_ethdev.c | 9 ++---
drivers/net/ixgbe/ixgbe_fdir.c | 7 ++--
drivers/net/ixgbe/ixgbe_flow.c | 65 ++++++++++++++-----------------
drivers/net/ixgbe/ixgbe_ipsec.c | 8 ++--
drivers/net/ixgbe/ixgbe_pf.c | 4 +-
drivers/net/ixgbe/ixgbe_tm.c | 11 +++---
drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +-
7 files changed, 48 insertions(+), 60 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 0cd3d0b105f4..6040cac9a896 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -6597,9 +6597,8 @@ ixgbe_add_del_ntuple_filter(struct rte_eth_dev *dev,
sizeof(struct ixgbe_5tuple_filter), 0);
if (filter == NULL)
return -ENOMEM;
- rte_memcpy(&filter->filter_info,
- &filter_5tuple,
- sizeof(struct ixgbe_5tuple_filter_info));
+ memcpy(&filter->filter_info, &filter_5tuple,
+ sizeof(struct ixgbe_5tuple_filter_info));
filter->queue = ntuple_filter->queue;
ret = ixgbe_add_5tuple_filter(dev, filter);
if (ret < 0) {
@@ -7596,9 +7595,7 @@ ixgbe_dev_l2_tunnel_filter_add(struct rte_eth_dev *dev,
if (!node)
return -ENOMEM;
- rte_memcpy(&node->key,
- &key,
- sizeof(struct ixgbe_l2_tn_key));
+ memcpy(&node->key, &key, sizeof(struct ixgbe_l2_tn_key));
node->pool = l2_tunnel->pool;
ret = ixgbe_insert_l2_tn_filter(l2_tn_info, node);
if (ret < 0) {
diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c
index 06d6e2126de5..b168ab82781b 100644
--- a/drivers/net/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/ixgbe/ixgbe_fdir.c
@@ -74,7 +74,7 @@
else \
ipv6_addr[i] = 0; \
} \
- rte_memcpy((ipaddr), ipv6_addr, sizeof(ipv6_addr));\
+ memcpy((ipaddr), ipv6_addr, sizeof(ipv6_addr));\
} while (0)
#define IXGBE_FDIRIP6M_INNER_MAC_SHIFT 4
@@ -1217,9 +1217,8 @@ ixgbe_fdir_filter_program(struct rte_eth_dev *dev,
0);
if (!node)
return -ENOMEM;
- rte_memcpy(&node->ixgbe_fdir,
- &rule->ixgbe_fdir,
- sizeof(union ixgbe_atr_input));
+ memcpy(&node->ixgbe_fdir, &rule->ixgbe_fdir,
+ sizeof(union ixgbe_atr_input));
node->fdirflags = fdircmd_flags;
node->fdirhash = fdirhash;
node->queue = queue;
diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index 687341c6b8d3..8a13f47f2b8c 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -1944,10 +1944,10 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
if (item->spec) {
rule->b_spec = TRUE;
ipv6_spec = item->spec;
- rte_memcpy(rule->ixgbe_fdir.formatted.src_ip,
- ipv6_spec->hdr.src_addr, 16);
- rte_memcpy(rule->ixgbe_fdir.formatted.dst_ip,
- ipv6_spec->hdr.dst_addr, 16);
+ memcpy(rule->ixgbe_fdir.formatted.src_ip,
+ ipv6_spec->hdr.src_addr, 16);
+ memcpy(rule->ixgbe_fdir.formatted.dst_ip,
+ ipv6_spec->hdr.dst_addr, 16);
}
/**
@@ -3070,9 +3070,9 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&ntuple_filter_ptr->filter_info,
- &ntuple_filter,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter_ptr->filter_info,
+ &ntuple_filter,
+ sizeof(struct rte_eth_ntuple_filter));
TAILQ_INSERT_TAIL(&filter_ntuple_list,
ntuple_filter_ptr, entries);
flow->rule = ntuple_filter_ptr;
@@ -3096,9 +3096,9 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(ðertype_filter_ptr->filter_info,
- ðertype_filter,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter_ptr->filter_info,
+ ðertype_filter,
+ sizeof(struct rte_eth_ethertype_filter));
TAILQ_INSERT_TAIL(&filter_ethertype_list,
ethertype_filter_ptr, entries);
flow->rule = ethertype_filter_ptr;
@@ -3120,9 +3120,8 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&syn_filter_ptr->filter_info,
- &syn_filter,
- sizeof(struct rte_eth_syn_filter));
+ memcpy(&syn_filter_ptr->filter_info, &syn_filter,
+ sizeof(struct rte_eth_syn_filter));
TAILQ_INSERT_TAIL(&filter_syn_list,
syn_filter_ptr,
entries);
@@ -3141,9 +3140,8 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
if (fdir_rule.b_mask) {
if (!fdir_info->mask_added) {
/* It's the first time the mask is set. */
- rte_memcpy(&fdir_info->mask,
- &fdir_rule.mask,
- sizeof(struct ixgbe_hw_fdir_mask));
+ memcpy(&fdir_info->mask, &fdir_rule.mask,
+ sizeof(struct ixgbe_hw_fdir_mask));
if (fdir_rule.mask.flex_bytes_mask) {
ret = ixgbe_fdir_set_flexbytes_offset(dev,
@@ -3185,9 +3183,9 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&fdir_rule_ptr->filter_info,
- &fdir_rule,
- sizeof(struct ixgbe_fdir_rule));
+ memcpy(&fdir_rule_ptr->filter_info,
+ &fdir_rule,
+ sizeof(struct ixgbe_fdir_rule));
TAILQ_INSERT_TAIL(&filter_fdir_list,
fdir_rule_ptr, entries);
flow->rule = fdir_rule_ptr;
@@ -3222,9 +3220,8 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&l2_tn_filter_ptr->filter_info,
- &l2_tn_filter,
- sizeof(struct ixgbe_l2_tunnel_conf));
+ memcpy(&l2_tn_filter_ptr->filter_info, &l2_tn_filter,
+ sizeof(struct ixgbe_l2_tunnel_conf));
TAILQ_INSERT_TAIL(&filter_l2_tunnel_list,
l2_tn_filter_ptr, entries);
flow->rule = l2_tn_filter_ptr;
@@ -3351,9 +3348,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_NTUPLE:
ntuple_filter_ptr = (struct ixgbe_ntuple_filter_ele *)
pmd_flow->rule;
- rte_memcpy(&ntuple_filter,
- &ntuple_filter_ptr->filter_info,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter, &ntuple_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ntuple_filter));
ret = ixgbe_add_del_ntuple_filter(dev, &ntuple_filter, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_ntuple_list,
@@ -3364,9 +3360,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_ETHERTYPE:
ethertype_filter_ptr = (struct ixgbe_ethertype_filter_ele *)
pmd_flow->rule;
- rte_memcpy(ðertype_filter,
- ðertype_filter_ptr->filter_info,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter, ðertype_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ethertype_filter));
ret = ixgbe_add_del_ethertype_filter(dev,
ðertype_filter, FALSE);
if (!ret) {
@@ -3378,9 +3373,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_SYN:
syn_filter_ptr = (struct ixgbe_eth_syn_filter_ele *)
pmd_flow->rule;
- rte_memcpy(&syn_filter,
- &syn_filter_ptr->filter_info,
- sizeof(struct rte_eth_syn_filter));
+ memcpy(&syn_filter, &syn_filter_ptr->filter_info,
+ sizeof(struct rte_eth_syn_filter));
ret = ixgbe_syn_filter_set(dev, &syn_filter, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_syn_list,
@@ -3390,9 +3384,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
break;
case RTE_ETH_FILTER_FDIR:
fdir_rule_ptr = (struct ixgbe_fdir_rule_ele *)pmd_flow->rule;
- rte_memcpy(&fdir_rule,
- &fdir_rule_ptr->filter_info,
- sizeof(struct ixgbe_fdir_rule));
+ memcpy(&fdir_rule, &fdir_rule_ptr->filter_info,
+ sizeof(struct ixgbe_fdir_rule));
ret = ixgbe_fdir_filter_program(dev, &fdir_rule, TRUE, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_fdir_list,
@@ -3405,8 +3398,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_L2_TUNNEL:
l2_tn_filter_ptr = (struct ixgbe_eth_l2_tunnel_conf_ele *)
pmd_flow->rule;
- rte_memcpy(&l2_tn_filter, &l2_tn_filter_ptr->filter_info,
- sizeof(struct ixgbe_l2_tunnel_conf));
+ memcpy(&l2_tn_filter, &l2_tn_filter_ptr->filter_info,
+ sizeof(struct ixgbe_l2_tunnel_conf));
ret = ixgbe_dev_l2_tunnel_filter_del(dev, &l2_tn_filter);
if (!ret) {
TAILQ_REMOVE(&filter_l2_tunnel_list,
diff --git a/drivers/net/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c
index d3313085560d..d8ed095dce0c 100644
--- a/drivers/net/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ixgbe/ixgbe_ipsec.c
@@ -680,10 +680,10 @@ ixgbe_crypto_add_ingress_sa_from_flow(const void *sess,
const struct rte_flow_item_ipv6 *ipv6 = ip_spec;
ic_session->src_ip.type = IPv6;
ic_session->dst_ip.type = IPv6;
- rte_memcpy(ic_session->src_ip.ipv6,
- ipv6->hdr.src_addr, 16);
- rte_memcpy(ic_session->dst_ip.ipv6,
- ipv6->hdr.dst_addr, 16);
+ memcpy(ic_session->src_ip.ipv6, ipv6->hdr.src_addr,
+ 16);
+ memcpy(ic_session->dst_ip.ipv6, ipv6->hdr.dst_addr,
+ 16);
} else {
const struct rte_flow_item_ipv4 *ipv4 = ip_spec;
ic_session->src_ip.type = IPv4;
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index 0a0f639e3986..9836d05540a3 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -450,7 +450,7 @@ ixgbe_vf_reset(struct rte_eth_dev *dev, uint16_t vf, uint32_t *msgbuf)
/* reply to reset with ack and vf mac address */
msgbuf[0] = IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_ACK;
- rte_memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
+ memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
/*
* Piggyback the multicast filter type so VF can compute the
* correct vectors
@@ -472,7 +472,7 @@ ixgbe_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
if (rte_is_valid_assigned_ether_addr(
(struct rte_ether_addr *)new_mac)) {
- rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
+ memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
return hw->mac.ops.set_rar(hw, rar_entry, new_mac, vf, IXGBE_RAH_AV);
}
return -1;
diff --git a/drivers/net/ixgbe/ixgbe_tm.c b/drivers/net/ixgbe/ixgbe_tm.c
index ac8976062fa7..00d9de43936b 100644
--- a/drivers/net/ixgbe/ixgbe_tm.c
+++ b/drivers/net/ixgbe/ixgbe_tm.c
@@ -289,8 +289,8 @@ ixgbe_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&tm_conf->shaper_profile_list,
shaper_profile, node);
@@ -637,8 +637,8 @@ ixgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->no = 0;
tm_node->parent = NULL;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
tm_conf->root = tm_node;
/* increase the reference counter of the shaper profile */
@@ -718,8 +718,7 @@ ixgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->reference_count = 0;
tm_node->parent = parent_node;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
if (parent_node_type == IXGBE_TM_NODE_TYPE_PORT) {
tm_node->no = parent_node->reference_count;
TAILQ_INSERT_TAIL(&tm_conf->tc_list,
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c
index f76ef6392194..ba700fe02313 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.c
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c
@@ -37,8 +37,8 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf,
if (rte_is_valid_assigned_ether_addr(
(struct rte_ether_addr *)new_mac)) {
- rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(vfinfo[vf].vf_mac_addresses, new_mac,
+ RTE_ETHER_ADDR_LEN);
return hw->mac.ops.set_rar(hw, rar_entry, new_mac, vf,
IXGBE_RAH_AV);
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 31/71] net/memif: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (29 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 30/71] net/ixgbe: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 32/71] net/qede: " Stephen Hemminger
` (45 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jakub Grajciar
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/memif/memif_socket.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
index 649f8d0e618f..f5a3354c4652 100644
--- a/drivers/net/memif/memif_socket.c
+++ b/drivers/net/memif/memif_socket.c
@@ -48,7 +48,7 @@ memif_msg_send(int fd, memif_msg_t *msg, int afd)
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
- rte_memcpy(CMSG_DATA(cmsg), &afd, sizeof(int));
+ memcpy(CMSG_DATA(cmsg), &afd, sizeof(int));
}
return sendmsg(fd, &mh, 0);
@@ -675,7 +675,7 @@ memif_msg_receive(struct memif_control_channel *cc)
if (cmsg->cmsg_type == SCM_CREDENTIALS)
cr = (struct ucred *)CMSG_DATA(cmsg);
else if (cmsg->cmsg_type == SCM_RIGHTS)
- rte_memcpy(&afd, CMSG_DATA(cmsg), sizeof(int));
+ memcpy(&afd, CMSG_DATA(cmsg), sizeof(int));
}
cmsg = CMSG_NXTHDR(&mh, cmsg);
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 32/71] net/qede: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (30 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 31/71] net/memif: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 33/71] baseband/acc: " Stephen Hemminger
` (44 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Devendra Singh Rawat, Alok Prasad
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/qede/qede_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index fd63262f3a47..32fa2016d260 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -180,7 +180,7 @@ static void qed_handle_bulletin_change(struct ecore_hwfn *hwfn)
is_mac_exist = ecore_vf_bulletin_get_forced_mac(hwfn, mac,
&is_mac_forced);
if (is_mac_exist && is_mac_forced)
- rte_memcpy(hwfn->hw_info.hw_mac_addr, mac, ETH_ALEN);
+ memcpy(hwfn->hw_info.hw_mac_addr, mac, ETH_ALEN);
/* Always update link configuration according to bulletin */
qed_link_update(hwfn);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 33/71] baseband/acc: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (31 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 32/71] net/qede: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 34/71] baseband/la12xx: " Stephen Hemminger
` (43 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Nicolas Chautru
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/baseband/acc/rte_acc100_pmd.c | 19 +++++++++----------
drivers/baseband/acc/rte_vrb_pmd.c | 21 ++++++++++-----------
2 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c
index 292537e24dc9..8bc0ce9d5532 100644
--- a/drivers/baseband/acc/rte_acc100_pmd.c
+++ b/drivers/baseband/acc/rte_acc100_pmd.c
@@ -3102,15 +3102,13 @@ enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
uint8_t *prev_ptr = (uint8_t *) prev_desc;
uint8_t *new_ptr = (uint8_t *) desc;
/* Copy first 4 words and BDESCs */
- rte_memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
- rte_memcpy(new_ptr + ACC_5GUL_OFFSET_0,
- prev_ptr + ACC_5GUL_OFFSET_0,
- ACC_5GUL_SIZE_1);
+ memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
+ memcpy(new_ptr + ACC_5GUL_OFFSET_0,
+ prev_ptr + ACC_5GUL_OFFSET_0, ACC_5GUL_SIZE_1);
desc->req.op_addr = prev_desc->req.op_addr;
/* Copy FCW */
- rte_memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
- prev_ptr + ACC_DESC_FCW_OFFSET,
- ACC_FCW_LD_BLEN);
+ memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
+ prev_ptr + ACC_DESC_FCW_OFFSET, ACC_FCW_LD_BLEN);
acc100_dma_desc_ld_update(op, &desc->req, input, h_output,
&in_offset, &h_out_offset,
&h_out_length, harq_layout);
@@ -3257,7 +3255,8 @@ enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
desc = acc_desc(q, total_enqueued_cbs);
desc->req.data_ptrs[0].address = q->ring_addr_iova + fcw_offset;
desc->req.data_ptrs[0].blen = ACC_FCW_LD_BLEN;
- rte_memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld, ACC_FCW_LD_BLEN);
+ memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
+ ACC_FCW_LD_BLEN);
ret = acc100_dma_desc_ld_fill(op, &desc->req, &input,
h_output, &in_offset, &h_out_offset,
&h_out_length,
@@ -4560,7 +4559,7 @@ acc100_configure(const char *dev_name, struct rte_acc_conf *conf)
struct acc_device *d = bbdev->data->dev_private;
/* Store configuration */
- rte_memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
+ memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
value = acc_reg_read(d, HwPfPcieGpexBridgeControl);
bool firstCfg = (value != ACC100_CFG_PCI_BRIDGE);
@@ -4955,7 +4954,7 @@ acc101_configure(const char *dev_name, struct rte_acc_conf *conf)
struct acc_device *d = bbdev->data->dev_private;
/* Store configuration */
- rte_memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
+ memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
/* PCIe Bridge configuration */
acc_reg_write(d, HwPfPcieGpexBridgeControl, ACC101_CFG_PCI_BRIDGE);
diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c
index 686e086a5c5c..72f6bff16081 100644
--- a/drivers/baseband/acc/rte_vrb_pmd.c
+++ b/drivers/baseband/acc/rte_vrb_pmd.c
@@ -2450,15 +2450,13 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
uint8_t *prev_ptr = (uint8_t *) prev_desc;
uint8_t *new_ptr = (uint8_t *) desc;
/* Copy first 4 words and BDESCs. */
- rte_memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
- rte_memcpy(new_ptr + ACC_5GUL_OFFSET_0,
- prev_ptr + ACC_5GUL_OFFSET_0,
- ACC_5GUL_SIZE_1);
+ memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
+ memcpy(new_ptr + ACC_5GUL_OFFSET_0,
+ prev_ptr + ACC_5GUL_OFFSET_0, ACC_5GUL_SIZE_1);
desc->req.op_addr = prev_desc->req.op_addr;
/* Copy FCW. */
- rte_memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
- prev_ptr + ACC_DESC_FCW_OFFSET,
- ACC_FCW_LD_BLEN);
+ memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
+ prev_ptr + ACC_DESC_FCW_OFFSET, ACC_FCW_LD_BLEN);
vrb_dma_desc_ld_update(op, &desc->req, input, h_output,
&in_offset, &h_out_offset,
&h_out_length, harq_layout);
@@ -2566,7 +2564,8 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
fcw_offset = (desc_idx << 8) + ACC_DESC_FCW_OFFSET;
desc->req.data_ptrs[0].address = q->ring_addr_iova + fcw_offset;
desc->req.data_ptrs[0].blen = ACC_FCW_LD_BLEN;
- rte_memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld, ACC_FCW_LD_BLEN);
+ memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
+ ACC_FCW_LD_BLEN);
desc->req.fcw_ld.tb_trailer_size = (c - r - 1) * trail_len;
ret = vrb_dma_desc_ld_fill(op, &desc->req, &input,
h_output, &in_offset, &h_out_offset,
@@ -4041,7 +4040,7 @@ enqueue_mldts_split_op(struct acc_queue *q, struct rte_bbdev_mldts_op *op,
if (symb == 0)
desc->req.cbs_in_tb = num_syms;
else
- rte_memcpy(&desc->req.fcw_mldts, fcw, ACC_FCW_MLDTS_BLEN);
+ memcpy(&desc->req.fcw_mldts, fcw, ACC_FCW_MLDTS_BLEN);
desc->req.data_ptrs[1].address = rte_pktmbuf_iova_offset(input_q, in_offset);
desc->req.data_ptrs[1].blen = q_size;
in_offset += q_size;
@@ -4396,7 +4395,7 @@ vrb1_configure(const char *dev_name, struct rte_acc_conf *conf)
struct acc_device *d = bbdev->data->dev_private;
/* Store configuration. */
- rte_memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
+ memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
/* Check we are already out of PG. */
status = acc_reg_read(d, VRB1_PfHiSectionPowerGatingAck);
@@ -4803,7 +4802,7 @@ vrb2_configure(const char *dev_name, struct rte_acc_conf *conf)
struct acc_device *d = bbdev->data->dev_private;
/* Store configuration. */
- rte_memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
+ memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
/* Explicitly releasing AXI as this may be stopped after PF FLR/BME. */
address = VRB2_PfDmaAxiControl;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 34/71] baseband/la12xx: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (32 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 33/71] baseband/acc: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 35/71] common/idpf: " Stephen Hemminger
` (42 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Gagandeep Singh, Hemant Agrawal
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/baseband/la12xx/bbdev_la12xx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c
index bb754a539580..23e2fdb81116 100644
--- a/drivers/baseband/la12xx/bbdev_la12xx.c
+++ b/drivers/baseband/la12xx/bbdev_la12xx.c
@@ -597,8 +597,8 @@ dequeue_single_op(struct bbdev_la12xx_q_priv *q_priv, void *dst)
op = q_priv->bbdev_op[ci];
- rte_memcpy(dst, q_priv->msg_ch_vaddr[ci],
- sizeof(struct bbdev_ipc_enqueue_op));
+ memcpy(dst, q_priv->msg_ch_vaddr[ci],
+ sizeof(struct bbdev_ipc_enqueue_op));
/* Move Consumer Index forward */
ci++;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 35/71] common/idpf: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (33 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 34/71] baseband/la12xx: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 36/71] common/qat: " Stephen Hemminger
` (41 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jingjing Wu
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/common/idpf/idpf_common_device.c | 4 ++--
drivers/common/idpf/idpf_common_virtchnl.c | 8 +++++---
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/common/idpf/idpf_common_device.c b/drivers/common/idpf/idpf_common_device.c
index cc4207a46e5e..2cb66371c4bd 100644
--- a/drivers/common/idpf/idpf_common_device.c
+++ b/drivers/common/idpf/idpf_common_device.c
@@ -459,8 +459,8 @@ idpf_vport_init(struct idpf_vport *vport,
vport->num_rx_q = vport_info->num_rx_q;
vport->num_rx_bufq = vport_info->num_rx_bufq;
vport->max_mtu = vport_info->max_mtu;
- rte_memcpy(vport->default_mac_addr,
- vport_info->default_mac_addr, ETH_ALEN);
+ memcpy(vport->default_mac_addr, vport_info->default_mac_addr,
+ ETH_ALEN);
vport->rss_algorithm = vport_info->rss_algorithm;
vport->rss_key_size = RTE_MIN(IDPF_RSS_KEY_LEN,
vport_info->rss_key_size);
diff --git a/drivers/common/idpf/idpf_common_virtchnl.c b/drivers/common/idpf/idpf_common_virtchnl.c
index 6455f640da25..96232c29d64f 100644
--- a/drivers/common/idpf/idpf_common_virtchnl.c
+++ b/drivers/common/idpf/idpf_common_virtchnl.c
@@ -294,7 +294,8 @@ idpf_vc_caps_get(struct idpf_adapter *adapter)
return err;
}
- rte_memcpy(&adapter->caps, args.out_buffer, sizeof(struct virtchnl2_get_capabilities));
+ memcpy(&adapter->caps, args.out_buffer,
+ sizeof(struct virtchnl2_get_capabilities));
return 0;
}
@@ -331,7 +332,8 @@ idpf_vc_vport_create(struct idpf_vport *vport,
return err;
}
- rte_memcpy(&(vport->vport_info.info), args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
+ memcpy(&(vport->vport_info.info), args.out_buffer,
+ IDPF_DFLT_MBX_BUF_SIZE);
return 0;
}
@@ -387,7 +389,7 @@ idpf_vc_queue_grps_add(struct idpf_vport *vport,
return err;
}
- rte_memcpy(p2p_queue_grps_out, args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
+ memcpy(p2p_queue_grps_out, args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
return 0;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 36/71] common/qat: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (34 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 35/71] common/idpf: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 37/71] compress/qat: " Stephen Hemminger
` (40 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Kai Ji
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/common/qat/qat_qp.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c
index f95dd33375a0..0c30c4d8c18d 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 =
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 37/71] compress/qat: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (35 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 36/71] common/qat: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 38/71] crypto/ccp: " Stephen Hemminger
` (39 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Kai Ji, Fan Zhang, Ashish Gupta
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/compress/qat/qat_comp.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c
index 559948a46a12..5bcbefe395bf 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",
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 38/71] crypto/ccp: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (36 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 37/71] compress/qat: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 39/71] crypto/cnxk: " Stephen Hemminger
` (38 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Sunil Uttarwar
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/crypto/ccp/ccp_crypto.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/crypto/ccp/ccp_crypto.c b/drivers/crypto/ccp/ccp_crypto.c
index 4b84b3303e18..4a70bc5d6e05 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;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 39/71] crypto/cnxk: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (37 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 38/71] crypto/ccp: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 40/71] crypto/dpaa_sec: " Stephen Hemminger
` (37 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Ankur Dwivedi, Anoob Joseph, Tejasree Kondoj
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +-
drivers/crypto/cnxk/cnxk_se.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
index 1dd1dbac9afc..a67af3ec35a1 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 c211884ddaea..e6c1e1586b9b 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 {
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 40/71] crypto/dpaa_sec: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (38 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 39/71] crypto/cnxk: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 41/71] crypto/ipsec_mb: " Stephen Hemminger
` (36 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Gagandeep Singh, Hemant Agrawal
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 44528eaf7f7a..3e7b78656bb4 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -676,7 +676,7 @@ dpaa_sec_dump(struct dpaa_sec_op_ctx *ctx, struct dpaa_sec_qp *qp)
}
cdb = &sess->cdb;
- rte_memcpy(&c_cdb, cdb, sizeof(struct sec_cdb));
+ memcpy(&c_cdb, cdb, sizeof(struct sec_cdb));
#ifdef RTE_LIB_SECURITY
printf("\nsession protocol type = %d\n", sess->proto_alg);
#endif
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 41/71] crypto/ipsec_mb: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (39 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 40/71] crypto/dpaa_sec: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 42/71] crypto/qat: " Stephen Hemminger
` (35 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Kai Ji, Pablo de Lara
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/ipsec_mb/pmd_snow3g.c b/drivers/crypto/ipsec_mb/pmd_snow3g.c
index a96779f05942..f3f519f2d451 100644
--- a/drivers/crypto/ipsec_mb/pmd_snow3g.c
+++ b/drivers/crypto/ipsec_mb/pmd_snow3g.c
@@ -291,8 +291,8 @@ process_snow3g_hash_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops,
/* Copy back digest from src to auth.digest.data */
if (digest_appended)
- rte_memcpy(ops[i]->sym->auth.digest.data,
- dst, SNOW3G_DIGEST_LENGTH);
+ memcpy(ops[i]->sym->auth.digest.data, dst,
+ SNOW3G_DIGEST_LENGTH);
}
processed_ops++;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 42/71] crypto/qat: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (40 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 41/71] crypto/ipsec_mb: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 43/71] crypto/scheduler: " Stephen Hemminger
` (34 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Kai Ji
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
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
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 43/71] crypto/scheduler: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (41 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 42/71] crypto/qat: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 44/71] event/cnxk: " Stephen Hemminger
` (33 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Kai Ji
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/crypto/scheduler/rte_cryptodev_scheduler.c | 6 +++---
drivers/crypto/scheduler/scheduler_failover.c | 12 ++++++------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
index 9a21edd32a9c..ed1833a7c61d 100644
--- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
+++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
@@ -79,7 +79,7 @@ sync_caps(struct rte_cryptodev_capabilities *caps,
/* remove a uncommon cap from the array */
for (j = i; j < sync_nb_caps - 1; j++)
- rte_memcpy(&caps[j], &caps[j+1], sizeof(*cap));
+ memcpy(&caps[j], &caps[j + 1], sizeof(*cap));
memset(&caps[sync_nb_caps - 1], 0, sizeof(*cap));
sync_nb_caps--;
@@ -216,8 +216,8 @@ sync_sec_caps(uint32_t worker_idx,
* caps, from the arrays
*/
for (j = i; j < nb_sec_caps - 1; j++) {
- rte_memcpy(&sec_caps[j], &sec_caps[j+1],
- sizeof(*sec_cap));
+ memcpy(&sec_caps[j], &sec_caps[j + 1],
+ sizeof(*sec_cap));
rte_memcpy(&sec_crypto_caps[j][0],
&sec_crypto_caps[j+1][0],
diff --git a/drivers/crypto/scheduler/scheduler_failover.c b/drivers/crypto/scheduler/scheduler_failover.c
index 52ff2ffbb7f6..e7c6d19d25b8 100644
--- a/drivers/crypto/scheduler/scheduler_failover.c
+++ b/drivers/crypto/scheduler/scheduler_failover.c
@@ -171,12 +171,12 @@ scheduler_start(struct rte_cryptodev *dev)
sched_ctx->workers[PRIMARY_WORKER_IDX].qp_id = i;
sched_ctx->workers[SECONDARY_WORKER_IDX].qp_id = i;
- rte_memcpy(&qp_ctx->primary_worker,
- &sched_ctx->workers[PRIMARY_WORKER_IDX],
- sizeof(struct scheduler_worker));
- rte_memcpy(&qp_ctx->secondary_worker,
- &sched_ctx->workers[SECONDARY_WORKER_IDX],
- sizeof(struct scheduler_worker));
+ memcpy(&qp_ctx->primary_worker,
+ &sched_ctx->workers[PRIMARY_WORKER_IDX],
+ sizeof(struct scheduler_worker));
+ memcpy(&qp_ctx->secondary_worker,
+ &sched_ctx->workers[SECONDARY_WORKER_IDX],
+ sizeof(struct scheduler_worker));
}
return 0;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 44/71] event/cnxk: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (42 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 43/71] crypto/scheduler: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 45/71] event/dlb2: " Stephen Hemminger
` (32 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Pavan Nikhilesh, Shijith Thotton
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/event/cnxk/cnxk_tim_evdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/event/cnxk/cnxk_tim_evdev.c b/drivers/event/cnxk/cnxk_tim_evdev.c
index 6d59fdf90983..2027c4644c5d 100644
--- a/drivers/event/cnxk/cnxk_tim_evdev.c
+++ b/drivers/event/cnxk/cnxk_tim_evdev.c
@@ -115,8 +115,8 @@ cnxk_tim_ring_info_get(const struct rte_event_timer_adapter *adptr,
adptr_info->min_resolution_ns = tim_ring->ena_periodic ?
tim_ring->max_tout :
tim_ring->tck_nsec;
- rte_memcpy(&adptr_info->conf, &adptr->data->conf,
- sizeof(struct rte_event_timer_adapter_conf));
+ memcpy(&adptr_info->conf, &adptr->data->conf,
+ sizeof(struct rte_event_timer_adapter_conf));
}
static int
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 45/71] event/dlb2: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (43 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 44/71] event/cnxk: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 46/71] event/dpaa2: " Stephen Hemminger
` (31 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Abdullah Sevincer
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/event/dlb2/dlb2.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index 271bbce54a3a..5c1cd35dbda6 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -225,7 +225,7 @@ dlb2_hw_query_resources(struct dlb2_eventdev *dlb2)
handle->info.hw_rsrc_max.reorder_window_size =
dlb2->hw_rsrc_query_results.num_hist_list_entries;
- rte_memcpy(dlb2_info, &handle->info.hw_rsrc_max, sizeof(*dlb2_info));
+ memcpy(dlb2_info, &handle->info.hw_rsrc_max, sizeof(*dlb2_info));
return 0;
}
@@ -1671,7 +1671,7 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,
qm_port->issued_releases = 0;
/* Save config message too. */
- rte_memcpy(&qm_port->cfg.ldb, &cfg, sizeof(qm_port->cfg.ldb));
+ memcpy(&qm_port->cfg.ldb, &cfg, sizeof(qm_port->cfg.ldb));
/* update state */
qm_port->state = PORT_STARTED; /* enabled at create time */
@@ -1872,7 +1872,7 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2,
qm_port->issued_releases = 0;
/* Save config message too. */
- rte_memcpy(&qm_port->cfg.dir, &cfg, sizeof(qm_port->cfg.dir));
+ memcpy(&qm_port->cfg.dir, &cfg, sizeof(qm_port->cfg.dir));
/* update state */
qm_port->state = PORT_STARTED; /* enabled at create time */
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 46/71] event/dpaa2: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (44 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 45/71] event/dlb2: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 47/71] event/octeontx: " Stephen Hemminger
` (30 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/event/dpaa2/dpaa2_eventdev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 1273455673ad..0331bb6fb91d 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -159,7 +159,7 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[],
"Unable to allocate event object");
goto send_partial;
}
- rte_memcpy(ev_temp, event, sizeof(struct rte_event));
+ memcpy(ev_temp, event, sizeof(struct rte_event));
DPAA2_SET_FD_ADDR((&fd_arr[loop]), (size_t)ev_temp);
DPAA2_SET_FD_LEN((&fd_arr[loop]),
sizeof(struct rte_event));
@@ -230,7 +230,7 @@ static void dpaa2_eventdev_process_parallel(struct qbman_swp *swp,
RTE_SET_USED(rxq);
- rte_memcpy(ev, ev_temp, sizeof(struct rte_event));
+ memcpy(ev, ev_temp, sizeof(struct rte_event));
rte_free(ev_temp);
qbman_swp_dqrr_consume(swp, dq);
@@ -249,7 +249,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
RTE_SET_USED(swp);
RTE_SET_USED(rxq);
- rte_memcpy(ev, ev_temp, sizeof(struct rte_event));
+ memcpy(ev, ev_temp, sizeof(struct rte_event));
rte_free(ev_temp);
*dpaa2_seqn(ev->mbuf) = dqrr_index + 1;
DPAA2_PER_LCORE_DQRR_SIZE++;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 47/71] event/octeontx: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (45 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 46/71] event/dpaa2: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 48/71] mempool/dpaa: " Stephen Hemminger
` (29 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Pavan Nikhilesh, Jerin Jacob
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/event/octeontx/timvf_evdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c
index 090b3ed18378..6409d6d1615b 100644
--- a/drivers/event/octeontx/timvf_evdev.c
+++ b/drivers/event/octeontx/timvf_evdev.c
@@ -42,8 +42,8 @@ timvf_ring_info_get(const struct rte_event_timer_adapter *adptr,
struct timvf_ring *timr = adptr->data->adapter_priv;
adptr_info->max_tmo_ns = timr->max_tout;
adptr_info->min_resolution_ns = timr->tck_nsec;
- rte_memcpy(&adptr_info->conf, &adptr->data->conf,
- sizeof(struct rte_event_timer_adapter_conf));
+ memcpy(&adptr_info->conf, &adptr->data->conf,
+ sizeof(struct rte_event_timer_adapter_conf));
}
static int
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 48/71] mempool/dpaa: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (46 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 47/71] event/octeontx: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 49/71] mempool/dpaa2: " Stephen Hemminger
` (28 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/mempool/dpaa/dpaa_mempool.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c
index 0b484b3d9c7d..f72b51b47271 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.c
+++ b/drivers/mempool/dpaa/dpaa_mempool.c
@@ -115,8 +115,8 @@ dpaa_mbuf_create_pool(struct rte_mempool *mp)
return -ENOMEM;
}
- rte_memcpy(bp_info, (void *)&rte_dpaa_bpid_info[bpid],
- sizeof(struct dpaa_bp_info));
+ memcpy(bp_info, (void *)&rte_dpaa_bpid_info[bpid],
+ sizeof(struct dpaa_bp_info));
mp->pool_data = (void *)bp_info;
DPAA_MEMPOOL_INFO("BMAN pool created for bpid =%d", bpid);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 49/71] mempool/dpaa2: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (47 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 48/71] mempool/dpaa: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 50/71] ml/cnxk: " Stephen Hemminger
` (27 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 4c9245cb814c..8899c0f8e683 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -125,8 +125,8 @@ rte_hw_mbuf_create_pool(struct rte_mempool *mp)
rte_dpaa2_bpid_info[bpid].bp_list = bp_list;
rte_dpaa2_bpid_info[bpid].bpid = bpid;
- rte_memcpy(bp_info, (void *)&rte_dpaa2_bpid_info[bpid],
- sizeof(struct dpaa2_bp_info));
+ memcpy(bp_info, (void *)&rte_dpaa2_bpid_info[bpid],
+ sizeof(struct dpaa2_bp_info));
mp->pool_data = (void *)bp_info;
DPAA2_MEMPOOL_DEBUG("BP List created for bpid =%d", dpbp_attr.bpid);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 50/71] ml/cnxk: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (48 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 49/71] mempool/dpaa2: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 51/71] net/af_xdp: " Stephen Hemminger
` (26 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Srikanth Yalavarthi
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/ml/cnxk/cn10k_ml_model.c | 8 +++++---
drivers/ml/cnxk/cn10k_ml_ops.c | 11 +++++++----
drivers/ml/cnxk/cnxk_ml_ops.c | 2 +-
drivers/ml/cnxk/mvtvm_ml_model.c | 8 +++++---
drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +++++---
5 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/drivers/ml/cnxk/cn10k_ml_model.c b/drivers/ml/cnxk/cn10k_ml_model.c
index 0325cd54f1f0..4e39a584fa82 100644
--- a/drivers/ml/cnxk/cn10k_ml_model.c
+++ b/drivers/ml/cnxk/cn10k_ml_model.c
@@ -560,7 +560,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]);
@@ -579,7 +579,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;
@@ -590,7 +591,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 834e55e88e9b..e53ada7b1ce4 100644
--- a/drivers/ml/cnxk/cn10k_ml_ops.c
+++ b/drivers/ml/cnxk/cn10k_ml_ops.c
@@ -668,11 +668,13 @@ 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);
/* Set layer name */
- rte_memcpy(layer->name, layer->glow.metadata.model.name, MRVL_ML_MODEL_NAME_LEN);
+ memcpy(layer->name, layer->glow.metadata.model.name,
+ MRVL_ML_MODEL_NAME_LEN);
/* Enable support for batch_size of 256 */
if (layer->glow.metadata.model.batch_size == 0)
@@ -748,11 +750,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/cnxk_ml_ops.c b/drivers/ml/cnxk/cnxk_ml_ops.c
index 971362b24202..f9d0f50e1fc4 100644
--- a/drivers/ml/cnxk/cnxk_ml_ops.c
+++ b/drivers/ml/cnxk/cnxk_ml_ops.c
@@ -1400,7 +1400,7 @@ cnxk_ml_model_info_get(struct rte_ml_dev *dev, uint16_t model_id,
}
info = (struct rte_ml_model_info *)model->info;
- rte_memcpy(model_info, info, sizeof(struct rte_ml_model_info));
+ memcpy(model_info, info, sizeof(struct rte_ml_model_info));
model_info->input_info = info->input_info;
model_info->output_info = info->output_info;
diff --git a/drivers/ml/cnxk/mvtvm_ml_model.c b/drivers/ml/cnxk/mvtvm_ml_model.c
index e3234ae44226..99b4774a2e11 100644
--- a/drivers/ml/cnxk/mvtvm_ml_model.c
+++ b/drivers/ml/cnxk/mvtvm_ml_model.c
@@ -310,7 +310,7 @@ mvtvm_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo
goto tvm_mrvl_model;
metadata = &model->mvtvm.metadata;
- rte_memcpy(info->name, metadata->model.name, TVMDP_NAME_STRLEN);
+ memcpy(info->name, metadata->model.name, TVMDP_NAME_STRLEN);
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]);
@@ -327,7 +327,8 @@ mvtvm_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, metadata->input[i].name, MRVL_ML_INPUT_NAME_LEN);
+ memcpy(input[i].name, metadata->input[i].name,
+ MRVL_ML_INPUT_NAME_LEN);
input[i].nb_dims = metadata->input[i].ndim;
input[i].shape = &model->mvtvm.info.input[i].shape[0];
input[i].type = model->mvtvm.info.input[i].qtype;
@@ -338,7 +339,8 @@ mvtvm_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, metadata->output[i].name, MRVL_ML_OUTPUT_NAME_LEN);
+ memcpy(output[i].name, metadata->output[i].name,
+ MRVL_ML_OUTPUT_NAME_LEN);
output[i].nb_dims = metadata->output[i].ndim;
output[i].shape = &model->mvtvm.info.output[i].shape[0];
output[i].type = model->mvtvm.info.output[i].qtype;
diff --git a/drivers/ml/cnxk/mvtvm_ml_ops.c b/drivers/ml/cnxk/mvtvm_ml_ops.c
index e825c3fb23e6..fca7e0c3c0bc 100644
--- a/drivers/ml/cnxk/mvtvm_ml_ops.c
+++ b/drivers/ml/cnxk/mvtvm_ml_ops.c
@@ -194,7 +194,7 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *
/* Copy mod.so */
model->mvtvm.object.so.addr = mz->addr;
model->mvtvm.object.so.size = object[0].size;
- rte_memcpy(model->mvtvm.object.so.name, object[0].name, TVMDP_NAME_STRLEN);
+ memcpy(model->mvtvm.object.so.name, object[0].name, TVMDP_NAME_STRLEN);
rte_memcpy(model->mvtvm.object.so.addr, object[0].buffer, object[0].size);
rte_free(object[0].buffer);
@@ -203,7 +203,8 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *
RTE_PTR_ADD(model->mvtvm.object.so.addr,
RTE_ALIGN_CEIL(model->mvtvm.object.so.size, RTE_CACHE_LINE_MIN_SIZE));
model->mvtvm.object.json.size = object[1].size;
- rte_memcpy(model->mvtvm.object.json.name, object[1].name, TVMDP_NAME_STRLEN);
+ memcpy(model->mvtvm.object.json.name, object[1].name,
+ TVMDP_NAME_STRLEN);
rte_memcpy(model->mvtvm.object.json.addr, object[1].buffer, object[1].size);
rte_free(object[1].buffer);
@@ -212,7 +213,8 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *
RTE_PTR_ADD(model->mvtvm.object.json.addr,
RTE_ALIGN_CEIL(model->mvtvm.object.json.size, RTE_CACHE_LINE_MIN_SIZE));
model->mvtvm.object.params.size = object[2].size;
- rte_memcpy(model->mvtvm.object.params.name, object[2].name, TVMDP_NAME_STRLEN);
+ memcpy(model->mvtvm.object.params.name, object[2].name,
+ TVMDP_NAME_STRLEN);
rte_memcpy(model->mvtvm.object.params.addr, object[2].buffer, object[2].size);
rte_free(object[2].buffer);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 51/71] net/af_xdp: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (49 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 50/71] ml/cnxk: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 52/71] net/avp: " Stephen Hemminger
` (25 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Ciara Loftus
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 2d151e45c7cd..8efc0e707a78 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -2094,7 +2094,7 @@ get_iface_info(const char *if_name,
if (ioctl(sock, SIOCGIFHWADDR, &ifr))
goto error;
- rte_memcpy(eth_addr, ifr.ifr_hwaddr.sa_data, RTE_ETHER_ADDR_LEN);
+ memcpy(eth_addr, ifr.ifr_hwaddr.sa_data, RTE_ETHER_ADDR_LEN);
close(sock);
return 0;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 52/71] net/avp: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (50 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 51/71] net/af_xdp: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 53/71] net/axgbe: " Stephen Hemminger
` (24 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Steven Webster, Matt Peters
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/avp/avp_ethdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index 53d9e38c939b..9bd05301720e 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -248,7 +248,7 @@ avp_dev_process_request(struct avp_dev *avp, struct rte_avp_request *request)
while (avp_fifo_get(avp->resp_q, (void **)&resp_addr, 1))
PMD_DRV_LOG(DEBUG, "Discarding stale response\n");
- rte_memcpy(avp->sync_addr, request, sizeof(*request));
+ memcpy(avp->sync_addr, request, sizeof(*request));
count = avp_fifo_put(avp->req_q, &avp->host_sync_addr, 1);
if (count < 1) {
PMD_DRV_LOG(ERR, "Cannot send request %u to host\n",
@@ -285,7 +285,7 @@ avp_dev_process_request(struct avp_dev *avp, struct rte_avp_request *request)
}
/* copy to user buffer */
- rte_memcpy(request, avp->sync_addr, sizeof(*request));
+ memcpy(request, avp->sync_addr, sizeof(*request));
ret = 0;
PMD_DRV_LOG(DEBUG, "Result %d received for request %u\n",
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 53/71] net/axgbe: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (51 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 52/71] net/avp: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 54/71] net/bnx2x: " Stephen Hemminger
` (23 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Selwin Sebastian
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/axgbe/axgbe_ethdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c
index dd681f15a01e..7ac30106e335 100644
--- a/drivers/net/axgbe/axgbe_ethdev.c
+++ b/drivers/net/axgbe/axgbe_ethdev.c
@@ -594,7 +594,7 @@ axgbe_dev_rss_hash_update(struct rte_eth_dev *dev,
if (rss_conf->rss_key != NULL &&
rss_conf->rss_key_len == AXGBE_RSS_HASH_KEY_SIZE) {
- rte_memcpy(pdata->rss_key, rss_conf->rss_key,
+ memcpy(pdata->rss_key, rss_conf->rss_key,
AXGBE_RSS_HASH_KEY_SIZE);
/* Program the hash key */
ret = axgbe_write_rss_hash_key(pdata);
@@ -637,7 +637,7 @@ axgbe_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
if (rss_conf->rss_key != NULL &&
rss_conf->rss_key_len >= AXGBE_RSS_HASH_KEY_SIZE) {
- rte_memcpy(rss_conf->rss_key, pdata->rss_key,
+ memcpy(rss_conf->rss_key, pdata->rss_key,
AXGBE_RSS_HASH_KEY_SIZE);
}
rss_conf->rss_key_len = AXGBE_RSS_HASH_KEY_SIZE;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 54/71] net/bnx2x: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (52 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 53/71] net/axgbe: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 55/71] net/bnxt: " Stephen Hemminger
` (22 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Julien Aube
Automatically generated by devtools/cocci/rte_memcpy.cocci.
Note: the indentation in this file does not follow the coding
standard of DPDK, so it will get some checkpatch warnings.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/bnx2x/bnx2x.c | 32 +++++++++++++++-----------------
drivers/net/bnx2x/bnx2x_stats.c | 10 +++++-----
drivers/net/bnx2x/bnx2x_vfpf.c | 19 ++++++++++---------
3 files changed, 30 insertions(+), 31 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 597ee4335977..16a9ff7f8c06 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -2242,18 +2242,18 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0)
tx_parse_bd->parsing_data =
(mac_type << ETH_TX_PARSE_BD_E2_ETH_ADDR_TYPE_SHIFT);
- rte_memcpy(&tx_parse_bd->data.mac_addr.dst_hi,
- &eh->dst_addr.addr_bytes[0], 2);
- rte_memcpy(&tx_parse_bd->data.mac_addr.dst_mid,
- &eh->dst_addr.addr_bytes[2], 2);
- rte_memcpy(&tx_parse_bd->data.mac_addr.dst_lo,
- &eh->dst_addr.addr_bytes[4], 2);
- rte_memcpy(&tx_parse_bd->data.mac_addr.src_hi,
- &eh->src_addr.addr_bytes[0], 2);
- rte_memcpy(&tx_parse_bd->data.mac_addr.src_mid,
- &eh->src_addr.addr_bytes[2], 2);
- rte_memcpy(&tx_parse_bd->data.mac_addr.src_lo,
- &eh->src_addr.addr_bytes[4], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.dst_hi,
+ &eh->dst_addr.addr_bytes[0], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.dst_mid,
+ &eh->dst_addr.addr_bytes[2], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.dst_lo,
+ &eh->dst_addr.addr_bytes[4], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.src_hi,
+ &eh->src_addr.addr_bytes[0], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.src_mid,
+ &eh->src_addr.addr_bytes[2], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.src_lo,
+ &eh->src_addr.addr_bytes[4], 2);
tx_parse_bd->data.mac_addr.dst_hi =
rte_cpu_to_be_16(tx_parse_bd->data.mac_addr.dst_hi);
@@ -6675,8 +6675,7 @@ bnx2x_config_rss_pf(struct bnx2x_softc *sc, struct ecore_rss_config_obj *rss_obj
/* Hash bits */
params.rss_result_mask = MULTI_MASK;
- rte_memcpy(params.ind_table, rss_obj->ind_table,
- sizeof(params.ind_table));
+ memcpy(params.ind_table, rss_obj->ind_table, sizeof(params.ind_table));
if (config_hash) {
/* RSS keys */
@@ -6742,8 +6741,7 @@ bnx2x_set_mac_one(struct bnx2x_softc *sc, uint8_t * mac,
/* fill a user request section if needed */
if (!rte_bit_relaxed_get32(RAMROD_CONT, ramrod_flags)) {
- rte_memcpy(ramrod_param.user_req.u.mac.mac, mac,
- ETH_ALEN);
+ memcpy(ramrod_param.user_req.u.mac.mac, mac, ETH_ALEN);
rte_bit_relaxed_set32(mac_type,
&ramrod_param.user_req.vlan_mac_flags);
@@ -6958,7 +6956,7 @@ static void bnx2x_link_report_locked(struct bnx2x_softc *sc)
ELINK_DEBUG_P1(sc, "link status change count = %x", sc->link_cnt);
/* report new link params and remember the state for the next time */
- rte_memcpy(&sc->last_reported_link, &cur_data, sizeof(cur_data));
+ memcpy(&sc->last_reported_link, &cur_data, sizeof(cur_data));
if (rte_bit_relaxed_get32(BNX2X_LINK_REPORT_LINK_DOWN,
&cur_data.link_report_flags)) {
diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_stats.c
index c07b01510a06..23c74c21c635 100644
--- a/drivers/net/bnx2x/bnx2x_stats.c
+++ b/drivers/net/bnx2x/bnx2x_stats.c
@@ -114,8 +114,8 @@ bnx2x_hw_stats_post(struct bnx2x_softc *sc)
/* Update MCP's statistics if possible */
if (sc->func_stx) {
- rte_memcpy(BNX2X_SP(sc, func_stats), &sc->func_stats,
- sizeof(sc->func_stats));
+ memcpy(BNX2X_SP(sc, func_stats), &sc->func_stats,
+ sizeof(sc->func_stats));
}
/* loader */
@@ -817,10 +817,10 @@ bnx2x_hw_stats_update(struct bnx2x_softc *sc)
etherstatspktsover1522octets);
}
- rte_memcpy(old, new, sizeof(struct nig_stats));
+ memcpy(old, new, sizeof(struct nig_stats));
- rte_memcpy(&(estats->rx_stat_ifhcinbadoctets_hi), &(pstats->mac_stx[1]),
- sizeof(struct mac_stx));
+ memcpy(&(estats->rx_stat_ifhcinbadoctets_hi), &(pstats->mac_stx[1]),
+ sizeof(struct mac_stx));
estats->brb_drop_hi = pstats->brb_drop_hi;
estats->brb_drop_lo = pstats->brb_drop_lo;
diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c
index 63953c2979ce..678c9e7d7d7c 100644
--- a/drivers/net/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/bnx2x/bnx2x_vfpf.c
@@ -52,9 +52,9 @@ bnx2x_check_bull(struct bnx2x_softc *sc)
/* check the mac address and VLAN and allocate memory if valid */
if (valid_bitmap & (1 << MAC_ADDR_VALID) && memcmp(bull->mac, sc->old_bulletin.mac, ETH_ALEN))
- rte_memcpy(&sc->link_params.mac_addr, bull->mac, ETH_ALEN);
+ memcpy(&sc->link_params.mac_addr, bull->mac, ETH_ALEN);
if (valid_bitmap & (1 << VLAN_VALID))
- rte_memcpy(&bull->vlan, &sc->old_bulletin.vlan, RTE_VLAN_HLEN);
+ memcpy(&bull->vlan, &sc->old_bulletin.vlan, RTE_VLAN_HLEN);
sc->old_bulletin = *bull;
@@ -569,7 +569,7 @@ bnx2x_vf_set_mac(struct bnx2x_softc *sc, int set)
bnx2x_check_bull(sc);
- rte_memcpy(query->filters[0].mac, sc->link_params.mac_addr, ETH_ALEN);
+ memcpy(query->filters[0].mac, sc->link_params.mac_addr, ETH_ALEN);
bnx2x_add_tlv(sc, query, query->first_tlv.tl.length,
BNX2X_VF_TLV_LIST_END,
@@ -583,10 +583,10 @@ bnx2x_vf_set_mac(struct bnx2x_softc *sc, int set)
while (BNX2X_VF_STATUS_FAILURE == reply->status &&
bnx2x_check_bull(sc)) {
/* A new mac was configured by PF for us */
- rte_memcpy(sc->link_params.mac_addr, sc->pf2vf_bulletin->mac,
- ETH_ALEN);
- rte_memcpy(query->filters[0].mac, sc->pf2vf_bulletin->mac,
- ETH_ALEN);
+ memcpy(sc->link_params.mac_addr, sc->pf2vf_bulletin->mac,
+ ETH_ALEN);
+ memcpy(query->filters[0].mac, sc->pf2vf_bulletin->mac,
+ ETH_ALEN);
rc = bnx2x_do_req4pf(sc, sc->vf2pf_mbox_mapping.paddr);
if (rc)
@@ -622,10 +622,11 @@ bnx2x_vf_config_rss(struct bnx2x_softc *sc,
BNX2X_VF_TLV_LIST_END,
sizeof(struct channel_list_end_tlv));
- rte_memcpy(query->rss_key, params->rss_key, sizeof(params->rss_key));
+ memcpy(query->rss_key, params->rss_key, sizeof(params->rss_key));
query->rss_key_size = T_ETH_RSS_KEY;
- rte_memcpy(query->ind_table, params->ind_table, T_ETH_INDIRECTION_TABLE_SIZE);
+ memcpy(query->ind_table, params->ind_table,
+ T_ETH_INDIRECTION_TABLE_SIZE);
query->ind_table_size = T_ETH_INDIRECTION_TABLE_SIZE;
query->rss_result_mask = params->rss_result_mask;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 55/71] net/bnxt: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (53 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 54/71] net/bnx2x: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-03-01 2:54 ` Somnath Kotur
2024-02-29 22:58 ` [PATCH 56/71] net/bonding: " Stephen Hemminger
` (21 subsequent siblings)
76 siblings, 1 reply; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Ajit Khaparde, Somnath Kotur
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/bnxt/bnxt_flow.c | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index f25bc6ff78c7..6466aa394af1 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -233,8 +233,9 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
"DMAC is invalid!\n");
return -rte_errno;
}
- rte_memcpy(filter->dst_macaddr,
- ð_spec->hdr.dst_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(filter->dst_macaddr,
+ ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
en |= use_ntuple ?
NTUPLE_FLTR_ALLOC_INPUT_EN_DST_MACADDR :
EM_FLOW_ALLOC_INPUT_EN_DST_MACADDR;
@@ -257,8 +258,9 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
"SMAC is invalid!\n");
return -rte_errno;
}
- rte_memcpy(filter->src_macaddr,
- ð_spec->hdr.src_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(filter->src_macaddr,
+ ð_spec->hdr.src_addr,
+ RTE_ETHER_ADDR_LEN);
en |= use_ntuple ?
NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_MACADDR :
EM_FLOW_ALLOC_INPUT_EN_SRC_MACADDR;
@@ -423,23 +425,23 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
en |= EM_FLOW_ALLOC_INPUT_EN_SRC_IPADDR |
EM_FLOW_ALLOC_INPUT_EN_DST_IPADDR;
- rte_memcpy(filter->src_ipaddr,
- ipv6_spec->hdr.src_addr, 16);
- rte_memcpy(filter->dst_ipaddr,
- ipv6_spec->hdr.dst_addr, 16);
+ memcpy(filter->src_ipaddr, ipv6_spec->hdr.src_addr,
+ 16);
+ memcpy(filter->dst_ipaddr, ipv6_spec->hdr.dst_addr,
+ 16);
if (!bnxt_check_zero_bytes(ipv6_mask->hdr.src_addr,
16)) {
- rte_memcpy(filter->src_ipaddr_mask,
- ipv6_mask->hdr.src_addr, 16);
+ memcpy(filter->src_ipaddr_mask,
+ ipv6_mask->hdr.src_addr, 16);
en |= !use_ntuple ? 0 :
NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR_MASK;
}
if (!bnxt_check_zero_bytes(ipv6_mask->hdr.dst_addr,
16)) {
- rte_memcpy(filter->dst_ipaddr_mask,
- ipv6_mask->hdr.dst_addr, 16);
+ memcpy(filter->dst_ipaddr_mask,
+ ipv6_mask->hdr.dst_addr, 16);
en |= !use_ntuple ? 0 :
NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR_MASK;
}
@@ -591,8 +593,8 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
return -rte_errno;
}
- rte_memcpy(((uint8_t *)&tenant_id_be + 1),
- vxlan_spec->hdr.vni, 3);
+ memcpy(((uint8_t *)&tenant_id_be + 1),
+ vxlan_spec->hdr.vni, 3);
filter->vni =
rte_be_to_cpu_32(tenant_id_be);
filter->tunnel_type =
@@ -645,8 +647,8 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
"Invalid TNI mask");
return -rte_errno;
}
- rte_memcpy(((uint8_t *)&tenant_id_be + 1),
- nvgre_spec->tni, 3);
+ memcpy(((uint8_t *)&tenant_id_be + 1),
+ nvgre_spec->tni, 3);
filter->vni =
rte_be_to_cpu_32(tenant_id_be);
filter->tunnel_type =
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 56/71] net/bonding: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (54 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 55/71] net/bnxt: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 57/71] net/cnxk: " Stephen Hemminger
` (20 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Chas Williams, Min Hu (Connor)
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/bonding/rte_eth_bond_8023ad.c | 4 ++--
drivers/net/bonding/rte_eth_bond_flow.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 79f1b3f1a0f2..8ddf5dc80aff 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -1539,10 +1539,10 @@ rte_eth_bond_8023ad_member_info(uint16_t port_id, uint16_t member_id,
info->selected = port->selected;
info->actor_state = port->actor_state;
- rte_memcpy(&info->actor, &port->actor, sizeof(port->actor));
+ memcpy(&info->actor, &port->actor, sizeof(port->actor));
info->partner_state = port->partner_state;
- rte_memcpy(&info->partner, &port->partner, sizeof(port->partner));
+ memcpy(&info->partner, &port->partner, sizeof(port->partner));
info->agg_port_id = port->aggregator_port_id;
return 0;
diff --git a/drivers/net/bonding/rte_eth_bond_flow.c b/drivers/net/bonding/rte_eth_bond_flow.c
index 5d0be5caf54b..bb9d347e2be4 100644
--- a/drivers/net/bonding/rte_eth_bond_flow.c
+++ b/drivers/net/bonding/rte_eth_bond_flow.c
@@ -182,7 +182,7 @@ bond_flow_query_count(struct rte_eth_dev *dev, struct rte_flow *flow,
count->hits = 0;
count->bytes_set = 0;
count->hits_set = 0;
- rte_memcpy(&member_count, count, sizeof(member_count));
+ memcpy(&member_count, count, sizeof(member_count));
for (i = 0; i < internals->member_count; i++) {
ret = rte_flow_query(internals->members[i].port_id,
flow->flows[i], action,
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 57/71] net/cnxk: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (55 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 56/71] net/bonding: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 58/71] net/cpfl: " Stephen Hemminger
` (19 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Nithin Dabilpuram, Kiran Kumar K,
Sunil Kumar Kori, Satha Rao
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/cnxk/cnxk_ethdev_ops.c | 2 +-
drivers/net/cnxk/cnxk_tm.c | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c
index 5de2919047c1..ee407b177ec0 100644
--- a/drivers/net/cnxk/cnxk_ethdev_ops.c
+++ b/drivers/net/cnxk/cnxk_ethdev_ops.c
@@ -451,7 +451,7 @@ cnxk_nix_mac_addr_set(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr)
}
/* Update mac address to cnxk ethernet device */
- rte_memcpy(dev->mac_addr, addr->addr_bytes, RTE_ETHER_ADDR_LEN);
+ memcpy(dev->mac_addr, addr->addr_bytes, RTE_ETHER_ADDR_LEN);
exit:
return rc;
diff --git a/drivers/net/cnxk/cnxk_tm.c b/drivers/net/cnxk/cnxk_tm.c
index c799193cb89b..5c8b0997ca7c 100644
--- a/drivers/net/cnxk/cnxk_tm.c
+++ b/drivers/net/cnxk/cnxk_tm.c
@@ -300,8 +300,7 @@ cnxk_nix_tm_shaper_profile_add(struct rte_eth_dev *eth_dev, uint32_t id,
profile->profile.pkt_len_adj = params->pkt_length_adjust;
profile->profile.pkt_mode = params->packet_mode;
profile->profile.free_fn = rte_free;
- rte_memcpy(&profile->params, params,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&profile->params, params, sizeof(struct rte_tm_shaper_params));
rc = roc_nix_tm_shaper_profile_add(nix, &profile->profile);
@@ -373,7 +372,7 @@ cnxk_nix_tm_node_add(struct rte_eth_dev *eth_dev, uint32_t node_id,
if (!node)
return -ENOMEM;
- rte_memcpy(&node->params, params, sizeof(struct rte_tm_node_params));
+ memcpy(&node->params, params, sizeof(struct rte_tm_node_params));
node->nix_node.id = node_id;
node->nix_node.parent_id = parent_node_id;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 58/71] net/cpfl: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (56 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 57/71] net/cnxk: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 59/71] net/cxgbe: " Stephen Hemminger
` (18 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Yuying Zhang
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/cpfl/cpfl_ethdev.c | 3 ++-
drivers/net/cpfl/cpfl_vchnl.c | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c
index ef19aa1b6a96..1037aec68d2d 100644
--- a/drivers/net/cpfl/cpfl_ethdev.c
+++ b/drivers/net/cpfl/cpfl_ethdev.c
@@ -2292,7 +2292,8 @@ cpfl_adapter_ext_init(struct rte_pci_device *pci_dev, struct cpfl_adapter_ext *a
strncpy(adapter->name, pci_dev->device.name, PCI_PRI_STR_SIZE);
- rte_memcpy(&base->caps, &req_caps, sizeof(struct virtchnl2_get_capabilities));
+ memcpy(&base->caps, &req_caps,
+ sizeof(struct virtchnl2_get_capabilities));
ret = idpf_adapter_init(base);
if (ret != 0) {
diff --git a/drivers/net/cpfl/cpfl_vchnl.c b/drivers/net/cpfl/cpfl_vchnl.c
index 7d277a0e8e83..e914014d8a9b 100644
--- a/drivers/net/cpfl/cpfl_vchnl.c
+++ b/drivers/net/cpfl/cpfl_vchnl.c
@@ -32,7 +32,7 @@ cpfl_cc_vport_list_get(struct cpfl_adapter_ext *adapter,
return err;
}
- rte_memcpy(response, args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
+ memcpy(response, args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
return 0;
}
@@ -66,7 +66,7 @@ cpfl_cc_vport_info_get(struct cpfl_adapter_ext *adapter,
return err;
}
- rte_memcpy(response, args.out_buffer, sizeof(*response));
+ memcpy(response, args.out_buffer, sizeof(*response));
return 0;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 59/71] net/cxgbe: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (57 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 58/71] net/cpfl: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 60/71] net/dpaa2: " Stephen Hemminger
` (17 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Rahul Lakkireddy
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/cxgbe/clip_tbl.c | 2 +-
drivers/net/cxgbe/cxgbe_filter.c | 8 ++++----
drivers/net/cxgbe/l2t.c | 4 ++--
drivers/net/cxgbe/smt.c | 20 +++++++++-----------
4 files changed, 16 insertions(+), 18 deletions(-)
diff --git a/drivers/net/cxgbe/clip_tbl.c b/drivers/net/cxgbe/clip_tbl.c
index b709e26f6aa9..d30fa6425f28 100644
--- a/drivers/net/cxgbe/clip_tbl.c
+++ b/drivers/net/cxgbe/clip_tbl.c
@@ -115,7 +115,7 @@ static struct clip_entry *t4_clip_alloc(struct rte_eth_dev *dev,
if (ce) {
t4_os_lock(&ce->lock);
if (__atomic_load_n(&ce->refcnt, __ATOMIC_RELAXED) == 0) {
- rte_memcpy(ce->addr, lip, sizeof(ce->addr));
+ memcpy(ce->addr, lip, sizeof(ce->addr));
if (v6) {
ce->type = FILTER_TYPE_IPV6;
__atomic_store_n(&ce->refcnt, 1,
diff --git a/drivers/net/cxgbe/cxgbe_filter.c b/drivers/net/cxgbe/cxgbe_filter.c
index 5a7efe7a733e..3d1d087ec215 100644
--- a/drivers/net/cxgbe/cxgbe_filter.c
+++ b/drivers/net/cxgbe/cxgbe_filter.c
@@ -851,10 +851,10 @@ static int set_filter_wr(struct rte_eth_dev *dev, unsigned int fidx)
fwr->ivlanm = cpu_to_be16(f->fs.mask.ivlan);
fwr->ovlan = cpu_to_be16(f->fs.val.ovlan);
fwr->ovlanm = cpu_to_be16(f->fs.mask.ovlan);
- rte_memcpy(fwr->lip, f->fs.val.lip, sizeof(fwr->lip));
- rte_memcpy(fwr->lipm, f->fs.mask.lip, sizeof(fwr->lipm));
- rte_memcpy(fwr->fip, f->fs.val.fip, sizeof(fwr->fip));
- rte_memcpy(fwr->fipm, f->fs.mask.fip, sizeof(fwr->fipm));
+ memcpy(fwr->lip, f->fs.val.lip, sizeof(fwr->lip));
+ memcpy(fwr->lipm, f->fs.mask.lip, sizeof(fwr->lipm));
+ memcpy(fwr->fip, f->fs.val.fip, sizeof(fwr->fip));
+ memcpy(fwr->fipm, f->fs.mask.fip, sizeof(fwr->fipm));
fwr->lp = cpu_to_be16(f->fs.val.lport);
fwr->lpm = cpu_to_be16(f->fs.mask.lport);
fwr->fp = cpu_to_be16(f->fs.val.fport);
diff --git a/drivers/net/cxgbe/l2t.c b/drivers/net/cxgbe/l2t.c
index 21f4019ae626..7721c7953ec0 100644
--- a/drivers/net/cxgbe/l2t.c
+++ b/drivers/net/cxgbe/l2t.c
@@ -82,7 +82,7 @@ static int write_l2e(struct rte_eth_dev *dev, struct l2t_entry *e, int sync,
V_L2T_W_NOREPLY(!sync));
req->l2t_idx = cpu_to_be16(l2t_idx);
req->vlan = cpu_to_be16(e->vlan);
- rte_memcpy(req->dst_mac, e->dmac, RTE_ETHER_ADDR_LEN);
+ memcpy(req->dst_mac, e->dmac, RTE_ETHER_ADDR_LEN);
if (loopback)
memset(req->dst_mac, 0, RTE_ETHER_ADDR_LEN);
@@ -155,7 +155,7 @@ static struct l2t_entry *t4_l2t_alloc_switching(struct rte_eth_dev *dev,
e->state = L2T_STATE_SWITCHING;
e->vlan = vlan;
e->lport = port;
- rte_memcpy(e->dmac, eth_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(e->dmac, eth_addr, RTE_ETHER_ADDR_LEN);
__atomic_store_n(&e->refcnt, 1, __ATOMIC_RELAXED);
ret = write_l2e(dev, e, 0, !L2T_LPBK, !L2T_ARPMISS);
if (ret < 0)
diff --git a/drivers/net/cxgbe/smt.c b/drivers/net/cxgbe/smt.c
index 4e14a73753de..a74b2e0794e6 100644
--- a/drivers/net/cxgbe/smt.c
+++ b/drivers/net/cxgbe/smt.c
@@ -55,26 +55,24 @@ static int write_smt_entry(struct rte_eth_dev *dev, struct smt_entry *e)
*/
if (e->idx & 1) {
req->pfvf1 = 0x0;
- rte_memcpy(req->src_mac1, e->src_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(req->src_mac1, e->src_mac, RTE_ETHER_ADDR_LEN);
/* fill pfvf0/src_mac0 with entry
* at prev index from smt-tab.
*/
req->pfvf0 = 0x0;
- rte_memcpy(req->src_mac0, s->smtab[e->idx - 1].src_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(req->src_mac0, s->smtab[e->idx - 1].src_mac,
+ RTE_ETHER_ADDR_LEN);
} else {
req->pfvf0 = 0x0;
- rte_memcpy(req->src_mac0, e->src_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(req->src_mac0, e->src_mac, RTE_ETHER_ADDR_LEN);
/* fill pfvf1/src_mac1 with entry
* at next index from smt-tab
*/
req->pfvf1 = 0x0;
- rte_memcpy(req->src_mac1, s->smtab[e->idx + 1].src_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(req->src_mac1, s->smtab[e->idx + 1].src_mac,
+ RTE_ETHER_ADDR_LEN);
}
row = (e->hw_idx >> 1);
} else {
@@ -87,8 +85,8 @@ static int write_smt_entry(struct rte_eth_dev *dev, struct smt_entry *e)
/* fill pfvf0/src_mac0 from smt-tab */
t6req->pfvf0 = 0x0;
- rte_memcpy(t6req->src_mac0, s->smtab[e->idx].src_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(t6req->src_mac0, s->smtab[e->idx].src_mac,
+ RTE_ETHER_ADDR_LEN);
row = e->hw_idx;
req = (struct cpl_smt_write_req *)t6req;
}
@@ -158,7 +156,7 @@ static struct smt_entry *t4_smt_alloc_switching(struct rte_eth_dev *dev,
t4_os_lock(&e->lock);
if (__atomic_load_n(&e->refcnt, __ATOMIC_RELAXED) == 0) {
e->pfvf = pfvf;
- rte_memcpy(e->src_mac, smac, RTE_ETHER_ADDR_LEN);
+ memcpy(e->src_mac, smac, RTE_ETHER_ADDR_LEN);
ret = write_smt_entry(dev, e);
if (ret) {
e->pfvf = 0;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 60/71] net/dpaa2: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (58 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 59/71] net/cxgbe: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 61/71] net/e1000: " Stephen Hemminger
` (16 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/dpaa2/dpaa2_tm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dpaa2/dpaa2_tm.c b/drivers/net/dpaa2/dpaa2_tm.c
index 8fe5bfa013bb..1749b1be2295 100644
--- a/drivers/net/dpaa2/dpaa2_tm.c
+++ b/drivers/net/dpaa2/dpaa2_tm.c
@@ -324,7 +324,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,
NULL, NULL);
profile->id = shaper_profile_id;
- rte_memcpy(&profile->params, params, sizeof(profile->params));
+ memcpy(&profile->params, params, sizeof(profile->params));
LIST_INSERT_HEAD(&priv->shaper_profiles, profile, next);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 61/71] net/e1000: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (59 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 60/71] net/dpaa2: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 62/71] net/enic: " Stephen Hemminger
` (15 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/e1000/igb_flow.c | 22 ++++++++++------------
drivers/net/e1000/igb_pf.c | 6 +++---
2 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c
index ea9b290e1cb5..8bca48496035 100644
--- a/drivers/net/e1000/igb_flow.c
+++ b/drivers/net/e1000/igb_flow.c
@@ -1484,9 +1484,9 @@ igb_flow_create(struct rte_eth_dev *dev,
goto out;
}
- rte_memcpy(&ntuple_filter_ptr->filter_info,
- &ntuple_filter,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter_ptr->filter_info,
+ &ntuple_filter,
+ sizeof(struct rte_eth_ntuple_filter));
TAILQ_INSERT_TAIL(&igb_filter_ntuple_list,
ntuple_filter_ptr, entries);
flow->rule = ntuple_filter_ptr;
@@ -1511,9 +1511,9 @@ igb_flow_create(struct rte_eth_dev *dev,
goto out;
}
- rte_memcpy(ðertype_filter_ptr->filter_info,
- ðertype_filter,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter_ptr->filter_info,
+ ðertype_filter,
+ sizeof(struct rte_eth_ethertype_filter));
TAILQ_INSERT_TAIL(&igb_filter_ethertype_list,
ethertype_filter_ptr, entries);
flow->rule = ethertype_filter_ptr;
@@ -1536,9 +1536,8 @@ igb_flow_create(struct rte_eth_dev *dev,
goto out;
}
- rte_memcpy(&syn_filter_ptr->filter_info,
- &syn_filter,
- sizeof(struct rte_eth_syn_filter));
+ memcpy(&syn_filter_ptr->filter_info, &syn_filter,
+ sizeof(struct rte_eth_syn_filter));
TAILQ_INSERT_TAIL(&igb_filter_syn_list,
syn_filter_ptr,
entries);
@@ -1562,9 +1561,8 @@ igb_flow_create(struct rte_eth_dev *dev,
goto out;
}
- rte_memcpy(&flex_filter_ptr->filter_info,
- &flex_filter,
- sizeof(struct igb_flex_filter));
+ memcpy(&flex_filter_ptr->filter_info, &flex_filter,
+ sizeof(struct igb_flex_filter));
TAILQ_INSERT_TAIL(&igb_filter_flex_list,
flex_filter_ptr, entries);
flow->rule = flex_filter_ptr;
diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c
index c7588ea57eaa..7e2ea3bdbcc1 100644
--- a/drivers/net/e1000/igb_pf.c
+++ b/drivers/net/e1000/igb_pf.c
@@ -290,7 +290,7 @@ igb_vf_reset(struct rte_eth_dev *dev, uint16_t vf, uint32_t *msgbuf)
/* reply to reset with ack and vf mac address */
msgbuf[0] = E1000_VF_RESET | E1000_VT_MSGTYPE_ACK;
- rte_memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
+ memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
e1000_write_mbx(hw, msgbuf, 3, vf);
return 0;
@@ -308,8 +308,8 @@ igb_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
if (rte_is_unicast_ether_addr((struct rte_ether_addr *)new_mac)) {
if (!rte_is_zero_ether_addr((struct rte_ether_addr *)new_mac))
- rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac,
- sizeof(vfinfo[vf].vf_mac_addresses));
+ memcpy(vfinfo[vf].vf_mac_addresses, new_mac,
+ sizeof(vfinfo[vf].vf_mac_addresses));
hw->mac.ops.rar_set(hw, new_mac, rar_entry);
rah = E1000_READ_REG(hw, E1000_RAH(rar_entry));
rah |= (0x1 << (E1000_RAH_POOLSEL_SHIFT + vf));
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 62/71] net/enic: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (60 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 61/71] net/e1000: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 63/71] net/failsafe: " Stephen Hemminger
` (14 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, John Daley, Hyong Youb Kim
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/enic/enic_main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index a6aaa760ca91..a940c160c9f1 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1221,8 +1221,8 @@ static int enic_set_rsskey(struct enic *enic, uint8_t *user_key)
/* Save for later queries */
if (!err) {
- rte_memcpy(&enic->rss_key, rss_key_buf_va,
- sizeof(union vnic_rss_key));
+ memcpy(&enic->rss_key, rss_key_buf_va,
+ sizeof(union vnic_rss_key));
}
enic_free_consistent(enic, sizeof(union vnic_rss_key),
rss_key_buf_va, rss_key_buf_pa);
@@ -1243,7 +1243,7 @@ int enic_set_rss_reta(struct enic *enic, union vnic_rss_cpu *rss_cpu)
if (!rss_cpu_buf_va)
return -ENOMEM;
- rte_memcpy(rss_cpu_buf_va, rss_cpu, sizeof(union vnic_rss_cpu));
+ memcpy(rss_cpu_buf_va, rss_cpu, sizeof(union vnic_rss_cpu));
err = enic_set_rss_cpu(enic,
rss_cpu_buf_pa,
@@ -1254,7 +1254,7 @@ int enic_set_rss_reta(struct enic *enic, union vnic_rss_cpu *rss_cpu)
/* Save for later queries */
if (!err)
- rte_memcpy(&enic->rss_cpu, rss_cpu, sizeof(union vnic_rss_cpu));
+ memcpy(&enic->rss_cpu, rss_cpu, sizeof(union vnic_rss_cpu));
return err;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 63/71] net/failsafe: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (61 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 62/71] net/enic: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 64/71] net/gve/base: " Stephen Hemminger
` (13 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Gaetan Rivet
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/failsafe/failsafe_ops.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index 9c013e04195c..47d453ef8028 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -902,16 +902,16 @@ fs_stats_get(struct rte_eth_dev *dev,
ret = fs_lock(dev, 0);
if (ret != 0)
return ret;
- rte_memcpy(stats, &PRIV(dev)->stats_accumulator, sizeof(*stats));
+ memcpy(stats, &PRIV(dev)->stats_accumulator, sizeof(*stats));
FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {
struct rte_eth_stats *snapshot = &sdev->stats_snapshot.stats;
uint64_t *timestamp = &sdev->stats_snapshot.timestamp;
- rte_memcpy(&backup, snapshot, sizeof(backup));
+ memcpy(&backup, snapshot, sizeof(backup));
ret = rte_eth_stats_get(PORT_ID(sdev), snapshot);
if (ret) {
if (!fs_err(sdev, ret)) {
- rte_memcpy(snapshot, &backup, sizeof(backup));
+ memcpy(snapshot, &backup, sizeof(backup));
goto inc;
}
ERROR("Operation rte_eth_stats_get failed for sub_device %d with error %d",
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 64/71] net/gve/base: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (62 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 63/71] net/failsafe: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 65/71] net/hinic: " Stephen Hemminger
` (12 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Junfeng Guo, Jeroen de Borst, Rushil Gupta,
Joshua Washington
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/gve/base/gve_adminq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/gve/base/gve_adminq.c b/drivers/net/gve/base/gve_adminq.c
index 629d15cfbe77..24b00a1fbf5b 100644
--- a/drivers/net/gve/base/gve_adminq.c
+++ b/drivers/net/gve/base/gve_adminq.c
@@ -785,7 +785,7 @@ int gve_adminq_describe_device(struct gve_priv *priv)
}
priv->max_mtu = mtu;
priv->num_event_counters = be16_to_cpu(descriptor->counters);
- rte_memcpy(priv->dev_addr.addr_bytes, descriptor->mac, ETH_ALEN);
+ memcpy(priv->dev_addr.addr_bytes, descriptor->mac, ETH_ALEN);
PMD_DRV_LOG(INFO, "MAC addr: " RTE_ETHER_ADDR_PRT_FMT,
RTE_ETHER_ADDR_BYTES(&priv->dev_addr));
priv->tx_pages_per_qpl = be16_to_cpu(descriptor->tx_pages_per_qpl);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 65/71] net/hinic: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (63 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 64/71] net/gve/base: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 66/71] net/mvpp2: " Stephen Hemminger
` (11 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/hinic/hinic_pmd_flow.c | 40 ++++++++++++++----------------
1 file changed, 18 insertions(+), 22 deletions(-)
diff --git a/drivers/net/hinic/hinic_pmd_flow.c b/drivers/net/hinic/hinic_pmd_flow.c
index d1a564a16303..cb61c989fd36 100644
--- a/drivers/net/hinic/hinic_pmd_flow.c
+++ b/drivers/net/hinic/hinic_pmd_flow.c
@@ -983,8 +983,7 @@ static int hinic_normal_item_check_ip(const struct rte_flow_item **in_out_item,
}
ipv6_spec = (const struct rte_flow_item_ipv6 *)item->spec;
- rte_memcpy(rule->hinic_fdir.dst_ipv6,
- ipv6_spec->hdr.dst_addr, 16);
+ memcpy(rule->hinic_fdir.dst_ipv6, ipv6_spec->hdr.dst_addr, 16);
/*
* Check if the next not void item is TCP or UDP or ICMP.
@@ -2193,8 +2192,8 @@ static int hinic_add_del_ntuple_filter(struct rte_eth_dev *dev,
sizeof(struct hinic_5tuple_filter), 0);
if (filter == NULL)
return -ENOMEM;
- rte_memcpy(&filter->filter_info, &filter_5tuple,
- sizeof(struct hinic_5tuple_filter_info));
+ memcpy(&filter->filter_info, &filter_5tuple,
+ sizeof(struct hinic_5tuple_filter_info));
filter->queue = ntuple_filter->queue;
filter_info->qid = ntuple_filter->queue;
@@ -2912,8 +2911,7 @@ static int hinic_add_del_tcam_fdir_filter(struct rte_eth_dev *dev,
sizeof(struct hinic_tcam_filter), 0);
if (tcam_filter == NULL)
return -ENOMEM;
- (void)rte_memcpy(&tcam_filter->tcam_key,
- &tcam_key, sizeof(struct tag_tcam_key));
+ memcpy(&tcam_filter->tcam_key, &tcam_key, sizeof(struct tag_tcam_key));
tcam_filter->queue = fdir_tcam_rule.data.qid;
ret = hinic_add_tcam_filter(dev, tcam_filter, &fdir_tcam_rule);
@@ -2990,9 +2988,9 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
&ntuple_filter, FALSE);
goto out;
}
- rte_memcpy(&ntuple_filter_ptr->filter_info,
- &ntuple_filter,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter_ptr->filter_info,
+ &ntuple_filter,
+ sizeof(struct rte_eth_ntuple_filter));
TAILQ_INSERT_TAIL(&nic_dev->filter_ntuple_list,
ntuple_filter_ptr, entries);
flow->rule = ntuple_filter_ptr;
@@ -3022,9 +3020,9 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
ðertype_filter, FALSE);
goto out;
}
- rte_memcpy(ðertype_filter_ptr->filter_info,
- ðertype_filter,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter_ptr->filter_info,
+ ðertype_filter,
+ sizeof(struct rte_eth_ethertype_filter));
TAILQ_INSERT_TAIL(&nic_dev->filter_ethertype_list,
ethertype_filter_ptr, entries);
flow->rule = ethertype_filter_ptr;
@@ -3065,8 +3063,8 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
goto out;
}
- rte_memcpy(&fdir_rule_ptr->filter_info, &fdir_rule,
- sizeof(struct hinic_fdir_rule));
+ memcpy(&fdir_rule_ptr->filter_info, &fdir_rule,
+ sizeof(struct hinic_fdir_rule));
TAILQ_INSERT_TAIL(&nic_dev->filter_fdir_rule_list,
fdir_rule_ptr, entries);
flow->rule = fdir_rule_ptr;
@@ -3109,8 +3107,8 @@ static int hinic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
case RTE_ETH_FILTER_NTUPLE:
ntuple_filter_ptr = (struct hinic_ntuple_filter_ele *)
pmd_flow->rule;
- rte_memcpy(&ntuple_filter, &ntuple_filter_ptr->filter_info,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter, &ntuple_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ntuple_filter));
ret = hinic_add_del_ntuple_filter(dev, &ntuple_filter, FALSE);
if (!ret) {
TAILQ_REMOVE(&nic_dev->filter_ntuple_list,
@@ -3121,9 +3119,8 @@ static int hinic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
case RTE_ETH_FILTER_ETHERTYPE:
ethertype_filter_ptr = (struct hinic_ethertype_filter_ele *)
pmd_flow->rule;
- rte_memcpy(ðertype_filter,
- ðertype_filter_ptr->filter_info,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter, ðertype_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ethertype_filter));
ret = hinic_add_del_ethertype_filter(dev,
ðertype_filter, FALSE);
if (!ret) {
@@ -3134,9 +3131,8 @@ static int hinic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
break;
case RTE_ETH_FILTER_FDIR:
fdir_rule_ptr = (struct hinic_fdir_rule_ele *)pmd_flow->rule;
- rte_memcpy(&fdir_rule,
- &fdir_rule_ptr->filter_info,
- sizeof(struct hinic_fdir_rule));
+ memcpy(&fdir_rule, &fdir_rule_ptr->filter_info,
+ sizeof(struct hinic_fdir_rule));
if (fdir_rule.mode == HINIC_FDIR_MODE_NORMAL) {
ret = hinic_add_del_fdir_filter(dev, &fdir_rule, FALSE);
} else if (fdir_rule.mode == HINIC_FDIR_MODE_TCAM) {
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 66/71] net/mvpp2: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (64 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 65/71] net/hinic: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 67/71] app/test-pmd: " Stephen Hemminger
` (10 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Liron Himi
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/mvpp2/mrvl_tm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/mvpp2/mrvl_tm.c b/drivers/net/mvpp2/mrvl_tm.c
index 9fac80b867be..a5cdae6d1d0d 100644
--- a/drivers/net/mvpp2/mrvl_tm.c
+++ b/drivers/net/mvpp2/mrvl_tm.c
@@ -437,7 +437,7 @@ mrvl_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,
NULL, NULL);
profile->id = shaper_profile_id;
- rte_memcpy(&profile->params, params, sizeof(profile->params));
+ memcpy(&profile->params, params, sizeof(profile->params));
LIST_INSERT_HEAD(&priv->shaper_profiles, profile, next);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 67/71] app/test-pmd: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (65 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 66/71] net/mvpp2: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 68/71] app/graph: " Stephen Hemminger
` (9 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Aman Singh, Yuying Zhang, Ori Kam
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-pmd/cmdline.c | 48 ++++++++++++++++++-------------------
app/test-pmd/cmdline_flow.c | 24 +++++++++----------
app/test-pmd/config.c | 8 +++----
3 files changed, 40 insertions(+), 40 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 566057caa523..898fb69a2f4d 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -9529,7 +9529,7 @@ static void cmd_set_vxlan_parsed(void *parsed_result,
vxlan_encap_conf.select_ipv4 = 0;
else
return;
- rte_memcpy(vxlan_encap_conf.vni, &id.vni[1], 3);
+ memcpy(vxlan_encap_conf.vni, &id.vni[1], 3);
vxlan_encap_conf.udp_src = rte_cpu_to_be_16(res->udp_src);
vxlan_encap_conf.udp_dst = rte_cpu_to_be_16(res->udp_dst);
vxlan_encap_conf.ip_tos = res->tos;
@@ -9543,10 +9543,10 @@ static void cmd_set_vxlan_parsed(void *parsed_result,
}
if (vxlan_encap_conf.select_vlan)
vxlan_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
- rte_memcpy(vxlan_encap_conf.eth_src, res->eth_src.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- rte_memcpy(vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(vxlan_encap_conf.eth_src, res->eth_src.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
}
static cmdline_parse_inst_t cmd_set_vxlan = {
@@ -9724,7 +9724,7 @@ static void cmd_set_nvgre_parsed(void *parsed_result,
nvgre_encap_conf.select_ipv4 = 0;
else
return;
- rte_memcpy(nvgre_encap_conf.tni, &id.tni[1], 3);
+ memcpy(nvgre_encap_conf.tni, &id.tni[1], 3);
if (nvgre_encap_conf.select_ipv4) {
IPV4_ADDR_TO_UINT(res->ip_src, nvgre_encap_conf.ipv4_src);
IPV4_ADDR_TO_UINT(res->ip_dst, nvgre_encap_conf.ipv4_dst);
@@ -9734,10 +9734,10 @@ static void cmd_set_nvgre_parsed(void *parsed_result,
}
if (nvgre_encap_conf.select_vlan)
nvgre_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
- rte_memcpy(nvgre_encap_conf.eth_src, res->eth_src.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- rte_memcpy(nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(nvgre_encap_conf.eth_src, res->eth_src.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
}
static cmdline_parse_inst_t cmd_set_nvgre = {
@@ -9851,10 +9851,10 @@ static void cmd_set_l2_encap_parsed(void *parsed_result,
return;
if (l2_encap_conf.select_vlan)
l2_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
- rte_memcpy(l2_encap_conf.eth_src, res->eth_src.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- rte_memcpy(l2_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(l2_encap_conf.eth_src, res->eth_src.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(l2_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
}
static cmdline_parse_inst_t cmd_set_l2_encap = {
@@ -10033,7 +10033,7 @@ static void cmd_set_mplsogre_encap_parsed(void *parsed_result,
mplsogre_encap_conf.select_ipv4 = 0;
else
return;
- rte_memcpy(mplsogre_encap_conf.label, &id.label, 3);
+ memcpy(mplsogre_encap_conf.label, &id.label, 3);
if (mplsogre_encap_conf.select_ipv4) {
IPV4_ADDR_TO_UINT(res->ip_src, mplsogre_encap_conf.ipv4_src);
IPV4_ADDR_TO_UINT(res->ip_dst, mplsogre_encap_conf.ipv4_dst);
@@ -10043,10 +10043,10 @@ static void cmd_set_mplsogre_encap_parsed(void *parsed_result,
}
if (mplsogre_encap_conf.select_vlan)
mplsogre_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
- rte_memcpy(mplsogre_encap_conf.eth_src, res->eth_src.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- rte_memcpy(mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(mplsogre_encap_conf.eth_src, res->eth_src.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
}
static cmdline_parse_inst_t cmd_set_mplsogre_encap = {
@@ -10269,7 +10269,7 @@ static void cmd_set_mplsoudp_encap_parsed(void *parsed_result,
mplsoudp_encap_conf.select_ipv4 = 0;
else
return;
- rte_memcpy(mplsoudp_encap_conf.label, &id.label, 3);
+ memcpy(mplsoudp_encap_conf.label, &id.label, 3);
mplsoudp_encap_conf.udp_src = rte_cpu_to_be_16(res->udp_src);
mplsoudp_encap_conf.udp_dst = rte_cpu_to_be_16(res->udp_dst);
if (mplsoudp_encap_conf.select_ipv4) {
@@ -10281,10 +10281,10 @@ static void cmd_set_mplsoudp_encap_parsed(void *parsed_result,
}
if (mplsoudp_encap_conf.select_vlan)
mplsoudp_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
- rte_memcpy(mplsoudp_encap_conf.eth_src, res->eth_src.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- rte_memcpy(mplsoudp_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(mplsoudp_encap_conf.eth_src, res->eth_src.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(mplsoudp_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
}
static cmdline_parse_inst_t cmd_set_mplsoudp_encap = {
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index b4389e51506b..17b73d2407c4 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -13732,7 +13732,7 @@ cmd_set_raw_parsed_sample(const struct buffer *in)
fprintf(stderr, "Error - Not supported action\n");
return;
}
- rte_memcpy(data, action, sizeof(struct rte_flow_action));
+ memcpy(data, action, sizeof(struct rte_flow_action));
data++;
}
}
@@ -13893,8 +13893,8 @@ cmd_set_raw_parsed(const struct buffer *in)
/* We have to add GTP header extra word. */
*total_size += sizeof(ext_word);
- rte_memcpy(data_tail - (*total_size),
- &ext_word, sizeof(ext_word));
+ memcpy(data_tail - (*total_size), &ext_word,
+ sizeof(ext_word));
}
size = sizeof(struct rte_gtp_hdr);
break;
@@ -13939,21 +13939,21 @@ cmd_set_raw_parsed(const struct buffer *in)
if (opt->checksum_rsvd.checksum) {
*total_size +=
sizeof(opt->checksum_rsvd);
- rte_memcpy(data_tail - (*total_size),
- &opt->checksum_rsvd,
- sizeof(opt->checksum_rsvd));
+ memcpy(data_tail - (*total_size),
+ &opt->checksum_rsvd,
+ sizeof(opt->checksum_rsvd));
}
if (opt->key.key) {
*total_size += sizeof(opt->key.key);
- rte_memcpy(data_tail - (*total_size),
- &opt->key.key,
- sizeof(opt->key.key));
+ memcpy(data_tail - (*total_size),
+ &opt->key.key,
+ sizeof(opt->key.key));
}
if (opt->sequence.sequence) {
*total_size += sizeof(opt->sequence.sequence);
- rte_memcpy(data_tail - (*total_size),
- &opt->sequence.sequence,
- sizeof(opt->sequence.sequence));
+ memcpy(data_tail - (*total_size),
+ &opt->sequence.sequence,
+ sizeof(opt->sequence.sequence));
}
}
proto = 0x2F;
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 08d7d0e2f87c..2b81f3ef3d2d 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2639,8 +2639,8 @@ port_flow_template_table_create(portid_t port_id, uint32_t id,
}
pt->nb_pattern_templates = nb_pattern_templates;
pt->nb_actions_templates = nb_actions_templates;
- rte_memcpy(&pt->flow_attr, &table_attr->flow_attr,
- sizeof(struct rte_flow_attr));
+ memcpy(&pt->flow_attr, &table_attr->flow_attr,
+ sizeof(struct rte_flow_attr));
printf("Template table #%u created\n", pt->id);
return 0;
}
@@ -3261,8 +3261,8 @@ port_queue_action_handle_update(portid_t port_id,
update = action->conf;
break;
case RTE_FLOW_ACTION_TYPE_METER_MARK:
- rte_memcpy(&mtr_update.meter_mark, action->conf,
- sizeof(struct rte_flow_action_meter_mark));
+ memcpy(&mtr_update.meter_mark, action->conf,
+ sizeof(struct rte_flow_action_meter_mark));
if (mtr_update.meter_mark.profile)
mtr_update.profile_valid = 1;
if (mtr_update.meter_mark.policy)
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 68/71] app/graph: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (66 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 67/71] app/test-pmd: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 69/71] app/test-eventdev: " Stephen Hemminger
` (8 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Sunil Kumar Kori, Rakesh Kudurumalla
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/graph/neigh.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/graph/neigh.c b/app/graph/neigh.c
index 22be7361e310..a99d2b6981a2 100644
--- a/app/graph/neigh.c
+++ b/app/graph/neigh.c
@@ -91,14 +91,14 @@ ip6_rewrite_node_add(struct neigh_ipv6_config *v6_config)
memset(data, 0, len);
/* Copy dst mac */
- rte_memcpy((void *)&data[0], (void *)&v6_config->mac, RTE_ETHER_ADDR_LEN);
+ memcpy((void *)&data[0], (void *)&v6_config->mac, RTE_ETHER_ADDR_LEN);
/* Copy src mac */
rc = rte_eth_macaddr_get(portid, &smac);
if (rc < 0)
return rc;
- rte_memcpy(&data[RTE_ETHER_ADDR_LEN], smac.addr_bytes, RTE_ETHER_ADDR_LEN);
+ memcpy(&data[RTE_ETHER_ADDR_LEN], smac.addr_bytes, RTE_ETHER_ADDR_LEN);
return rte_node_ip6_rewrite_add(portid, data, len, portid);
}
@@ -121,7 +121,7 @@ ip4_rewrite_node_add(struct neigh_ipv4_config *v4_config)
memset(data, 0, len);
/* Copy dst mac */
- rte_memcpy((void *)&data[0], (void *)&v4_config->mac, RTE_ETHER_ADDR_LEN);
+ memcpy((void *)&data[0], (void *)&v4_config->mac, RTE_ETHER_ADDR_LEN);
/* Copy src mac */
rc = rte_eth_macaddr_get(portid, &smac);
@@ -130,7 +130,7 @@ ip4_rewrite_node_add(struct neigh_ipv4_config *v4_config)
return rc;
}
- rte_memcpy(&data[RTE_ETHER_ADDR_LEN], smac.addr_bytes, RTE_ETHER_ADDR_LEN);
+ memcpy(&data[RTE_ETHER_ADDR_LEN], smac.addr_bytes, RTE_ETHER_ADDR_LEN);
return rte_node_ip4_rewrite_add(portid, data, len, portid);
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 69/71] app/test-eventdev: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (67 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 68/71] app/graph: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 70/71] app/test: " Stephen Hemminger
` (7 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jerin Jacob
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-eventdev/test_pipeline_common.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
index b111690b7cd4..49bfd0c363f5 100644
--- a/app/test-eventdev/test_pipeline_common.c
+++ b/app/test-eventdev/test_pipeline_common.c
@@ -177,22 +177,17 @@ pipeline_tx_first(struct test_pipeline *t, struct evt_options *opt)
mbuf->pkt_len = pkt_sz;
/* Copy Ethernet header */
- rte_memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, 0),
- ð_hdr, sizeof(struct rte_ether_hdr));
+ memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, 0),
+ ð_hdr, sizeof(struct rte_ether_hdr));
/* Copy Ipv4 header */
- rte_memcpy(rte_pktmbuf_mtod_offset(
- mbuf, char *,
- sizeof(struct rte_ether_hdr)),
- &ip_hdr, sizeof(struct rte_ipv4_hdr));
+ memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, sizeof(struct rte_ether_hdr)),
+ &ip_hdr, sizeof(struct rte_ipv4_hdr));
/* Copy UDP header */
- rte_memcpy(
- rte_pktmbuf_mtod_offset(
- mbuf, char *,
- sizeof(struct rte_ipv4_hdr) +
- sizeof(struct rte_ether_hdr)),
- &udp_hdr, sizeof(struct rte_udp_hdr));
+ memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, sizeof(struct rte_ipv4_hdr)
+ + sizeof(struct rte_ether_hdr)),
+ &udp_hdr, sizeof(struct rte_udp_hdr));
pkt_udp_hdr = rte_pktmbuf_mtod_offset(
mbuf, struct rte_udp_hdr *,
sizeof(struct rte_ipv4_hdr) +
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 70/71] app/test: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (68 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 69/71] app/test-eventdev: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-02-29 22:58 ` [PATCH 71/71] examples: " Stephen Hemminger
` (6 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Jasvinder Singh, Akhil Goyal, Fan Zhang,
Abhinandan Gujjar, Amit Prakash Shukla, Konstantin Ananyev,
Vladimir Medvedkin, Chas Williams, Min Hu (Connor),
Anoob Joseph
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test/packet_burst_generator.c | 4 +--
app/test/test_crc.c | 4 +--
app/test/test_cryptodev.c | 18 ++++++--------
app/test/test_event_crypto_adapter.c | 12 ++++-----
app/test/test_event_dma_adapter.c | 4 +--
app/test/test_ipsec.c | 6 ++---
app/test/test_link_bonding_mode4.c | 8 +++---
app/test/test_security_inline_proto.c | 36 +++++++++++++--------------
app/test/virtual_pmd.c | 2 +-
9 files changed, 46 insertions(+), 48 deletions(-)
diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c
index 867a88da0055..fcca2d238ece 100644
--- a/app/test/packet_burst_generator.c
+++ b/app/test/packet_burst_generator.c
@@ -148,8 +148,8 @@ initialize_ipv6_header(struct rte_ipv6_hdr *ip_hdr, uint8_t *src_addr,
ip_hdr->proto = IPPROTO_UDP;
ip_hdr->hop_limits = IP_DEFTTL;
- rte_memcpy(ip_hdr->src_addr, src_addr, sizeof(ip_hdr->src_addr));
- rte_memcpy(ip_hdr->dst_addr, dst_addr, sizeof(ip_hdr->dst_addr));
+ memcpy(ip_hdr->src_addr, src_addr, sizeof(ip_hdr->src_addr));
+ memcpy(ip_hdr->dst_addr, dst_addr, sizeof(ip_hdr->dst_addr));
return (uint16_t) (pkt_data_len + sizeof(struct rte_ipv6_hdr));
}
diff --git a/app/test/test_crc.c b/app/test/test_crc.c
index b85fca35fe2d..67252b18a84a 100644
--- a/app/test/test_crc.c
+++ b/app/test/test_crc.c
@@ -83,7 +83,7 @@ test_crc_calc(void)
return -7;
for (i = 0; i < CRC32_VEC_LEN1; i += 12)
- rte_memcpy(&test_data[i], crc32_vec1, 12);
+ memcpy(&test_data[i], crc32_vec1, 12);
result = crc_calc(test_data, CRC32_VEC_LEN1, type);
if (result != crc32_vec1_res) {
@@ -93,7 +93,7 @@ test_crc_calc(void)
/* 32-bit ethernet CRC: Test 3 */
for (i = 0; i < CRC32_VEC_LEN2; i += 12)
- rte_memcpy(&test_data[i], crc32_vec1, 12);
+ memcpy(&test_data[i], crc32_vec1, 12);
result = crc_calc(test_data, CRC32_VEC_LEN2, type);
if (result != crc32_vec2_res) {
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 38a65aa88f04..d87bcbb05b86 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -2345,8 +2345,8 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
sym_op->auth.data.length = QUOTE_512_BYTES;
/* Copy IV at the end of the crypto operation */
- rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET),
- aes_cbc_iv, CIPHER_IV_LENGTH_AES_CBC);
+ memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET),
+ aes_cbc_iv, CIPHER_IV_LENGTH_AES_CBC);
/* Set crypto operation cipher parameters */
sym_op->cipher.data.offset = 0;
@@ -2480,9 +2480,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(void *sess,
DIGEST_BYTE_LENGTH_SHA512);
TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
- rte_memcpy(ut_params->digest,
- digest,
- DIGEST_BYTE_LENGTH_SHA512);
+ memcpy(ut_params->digest, digest, DIGEST_BYTE_LENGTH_SHA512);
/* Generate Crypto op data structure */
ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
@@ -2505,8 +2503,8 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(void *sess,
sym_op->auth.data.length = QUOTE_512_BYTES;
/* Copy IV at the end of the crypto operation */
- rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET),
- iv, CIPHER_IV_LENGTH_AES_CBC);
+ memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET),
+ iv, CIPHER_IV_LENGTH_AES_CBC);
sym_op->cipher.data.offset = 0;
sym_op->cipher.data.length = QUOTE_512_BYTES;
@@ -8863,7 +8861,7 @@ create_aead_operation(enum rte_crypto_aead_operation op,
uint8_t *, IV_OFFSET);
if (tdata->iv.len == 0) {
- rte_memcpy(iv_ptr, tdata->iv.data, AES_GCM_J0_LENGTH);
+ memcpy(iv_ptr, tdata->iv.data, AES_GCM_J0_LENGTH);
debug_hexdump(stdout, "iv:", iv_ptr,
AES_GCM_J0_LENGTH);
} else {
@@ -13659,8 +13657,8 @@ test_multi_session_random_usage(void)
for (i = 0; i < MB_SESSION_NUMBER; i++) {
- rte_memcpy(&ut_paramz[i].ut_params, &unittest_params,
- sizeof(struct crypto_unittest_params));
+ memcpy(&ut_paramz[i].ut_params, &unittest_params,
+ sizeof(struct crypto_unittest_params));
test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
&ut_paramz[i].ut_params,
diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 0c56744ba031..4992c5bc5035 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -454,7 +454,7 @@ test_op_forward_mode(uint8_t session_less)
m_data.request_info.cdev_id = request_info.cdev_id;
m_data.request_info.queue_pair_id = request_info.queue_pair_id;
m_data.response_info.event = response_info.event;
- rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
+ memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
}
sym_op->m_src = m;
@@ -653,8 +653,8 @@ test_asym_op_forward_mode(uint8_t session_less)
m_data.request_info.cdev_id = request_info.cdev_id;
m_data.request_info.queue_pair_id = request_info.queue_pair_id;
m_data.response_info.event = response_info.event;
- rte_memcpy((uint8_t *)op + op->private_data_offset,
- &m_data, sizeof(m_data));
+ memcpy((uint8_t *)op + op->private_data_offset, &m_data,
+ sizeof(m_data));
}
/* Fill in event info and update event_ptr with rte_crypto_op */
memset(&ev, 0, sizeof(ev));
@@ -820,7 +820,7 @@ test_op_new_mode(uint8_t session_less)
op->private_data_offset = len;
/* Fill in private data information */
m_data.response_info.event = response_info.event;
- rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
+ memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
}
sym_op->m_src = m;
@@ -977,8 +977,8 @@ test_asym_op_new_mode(uint8_t session_less)
sizeof(struct rte_crypto_asym_xform));
/* Fill in private data information */
m_data.response_info.event = response_info.event;
- rte_memcpy((uint8_t *)op + op->private_data_offset,
- &m_data, sizeof(m_data));
+ memcpy((uint8_t *)op + op->private_data_offset, &m_data,
+ sizeof(m_data));
}
ret = send_op_recv_ev(op);
diff --git a/app/test/test_event_dma_adapter.c b/app/test/test_event_dma_adapter.c
index 35b417b69f7b..af2e44a703e4 100644
--- a/app/test/test_event_dma_adapter.c
+++ b/app/test/test_event_dma_adapter.c
@@ -269,8 +269,8 @@ test_op_forward_mode(void)
op->vchan = TEST_DMA_VCHAN_ID;
response_info.event = dma_response_info.event;
- rte_memcpy((uint8_t *)op + sizeof(struct rte_event_dma_adapter_op), &response_info,
- sizeof(struct rte_event));
+ memcpy((uint8_t *)op + sizeof(struct rte_event_dma_adapter_op),
+ &response_info, sizeof(struct rte_event));
/* Fill in event info and update event_ptr with rte_event_dma_adapter_op */
memset(&ev[i], 0, sizeof(struct rte_event));
diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c
index 6cb1bac1e732..25aabdb616da 100644
--- a/app/test/test_ipsec.c
+++ b/app/test/test_ipsec.c
@@ -601,10 +601,10 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string,
/* copy outer IP and ESP header */
ipv4_outer.total_length = rte_cpu_to_be_16(t_len);
ipv4_outer.packet_id = rte_cpu_to_be_16(seq);
- rte_memcpy(dst, &ipv4_outer, sizeof(ipv4_outer));
+ memcpy(dst, &ipv4_outer, sizeof(ipv4_outer));
dst += sizeof(ipv4_outer);
m->l3_len = sizeof(ipv4_outer);
- rte_memcpy(dst, &esph, sizeof(esph));
+ memcpy(dst, &esph, sizeof(esph));
dst += sizeof(esph);
if (string != NULL) {
@@ -616,7 +616,7 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string,
sizeof(esp_pad_bytes)));
dst += padlen;
/* copy ESP tail header */
- rte_memcpy(dst, &espt, sizeof(espt));
+ memcpy(dst, &espt, sizeof(espt));
} else
memset(dst, 0, t_len);
diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c
index ff13dbed93f3..e4827c1e8091 100644
--- a/app/test/test_link_bonding_mode4.c
+++ b/app/test/test_link_bonding_mode4.c
@@ -1399,8 +1399,8 @@ test_mode4_ext_ctrl(void)
for (i = 0; i < MEMBER_COUNT; i++) {
lacp_tx_buf[i] = rte_pktmbuf_alloc(test_params.mbuf_pool);
- rte_memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *),
- &lacpdu, sizeof(lacpdu));
+ memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *), &lacpdu,
+ sizeof(lacpdu));
rte_pktmbuf_pkt_len(lacp_tx_buf[i]) = sizeof(lacpdu);
}
@@ -1453,8 +1453,8 @@ test_mode4_ext_lacp(void)
for (i = 0; i < MEMBER_COUNT; i++) {
lacp_tx_buf[i] = rte_pktmbuf_alloc(test_params.mbuf_pool);
- rte_memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *),
- &lacpdu, sizeof(lacpdu));
+ memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *), &lacpdu,
+ sizeof(lacpdu));
rte_pktmbuf_pkt_len(lacp_tx_buf[i]) = sizeof(lacpdu);
}
diff --git a/app/test/test_security_inline_proto.c b/app/test/test_security_inline_proto.c
index 481382b64e85..8268a0855ba7 100644
--- a/app/test/test_security_inline_proto.c
+++ b/app/test/test_security_inline_proto.c
@@ -245,8 +245,8 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,
/* Copy cipher session parameters */
if (sa->aead) {
- rte_memcpy(sess_conf->crypto_xform, &sa->xform.aead,
- sizeof(struct rte_crypto_sym_xform));
+ memcpy(sess_conf->crypto_xform, &sa->xform.aead,
+ sizeof(struct rte_crypto_sym_xform));
sess_conf->crypto_xform->aead.key.data = sa->key.data;
/* Verify crypto capabilities */
if (test_sec_crypto_caps_aead_verify(sec_cap, sess_conf->crypto_xform) != 0) {
@@ -256,13 +256,13 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,
}
} else {
if (dir == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) {
- rte_memcpy(&sess_conf->crypto_xform->cipher,
- &sa->xform.chain.cipher.cipher,
- sizeof(struct rte_crypto_cipher_xform));
+ memcpy(&sess_conf->crypto_xform->cipher,
+ &sa->xform.chain.cipher.cipher,
+ sizeof(struct rte_crypto_cipher_xform));
- rte_memcpy(&sess_conf->crypto_xform->next->auth,
- &sa->xform.chain.auth.auth,
- sizeof(struct rte_crypto_auth_xform));
+ memcpy(&sess_conf->crypto_xform->next->auth,
+ &sa->xform.chain.auth.auth,
+ sizeof(struct rte_crypto_auth_xform));
sess_conf->crypto_xform->cipher.key.data =
sa->key.data;
sess_conf->crypto_xform->next->auth.key.data =
@@ -282,12 +282,12 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,
return TEST_SKIPPED;
}
} else {
- rte_memcpy(&sess_conf->crypto_xform->next->cipher,
- &sa->xform.chain.cipher.cipher,
- sizeof(struct rte_crypto_cipher_xform));
- rte_memcpy(&sess_conf->crypto_xform->auth,
- &sa->xform.chain.auth.auth,
- sizeof(struct rte_crypto_auth_xform));
+ memcpy(&sess_conf->crypto_xform->next->cipher,
+ &sa->xform.chain.cipher.cipher,
+ sizeof(struct rte_crypto_cipher_xform));
+ memcpy(&sess_conf->crypto_xform->auth,
+ &sa->xform.chain.auth.auth,
+ sizeof(struct rte_crypto_auth_xform));
sess_conf->crypto_xform->auth.key.data =
sa->auth_key.data;
sess_conf->crypto_xform->next->cipher.key.data =
@@ -463,12 +463,12 @@ init_packet(struct rte_mempool *mp, const uint8_t *data, unsigned int len, bool
return NULL;
if (outer_ipv4) {
- rte_memcpy(rte_pktmbuf_append(pkt, RTE_ETHER_HDR_LEN),
- &dummy_ipv4_eth_hdr, RTE_ETHER_HDR_LEN);
+ memcpy(rte_pktmbuf_append(pkt, RTE_ETHER_HDR_LEN),
+ &dummy_ipv4_eth_hdr, RTE_ETHER_HDR_LEN);
pkt->l3_len = sizeof(struct rte_ipv4_hdr);
} else {
- rte_memcpy(rte_pktmbuf_append(pkt, RTE_ETHER_HDR_LEN),
- &dummy_ipv6_eth_hdr, RTE_ETHER_HDR_LEN);
+ memcpy(rte_pktmbuf_append(pkt, RTE_ETHER_HDR_LEN),
+ &dummy_ipv6_eth_hdr, RTE_ETHER_HDR_LEN);
pkt->l3_len = sizeof(struct rte_ipv6_hdr);
}
pkt->l2_len = RTE_ETHER_HDR_LEN;
diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
index b7d74a467a22..18056eff1051 100644
--- a/app/test/virtual_pmd.c
+++ b/app/test/virtual_pmd.c
@@ -186,7 +186,7 @@ virtual_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
struct virtual_ethdev_private *dev_private = dev->data->dev_private;
if (stats)
- rte_memcpy(stats, &dev_private->eth_stats, sizeof(*stats));
+ memcpy(stats, &dev_private->eth_stats, sizeof(*stats));
return 0;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH 71/71] examples: replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (69 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 70/71] app/test: " Stephen Hemminger
@ 2024-02-29 22:58 ` Stephen Hemminger
2024-03-01 8:38 ` [PATCH 00/71] " Bruce Richardson
` (5 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-02-29 22:58 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Nicolas Chautru, Tomasz Kantecki,
Kirill Rybalchenko, Maxime Coquelin, Chenbo Xia
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/bbdev_app/main.c | 2 +-
examples/l2fwd-cat/cat.c | 3 +--
examples/ptpclient/ptpclient.c | 11 +++++------
examples/vhost/main.c | 5 ++---
examples/vmdq/main.c | 5 ++---
examples/vmdq_dcb/main.c | 14 +++++---------
6 files changed, 16 insertions(+), 24 deletions(-)
diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 16599ae9cee3..52c8eabba778 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -359,7 +359,7 @@ add_ether_hdr(struct rte_mbuf *pkt_src, struct rte_mbuf *pkt_dst)
eth_to = rte_pktmbuf_mtod(pkt_dst, struct rte_ether_hdr *);
/* copy header */
- rte_memcpy(eth_to, eth_from, sizeof(struct rte_ether_hdr));
+ memcpy(eth_to, eth_from, sizeof(struct rte_ether_hdr));
}
static inline void
diff --git a/examples/l2fwd-cat/cat.c b/examples/l2fwd-cat/cat.c
index 00e4cde48b48..b03fef47fdb7 100644
--- a/examples/l2fwd-cat/cat.c
+++ b/examples/l2fwd-cat/cat.c
@@ -314,8 +314,7 @@ parse_l3ca(const char *l3ca)
if (cmask != 0 && is_contiguous(cmask) == 0)
goto err;
- rte_memcpy(&m_config[idx].cpumask,
- &cpuset, sizeof(rte_cpuset_t));
+ memcpy(&m_config[idx].cpumask, &cpuset, sizeof(rte_cpuset_t));
if (cmask != 0) {
m_config[idx].cdp = 1;
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 2535d848a1e9..e918bc05db34 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -359,9 +359,9 @@ parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx)
ptp_data->seqID_SYNC = rte_be_to_cpu_16(ptp_hdr->seq_id);
if (ptp_data->ptpset == 0) {
- rte_memcpy(&ptp_data->master_clock_id,
- &ptp_hdr->source_port_id.clock_id,
- sizeof(struct clock_id));
+ memcpy(&ptp_data->master_clock_id,
+ &ptp_hdr->source_port_id.clock_id,
+ sizeof(struct clock_id));
ptp_data->ptpset = 1;
}
@@ -466,9 +466,8 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
client_clkid->id[6] = eth_hdr->src_addr.addr_bytes[4];
client_clkid->id[7] = eth_hdr->src_addr.addr_bytes[5];
- rte_memcpy(&ptp_data->client_clock_id,
- client_clkid,
- sizeof(struct clock_id));
+ memcpy(&ptp_data->client_clock_id, client_clkid,
+ sizeof(struct clock_id));
/* Enable flag for hardware timestamping. */
created_pkt->ol_flags |= RTE_MBUF_F_TX_IEEE1588_TMST;
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 3fc1b151d182..5691ec110ac8 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -405,9 +405,8 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_devices)
conf.pool_map[i].pools = (1UL << i);
}
- (void)(rte_memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &conf,
- sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
+ (void)(memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
+ (void)(memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &conf, sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
return 0;
}
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 4a3ce6884c5c..3a9d1281d901 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -151,9 +151,8 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_pools)
conf.pool_map[i].pools = (1UL << (i % num_pools));
}
- (void)(rte_memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &conf,
- sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
+ (void)(memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
+ (void)(memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &conf, sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
if (rss_enable) {
eth_conf->rxmode.mq_mode = RTE_ETH_MQ_RX_VMDQ_RSS;
eth_conf->rx_adv_conf.rss_conf.rss_hf = RTE_ETH_RSS_IP |
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 4ccc2fe4b01c..4aab67b23d67 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -161,15 +161,11 @@ get_eth_conf(struct rte_eth_conf *eth_conf)
tx_conf.dcb_tc[i] = i % num_tcs;
}
dcb_conf.nb_tcs = (enum rte_eth_nb_tcs)num_tcs;
- (void)(rte_memcpy(eth_conf, &vmdq_dcb_conf_default, sizeof(*eth_conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_dcb_conf, &conf,
- sizeof(conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.dcb_rx_conf, &dcb_conf,
- sizeof(dcb_conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &vmdq_conf,
- sizeof(vmdq_conf)));
- (void)(rte_memcpy(ð_conf->tx_adv_conf.vmdq_dcb_tx_conf, &tx_conf,
- sizeof(tx_conf)));
+ (void)(memcpy(eth_conf, &vmdq_dcb_conf_default, sizeof(*eth_conf)));
+ (void)(memcpy(ð_conf->rx_adv_conf.vmdq_dcb_conf, &conf, sizeof(conf)));
+ (void)(memcpy(ð_conf->rx_adv_conf.dcb_rx_conf, &dcb_conf, sizeof(dcb_conf)));
+ (void)(memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &vmdq_conf, sizeof(vmdq_conf)));
+ (void)(memcpy(ð_conf->tx_adv_conf.vmdq_dcb_tx_conf, &tx_conf, sizeof(tx_conf)));
if (rss_enable) {
eth_conf->rxmode.mq_mode = RTE_ETH_MQ_RX_VMDQ_DCB_RSS;
eth_conf->rx_adv_conf.rss_conf.rss_hf = RTE_ETH_RSS_IP |
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* Re: [PATCH 55/71] net/bnxt: replace use of fixed size rte_memcpy
2024-02-29 22:58 ` [PATCH 55/71] net/bnxt: " Stephen Hemminger
@ 2024-03-01 2:54 ` Somnath Kotur
0 siblings, 0 replies; 205+ messages in thread
From: Somnath Kotur @ 2024-03-01 2:54 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev, Ajit Khaparde
[-- Attachment #1: Type: text/plain, Size: 5631 bytes --]
On Fri, Mar 1, 2024 at 4:30 AM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> Automatically generated by devtools/cocci/rte_memcpy.cocci
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> drivers/net/bnxt/bnxt_flow.c | 34 ++++++++++++++++++----------------
> 1 file changed, 18 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
> index f25bc6ff78c7..6466aa394af1 100644
> --- a/drivers/net/bnxt/bnxt_flow.c
> +++ b/drivers/net/bnxt/bnxt_flow.c
> @@ -233,8 +233,9 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
> "DMAC is invalid!\n");
> return -rte_errno;
> }
> - rte_memcpy(filter->dst_macaddr,
> - ð_spec->hdr.dst_addr, RTE_ETHER_ADDR_LEN);
> + memcpy(filter->dst_macaddr,
> + ð_spec->hdr.dst_addr,
> + RTE_ETHER_ADDR_LEN);
> en |= use_ntuple ?
> NTUPLE_FLTR_ALLOC_INPUT_EN_DST_MACADDR :
> EM_FLOW_ALLOC_INPUT_EN_DST_MACADDR;
> @@ -257,8 +258,9 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
> "SMAC is invalid!\n");
> return -rte_errno;
> }
> - rte_memcpy(filter->src_macaddr,
> - ð_spec->hdr.src_addr, RTE_ETHER_ADDR_LEN);
> + memcpy(filter->src_macaddr,
> + ð_spec->hdr.src_addr,
> + RTE_ETHER_ADDR_LEN);
> en |= use_ntuple ?
> NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_MACADDR :
> EM_FLOW_ALLOC_INPUT_EN_SRC_MACADDR;
> @@ -423,23 +425,23 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
> en |= EM_FLOW_ALLOC_INPUT_EN_SRC_IPADDR |
> EM_FLOW_ALLOC_INPUT_EN_DST_IPADDR;
>
> - rte_memcpy(filter->src_ipaddr,
> - ipv6_spec->hdr.src_addr, 16);
> - rte_memcpy(filter->dst_ipaddr,
> - ipv6_spec->hdr.dst_addr, 16);
> + memcpy(filter->src_ipaddr, ipv6_spec->hdr.src_addr,
> + 16);
> + memcpy(filter->dst_ipaddr, ipv6_spec->hdr.dst_addr,
> + 16);
>
> if (!bnxt_check_zero_bytes(ipv6_mask->hdr.src_addr,
> 16)) {
> - rte_memcpy(filter->src_ipaddr_mask,
> - ipv6_mask->hdr.src_addr, 16);
> + memcpy(filter->src_ipaddr_mask,
> + ipv6_mask->hdr.src_addr, 16);
> en |= !use_ntuple ? 0 :
> NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR_MASK;
> }
>
> if (!bnxt_check_zero_bytes(ipv6_mask->hdr.dst_addr,
> 16)) {
> - rte_memcpy(filter->dst_ipaddr_mask,
> - ipv6_mask->hdr.dst_addr, 16);
> + memcpy(filter->dst_ipaddr_mask,
> + ipv6_mask->hdr.dst_addr, 16);
> en |= !use_ntuple ? 0 :
> NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR_MASK;
> }
> @@ -591,8 +593,8 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
> return -rte_errno;
> }
>
> - rte_memcpy(((uint8_t *)&tenant_id_be + 1),
> - vxlan_spec->hdr.vni, 3);
> + memcpy(((uint8_t *)&tenant_id_be + 1),
> + vxlan_spec->hdr.vni, 3);
> filter->vni =
> rte_be_to_cpu_32(tenant_id_be);
> filter->tunnel_type =
> @@ -645,8 +647,8 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
> "Invalid TNI mask");
> return -rte_errno;
> }
> - rte_memcpy(((uint8_t *)&tenant_id_be + 1),
> - nvgre_spec->tni, 3);
> + memcpy(((uint8_t *)&tenant_id_be + 1),
> + nvgre_spec->tni, 3);
> filter->vni =
> rte_be_to_cpu_32(tenant_id_be);
> filter->tunnel_type =
> --
> 2.43.0
>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4212 bytes --]
^ permalink raw reply [flat|nested] 205+ messages in thread
* RE: [PATCH 01/71] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
2024-02-29 22:57 ` [PATCH 01/71] cocci/rte_memcpy: add script to eliminate " Stephen Hemminger
@ 2024-03-01 8:07 ` Morten Brørup
0 siblings, 0 replies; 205+ messages in thread
From: Morten Brørup @ 2024-03-01 8:07 UTC (permalink / raw)
To: Stephen Hemminger, dev
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Thursday, 29 February 2024 23.58
>
> Rte_memcpy should not be used for the simple case of copying
> a fix size structure because it is slower and will hide problems
> from code analysis tools. Coverity, fortify and other analyzers
> special case memcpy().
>
> Gcc (and Clang) are smart enough to inline copies which
> will be faster.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
For the series,
Acked-by: Morten Brørup <mb@smartsharesystems.com>
^ permalink raw reply [flat|nested] 205+ messages in thread
* Re: [PATCH 00/71] replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (70 preceding siblings ...)
2024-02-29 22:58 ` [PATCH 71/71] examples: " Stephen Hemminger
@ 2024-03-01 8:38 ` Bruce Richardson
2024-03-01 11:06 ` Hemant Agrawal
` (4 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Bruce Richardson @ 2024-03-01 8:38 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
On Thu, Feb 29, 2024 at 02:57:47PM -0800, Stephen Hemminger wrote:
> The DPDK has a lot of "cargo cult" usage of rte_memcpy.
> This patch set replaces cases where rte_memcpy is used with a fixed
> size constant size.
>
> Typical example is:
> rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
> which can be replaced with:
> memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
>
> This has two benefits. Gcc (and clang) are smart enough that for
> all small fixed size values, they just generate the necessary instructions
> to do it inline. It also means that fortify, Coverity, and ASAN
> analyzers can check these memcpy's.
>
> So faster, better, safer.
>
> The first patch is a simple coccinelle script to do the replacement
> and the rest are the results broken out by module.
>
> The coccinelle script can be used again to make sure more bad
> usage doesn't creep in with new drivers.
>
Thanks for this Stephen.
Series-acked-by: Bruce Richardson <bruce.richardson@intel.com>
^ permalink raw reply [flat|nested] 205+ messages in thread
* RE: [PATCH 00/71] replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (71 preceding siblings ...)
2024-03-01 8:38 ` [PATCH 00/71] " Bruce Richardson
@ 2024-03-01 11:06 ` Hemant Agrawal
2024-03-01 12:55 ` Konstantin Ananyev
` (3 subsequent siblings)
76 siblings, 0 replies; 205+ messages in thread
From: Hemant Agrawal @ 2024-03-01 11:06 UTC (permalink / raw)
To: Stephen Hemminger, dev
[-- Attachment #1: Type: text/plain, Size: 68 bytes --]
For DPAAx
Series-
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 9818 bytes --]
^ permalink raw reply [flat|nested] 205+ messages in thread
* RE: [PATCH 00/71] replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (72 preceding siblings ...)
2024-03-01 11:06 ` Hemant Agrawal
@ 2024-03-01 12:55 ` Konstantin Ananyev
2024-03-01 18:55 ` Ajit Khaparde
2024-03-01 13:53 ` David Marchand
` (2 subsequent siblings)
76 siblings, 1 reply; 205+ messages in thread
From: Konstantin Ananyev @ 2024-03-01 12:55 UTC (permalink / raw)
To: Stephen Hemminger, dev
> The DPDK has a lot of "cargo cult" usage of rte_memcpy.
> This patch set replaces cases where rte_memcpy is used with a fixed
> size constant size.
>
> Typical example is:
> rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
> which can be replaced with:
> memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
>
> This has two benefits. Gcc (and clang) are smart enough that for
> all small fixed size values, they just generate the necessary instructions
> to do it inline. It also means that fortify, Coverity, and ASAN
> analyzers can check these memcpy's.
>
> So faster, better, safer.
>
> The first patch is a simple coccinelle script to do the replacement
> and the rest are the results broken out by module.
>
> The coccinelle script can be used again to make sure more bad
> usage doesn't creep in with new drivers.
>
> Stephen Hemminger (71):
> cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
> eal: replace use of fixed size rte_memcpy
> ethdev: replace use of fixed size rte_memcpy
> eventdev: replace use of fixed size rte_memcpy
> cryptodev: replace use of fixed size rte_memcpy
> ip_frag: replace use of fixed size rte_memcpy
> net: replace use of fixed size rte_memcpy
> lpm: replace use of fixed size rte_memcpy
> node: replace use of fixed size rte_memcpy
> pdcp: replace use of fixed size rte_memcpy
> pipeline: replace use of fixed size rte_memcpy
> rib: replace use of fixed size rte_memcpy
> security: replace use of fixed size rte_memcpy
> net/mlx5: replace use of fixed size rte_memcpy
> net/nfp: replace use of fixed size rte_memcpy
> net/ngbe: replace use of fixed size rte_memcpy
> net/null: replace use of fixed size rte_memcpy
> net/pcap: replace use of fixed size rte_memcpy
> net/sfc: replace use of fixed size rte_memcpy
> net/tap: replace use of fixed size rte_memcpy
> net/txgbe: replace use of fixed size rte_memcpy
> raw/ifpga: replace use of fixed size rte_memcpy
> raw/skeleton: replace use of fixed size rte_memcpy
> net/hns3: replace use of fixed size rte_memcpy
> net/i40e: replace use of fixed size rte_memcpy
> net/iavf: replace use of fixed size rte_memcpy
> net/ice: replace use of fixed size rte_memcpy
> net/idpf: replace use of fixed size rte_memcpy
> net/ipn3ke: replace use of fixed size rte_memcpy
> net/ixgbe: replace use of fixed size rte_memcpy
> net/memif: replace use of fixed size rte_memcpy
> net/qede: replace use of fixed size rte_memcpy
> baseband/acc: replace use of fixed size rte_memcpy
> baseband/la12xx: replace use of fixed size rte_memcpy
> common/idpf: replace use of fixed size rte_memcpy
> common/qat: replace use of fixed size rte_memcpy
> compress/qat: replace use of fixed size rte_memcpy
> crypto/ccp: replace use of fixed size rte_memcpy
> crypto/cnxk: replace use of fixed size rte_memcpy
> crypto/dpaa_sec: replace use of fixed size rte_memcpy
> crypto/ipsec_mb: replace use of fixed size rte_memcpy
> crypto/qat: replace use of fixed size rte_memcpy
> crypto/scheduler: replace use of fixed size rte_memcpy
> event/cnxk: replace use of fixed size rte_memcpy
> event/dlb2: replace use of fixed size rte_memcpy
> event/dpaa2: replace use of fixed size rte_memcpy
> event/octeontx: replace use of fixed size rte_memcpy
> mempool/dpaa: replace use of fixed size rte_memcpy
> mempool/dpaa2: replace use of fixed size rte_memcpy
> ml/cnxk: replace use of fixed size rte_memcpy
> net/af_xdp: replace use of fixed size rte_memcpy
> net/avp: replace use of fixed size rte_memcpy
> net/axgbe: replace use of fixed size rte_memcpy
> net/bnx2x: replace use of fixed size rte_memcpy
> net/bnxt: replace use of fixed size rte_memcpy
> net/bonding: replace use of fixed size rte_memcpy
> net/cnxk: replace use of fixed size rte_memcpy
> net/cpfl: replace use of fixed size rte_memcpy
> net/cxgbe: replace use of fixed size rte_memcpy
> net/dpaa2: replace use of fixed size rte_memcpy
> net/e1000: replace use of fixed size rte_memcpy
> net/enic: replace use of fixed size rte_memcpy
> net/failsafe: replace use of fixed size rte_memcpy
> net/gve/base: replace use of fixed size rte_memcpy
> net/hinic: replace use of fixed size rte_memcpy
> net/mvpp2: replace use of fixed size rte_memcpy
> app/test-pmd: replace use of fixed size rte_memcpy
> app/graph: replace use of fixed size rte_memcpy
> app/test-eventdev: replace use of fixed size rte_memcpy
> app/test: replace use of fixed size rte_memcpy
> examples: replace use of fixed size rte_memcpy
>
> app/graph/neigh.c | 8 +-
> app/test-eventdev/test_pipeline_common.c | 19 ++-
> app/test-pmd/cmdline.c | 48 ++++----
> app/test-pmd/cmdline_flow.c | 24 ++--
> app/test-pmd/config.c | 8 +-
> app/test/packet_burst_generator.c | 4 +-
> app/test/test_crc.c | 4 +-
> app/test/test_cryptodev.c | 18 ++-
> app/test/test_event_crypto_adapter.c | 12 +-
> app/test/test_event_dma_adapter.c | 4 +-
> app/test/test_ipsec.c | 6 +-
> app/test/test_link_bonding_mode4.c | 8 +-
> app/test/test_security_inline_proto.c | 36 +++---
> app/test/virtual_pmd.c | 2 +-
> devtools/cocci/rte_memcpy.cocci | 11 ++
> drivers/baseband/acc/rte_acc100_pmd.c | 19 ++-
> drivers/baseband/acc/rte_vrb_pmd.c | 21 ++--
> drivers/baseband/la12xx/bbdev_la12xx.c | 4 +-
> drivers/common/idpf/idpf_common_device.c | 4 +-
> drivers/common/idpf/idpf_common_virtchnl.c | 8 +-
> drivers/common/qat/qat_qp.c | 10 +-
> drivers/compress/qat/qat_comp.c | 8 +-
> drivers/crypto/ccp/ccp_crypto.c | 14 +--
> drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +-
> drivers/crypto/cnxk/cnxk_se.h | 2 +-
> drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
> drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +-
> drivers/crypto/qat/qat_sym_session.c | 52 ++++-----
> .../scheduler/rte_cryptodev_scheduler.c | 6 +-
> drivers/crypto/scheduler/scheduler_failover.c | 12 +-
> drivers/event/cnxk/cnxk_tim_evdev.c | 4 +-
> drivers/event/dlb2/dlb2.c | 6 +-
> drivers/event/dpaa2/dpaa2_eventdev.c | 6 +-
> drivers/event/octeontx/timvf_evdev.c | 4 +-
> drivers/mempool/dpaa/dpaa_mempool.c | 4 +-
> drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 +-
> drivers/ml/cnxk/cn10k_ml_model.c | 8 +-
> drivers/ml/cnxk/cn10k_ml_ops.c | 11 +-
> drivers/ml/cnxk/cnxk_ml_ops.c | 2 +-
> drivers/ml/cnxk/mvtvm_ml_model.c | 8 +-
> drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +-
> drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
> drivers/net/avp/avp_ethdev.c | 4 +-
> drivers/net/axgbe/axgbe_ethdev.c | 4 +-
> drivers/net/bnx2x/bnx2x.c | 32 +++---
> drivers/net/bnx2x/bnx2x_stats.c | 10 +-
> drivers/net/bnx2x/bnx2x_vfpf.c | 19 +--
> drivers/net/bnxt/bnxt_flow.c | 34 +++---
> drivers/net/bonding/rte_eth_bond_8023ad.c | 4 +-
> drivers/net/bonding/rte_eth_bond_flow.c | 2 +-
> drivers/net/cnxk/cnxk_ethdev_ops.c | 2 +-
> drivers/net/cnxk/cnxk_tm.c | 5 +-
> drivers/net/cpfl/cpfl_ethdev.c | 3 +-
> drivers/net/cpfl/cpfl_vchnl.c | 4 +-
> drivers/net/cxgbe/clip_tbl.c | 2 +-
> drivers/net/cxgbe/cxgbe_filter.c | 8 +-
> drivers/net/cxgbe/l2t.c | 4 +-
> drivers/net/cxgbe/smt.c | 20 ++--
> drivers/net/dpaa2/dpaa2_tm.c | 2 +-
> drivers/net/e1000/igb_flow.c | 22 ++--
> drivers/net/e1000/igb_pf.c | 6 +-
> drivers/net/enic/enic_main.c | 8 +-
> drivers/net/failsafe/failsafe_ops.c | 6 +-
> drivers/net/gve/base/gve_adminq.c | 2 +-
> drivers/net/hinic/hinic_pmd_flow.c | 40 +++----
> drivers/net/hns3/hns3_fdir.c | 2 +-
> drivers/net/hns3/hns3_flow.c | 4 +-
> drivers/net/i40e/i40e_ethdev.c | 108 ++++++++----------
> drivers/net/i40e/i40e_fdir.c | 28 +++--
> drivers/net/i40e/i40e_flow.c | 56 +++++----
> drivers/net/i40e/i40e_pf.c | 2 +-
> drivers/net/i40e/i40e_tm.c | 11 +-
> drivers/net/i40e/rte_pmd_i40e.c | 34 +++---
> drivers/net/iavf/iavf_fdir.c | 93 +++++++--------
> drivers/net/iavf/iavf_fsub.c | 50 ++++----
> drivers/net/iavf/iavf_generic_flow.c | 2 +-
> drivers/net/iavf/iavf_tm.c | 11 +-
> drivers/net/iavf/iavf_vchnl.c | 9 +-
> drivers/net/ice/ice_dcf.c | 5 +-
> drivers/net/ice/ice_dcf_parent.c | 2 +-
> drivers/net/ice/ice_dcf_sched.c | 11 +-
> drivers/net/ice/ice_diagnose.c | 4 +-
> drivers/net/ice/ice_ethdev.c | 14 +--
> drivers/net/ice/ice_fdir_filter.c | 37 +++---
> drivers/net/ice/ice_generic_flow.c | 2 +-
> drivers/net/ice/ice_hash.c | 2 +-
> drivers/net/ice/ice_tm.c | 11 +-
> drivers/net/idpf/idpf_ethdev.c | 7 +-
> drivers/net/idpf/idpf_rxtx.c | 10 +-
> drivers/net/ipn3ke/ipn3ke_flow.c | 32 +++---
> drivers/net/ipn3ke/ipn3ke_representor.c | 16 +--
> drivers/net/ipn3ke/ipn3ke_tm.c | 6 +-
> drivers/net/ixgbe/ixgbe_ethdev.c | 9 +-
> drivers/net/ixgbe/ixgbe_fdir.c | 7 +-
> drivers/net/ixgbe/ixgbe_flow.c | 65 +++++------
> drivers/net/ixgbe/ixgbe_ipsec.c | 8 +-
> drivers/net/ixgbe/ixgbe_pf.c | 4 +-
> drivers/net/ixgbe/ixgbe_tm.c | 11 +-
> drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +-
> drivers/net/memif/memif_socket.c | 4 +-
> drivers/net/mlx5/mlx5_devx.c | 4 +-
> drivers/net/mlx5/mlx5_flow.c | 38 +++---
> drivers/net/mlx5/mlx5_flow_aso.c | 6 +-
> drivers/net/mlx5/mlx5_flow_hw.c | 16 +--
> drivers/net/mlx5/mlx5_rx.c | 6 +-
> drivers/net/mlx5/mlx5_rxtx_vec.c | 8 +-
> drivers/net/mvpp2/mrvl_tm.c | 2 +-
> drivers/net/nfp/flower/nfp_conntrack.c | 2 +-
> drivers/net/nfp/flower/nfp_flower_flow.c | 16 +--
> .../net/nfp/flower/nfp_flower_representor.c | 2 +-
> drivers/net/nfp/nfp_mtr.c | 10 +-
> drivers/net/ngbe/ngbe_pf.c | 4 +-
> drivers/net/null/rte_eth_null.c | 6 +-
> drivers/net/pcap/pcap_ethdev.c | 2 +-
> drivers/net/pcap/pcap_osdep_freebsd.c | 2 +-
> drivers/net/pcap/pcap_osdep_linux.c | 2 +-
> drivers/net/qede/qede_main.c | 2 +-
> drivers/net/sfc/sfc.c | 2 +-
> drivers/net/sfc/sfc_ef10_tx.c | 2 +-
> drivers/net/sfc/sfc_ethdev.c | 11 +-
> drivers/net/sfc/sfc_flow.c | 20 ++--
> drivers/net/sfc/sfc_flow_rss.c | 2 +-
> drivers/net/sfc/sfc_mae.c | 2 +-
> drivers/net/sfc/sfc_rx.c | 2 +-
> drivers/net/sfc/sfc_tso.c | 2 +-
> drivers/net/sfc/sfc_tso.h | 9 +-
> drivers/net/tap/rte_eth_tap.c | 14 +--
> drivers/net/txgbe/txgbe_ethdev.c | 9 +-
> drivers/net/txgbe/txgbe_fdir.c | 6 +-
> drivers/net/txgbe/txgbe_flow.c | 65 +++++------
> drivers/net/txgbe/txgbe_ipsec.c | 8 +-
> drivers/net/txgbe/txgbe_pf.c | 4 +-
> drivers/net/txgbe/txgbe_tm.c | 11 +-
> drivers/raw/ifpga/afu_pmd_he_hssi.c | 2 +-
> drivers/raw/ifpga/afu_pmd_he_lpbk.c | 2 +-
> drivers/raw/ifpga/afu_pmd_he_mem.c | 2 +-
> drivers/raw/ifpga/afu_pmd_n3000.c | 8 +-
> drivers/raw/ifpga/ifpga_rawdev.c | 10 +-
> drivers/raw/skeleton/skeleton_rawdev.c | 7 +-
> examples/bbdev_app/main.c | 2 +-
> examples/l2fwd-cat/cat.c | 3 +-
> examples/ptpclient/ptpclient.c | 11 +-
> examples/vhost/main.c | 5 +-
> examples/vmdq/main.c | 5 +-
> examples/vmdq_dcb/main.c | 14 +--
> lib/cryptodev/rte_cryptodev.c | 2 +-
> lib/eal/common/eal_common_options.c | 7 +-
> lib/ethdev/rte_ethdev.c | 3 +-
> lib/ethdev/rte_flow.c | 5 +-
> lib/eventdev/rte_event_crypto_adapter.c | 2 +-
> lib/eventdev/rte_event_dma_adapter.c | 4 +-
> lib/eventdev/rte_event_timer_adapter.c | 2 +-
> lib/fib/trie.c | 2 +-
> lib/ip_frag/rte_ipv6_fragmentation.c | 4 +-
> lib/ip_frag/rte_ipv6_reassembly.c | 6 +-
> lib/lpm/rte_lpm6.c | 3 +-
> lib/net/rte_ether.c | 2 +-
> lib/node/ip6_lookup.c | 8 +-
> lib/pdcp/pdcp_process.c | 36 +++---
> lib/pipeline/rte_table_action.c | 8 +-
> lib/rib/rte_rib6.h | 3 +-
> lib/security/rte_security.c | 4 +-
> 162 files changed, 880 insertions(+), 960 deletions(-)
> create mode 100644 devtools/cocci/rte_memcpy.cocci
>
> --
Series-Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
> 2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* Re: [PATCH 00/71] replace use of fixed size rte_memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (73 preceding siblings ...)
2024-03-01 12:55 ` Konstantin Ananyev
@ 2024-03-01 13:53 ` David Marchand
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
76 siblings, 0 replies; 205+ messages in thread
From: David Marchand @ 2024-03-01 13:53 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
Hello Stephen,
On Fri, Mar 1, 2024 at 12:00 AM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> The DPDK has a lot of "cargo cult" usage of rte_memcpy.
> This patch set replaces cases where rte_memcpy is used with a fixed
> size constant size.
>
> Typical example is:
> rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
> which can be replaced with:
> memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
>
> This has two benefits. Gcc (and clang) are smart enough that for
> all small fixed size values, they just generate the necessary instructions
> to do it inline. It also means that fortify, Coverity, and ASAN
> analyzers can check these memcpy's.
>
> So faster, better, safer.
>
> The first patch is a simple coccinelle script to do the replacement
> and the rest are the results broken out by module.
>
> The coccinelle script can be used again to make sure more bad
> usage doesn't creep in with new drivers.
There is a build issue reported by the CI, please fix and submit a new revision.
--
David Marchand
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 00/71] replace use of fixed size rte_mempcy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (74 preceding siblings ...)
2024-03-01 13:53 ` David Marchand
@ 2024-03-01 17:14 ` Stephen Hemminger
2024-03-01 17:14 ` [PATCH v2 01/71] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy Stephen Hemminger
` (72 more replies)
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
76 siblings, 73 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:14 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
The DPDK has a lot of "cargo cult" usage of rte_memcpy.
This patch set replaces cases where rte_memcpy is used with a fixed
size constant size.
Typical example is:
rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
which can be replaced with:
memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
This has two benefits. Gcc (and clang) are smart enough that for
all small fixed size values, they just generate the necessary instructions
to do it inline. It also means that fortify, Coverity, and ASAN
analyzers can check these memcpy's.
So faster, better, safer.
The first patch is a simple coccinelle script to do the replacement
and the rest are the results broken out by module.
The coccinelle script can be used again to make sure more bad
usage doesn't creep in with new drivers.
v2 - fix CI failure on some OS by adding string.h
remove rte_memcpy.h if no longer used
Stephen Hemminger (71):
cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
eal: replace use of fixed size rte_memcpy
ethdev: replace use of fixed size rte_memcpy
eventdev: replace use of fixed size rte_memcpy
cryptodev: replace use of fixed size rte_memcpy
ip_frag: replace use of fixed size rte_memcpy
net: replace use of fixed size rte_memcpy
lpm: replace use of fixed size rte_memcpy
node: replace use of fixed size rte_memcpy
pdcp: replace use of fixed size rte_memcpy
pipeline: replace use of fixed size rte_memcpy
rib: replace use of fixed size rte_memcpy
security: replace use of fixed size rte_memcpy
net/mlx5: replace use of fixed size rte_memcpy
net/nfp: replace use of fixed size rte_memcpy
net/ngbe: replace use of fixed size rte_memcpy
net/null: replace use of fixed size rte_memcpy
net/pcap: replace use of fixed size rte_memcpy
net/sfc: replace use of fixed size rte_memcpy
net/tap: replace use of fixed size rte_memcpy
net/txgbe: replace use of fixed size rte_memcpy
raw/ifpga: replace use of fixed size rte_memcpy
raw/skeleton: replace use of fixed size rte_memcpy
net/hns3: replace use of fixed size rte_memcpy
net/i40e: replace use of fixed size rte_memcpy
net/iavf: replace use of fixed size rte_memcpy
net/ice: replace use of fixed size rte_memcpy
net/idpf: replace use of fixed size rte_memcpy
net/ipn3ke: replace use of fixed size rte_memcpy
net/ixgbe: replace use of fixed size rte_memcpy
net/memif: replace use of fixed size rte_memcpy
net/qede: replace use of fixed size rte_memcpy
baseband/acc: replace use of fixed size rte_memcpy
baseband/la12xx: replace use of fixed size rte_memcpy
common/idpf: replace use of fixed size rte_memcpy
common/qat: replace use of fixed size rte_memcpy
compress/qat: replace use of fixed size rte_memcpy
crypto/ccp: replace use of fixed size rte_memcpy
crypto/cnxk: replace use of fixed size rte_memcpy
crypto/dpaa_sec: replace use of fixed size rte_memcpy
crypto/ipsec_mb: replace use of fixed size rte_memcpy
crypto/qat: replace use of fixed size rte_memcpy
crypto/scheduler: replace use of fixed size rte_memcpy
event/cnxk: replace use of fixed size rte_memcpy
event/dlb2: replace use of fixed size rte_memcpy
event/dpaa2: replace use of fixed size rte_memcpy
event/octeontx: replace use of fixed size rte_memcpy
mempool/dpaa: replace use of fixed size rte_memcpy
mempool/dpaa2: replace use of fixed size rte_memcpy
ml/cnxk: replace use of fixed size rte_memcpy
net/af_xdp: replace use of fixed size rte_memcpy
net/avp: replace use of fixed size rte_memcpy
net/axgbe: replace use of fixed size rte_memcpy
net/bnx2x: replace use of fixed size rte_memcpy
net/bnxt: replace use of fixed size rte_memcpy
net/bonding: replace use of fixed size rte_memcpy
net/cnxk: replace use of fixed size rte_memcpy
net/cpfl: replace use of fixed size rte_memcpy
net/cxgbe: replace use of fixed size rte_memcpy
net/dpaa2: replace use of fixed size rte_memcpy
net/e1000: replace use of fixed size rte_memcpy
net/enic: replace use of fixed size rte_memcpy
net/failsafe: replace use of fixed size rte_memcpy
net/gve/base: replace use of fixed size rte_memcpy
net/hinic: replace use of fixed size rte_memcpy
net/mvpp2: replace use of fixed size rte_memcpy
app/test-pmd: replace use of fixed size rte_memcpy
app/graph: replace use of fixed size rte_memcpy
app/test-eventdev: replace use of fixed size rte_memcpy
app/test: replace use of fixed size rte_memcpy
examples: replace use of fixed size rte_memcpy
app/graph/neigh.c | 8 +-
app/test-eventdev/test_pipeline_common.c | 19 ++-
app/test-pmd/cmdline.c | 48 ++++----
app/test-pmd/cmdline_flow.c | 24 ++--
app/test-pmd/config.c | 8 +-
app/test-pmd/csumonly.c | 1 -
app/test-pmd/flowgen.c | 1 -
app/test-pmd/iofwd.c | 1 -
app/test-pmd/macfwd.c | 1 -
app/test-pmd/macswap.c | 1 -
app/test-pmd/noisy_vnf.c | 1 -
app/test-pmd/rxonly.c | 1 -
app/test-pmd/testpmd.c | 1 -
app/test/commands.c | 1 -
app/test/packet_burst_generator.c | 4 +-
app/test/test_crc.c | 5 +-
app/test/test_cryptodev.c | 18 ++-
app/test/test_cryptodev_asym.c | 1 -
app/test/test_cryptodev_security_pdcp.c | 1 -
app/test/test_efd.c | 1 -
app/test/test_efd_perf.c | 1 -
app/test/test_event_crypto_adapter.c | 12 +-
app/test/test_event_dma_adapter.c | 4 +-
app/test/test_eventdev.c | 1 -
app/test/test_ipsec.c | 6 +-
app/test/test_link_bonding_mode4.c | 8 +-
app/test/test_mbuf.c | 1 -
app/test/test_member.c | 1 -
app/test/test_member_perf.c | 1 -
app/test/test_rawdev.c | 1 -
app/test/test_security_inline_proto.c | 36 +++---
app/test/test_service_cores.c | 1 -
app/test/virtual_pmd.c | 3 +-
devtools/cocci/rte_memcpy.cocci | 11 ++
drivers/baseband/acc/rte_acc100_pmd.c | 17 ++-
drivers/baseband/acc/rte_vrb_pmd.c | 21 ++--
drivers/baseband/la12xx/bbdev_la12xx.c | 4 +-
drivers/common/idpf/idpf_common_device.c | 4 +-
drivers/common/idpf/idpf_common_virtchnl.c | 8 +-
drivers/common/qat/qat_qp.c | 10 +-
drivers/compress/qat/qat_comp.c | 8 +-
drivers/crypto/ccp/ccp_crypto.c | 14 +--
drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +-
drivers/crypto/cnxk/cnxk_se.h | 2 +-
drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +-
drivers/crypto/qat/qat_sym_session.c | 52 ++++-----
.../scheduler/rte_cryptodev_scheduler.c | 6 +-
drivers/crypto/scheduler/scheduler_failover.c | 12 +-
drivers/event/cnxk/cnxk_tim_evdev.c | 4 +-
drivers/event/dlb2/dlb2.c | 6 +-
drivers/event/dpaa2/dpaa2_eventdev.c | 6 +-
drivers/event/octeontx/timvf_evdev.c | 4 +-
drivers/mempool/dpaa/dpaa_mempool.c | 4 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 +-
drivers/ml/cnxk/cn10k_ml_model.c | 8 +-
drivers/ml/cnxk/cn10k_ml_ops.c | 11 +-
drivers/ml/cnxk/cnxk_ml_ops.c | 2 +-
drivers/ml/cnxk/mvtvm_ml_model.c | 8 +-
drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +-
drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
drivers/net/avp/avp_ethdev.c | 4 +-
drivers/net/axgbe/axgbe_ethdev.c | 4 +-
drivers/net/bnx2x/bnx2x.c | 32 +++--
drivers/net/bnx2x/bnx2x_stats.c | 10 +-
drivers/net/bnx2x/bnx2x_vfpf.c | 19 +--
drivers/net/bnxt/bnxt_flow.c | 34 +++---
drivers/net/bonding/rte_eth_bond_8023ad.c | 4 +-
drivers/net/bonding/rte_eth_bond_flow.c | 2 +-
drivers/net/cnxk/cnxk_ethdev_ops.c | 2 +-
drivers/net/cnxk/cnxk_tm.c | 5 +-
drivers/net/cpfl/cpfl_ethdev.c | 3 +-
drivers/net/cpfl/cpfl_vchnl.c | 4 +-
drivers/net/cxgbe/clip_tbl.c | 2 +-
drivers/net/cxgbe/cxgbe_filter.c | 8 +-
drivers/net/cxgbe/l2t.c | 4 +-
drivers/net/cxgbe/smt.c | 20 ++--
drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 1 -
drivers/net/dpaa2/dpaa2_ethdev.c | 1 -
drivers/net/dpaa2/dpaa2_recycle.c | 1 -
drivers/net/dpaa2/dpaa2_rxtx.c | 1 -
drivers/net/dpaa2/dpaa2_sparser.c | 1 -
drivers/net/dpaa2/dpaa2_tm.c | 2 +-
drivers/net/e1000/em_rxtx.c | 1 -
drivers/net/e1000/igb_flow.c | 22 ++--
drivers/net/e1000/igb_pf.c | 7 +-
drivers/net/e1000/igb_rxtx.c | 1 -
drivers/net/enic/enic_main.c | 8 +-
drivers/net/failsafe/failsafe_ops.c | 6 +-
drivers/net/gve/base/gve_adminq.c | 2 +-
drivers/net/hinic/hinic_pmd_flow.c | 40 +++----
drivers/net/hns3/hns3_fdir.c | 2 +-
drivers/net/hns3/hns3_flow.c | 4 +-
drivers/net/i40e/i40e_ethdev.c | 109 ++++++++----------
drivers/net/i40e/i40e_fdir.c | 28 +++--
drivers/net/i40e/i40e_flow.c | 56 +++++----
drivers/net/i40e/i40e_pf.c | 3 +-
drivers/net/i40e/i40e_tm.c | 11 +-
drivers/net/i40e/rte_pmd_i40e.c | 34 +++---
drivers/net/iavf/iavf_fdir.c | 93 +++++++--------
drivers/net/iavf/iavf_fsub.c | 50 ++++----
drivers/net/iavf/iavf_generic_flow.c | 2 +-
drivers/net/iavf/iavf_tm.c | 11 +-
drivers/net/iavf/iavf_vchnl.c | 9 +-
drivers/net/ice/ice_dcf.c | 5 +-
drivers/net/ice/ice_dcf_parent.c | 2 +-
drivers/net/ice/ice_dcf_sched.c | 11 +-
drivers/net/ice/ice_diagnose.c | 4 +-
drivers/net/ice/ice_ethdev.c | 14 +--
drivers/net/ice/ice_fdir_filter.c | 37 +++---
drivers/net/ice/ice_generic_flow.c | 2 +-
drivers/net/ice/ice_hash.c | 2 +-
drivers/net/ice/ice_tm.c | 11 +-
drivers/net/idpf/idpf_ethdev.c | 7 +-
drivers/net/idpf/idpf_rxtx.c | 10 +-
drivers/net/ipn3ke/ipn3ke_flow.c | 32 +++--
drivers/net/ipn3ke/ipn3ke_representor.c | 16 +--
drivers/net/ipn3ke/ipn3ke_tm.c | 6 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 9 +-
drivers/net/ixgbe/ixgbe_fdir.c | 7 +-
drivers/net/ixgbe/ixgbe_flow.c | 65 +++++------
drivers/net/ixgbe/ixgbe_ipsec.c | 8 +-
drivers/net/ixgbe/ixgbe_pf.c | 5 +-
drivers/net/ixgbe/ixgbe_tm.c | 11 +-
drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +-
drivers/net/memif/memif_socket.c | 4 +-
drivers/net/mlx5/mlx5_devx.c | 4 +-
drivers/net/mlx5/mlx5_flow.c | 38 +++---
drivers/net/mlx5/mlx5_flow_aso.c | 6 +-
drivers/net/mlx5/mlx5_flow_hw.c | 16 +--
drivers/net/mlx5/mlx5_rx.c | 6 +-
drivers/net/mlx5/mlx5_rxtx_vec.c | 8 +-
drivers/net/mvpp2/mrvl_tm.c | 2 +-
drivers/net/nfp/flower/nfp_conntrack.c | 2 +-
drivers/net/nfp/flower/nfp_flower_flow.c | 16 +--
.../net/nfp/flower/nfp_flower_representor.c | 2 +-
drivers/net/nfp/nfp_mtr.c | 10 +-
drivers/net/ngbe/ngbe_pf.c | 4 +-
drivers/net/null/rte_eth_null.c | 6 +-
drivers/net/pcap/pcap_ethdev.c | 2 +-
drivers/net/pcap/pcap_osdep_freebsd.c | 2 +-
drivers/net/pcap/pcap_osdep_linux.c | 2 +-
drivers/net/qede/qede_main.c | 2 +-
drivers/net/sfc/sfc.c | 2 +-
drivers/net/sfc/sfc_ef10_tx.c | 2 +-
drivers/net/sfc/sfc_ethdev.c | 11 +-
drivers/net/sfc/sfc_flow.c | 20 ++--
drivers/net/sfc/sfc_flow_rss.c | 2 +-
drivers/net/sfc/sfc_mae.c | 2 +-
drivers/net/sfc/sfc_rx.c | 2 +-
drivers/net/sfc/sfc_tso.c | 2 +-
drivers/net/sfc/sfc_tso.h | 9 +-
drivers/net/tap/rte_eth_tap.c | 14 +--
drivers/net/txgbe/txgbe_ethdev.c | 9 +-
drivers/net/txgbe/txgbe_fdir.c | 6 +-
drivers/net/txgbe/txgbe_flow.c | 65 +++++------
drivers/net/txgbe/txgbe_ipsec.c | 8 +-
drivers/net/txgbe/txgbe_pf.c | 4 +-
drivers/net/txgbe/txgbe_tm.c | 11 +-
drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +-
drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +-
drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +-
drivers/raw/ifpga/afu_pmd_n3000.c | 8 +-
drivers/raw/ifpga/ifpga_rawdev.c | 11 +-
drivers/raw/skeleton/skeleton_rawdev.c | 7 +-
examples/bbdev_app/main.c | 2 +-
examples/l2fwd-cat/cat.c | 4 +-
examples/ptpclient/ptpclient.c | 11 +-
examples/vhost/main.c | 5 +-
examples/vmdq/main.c | 6 +-
examples/vmdq_dcb/main.c | 15 +--
lib/cryptodev/rte_cryptodev.c | 2 +-
lib/eal/common/eal_common_options.c | 7 +-
lib/ethdev/rte_ethdev.c | 3 +-
lib/ethdev/rte_flow.c | 5 +-
lib/eventdev/rte_event_crypto_adapter.c | 2 +-
lib/eventdev/rte_event_dma_adapter.c | 4 +-
lib/eventdev/rte_event_timer_adapter.c | 2 +-
lib/fib/trie.c | 2 +-
lib/ip_frag/rte_ipv6_fragmentation.c | 4 +-
lib/ip_frag/rte_ipv6_reassembly.c | 6 +-
lib/lpm/rte_lpm6.c | 3 +-
lib/net/rte_ether.c | 2 +-
lib/node/ip6_lookup.c | 8 +-
lib/pdcp/pdcp_process.c | 36 +++---
lib/pipeline/rte_table_action.c | 8 +-
lib/rib/rte_rib6.h | 5 +-
lib/security/rte_security.c | 4 +-
188 files changed, 881 insertions(+), 998 deletions(-)
create mode 100644 devtools/cocci/rte_memcpy.cocci
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 01/71] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
@ 2024-03-01 17:14 ` Stephen Hemminger
2024-03-02 11:19 ` Mattias Rönnblom
2024-03-01 17:14 ` [PATCH v2 02/71] eal: replace use of " Stephen Hemminger
` (71 subsequent siblings)
72 siblings, 1 reply; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:14 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Rte_memcpy should not be used for the simple case of copying
a fix size structure because it is slower and will hide problems
from code analysis tools. Coverity, fortify and other analyzers
special case memcpy().
Gcc (and Clang) are smart enough to inline copies which
will be faster.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
devtools/cocci/rte_memcpy.cocci | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 devtools/cocci/rte_memcpy.cocci
diff --git a/devtools/cocci/rte_memcpy.cocci b/devtools/cocci/rte_memcpy.cocci
new file mode 100644
index 000000000000..fa1038fc066d
--- /dev/null
+++ b/devtools/cocci/rte_memcpy.cocci
@@ -0,0 +1,11 @@
+//
+// rte_memcpy should not be used for simple fixed size structure
+// because compiler's are smart enough to inline these.
+//
+@@
+expression src, dst; constant size;
+@@
+(
+- rte_memcpy(dst, src, size)
++ memcpy(dst, src, size)
+)
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 02/71] eal: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
2024-03-01 17:14 ` [PATCH v2 01/71] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy Stephen Hemminger
@ 2024-03-01 17:14 ` Stephen Hemminger
2024-03-01 17:14 ` [PATCH v2 03/71] ethdev: " Stephen Hemminger
` (70 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:14 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/eal/common/eal_common_options.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index e541f0793964..07bfaffdac76 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -30,7 +30,6 @@
#include <rte_tailq.h>
#include <rte_version.h>
#include <rte_devargs.h>
-#include <rte_memcpy.h>
#ifndef RTE_EXEC_ENV_WINDOWS
#include <rte_telemetry.h>
#endif
@@ -1253,7 +1252,7 @@ eal_parse_lcores(const char *lcores)
/* without '@', by default using lcore_set as cpuset */
if (*lcores != '@')
- rte_memcpy(&cpuset, &lcore_set, sizeof(cpuset));
+ memcpy(&cpuset, &lcore_set, sizeof(cpuset));
set_count = CPU_COUNT(&lcore_set);
/* start to update lcore_set */
@@ -1275,8 +1274,8 @@ eal_parse_lcores(const char *lcores)
if (check_cpuset(&cpuset) < 0)
goto err;
- rte_memcpy(&lcore_config[idx].cpuset, &cpuset,
- sizeof(rte_cpuset_t));
+ memcpy(&lcore_config[idx].cpuset, &cpuset,
+ sizeof(rte_cpuset_t));
}
/* some cores from the lcore_set can't be handled by EAL */
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 03/71] ethdev: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
2024-03-01 17:14 ` [PATCH v2 01/71] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy Stephen Hemminger
2024-03-01 17:14 ` [PATCH v2 02/71] eal: replace use of " Stephen Hemminger
@ 2024-03-01 17:14 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 04/71] eventdev: " Stephen Hemminger
` (69 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:14 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Thomas Monjalon, Ferruh Yigit,
Andrew Rybchenko, Ori Kam
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/ethdev/rte_ethdev.c | 3 +--
lib/ethdev/rte_flow.c | 5 ++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index f1c658f49e80..ef62a0260747 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -15,7 +15,6 @@
#include <rte_log.h>
#include <rte_interrupts.h>
#include <rte_kvargs.h>
-#include <rte_memcpy.h>
#include <rte_common.h>
#include <rte_mempool.h>
#include <rte_malloc.h>
@@ -618,7 +617,7 @@ rte_eth_dev_owner_get(const uint16_t port_id, struct rte_eth_dev_owner *owner)
rte_spinlock_lock(rte_mcfg_ethdev_get_lock());
if (eth_dev_shared_data_prepare() != NULL) {
- rte_memcpy(owner, ðdev->data->owner, sizeof(*owner));
+ memcpy(owner, ðdev->data->owner, sizeof(*owner));
ret = 0;
} else {
ret = -ENOMEM;
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 7ab1100ea049..9b831486eb5e 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -994,9 +994,8 @@ rte_flow_conv_rule(struct rte_flow_conv_rule *dst,
if (src->attr_ro) {
off = RTE_ALIGN_CEIL(off, sizeof(double));
if (size && size >= off + sizeof(*dst->attr))
- dst->attr = rte_memcpy
- ((void *)((uintptr_t)dst + off),
- src->attr_ro, sizeof(*dst->attr));
+ dst->attr = memcpy((void *)((uintptr_t)dst + off),
+ src->attr_ro, sizeof(*dst->attr));
off += sizeof(*dst->attr);
}
if (src->pattern_ro) {
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 04/71] eventdev: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (2 preceding siblings ...)
2024-03-01 17:14 ` [PATCH v2 03/71] ethdev: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 05/71] cryptodev: " Stephen Hemminger
` (68 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Abhinandan Gujjar, Jerin Jacob,
Amit Prakash Shukla, Erik Gabriel Carrillo
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/eventdev/rte_event_crypto_adapter.c | 2 +-
lib/eventdev/rte_event_dma_adapter.c | 4 ++--
lib/eventdev/rte_event_timer_adapter.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index d46595d19028..d974404abe21 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -647,7 +647,7 @@ eca_ops_enqueue_burst(struct event_crypto_adapter *adapter,
continue;
}
- rte_memcpy(ev, &m_data->response_info, sizeof(*ev));
+ memcpy(ev, &m_data->response_info, sizeof(*ev));
ev->event_ptr = ops[i];
ev->event_type = RTE_EVENT_TYPE_CRYPTODEV;
if (adapter->implicit_release_disabled)
diff --git a/lib/eventdev/rte_event_dma_adapter.c b/lib/eventdev/rte_event_dma_adapter.c
index 4196164305d9..c50b3d23da2d 100644
--- a/lib/eventdev/rte_event_dma_adapter.c
+++ b/lib/eventdev/rte_event_dma_adapter.c
@@ -447,7 +447,7 @@ rte_event_dma_adapter_create(uint8_t id, uint8_t evdev_id, struct rte_event_port
if (pc == NULL)
return -ENOMEM;
- rte_memcpy(pc, port_config, sizeof(struct rte_event_port_conf));
+ memcpy(pc, port_config, sizeof(struct rte_event_port_conf));
ret = rte_event_dma_adapter_create_ext(id, evdev_id, edma_default_config_cb, mode, pc);
if (ret != 0)
rte_free(pc);
@@ -668,7 +668,7 @@ edma_ops_enqueue_burst(struct event_dma_adapter *adapter, struct rte_event_dma_a
continue;
}
- rte_memcpy(ev, response_info, sizeof(struct rte_event));
+ memcpy(ev, response_info, sizeof(struct rte_event));
ev->event_ptr = ops[i];
ev->event_type = RTE_EVENT_TYPE_DMADEV;
if (adapter->implicit_release_disabled)
diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c
index a3c6fb772e58..a425a30f5e05 100644
--- a/lib/eventdev/rte_event_timer_adapter.c
+++ b/lib/eventdev/rte_event_timer_adapter.c
@@ -548,7 +548,7 @@ event_buffer_add(struct event_buffer *bufp, struct rte_event *eventp)
/* Instead of modulus, bitwise AND with mask to get head_idx. */
head_idx = bufp->head & EVENT_BUFFER_MASK;
buf_eventp = &bufp->events[head_idx];
- rte_memcpy(buf_eventp, eventp, sizeof(struct rte_event));
+ memcpy(buf_eventp, eventp, sizeof(struct rte_event));
/* Wrap automatically when overflow occurs. */
bufp->head++;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 05/71] cryptodev: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (3 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 04/71] eventdev: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 06/71] ip_frag: " Stephen Hemminger
` (67 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Akhil Goyal, Fan Zhang
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/cryptodev/rte_cryptodev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 886eb7adc4a9..1377777525dc 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -2854,7 +2854,7 @@ crypto_caps_array(struct rte_tel_data *d,
while ((dev_caps = &capabilities[i++])->op !=
RTE_CRYPTO_OP_TYPE_UNDEFINED) {
memset(&caps_val, 0, CRYPTO_CAPS_SZ * sizeof(caps_val[0]));
- rte_memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
+ memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
for (j = 0; j < CRYPTO_CAPS_SZ; j++)
rte_tel_data_add_array_uint(d, caps_val[j]);
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 06/71] ip_frag: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (4 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 05/71] cryptodev: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 07/71] net: " Stephen Hemminger
` (66 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Konstantin Ananyev
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/ip_frag/rte_ipv6_fragmentation.c | 4 +---
lib/ip_frag/rte_ipv6_reassembly.c | 6 ++----
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/lib/ip_frag/rte_ipv6_fragmentation.c b/lib/ip_frag/rte_ipv6_fragmentation.c
index 56696f32f851..72ce6501c864 100644
--- a/lib/ip_frag/rte_ipv6_fragmentation.c
+++ b/lib/ip_frag/rte_ipv6_fragmentation.c
@@ -5,8 +5,6 @@
#include <stddef.h>
#include <errno.h>
-#include <rte_memcpy.h>
-
#include "ip_frag_common.h"
/**
@@ -23,7 +21,7 @@ __fill_ipv6hdr_frag(struct rte_ipv6_hdr *dst,
{
struct rte_ipv6_fragment_ext *fh;
- rte_memcpy(dst, src, sizeof(*dst));
+ memcpy(dst, src, sizeof(*dst));
dst->payload_len = rte_cpu_to_be_16(len);
dst->proto = IPPROTO_FRAGMENT;
diff --git a/lib/ip_frag/rte_ipv6_reassembly.c b/lib/ip_frag/rte_ipv6_reassembly.c
index 88863a98d1fe..663b1737a64e 100644
--- a/lib/ip_frag/rte_ipv6_reassembly.c
+++ b/lib/ip_frag/rte_ipv6_reassembly.c
@@ -4,8 +4,6 @@
#include <stddef.h>
-#include <rte_memcpy.h>
-
#include "ip_frag_common.h"
/**
@@ -143,8 +141,8 @@ rte_ipv6_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
int32_t ip_len;
int32_t trim;
- rte_memcpy(&key.src_dst[0], ip_hdr->src_addr, 16);
- rte_memcpy(&key.src_dst[2], ip_hdr->dst_addr, 16);
+ memcpy(&key.src_dst[0], ip_hdr->src_addr, 16);
+ memcpy(&key.src_dst[2], ip_hdr->dst_addr, 16);
key.id = frag_hdr->id;
key.key_len = IPV6_KEYLEN;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 07/71] net: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (5 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 06/71] ip_frag: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 08/71] lpm: " Stephen Hemminger
` (65 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/net/rte_ether.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/net/rte_ether.c b/lib/net/rte_ether.c
index f59c20289d37..761b38f8053f 100644
--- a/lib/net/rte_ether.c
+++ b/lib/net/rte_ether.c
@@ -13,7 +13,7 @@ rte_eth_random_addr(uint8_t *addr)
uint64_t rand = rte_rand();
uint8_t *p = (uint8_t *)&rand;
- rte_memcpy(addr, p, RTE_ETHER_ADDR_LEN);
+ memcpy(addr, p, RTE_ETHER_ADDR_LEN);
addr[0] &= (uint8_t)~RTE_ETHER_GROUP_ADDR; /* clear multicast bit */
addr[0] |= RTE_ETHER_LOCAL_ADMIN_ADDR; /* set local assignment bit */
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 08/71] lpm: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (6 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 07/71] net: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 09/71] node: " Stephen Hemminger
` (64 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Bruce Richardson, Vladimir Medvedkin
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/lpm/rte_lpm6.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c
index 271bc480dc60..3303463fbd0a 100644
--- a/lib/lpm/rte_lpm6.c
+++ b/lib/lpm/rte_lpm6.c
@@ -10,7 +10,6 @@
#include <rte_log.h>
#include <rte_common.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_eal_memconfig.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
@@ -138,7 +137,7 @@ ip6_mask_addr(uint8_t *ip, uint8_t depth)
static inline void
ip6_copy_addr(uint8_t *dst, const uint8_t *src)
{
- rte_memcpy(dst, src, RTE_LPM6_IPV6_ADDR_SIZE);
+ memcpy(dst, src, RTE_LPM6_IPV6_ADDR_SIZE);
}
/*
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 09/71] node: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (7 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 08/71] lpm: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 10/71] pdcp: " Stephen Hemminger
` (63 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Nithin Dabilpuram, Pavan Nikhilesh
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/node/ip6_lookup.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/node/ip6_lookup.c b/lib/node/ip6_lookup.c
index 309964f60fd6..b8e567ccd92d 100644
--- a/lib/node/ip6_lookup.c
+++ b/lib/node/ip6_lookup.c
@@ -112,28 +112,28 @@ ip6_lookup_node_process_scalar(struct rte_graph *graph, struct rte_node *node,
sizeof(struct rte_ether_hdr));
/* Extract hop_limits as ipv6 hdr is in cache */
node_mbuf_priv1(mbuf0, dyn)->ttl = ipv6_hdr->hop_limits;
- rte_memcpy(ip_batch[0], ipv6_hdr->dst_addr, 16);
+ memcpy(ip_batch[0], ipv6_hdr->dst_addr, 16);
/* Extract DIP of mbuf1 */
ipv6_hdr = rte_pktmbuf_mtod_offset(mbuf1, struct rte_ipv6_hdr *,
sizeof(struct rte_ether_hdr));
/* Extract hop_limits as ipv6 hdr is in cache */
node_mbuf_priv1(mbuf1, dyn)->ttl = ipv6_hdr->hop_limits;
- rte_memcpy(ip_batch[1], ipv6_hdr->dst_addr, 16);
+ memcpy(ip_batch[1], ipv6_hdr->dst_addr, 16);
/* Extract DIP of mbuf2 */
ipv6_hdr = rte_pktmbuf_mtod_offset(mbuf2, struct rte_ipv6_hdr *,
sizeof(struct rte_ether_hdr));
/* Extract hop_limits as ipv6 hdr is in cache */
node_mbuf_priv1(mbuf2, dyn)->ttl = ipv6_hdr->hop_limits;
- rte_memcpy(ip_batch[2], ipv6_hdr->dst_addr, 16);
+ memcpy(ip_batch[2], ipv6_hdr->dst_addr, 16);
/* Extract DIP of mbuf3 */
ipv6_hdr = rte_pktmbuf_mtod_offset(mbuf3, struct rte_ipv6_hdr *,
sizeof(struct rte_ether_hdr));
/* Extract hop_limits as ipv6 hdr is in cache */
node_mbuf_priv1(mbuf3, dyn)->ttl = ipv6_hdr->hop_limits;
- rte_memcpy(ip_batch[3], ipv6_hdr->dst_addr, 16);
+ memcpy(ip_batch[3], ipv6_hdr->dst_addr, 16);
rte_lpm6_lookup_bulk_func(lpm6, ip_batch, next_hop, 4);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 10/71] pdcp: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (8 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 09/71] node: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 11/71] pipeline: " Stephen Hemminger
` (62 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anoob Joseph, Volodymyr Fialko
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/pdcp/pdcp_process.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/lib/pdcp/pdcp_process.c b/lib/pdcp/pdcp_process.c
index 9b9b881124b8..6c0693f66629 100644
--- a/lib/pdcp/pdcp_process.c
+++ b/lib/pdcp/pdcp_process.c
@@ -60,7 +60,7 @@ pdcp_iv_gen_null_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv *e
m = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(m_ptr, &m, 8);
+ memcpy(m_ptr, &m, 8);
}
static void
@@ -72,10 +72,10 @@ pdcp_iv_gen_null_zs(struct rte_crypto_op *cop, const struct entity_priv *en_priv
iv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET);
iv_u64[0] = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64[0], 8);
+ memcpy(iv, &iv_u64[0], 8);
iv_u64[1] = iv_u64[0] ^ en_priv->auth_iv_part.u64[1];
- rte_memcpy(iv + 8, &iv_u64[1], 8);
+ memcpy(iv + 8, &iv_u64[1], 8);
}
static void
@@ -89,7 +89,7 @@ pdcp_iv_gen_aes_ctr_null(struct rte_crypto_op *cop, const struct entity_priv *en
iv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
iv_u64[1] = 0;
- rte_memcpy(iv, iv_u64, 16);
+ memcpy(iv, iv_u64, 16);
}
static void
@@ -101,8 +101,8 @@ pdcp_iv_gen_zs_null(struct rte_crypto_op *cop, const struct entity_priv *en_priv
iv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET);
iv_u64 = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64, 8);
- rte_memcpy(iv + 8, &iv_u64, 8);
+ memcpy(iv, &iv_u64, 8);
+ memcpy(iv + 8, &iv_u64, 8);
}
static void
@@ -115,17 +115,17 @@ pdcp_iv_gen_zs_zs(struct rte_crypto_op *cop, const struct entity_priv *en_priv,
/* Generating cipher IV */
iv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64[0], 8);
- rte_memcpy(iv + 8, &iv_u64[0], 8);
+ memcpy(iv, &iv_u64[0], 8);
+ memcpy(iv + 8, &iv_u64[0], 8);
iv += PDCP_IV_LEN;
/* Generating auth IV */
iv_u64[0] = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64[0], 8);
+ memcpy(iv, &iv_u64[0], 8);
iv_u64[1] = iv_u64[0] ^ en_priv->auth_iv_part.u64[1];
- rte_memcpy(iv + 8, &iv_u64[1], 8);
+ memcpy(iv + 8, &iv_u64[1], 8);
}
static void
@@ -140,12 +140,12 @@ pdcp_iv_gen_zs_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv *en_
iv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET);
iv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64[0], 8);
- rte_memcpy(iv + 8, &iv_u64[0], 8);
+ memcpy(iv, &iv_u64[0], 8);
+ memcpy(iv + 8, &iv_u64[0], 8);
m_ptr = (uint8_t *)rte_pktmbuf_prepend(mb, 8);
m = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(m_ptr, &m, 8);
+ memcpy(m_ptr, &m, 8);
}
static void
@@ -162,11 +162,11 @@ pdcp_iv_gen_aes_ctr_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv
iv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
iv_u64[1] = 0;
- rte_memcpy(iv, iv_u64, PDCP_IV_LEN);
+ memcpy(iv, iv_u64, PDCP_IV_LEN);
m_ptr = (uint8_t *)rte_pktmbuf_prepend(mb, 8);
m = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(m_ptr, &m, 8);
+ memcpy(m_ptr, &m, 8);
}
static void
@@ -179,15 +179,15 @@ pdcp_iv_gen_aes_ctr_zs(struct rte_crypto_op *cop, const struct entity_priv *en_p
iv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
iv_u64[1] = 0;
- rte_memcpy(iv, iv_u64, PDCP_IV_LEN);
+ memcpy(iv, iv_u64, PDCP_IV_LEN);
iv += PDCP_IV_LEN;
iv_u64[0] = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64[0], 8);
+ memcpy(iv, &iv_u64[0], 8);
iv_u64[1] = iv_u64[0] ^ en_priv->auth_iv_part.u64[1];
- rte_memcpy(iv + 8, &iv_u64[1], 8);
+ memcpy(iv + 8, &iv_u64[1], 8);
}
static int
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 11/71] pipeline: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (9 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 10/71] pdcp: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 12/71] rib: " Stephen Hemminger
` (61 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Cristian Dumitrescu
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/pipeline/rte_table_action.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/pipeline/rte_table_action.c b/lib/pipeline/rte_table_action.c
index dfdbc66b087c..c2312dc803a1 100644
--- a/lib/pipeline/rte_table_action.c
+++ b/lib/pipeline/rte_table_action.c
@@ -1441,7 +1441,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip,
tcp->src_port,
data->port);
- rte_memcpy(ip->src_addr, data->addr, 16);
+ memcpy(ip->src_addr, data->addr, 16);
tcp->src_port = data->port;
tcp->cksum = tcp_cksum;
} else {
@@ -1454,7 +1454,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip,
udp->src_port,
data->port);
- rte_memcpy(ip->src_addr, data->addr, 16);
+ memcpy(ip->src_addr, data->addr, 16);
udp->src_port = data->port;
udp->dgram_cksum = udp_cksum;
}
@@ -1469,7 +1469,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip,
tcp->dst_port,
data->port);
- rte_memcpy(ip->dst_addr, data->addr, 16);
+ memcpy(ip->dst_addr, data->addr, 16);
tcp->dst_port = data->port;
tcp->cksum = tcp_cksum;
} else {
@@ -1482,7 +1482,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip,
udp->dst_port,
data->port);
- rte_memcpy(ip->dst_addr, data->addr, 16);
+ memcpy(ip->dst_addr, data->addr, 16);
udp->dst_port = data->port;
udp->dgram_cksum = udp_cksum;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 12/71] rib: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (10 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 11/71] pipeline: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 13/71] security: " Stephen Hemminger
` (60 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Vladimir Medvedkin
Mostly automatically generated by devtools/cocci/rte_memcpy.cocci
The fib/trie.c was relying on headers
rte_rib6 -> rte_memcpy -> rte_vect
since rib6 is no longer using rte_memcpy need to get rte_vect.h
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/fib/trie.c | 2 +-
lib/rib/rte_rib6.h | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/fib/trie.c b/lib/fib/trie.c
index 09470e7287cc..a77f6c758b0d 100644
--- a/lib/fib/trie.c
+++ b/lib/fib/trie.c
@@ -9,7 +9,7 @@
#include <rte_debug.h>
#include <rte_malloc.h>
#include <rte_errno.h>
-
+#include <rte_vect.h>
#include <rte_rib6.h>
#include <rte_fib6.h>
#include "trie.h"
diff --git a/lib/rib/rte_rib6.h b/lib/rib/rte_rib6.h
index 775286f965f2..f366d3d197f3 100644
--- a/lib/rib/rte_rib6.h
+++ b/lib/rib/rte_rib6.h
@@ -14,7 +14,8 @@
* Level compressed tree implementation for IPv6 Longest Prefix Match
*/
-#include <rte_memcpy.h>
+#include <string.h>
+
#include <rte_common.h>
#ifdef __cplusplus
@@ -61,7 +62,7 @@ rte_rib6_copy_addr(uint8_t *dst, const uint8_t *src)
{
if ((dst == NULL) || (src == NULL))
return;
- rte_memcpy(dst, src, RTE_RIB6_IPV6_ADDR_SIZE);
+ memcpy(dst, src, RTE_RIB6_IPV6_ADDR_SIZE);
}
/**
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 13/71] security: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (11 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 12/71] rib: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 14/71] net/mlx5: " Stephen Hemminger
` (59 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Akhil Goyal, Anoob Joseph
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/security/rte_security.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
index e5c862f5f570..28d59ef38831 100644
--- a/lib/security/rte_security.c
+++ b/lib/security/rte_security.c
@@ -384,7 +384,7 @@ crypto_caps_array(struct rte_tel_data *d,
while ((dev_caps = &capabilities[i++])->op !=
RTE_CRYPTO_OP_TYPE_UNDEFINED) {
memset(&caps_val, 0, CRYPTO_CAPS_SZ * sizeof(caps_val[0]));
- rte_memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
+ memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
for (j = 0; j < CRYPTO_CAPS_SZ; j++)
rte_tel_data_add_array_uint(d, caps_val[j]);
}
@@ -409,7 +409,7 @@ sec_caps_array(struct rte_tel_data *d,
while ((dev_caps = &capabilities[i++])->action !=
RTE_SECURITY_ACTION_TYPE_NONE) {
memset(&caps_val, 0, SEC_CAPS_SZ * sizeof(caps_val[0]));
- rte_memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
+ memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
for (j = 0; j < SEC_CAPS_SZ; j++)
rte_tel_data_add_array_uint(d, caps_val[j]);
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 14/71] net/mlx5: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (12 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 13/71] security: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-08 18:16 ` Dariusz Sosnowski
2024-03-01 17:15 ` [PATCH v2 15/71] net/nfp: " Stephen Hemminger
` (58 subsequent siblings)
72 siblings, 1 reply; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Dariusz Sosnowski, Viacheslav Ovsiienko,
Ori Kam, Suanming Mou, Matan Azrad
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/mlx5/mlx5_devx.c | 4 ++--
drivers/net/mlx5/mlx5_flow.c | 38 ++++++++++++++++----------------
drivers/net/mlx5/mlx5_flow_aso.c | 6 ++---
drivers/net/mlx5/mlx5_flow_hw.c | 16 +++++++-------
drivers/net/mlx5/mlx5_rx.c | 6 ++---
drivers/net/mlx5/mlx5_rxtx_vec.c | 8 +++----
6 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c
index 9fa400fc48ef..6380a5c83cd3 100644
--- a/drivers/net/mlx5/mlx5_devx.c
+++ b/drivers/net/mlx5/mlx5_devx.c
@@ -512,7 +512,7 @@ mlx5_rxq_obj_hairpin_new(struct mlx5_rxq_priv *rxq)
* during queue setup.
*/
MLX5_ASSERT(hca_attr->hairpin_data_buffer_locked);
- rte_memcpy(&locked_attr, &unlocked_attr, sizeof(locked_attr));
+ memcpy(&locked_attr, &unlocked_attr, sizeof(locked_attr));
locked_attr.hairpin_data_buffer_type =
MLX5_RQC_HAIRPIN_DATA_BUFFER_TYPE_LOCKED_INTERNAL_BUFFER;
tmpl->rq = mlx5_devx_cmd_create_rq(priv->sh->cdev->ctx, &locked_attr,
@@ -1289,7 +1289,7 @@ mlx5_txq_obj_hairpin_new(struct rte_eth_dev *dev, uint16_t idx)
*/
MLX5_ASSERT(hca_attr->hairpin_sq_wq_in_host_mem);
MLX5_ASSERT(hca_attr->hairpin_sq_wqe_bb_size > 0);
- rte_memcpy(&host_mem_attr, &dev_mem_attr, sizeof(host_mem_attr));
+ memcpy(&host_mem_attr, &dev_mem_attr, sizeof(host_mem_attr));
umem_size = MLX5_WQE_SIZE *
RTE_BIT32(host_mem_attr.wq_attr.log_hairpin_num_packets);
umem_dbrec = RTE_ALIGN(umem_size, MLX5_DBR_SIZE);
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 2b2ae626186e..53c20592b91a 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -4495,8 +4495,8 @@ flow_action_handles_translate(struct rte_eth_dev *dev,
(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION_NUM,
NULL, "too many shared actions");
}
- rte_memcpy(&handle[copied_n].action, &actions[n].conf,
- sizeof(actions[n].conf));
+ memcpy(&handle[copied_n].action, &actions[n].conf,
+ sizeof(actions[n].conf));
handle[copied_n].index = n;
copied_n++;
}
@@ -5362,29 +5362,29 @@ flow_hairpin_split(struct rte_eth_dev *dev,
case RTE_FLOW_ACTION_TYPE_NVGRE_ENCAP:
case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN:
case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP:
- rte_memcpy(actions_tx, actions,
+ memcpy(actions_tx, actions,
sizeof(struct rte_flow_action));
actions_tx++;
break;
case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID:
if (push_vlan) {
- rte_memcpy(actions_tx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_tx, actions,
+ sizeof(struct rte_flow_action));
actions_tx++;
} else {
- rte_memcpy(actions_rx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions,
+ sizeof(struct rte_flow_action));
actions_rx++;
}
break;
case RTE_FLOW_ACTION_TYPE_COUNT:
if (encap) {
- rte_memcpy(actions_tx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_tx, actions,
+ sizeof(struct rte_flow_action));
actions_tx++;
} else {
- rte_memcpy(actions_rx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions,
+ sizeof(struct rte_flow_action));
actions_rx++;
}
break;
@@ -5396,8 +5396,8 @@ flow_hairpin_split(struct rte_eth_dev *dev,
actions_tx++;
encap = 1;
} else {
- rte_memcpy(actions_rx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions,
+ sizeof(struct rte_flow_action));
actions_rx++;
}
break;
@@ -5408,14 +5408,14 @@ flow_hairpin_split(struct rte_eth_dev *dev,
sizeof(struct rte_flow_action));
actions_tx++;
} else {
- rte_memcpy(actions_rx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions,
+ sizeof(struct rte_flow_action));
actions_rx++;
}
break;
default:
- rte_memcpy(actions_rx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions,
+ sizeof(struct rte_flow_action));
actions_rx++;
break;
}
@@ -5425,7 +5425,7 @@ flow_hairpin_split(struct rte_eth_dev *dev,
tag_action->type = (enum rte_flow_action_type)
MLX5_RTE_FLOW_ACTION_TYPE_TAG;
actions_rx++;
- rte_memcpy(actions_rx, actions, sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions, sizeof(struct rte_flow_action));
actions_rx++;
set_tag = (void *)actions_rx;
*set_tag = (struct mlx5_rte_flow_action_set_tag) {
@@ -5435,7 +5435,7 @@ flow_hairpin_split(struct rte_eth_dev *dev,
MLX5_ASSERT(set_tag->id > REG_NON);
tag_action->conf = set_tag;
/* Create Tx item list. */
- rte_memcpy(actions_tx, actions, sizeof(struct rte_flow_action));
+ memcpy(actions_tx, actions, sizeof(struct rte_flow_action));
addr = (void *)&pattern_tx[2];
item = pattern_tx;
item->type = (enum rte_flow_item_type)
diff --git a/drivers/net/mlx5/mlx5_flow_aso.c b/drivers/net/mlx5/mlx5_flow_aso.c
index f3114434729e..49de92c675cd 100644
--- a/drivers/net/mlx5/mlx5_flow_aso.c
+++ b/drivers/net/mlx5/mlx5_flow_aso.c
@@ -1327,9 +1327,9 @@ mlx5_aso_ct_status_update(struct mlx5_aso_sq *sq, uint16_t num)
MLX5_ASSERT(ct);
MLX5_ASO_CT_UPDATE_STATE(ct, ASO_CONNTRACK_READY);
if (sq->elts[idx].query_data)
- rte_memcpy(sq->elts[idx].query_data,
- (char *)((uintptr_t)sq->mr.addr + idx * 64),
- 64);
+ memcpy(sq->elts[idx].query_data,
+ (char *)((uintptr_t)sq->mr.addr + idx * 64),
+ 64);
}
}
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index bcf43f545779..04b12bba95a9 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -1970,7 +1970,7 @@ mlx5_tbl_translate_modify_header(struct rte_eth_dev *dev,
return rte_flow_error_set(error, ENOMEM,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL, "translate modify_header: no memory for modify header context");
- rte_memcpy(acts->mhdr, mhdr, sizeof(*mhdr));
+ memcpy(acts->mhdr, mhdr, sizeof(*mhdr));
pattern.data = (__be64 *)acts->mhdr->mhdr_cmds;
if (mhdr->shared) {
uint32_t flags = mlx5_hw_act_flag[!!attr->group][tbl_type] |
@@ -2823,9 +2823,9 @@ flow_hw_modify_field_construct(struct mlx5_hw_q_job *job,
mhdr_action->src.field != RTE_FLOW_FIELD_POINTER)
return 0;
if (mhdr_action->src.field == RTE_FLOW_FIELD_VALUE)
- rte_memcpy(values, &mhdr_action->src.value, sizeof(values));
+ memcpy(values, &mhdr_action->src.value, sizeof(values));
else
- rte_memcpy(values, mhdr_action->src.pvalue, sizeof(values));
+ memcpy(values, mhdr_action->src.pvalue, sizeof(values));
if (mhdr_action->dst.field == RTE_FLOW_FIELD_META ||
mhdr_action->dst.field == RTE_FLOW_FIELD_TAG ||
mhdr_action->dst.field == RTE_FLOW_FIELD_METER_COLOR ||
@@ -4467,7 +4467,7 @@ flow_hw_table_create(struct rte_eth_dev *dev,
rte_flow_error_set(error, err, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
"Failed to create template table");
else
- rte_memcpy(error, &sub_error, sizeof(sub_error));
+ memcpy(error, &sub_error, sizeof(sub_error));
}
return NULL;
}
@@ -7773,8 +7773,8 @@ flow_hw_create_tx_repr_tag_jump_acts_tmpl(struct rte_eth_dev *dev,
struct rte_flow_action actions_m[4] = { { 0 } };
unsigned int idx = 0;
- rte_memcpy(set_tag_v.src.value, &tag_value, sizeof(tag_value));
- rte_memcpy(set_tag_m.src.value, &tag_mask, sizeof(tag_mask));
+ memcpy(set_tag_v.src.value, &tag_value, sizeof(tag_value));
+ memcpy(set_tag_m.src.value, &tag_mask, sizeof(tag_mask));
flow_hw_update_action_mask(&actions_v[idx], &actions_m[idx],
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD,
&set_tag_v, &set_tag_m);
@@ -8181,8 +8181,8 @@ flow_hw_create_ctrl_regc_jump_actions_template(struct rte_eth_dev *dev,
};
set_reg_v.dst.offset = rte_bsf32(marker_mask);
- rte_memcpy(set_reg_v.src.value, &marker_bits, sizeof(marker_bits));
- rte_memcpy(set_reg_m.src.value, &marker_mask, sizeof(marker_mask));
+ memcpy(set_reg_v.src.value, &marker_bits, sizeof(marker_bits));
+ memcpy(set_reg_m.src.value, &marker_mask, sizeof(marker_mask));
return flow_hw_actions_template_create(dev, &attr, actions_v, actions_m, error);
}
diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c
index 5bf1a679b2d8..e35f9abd2064 100644
--- a/drivers/net/mlx5/mlx5_rx.c
+++ b/drivers/net/mlx5/mlx5_rx.c
@@ -761,9 +761,9 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
ret = check_cqe_iteration(next, rxq->cqe_n, rxq->cq_ci);
if (ret != MLX5_CQE_STATUS_SW_OWN ||
MLX5_CQE_FORMAT(next->op_own) == MLX5_COMPRESSED)
- rte_memcpy(&rxq->title_cqe,
- (const void *)(uintptr_t)cqe,
- sizeof(struct mlx5_cqe));
+ memcpy(&rxq->title_cqe,
+ (const void *)(uintptr_t)cqe,
+ sizeof(struct mlx5_cqe));
}
}
}
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec.c b/drivers/net/mlx5/mlx5_rxtx_vec.c
index 2363d7ed27a7..c3bcd3ef16de 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec.c
+++ b/drivers/net/mlx5/mlx5_rxtx_vec.c
@@ -349,8 +349,8 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
ret = check_cqe_iteration(next, rxq->cqe_n, rxq->cq_ci);
if (ret != MLX5_CQE_STATUS_SW_OWN ||
MLX5_CQE_FORMAT(next->op_own) == MLX5_COMPRESSED)
- rte_memcpy(&rxq->title_pkt, elts[nocmp_n - 1],
- sizeof(struct rte_mbuf));
+ memcpy(&rxq->title_pkt, elts[nocmp_n - 1],
+ sizeof(struct rte_mbuf));
}
/* Decompress the last CQE if compressed. */
if (comp_idx < MLX5_VPMD_DESCS_PER_LOOP) {
@@ -499,8 +499,8 @@ rxq_burst_mprq_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
ret = check_cqe_iteration(next, rxq->cqe_n, rxq->cq_ci);
if (ret != MLX5_CQE_STATUS_SW_OWN ||
MLX5_CQE_FORMAT(next->op_own) == MLX5_COMPRESSED)
- rte_memcpy(&rxq->title_pkt, elts[nocmp_n - 1],
- sizeof(struct rte_mbuf));
+ memcpy(&rxq->title_pkt, elts[nocmp_n - 1],
+ sizeof(struct rte_mbuf));
}
/* Decompress the last CQE if compressed. */
if (comp_idx < MLX5_VPMD_DESCS_PER_LOOP) {
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 15/71] net/nfp: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (13 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 14/71] net/mlx5: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 16/71] net/ngbe: " Stephen Hemminger
` (57 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Chaoyong He
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/nfp/flower/nfp_conntrack.c | 2 +-
drivers/net/nfp/flower/nfp_flower_flow.c | 16 ++++++++--------
drivers/net/nfp/flower/nfp_flower_representor.c | 2 +-
drivers/net/nfp/nfp_mtr.c | 10 +++++-----
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/net/nfp/flower/nfp_conntrack.c b/drivers/net/nfp/flower/nfp_conntrack.c
index f89003be8b40..279bf17eb3a5 100644
--- a/drivers/net/nfp/flower/nfp_conntrack.c
+++ b/drivers/net/nfp/flower/nfp_conntrack.c
@@ -1470,7 +1470,7 @@ nfp_ct_do_flow_merge(struct nfp_ct_zone_entry *ze,
merge_entry->ze = ze;
merge_entry->pre_ct_parent = pre_ct_entry;
merge_entry->post_ct_parent = post_ct_entry;
- rte_memcpy(merge_entry->cookie, new_cookie, sizeof(new_cookie));
+ memcpy(merge_entry->cookie, new_cookie, sizeof(new_cookie));
merge_entry->rule.items_cnt = pre_ct_entry->rule.items_cnt +
post_ct_entry->rule.items_cnt - cnt_same_item - 1;
merge_entry->rule.actions_cnt = pre_ct_entry->rule.actions_cnt +
diff --git a/drivers/net/nfp/flower/nfp_flower_flow.c b/drivers/net/nfp/flower/nfp_flower_flow.c
index e26be30d1833..3d07a4429b62 100644
--- a/drivers/net/nfp/flower/nfp_flower_flow.c
+++ b/drivers/net/nfp/flower/nfp_flower_flow.c
@@ -178,10 +178,10 @@ nfp_mask_id_alloc(struct nfp_flow_priv *priv,
return -ENOENT;
}
- rte_memcpy(&temp_id, &ring->buf[ring->tail], NFP_FLOWER_MASK_ELEMENT_RS);
+ memcpy(&temp_id, &ring->buf[ring->tail], NFP_FLOWER_MASK_ELEMENT_RS);
*mask_id = temp_id;
- rte_memcpy(&ring->buf[ring->tail], &freed_id, NFP_FLOWER_MASK_ELEMENT_RS);
+ memcpy(&ring->buf[ring->tail], &freed_id, NFP_FLOWER_MASK_ELEMENT_RS);
ring->tail = (ring->tail + NFP_FLOWER_MASK_ELEMENT_RS) %
(NFP_FLOWER_MASK_ENTRY_RS * NFP_FLOWER_MASK_ELEMENT_RS);
@@ -200,7 +200,7 @@ nfp_mask_id_free(struct nfp_flow_priv *priv,
if (CIRC_SPACE(ring->head, ring->tail, NFP_FLOWER_MASK_ENTRY_RS) == 0)
return -ENOBUFS;
- rte_memcpy(&ring->buf[ring->head], &mask_id, NFP_FLOWER_MASK_ELEMENT_RS);
+ memcpy(&ring->buf[ring->head], &mask_id, NFP_FLOWER_MASK_ELEMENT_RS);
ring->head = (ring->head + NFP_FLOWER_MASK_ELEMENT_RS) %
(NFP_FLOWER_MASK_ENTRY_RS * NFP_FLOWER_MASK_ELEMENT_RS);
@@ -2247,13 +2247,13 @@ nfp_flow_action_set_mac(char *act_data,
set_mac = action->conf;
if (mac_src_flag) {
- rte_memcpy(&set_eth->eth_addr[RTE_ETHER_ADDR_LEN],
- set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(&set_eth->eth_addr[RTE_ETHER_ADDR_LEN],
+ set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
set_eth->eth_addr_mask[RTE_ETHER_ADDR_LEN + i] = 0xff;
} else {
- rte_memcpy(&set_eth->eth_addr[0],
- set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(&set_eth->eth_addr[0], set_mac->mac_addr,
+ RTE_ETHER_ADDR_LEN);
for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
set_eth->eth_addr_mask[i] = 0xff;
}
@@ -2329,7 +2329,7 @@ nfp_flow_action_set_ipv6(char *act_data,
set_ip->reserved = 0;
for (i = 0; i < 4; i++) {
- rte_memcpy(&tmp, &set_ipv6->ipv6_addr[i * 4], 4);
+ memcpy(&tmp, &set_ipv6->ipv6_addr[i * 4], 4);
set_ip->ipv6[i].exact = tmp;
set_ip->ipv6[i].mask = RTE_BE32(0xffffffff);
}
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index 4f4df0cd2ee2..ce2b06611802 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -181,7 +181,7 @@ nfp_flower_repr_stats_get(struct rte_eth_dev *ethdev,
struct nfp_flower_representor *repr;
repr = ethdev->data->dev_private;
- rte_memcpy(stats, &repr->repr_stats, sizeof(struct rte_eth_stats));
+ memcpy(stats, &repr->repr_stats, sizeof(struct rte_eth_stats));
return 0;
}
diff --git a/drivers/net/nfp/nfp_mtr.c b/drivers/net/nfp/nfp_mtr.c
index 255977ec2236..1f173409b421 100644
--- a/drivers/net/nfp/nfp_mtr.c
+++ b/drivers/net/nfp/nfp_mtr.c
@@ -243,7 +243,7 @@ nfp_mtr_profile_mod(struct nfp_app_fw_flower *app_fw_flower,
struct nfp_profile_conf old_conf;
/* Get the old profile config */
- rte_memcpy(&old_conf, &mtr_profile->conf, sizeof(old_conf));
+ memcpy(&old_conf, &mtr_profile->conf, sizeof(old_conf));
memset(&mtr_profile->conf, 0, sizeof(struct nfp_profile_conf));
@@ -267,7 +267,7 @@ nfp_mtr_profile_mod(struct nfp_app_fw_flower *app_fw_flower,
return 0;
rollback:
- rte_memcpy(&mtr_profile->conf, &old_conf, sizeof(old_conf));
+ memcpy(&mtr_profile->conf, &old_conf, sizeof(old_conf));
return ret;
}
@@ -492,8 +492,8 @@ nfp_mtr_policy_add(struct rte_eth_dev *dev,
}
mtr_policy->policy_id = mtr_policy_id;
- rte_memcpy(&mtr_policy->policy, policy,
- sizeof(struct rte_mtr_meter_policy_params));
+ memcpy(&mtr_policy->policy, policy,
+ sizeof(struct rte_mtr_meter_policy_params));
/* Insert policy into policy list */
LIST_INSERT_HEAD(&priv->policies, mtr_policy, next);
@@ -1028,7 +1028,7 @@ nfp_mtr_stats_read(struct rte_eth_dev *dev,
*stats_mask = mtr->stats_mask;
rte_spinlock_lock(&priv->mtr_stats_lock);
- rte_memcpy(&curr, &mtr->mtr_stats.curr, sizeof(curr));
+ memcpy(&curr, &mtr->mtr_stats.curr, sizeof(curr));
rte_spinlock_unlock(&priv->mtr_stats_lock);
prev = &mtr->mtr_stats.prev;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 16/71] net/ngbe: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (14 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 15/71] net/nfp: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 17/71] net/null: " Stephen Hemminger
` (56 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jiawen Wu
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/ngbe/ngbe_pf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ngbe/ngbe_pf.c b/drivers/net/ngbe/ngbe_pf.c
index 947ae7fe942a..48f578b06626 100644
--- a/drivers/net/ngbe/ngbe_pf.c
+++ b/drivers/net/ngbe/ngbe_pf.c
@@ -347,7 +347,7 @@ ngbe_vf_reset(struct rte_eth_dev *eth_dev, uint16_t vf, uint32_t *msgbuf)
/* reply to reset with ack and vf mac address */
msgbuf[0] = NGBE_VF_RESET | NGBE_VT_MSGTYPE_ACK;
- rte_memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
+ memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
/*
* Piggyback the multicast filter type so VF can compute the
* correct vectors
@@ -369,7 +369,7 @@ ngbe_vf_set_mac_addr(struct rte_eth_dev *eth_dev,
struct rte_ether_addr *ea = (struct rte_ether_addr *)new_mac;
if (rte_is_valid_assigned_ether_addr(ea)) {
- rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
+ memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
return hw->mac.set_rar(hw, rar_entry, new_mac, vf, true);
}
return -1;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 17/71] net/null: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (15 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 16/71] net/ngbe: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 18/71] net/pcap: " Stephen Hemminger
` (55 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Tetsuya Mukawa
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/null/rte_eth_null.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 7c46004f1e33..fd8b01b2b17b 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -465,7 +465,7 @@ eth_rss_hash_update(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf)
rss_conf->rss_hf & internal->flow_type_rss_offloads;
if (rss_conf->rss_key)
- rte_memcpy(internal->rss_key, rss_conf->rss_key, 40);
+ memcpy(internal->rss_key, rss_conf->rss_key, 40);
rte_spinlock_unlock(&internal->rss_lock);
@@ -482,7 +482,7 @@ eth_rss_hash_conf_get(struct rte_eth_dev *dev,
rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf;
if (rss_conf->rss_key)
- rte_memcpy(rss_conf->rss_key, internal->rss_key, 40);
+ memcpy(rss_conf->rss_key, internal->rss_key, 40);
rte_spinlock_unlock(&internal->rss_lock);
@@ -577,7 +577,7 @@ eth_dev_null_create(struct rte_vdev_device *dev, struct pmd_options *args)
internals->flow_type_rss_offloads = RTE_ETH_RSS_PROTO_MASK;
internals->reta_size = RTE_DIM(internals->reta_conf) * RTE_ETH_RETA_GROUP_SIZE;
- rte_memcpy(internals->rss_key, default_rss_key, 40);
+ memcpy(internals->rss_key, default_rss_key, 40);
data = eth_dev->data;
data->nb_rx_queues = (uint16_t)nb_rx_queues;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 18/71] net/pcap: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (16 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 17/71] net/null: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 19/71] net/sfc: " Stephen Hemminger
` (54 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/pcap/pcap_ethdev.c | 2 +-
drivers/net/pcap/pcap_osdep_freebsd.c | 2 +-
drivers/net/pcap/pcap_osdep_linux.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/pcap/pcap_ethdev.c b/drivers/net/pcap/pcap_ethdev.c
index bfec0850456f..54f0dfffbdd0 100644
--- a/drivers/net/pcap/pcap_ethdev.c
+++ b/drivers/net/pcap/pcap_ethdev.c
@@ -1270,7 +1270,7 @@ eth_pcap_update_mac(const char *if_name, struct rte_eth_dev *eth_dev,
return -1;
PMD_LOG(INFO, "Setting phy MAC for %s", if_name);
- rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
+ memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
eth_dev->data->mac_addrs = mac_addrs;
return 0;
}
diff --git a/drivers/net/pcap/pcap_osdep_freebsd.c b/drivers/net/pcap/pcap_osdep_freebsd.c
index 20556b3e9215..d395a5957d56 100644
--- a/drivers/net/pcap/pcap_osdep_freebsd.c
+++ b/drivers/net/pcap/pcap_osdep_freebsd.c
@@ -52,7 +52,7 @@ osdep_iface_mac_get(const char *if_name, struct rte_ether_addr *mac)
ifm = (struct if_msghdr *)buf;
sdl = (struct sockaddr_dl *)(ifm + 1);
- rte_memcpy(mac->addr_bytes, LLADDR(sdl), RTE_ETHER_ADDR_LEN);
+ memcpy(mac->addr_bytes, LLADDR(sdl), RTE_ETHER_ADDR_LEN);
rte_free(buf);
return 0;
diff --git a/drivers/net/pcap/pcap_osdep_linux.c b/drivers/net/pcap/pcap_osdep_linux.c
index 97033f57c5d9..fc79ad6cdf9e 100644
--- a/drivers/net/pcap/pcap_osdep_linux.c
+++ b/drivers/net/pcap/pcap_osdep_linux.c
@@ -35,7 +35,7 @@ osdep_iface_mac_get(const char *if_name, struct rte_ether_addr *mac)
return -1;
}
- rte_memcpy(mac->addr_bytes, ifr.ifr_hwaddr.sa_data, RTE_ETHER_ADDR_LEN);
+ memcpy(mac->addr_bytes, ifr.ifr_hwaddr.sa_data, RTE_ETHER_ADDR_LEN);
close(if_fd);
return 0;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 19/71] net/sfc: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (17 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 18/71] net/pcap: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 20/71] net/tap: " Stephen Hemminger
` (53 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Andrew Rybchenko
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/sfc/sfc.c | 2 +-
drivers/net/sfc/sfc_ef10_tx.c | 2 +-
drivers/net/sfc/sfc_ethdev.c | 11 +++++------
drivers/net/sfc/sfc_flow.c | 20 ++++++++++----------
| 2 +-
drivers/net/sfc/sfc_mae.c | 2 +-
drivers/net/sfc/sfc_rx.c | 2 +-
drivers/net/sfc/sfc_tso.c | 2 +-
drivers/net/sfc/sfc_tso.h | 9 ++++-----
9 files changed, 25 insertions(+), 27 deletions(-)
diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c
index 2cfff20f4783..2fd160e99ed2 100644
--- a/drivers/net/sfc/sfc.c
+++ b/drivers/net/sfc/sfc.c
@@ -850,7 +850,7 @@ sfc_rss_attach(struct sfc_adapter *sa)
efx_ev_fini(sa->nic);
efx_intr_fini(sa->nic);
- rte_memcpy(rss->key, default_rss_key, sizeof(rss->key));
+ memcpy(rss->key, default_rss_key, sizeof(rss->key));
memset(&rss->dummy_ctx, 0, sizeof(rss->dummy_ctx));
rss->dummy_ctx.conf.qid_span = 1;
rss->dummy_ctx.dummy = true;
diff --git a/drivers/net/sfc/sfc_ef10_tx.c b/drivers/net/sfc/sfc_ef10_tx.c
index 116229382b68..0b78a9eaccd1 100644
--- a/drivers/net/sfc/sfc_ef10_tx.c
+++ b/drivers/net/sfc/sfc_ef10_tx.c
@@ -514,7 +514,7 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg,
first_m_seg->outer_l2_len);
th = (const struct rte_tcp_hdr *)(hdr_addr + tcph_off);
- rte_memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t));
+ memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t));
sent_seq = rte_be_to_cpu_32(sent_seq);
sfc_ef10_tx_qdesc_tso2_create(txq, *added, packet_id, outer_packet_id,
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 92ca5e7a60de..a6f0743f102c 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -1287,8 +1287,7 @@ sfc_set_mc_addr_list(struct rte_eth_dev *dev,
}
for (i = 0; i < nb_mc_addr; ++i) {
- rte_memcpy(mc_addrs, mc_addr_set[i].addr_bytes,
- EFX_MAC_ADDR_LEN);
+ memcpy(mc_addrs, mc_addr_set[i].addr_bytes, EFX_MAC_ADDR_LEN);
mc_addrs += EFX_MAC_ADDR_LEN;
}
@@ -1672,7 +1671,7 @@ sfc_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
rss_conf->rss_hf = sfc_rx_hf_efx_to_rte(rss, rss->hash_types);
rss_conf->rss_key_len = EFX_RSS_KEY_SIZE;
if (rss_conf->rss_key != NULL)
- rte_memcpy(rss_conf->rss_key, rss->key, EFX_RSS_KEY_SIZE);
+ memcpy(rss_conf->rss_key, rss->key, EFX_RSS_KEY_SIZE);
return 0;
}
@@ -1741,7 +1740,7 @@ sfc_dev_rss_hash_update(struct rte_eth_dev *dev,
}
}
- rte_memcpy(rss->key, rss_conf->rss_key, sizeof(rss->key));
+ memcpy(rss->key, rss_conf->rss_key, sizeof(rss->key));
}
rss->hash_types = efx_hash_types;
@@ -1840,7 +1839,7 @@ sfc_dev_rss_reta_update(struct rte_eth_dev *dev,
sfc_adapter_lock(sa);
- rte_memcpy(rss_tbl_new, rss->tbl, sizeof(rss->tbl));
+ memcpy(rss_tbl_new, rss->tbl, sizeof(rss->tbl));
for (entry = 0; entry < reta_size; entry++) {
int grp_idx = entry % RTE_ETH_RETA_GROUP_SIZE;
@@ -1864,7 +1863,7 @@ sfc_dev_rss_reta_update(struct rte_eth_dev *dev,
goto fail_scale_tbl_set;
}
- rte_memcpy(rss->tbl, rss_tbl_new, sizeof(rss->tbl));
+ memcpy(rss->tbl, rss_tbl_new, sizeof(rss->tbl));
fail_scale_tbl_set:
bad_reta_entry:
diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index 1b50aefe5c48..2bb98a443335 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -325,8 +325,8 @@ sfc_flow_parse_eth(const struct rte_flow_item *item,
efx_spec->efs_match_flags |= is_ifrm ?
EFX_FILTER_MATCH_IFRM_LOC_MAC :
EFX_FILTER_MATCH_LOC_MAC;
- rte_memcpy(loc_mac, spec->hdr.dst_addr.addr_bytes,
- EFX_MAC_ADDR_LEN);
+ memcpy(loc_mac, spec->hdr.dst_addr.addr_bytes,
+ EFX_MAC_ADDR_LEN);
} else if (memcmp(mask->hdr.dst_addr.addr_bytes, ig_mask,
EFX_MAC_ADDR_LEN) == 0) {
if (rte_is_unicast_ether_addr(&spec->hdr.dst_addr))
@@ -348,8 +348,8 @@ sfc_flow_parse_eth(const struct rte_flow_item *item,
*/
if (rte_is_same_ether_addr(&mask->hdr.src_addr, &supp_mask.hdr.src_addr)) {
efx_spec->efs_match_flags |= EFX_FILTER_MATCH_REM_MAC;
- rte_memcpy(efx_spec->efs_rem_mac, spec->hdr.src_addr.addr_bytes,
- EFX_MAC_ADDR_LEN);
+ memcpy(efx_spec->efs_rem_mac, spec->hdr.src_addr.addr_bytes,
+ EFX_MAC_ADDR_LEN);
} else if (!rte_is_zero_ether_addr(&mask->hdr.src_addr)) {
goto fail_bad_mask;
}
@@ -624,8 +624,8 @@ sfc_flow_parse_ipv6(const struct rte_flow_item *item,
RTE_BUILD_BUG_ON(sizeof(efx_spec->efs_rem_host) !=
sizeof(spec->hdr.src_addr));
- rte_memcpy(&efx_spec->efs_rem_host, spec->hdr.src_addr,
- sizeof(efx_spec->efs_rem_host));
+ memcpy(&efx_spec->efs_rem_host, spec->hdr.src_addr,
+ sizeof(efx_spec->efs_rem_host));
} else if (!sfc_flow_is_zero(mask->hdr.src_addr,
sizeof(mask->hdr.src_addr))) {
goto fail_bad_mask;
@@ -637,8 +637,8 @@ sfc_flow_parse_ipv6(const struct rte_flow_item *item,
RTE_BUILD_BUG_ON(sizeof(efx_spec->efs_loc_host) !=
sizeof(spec->hdr.dst_addr));
- rte_memcpy(&efx_spec->efs_loc_host, spec->hdr.dst_addr,
- sizeof(efx_spec->efs_loc_host));
+ memcpy(&efx_spec->efs_loc_host, spec->hdr.dst_addr,
+ sizeof(efx_spec->efs_loc_host));
} else if (!sfc_flow_is_zero(mask->hdr.dst_addr,
sizeof(mask->hdr.dst_addr))) {
goto fail_bad_mask;
@@ -889,8 +889,8 @@ sfc_flow_set_efx_spec_vni_or_vsid(efx_filter_spec_t *efx_spec,
if (memcmp(vni_or_vsid_mask, vni_or_vsid_full_mask,
EFX_VNI_OR_VSID_LEN) == 0) {
efx_spec->efs_match_flags |= EFX_FILTER_MATCH_VNI_OR_VSID;
- rte_memcpy(efx_spec->efs_vni_or_vsid, vni_or_vsid_val,
- EFX_VNI_OR_VSID_LEN);
+ memcpy(efx_spec->efs_vni_or_vsid, vni_or_vsid_val,
+ EFX_VNI_OR_VSID_LEN);
} else if (!sfc_flow_is_zero(vni_or_vsid_mask, EFX_VNI_OR_VSID_LEN)) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM, item,
--git a/drivers/net/sfc/sfc_flow_rss.c b/drivers/net/sfc/sfc_flow_rss.c
index e28c943335f3..a46ce1fa87e1 100644
--- a/drivers/net/sfc/sfc_flow_rss.c
+++ b/drivers/net/sfc/sfc_flow_rss.c
@@ -119,7 +119,7 @@ sfc_flow_rss_parse_conf(struct sfc_adapter *sa,
key = ethdev_rss->key;
}
- rte_memcpy(out->key, key, sizeof(out->key));
+ memcpy(out->key, key, sizeof(out->key));
switch (in->func) {
case RTE_ETH_HASH_FUNCTION_DEFAULT:
diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index 60ff6d21810a..1f243e798e00 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -547,7 +547,7 @@ sfc_mae_mac_addr_add(struct sfc_adapter *sa,
if (mac_addr == NULL)
return ENOMEM;
- rte_memcpy(mac_addr->addr_bytes, addr_bytes, EFX_MAC_ADDR_LEN);
+ memcpy(mac_addr->addr_bytes, addr_bytes, EFX_MAC_ADDR_LEN);
mac_addr->refcnt = 1;
mac_addr->fw_rsrc.mac_id.id = EFX_MAE_RSRC_ID_INVALID;
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index a19322926572..55aae9ef04f3 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -1526,7 +1526,7 @@ sfc_rx_process_adv_conf_rss(struct sfc_adapter *sa,
sizeof(rss->key));
return EINVAL;
}
- rte_memcpy(rss->key, conf->rss_key, sizeof(rss->key));
+ memcpy(rss->key, conf->rss_key, sizeof(rss->key));
}
rss->hash_types = efx_hash_types;
diff --git a/drivers/net/sfc/sfc_tso.c b/drivers/net/sfc/sfc_tso.c
index a0827d1c0dd6..5da2de3c3d49 100644
--- a/drivers/net/sfc/sfc_tso.c
+++ b/drivers/net/sfc/sfc_tso.c
@@ -159,7 +159,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,
/* Handle TCP header */
th = (const struct rte_tcp_hdr *)(tsoh + tcph_off);
- rte_memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t));
+ memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t));
sent_seq = rte_be_to_cpu_32(sent_seq);
efx_tx_qdesc_tso2_create(txq->common, packet_id, 0, sent_seq,
diff --git a/drivers/net/sfc/sfc_tso.h b/drivers/net/sfc/sfc_tso.h
index 9029ad159014..e914eae77ef8 100644
--- a/drivers/net/sfc/sfc_tso.h
+++ b/drivers/net/sfc/sfc_tso.h
@@ -35,7 +35,7 @@ sfc_tso_ip4_get_ipid(const uint8_t *pkt_hdrp, size_t ip_hdr_off)
uint16_t ipid;
ip_hdrp = (const struct rte_ipv4_hdr *)(pkt_hdrp + ip_hdr_off);
- rte_memcpy(&ipid, &ip_hdrp->packet_id, sizeof(ipid));
+ memcpy(&ipid, &ip_hdrp->packet_id, sizeof(ipid));
return rte_be_to_cpu_16(ipid);
}
@@ -46,9 +46,8 @@ sfc_tso_outer_udp_fix_len(const struct rte_mbuf *m, uint8_t *tsoh)
rte_be16_t len = rte_cpu_to_be_16(m->l2_len + m->l3_len + m->l4_len +
m->tso_segsz);
- rte_memcpy(tsoh + m->outer_l2_len + m->outer_l3_len +
- offsetof(struct rte_udp_hdr, dgram_len),
- &len, sizeof(len));
+ memcpy(tsoh + m->outer_l2_len + m->outer_l3_len + offsetof(struct rte_udp_hdr, dgram_len),
+ &len, sizeof(len));
}
static inline void
@@ -67,7 +66,7 @@ sfc_tso_innermost_ip_fix_len(const struct rte_mbuf *m, uint8_t *tsoh,
len = rte_cpu_to_be_16(ip_payload_len);
}
- rte_memcpy(tsoh + iph_ofst + field_ofst, &len, sizeof(len));
+ memcpy(tsoh + iph_ofst + field_ofst, &len, sizeof(len));
}
unsigned int sfc_tso_prepare_header(uint8_t *tsoh, size_t header_len,
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 20/71] net/tap: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (18 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 19/71] net/sfc: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 21/71] net/txgbe: " Stephen Hemminger
` (52 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/tap/rte_eth_tap.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 69d9da695bed..518619c53b4a 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -1404,11 +1404,11 @@ tap_mac_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)
mac_addr))
mode = LOCAL_AND_REMOTE;
ifr.ifr_hwaddr.sa_family = AF_LOCAL;
- rte_memcpy(ifr.ifr_hwaddr.sa_data, mac_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(ifr.ifr_hwaddr.sa_data, mac_addr, RTE_ETHER_ADDR_LEN);
ret = tap_ioctl(pmd, SIOCSIFHWADDR, &ifr, 1, mode);
if (ret < 0)
return ret;
- rte_memcpy(&pmd->eth_addr, mac_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(&pmd->eth_addr, mac_addr, RTE_ETHER_ADDR_LEN);
if (pmd->remote_if_index && !pmd->flow_isolate) {
/* Replace MAC redirection rule after a MAC change */
ret = tap_flow_implicit_destroy(pmd, TAP_REMOTE_LOCAL_MAC);
@@ -2010,7 +2010,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
if (rte_is_zero_ether_addr(mac_addr))
rte_eth_random_addr((uint8_t *)&pmd->eth_addr);
else
- rte_memcpy(&pmd->eth_addr, mac_addr, sizeof(*mac_addr));
+ memcpy(&pmd->eth_addr, mac_addr, sizeof(*mac_addr));
}
/*
@@ -2033,8 +2033,8 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
if (pmd->type == ETH_TUNTAP_TYPE_TAP) {
memset(&ifr, 0, sizeof(struct ifreq));
ifr.ifr_hwaddr.sa_family = AF_LOCAL;
- rte_memcpy(ifr.ifr_hwaddr.sa_data, &pmd->eth_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(ifr.ifr_hwaddr.sa_data, &pmd->eth_addr,
+ RTE_ETHER_ADDR_LEN);
if (tap_ioctl(pmd, SIOCSIFHWADDR, &ifr, 0, LOCAL_ONLY) < 0)
goto error_exit;
}
@@ -2091,8 +2091,8 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
pmd->name, pmd->remote_iface);
goto error_remote;
}
- rte_memcpy(&pmd->eth_addr, ifr.ifr_hwaddr.sa_data,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&pmd->eth_addr, ifr.ifr_hwaddr.sa_data,
+ RTE_ETHER_ADDR_LEN);
/* The desired MAC is already in ifreq after SIOCGIFHWADDR. */
if (tap_ioctl(pmd, SIOCSIFHWADDR, &ifr, 0, LOCAL_ONLY) < 0) {
TAP_LOG(ERR, "%s: failed to get %s MAC address.",
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 21/71] net/txgbe: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (19 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 20/71] net/tap: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 22/71] raw/ifpga: " Stephen Hemminger
` (51 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jiawen Wu, Jian Wang
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/txgbe/txgbe_ethdev.c | 9 ++---
drivers/net/txgbe/txgbe_fdir.c | 6 +--
drivers/net/txgbe/txgbe_flow.c | 65 ++++++++++++++------------------
drivers/net/txgbe/txgbe_ipsec.c | 8 ++--
drivers/net/txgbe/txgbe_pf.c | 4 +-
drivers/net/txgbe/txgbe_tm.c | 11 +++---
6 files changed, 46 insertions(+), 57 deletions(-)
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index b75e8898e2d4..1c42fd74b47d 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -4304,9 +4304,8 @@ txgbe_add_del_ntuple_filter(struct rte_eth_dev *dev,
sizeof(struct txgbe_5tuple_filter), 0);
if (filter == NULL)
return -ENOMEM;
- rte_memcpy(&filter->filter_info,
- &filter_5tuple,
- sizeof(struct txgbe_5tuple_filter_info));
+ memcpy(&filter->filter_info, &filter_5tuple,
+ sizeof(struct txgbe_5tuple_filter_info));
filter->queue = ntuple_filter->queue;
ret = txgbe_add_5tuple_filter(dev, filter);
if (ret < 0) {
@@ -5109,9 +5108,7 @@ txgbe_dev_l2_tunnel_filter_add(struct rte_eth_dev *dev,
if (!node)
return -ENOMEM;
- rte_memcpy(&node->key,
- &key,
- sizeof(struct txgbe_l2_tn_key));
+ memcpy(&node->key, &key, sizeof(struct txgbe_l2_tn_key));
node->pool = l2_tunnel->pool;
ret = txgbe_insert_l2_tn_filter(l2_tn_info, node);
if (ret < 0) {
diff --git a/drivers/net/txgbe/txgbe_fdir.c b/drivers/net/txgbe/txgbe_fdir.c
index a198b6781bad..00366ed87323 100644
--- a/drivers/net/txgbe/txgbe_fdir.c
+++ b/drivers/net/txgbe/txgbe_fdir.c
@@ -42,7 +42,7 @@
else \
ipv6_addr[i] = 0; \
} \
- rte_memcpy((ipaddr), ipv6_addr, sizeof(ipv6_addr));\
+ memcpy((ipaddr), ipv6_addr, sizeof(ipv6_addr));\
} while (0)
/**
@@ -858,8 +858,8 @@ txgbe_fdir_filter_program(struct rte_eth_dev *dev,
sizeof(struct txgbe_fdir_filter), 0);
if (!node)
return -ENOMEM;
- rte_memcpy(&node->input, &rule->input,
- sizeof(struct txgbe_atr_input));
+ memcpy(&node->input, &rule->input,
+ sizeof(struct txgbe_atr_input));
node->fdirflags = rule->fdirflags;
node->fdirhash = fdirhash;
node->queue = queue;
diff --git a/drivers/net/txgbe/txgbe_flow.c b/drivers/net/txgbe/txgbe_flow.c
index 7ef52d0b0fcd..c76fc0eed0e0 100644
--- a/drivers/net/txgbe/txgbe_flow.c
+++ b/drivers/net/txgbe/txgbe_flow.c
@@ -1834,10 +1834,10 @@ txgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev __rte_unused,
if (item->spec) {
rule->b_spec = TRUE;
ipv6_spec = item->spec;
- rte_memcpy(rule->input.src_ip,
- ipv6_spec->hdr.src_addr, 16);
- rte_memcpy(rule->input.dst_ip,
- ipv6_spec->hdr.dst_addr, 16);
+ memcpy(rule->input.src_ip, ipv6_spec->hdr.src_addr,
+ 16);
+ memcpy(rule->input.dst_ip, ipv6_spec->hdr.dst_addr,
+ 16);
}
/**
@@ -2756,9 +2756,9 @@ txgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&ntuple_filter_ptr->filter_info,
- &ntuple_filter,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter_ptr->filter_info,
+ &ntuple_filter,
+ sizeof(struct rte_eth_ntuple_filter));
TAILQ_INSERT_TAIL(&filter_ntuple_list,
ntuple_filter_ptr, entries);
flow->rule = ntuple_filter_ptr;
@@ -2782,9 +2782,9 @@ txgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(ðertype_filter_ptr->filter_info,
- ðertype_filter,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter_ptr->filter_info,
+ ðertype_filter,
+ sizeof(struct rte_eth_ethertype_filter));
TAILQ_INSERT_TAIL(&filter_ethertype_list,
ethertype_filter_ptr, entries);
flow->rule = ethertype_filter_ptr;
@@ -2806,9 +2806,8 @@ txgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&syn_filter_ptr->filter_info,
- &syn_filter,
- sizeof(struct rte_eth_syn_filter));
+ memcpy(&syn_filter_ptr->filter_info, &syn_filter,
+ sizeof(struct rte_eth_syn_filter));
TAILQ_INSERT_TAIL(&filter_syn_list,
syn_filter_ptr,
entries);
@@ -2827,9 +2826,8 @@ txgbe_flow_create(struct rte_eth_dev *dev,
if (fdir_rule.b_mask) {
if (!fdir_info->mask_added) {
/* It's the first time the mask is set. */
- rte_memcpy(&fdir_info->mask,
- &fdir_rule.mask,
- sizeof(struct txgbe_hw_fdir_mask));
+ memcpy(&fdir_info->mask, &fdir_rule.mask,
+ sizeof(struct txgbe_hw_fdir_mask));
fdir_info->flex_bytes_offset =
fdir_rule.flex_bytes_offset;
@@ -2873,9 +2871,9 @@ txgbe_flow_create(struct rte_eth_dev *dev,
"failed to allocate memory");
goto out;
}
- rte_memcpy(&fdir_rule_ptr->filter_info,
- &fdir_rule,
- sizeof(struct txgbe_fdir_rule));
+ memcpy(&fdir_rule_ptr->filter_info,
+ &fdir_rule,
+ sizeof(struct txgbe_fdir_rule));
TAILQ_INSERT_TAIL(&filter_fdir_list,
fdir_rule_ptr, entries);
flow->rule = fdir_rule_ptr;
@@ -2910,9 +2908,8 @@ txgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&l2_tn_filter_ptr->filter_info,
- &l2_tn_filter,
- sizeof(struct txgbe_l2_tunnel_conf));
+ memcpy(&l2_tn_filter_ptr->filter_info, &l2_tn_filter,
+ sizeof(struct txgbe_l2_tunnel_conf));
TAILQ_INSERT_TAIL(&filter_l2_tunnel_list,
l2_tn_filter_ptr, entries);
flow->rule = l2_tn_filter_ptr;
@@ -3038,9 +3035,8 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_NTUPLE:
ntuple_filter_ptr = (struct txgbe_ntuple_filter_ele *)
pmd_flow->rule;
- rte_memcpy(&ntuple_filter,
- &ntuple_filter_ptr->filter_info,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter, &ntuple_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ntuple_filter));
ret = txgbe_add_del_ntuple_filter(dev, &ntuple_filter, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_ntuple_list,
@@ -3051,9 +3047,8 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_ETHERTYPE:
ethertype_filter_ptr = (struct txgbe_ethertype_filter_ele *)
pmd_flow->rule;
- rte_memcpy(ðertype_filter,
- ðertype_filter_ptr->filter_info,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter, ðertype_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ethertype_filter));
ret = txgbe_add_del_ethertype_filter(dev,
ðertype_filter, FALSE);
if (!ret) {
@@ -3065,9 +3060,8 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_SYN:
syn_filter_ptr = (struct txgbe_eth_syn_filter_ele *)
pmd_flow->rule;
- rte_memcpy(&syn_filter,
- &syn_filter_ptr->filter_info,
- sizeof(struct rte_eth_syn_filter));
+ memcpy(&syn_filter, &syn_filter_ptr->filter_info,
+ sizeof(struct rte_eth_syn_filter));
ret = txgbe_syn_filter_set(dev, &syn_filter, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_syn_list,
@@ -3077,9 +3071,8 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
break;
case RTE_ETH_FILTER_FDIR:
fdir_rule_ptr = (struct txgbe_fdir_rule_ele *)pmd_flow->rule;
- rte_memcpy(&fdir_rule,
- &fdir_rule_ptr->filter_info,
- sizeof(struct txgbe_fdir_rule));
+ memcpy(&fdir_rule, &fdir_rule_ptr->filter_info,
+ sizeof(struct txgbe_fdir_rule));
ret = txgbe_fdir_filter_program(dev, &fdir_rule, TRUE, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_fdir_list,
@@ -3092,8 +3085,8 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_L2_TUNNEL:
l2_tn_filter_ptr = (struct txgbe_eth_l2_tunnel_conf_ele *)
pmd_flow->rule;
- rte_memcpy(&l2_tn_filter, &l2_tn_filter_ptr->filter_info,
- sizeof(struct txgbe_l2_tunnel_conf));
+ memcpy(&l2_tn_filter, &l2_tn_filter_ptr->filter_info,
+ sizeof(struct txgbe_l2_tunnel_conf));
ret = txgbe_dev_l2_tunnel_filter_del(dev, &l2_tn_filter);
if (!ret) {
TAILQ_REMOVE(&filter_l2_tunnel_list,
diff --git a/drivers/net/txgbe/txgbe_ipsec.c b/drivers/net/txgbe/txgbe_ipsec.c
index f9f8108fb894..000dd5ec6d39 100644
--- a/drivers/net/txgbe/txgbe_ipsec.c
+++ b/drivers/net/txgbe/txgbe_ipsec.c
@@ -658,10 +658,10 @@ txgbe_crypto_add_ingress_sa_from_flow(const void *sess,
const struct rte_flow_item_ipv6 *ipv6 = ip_spec;
ic_session->src_ip.type = IPv6;
ic_session->dst_ip.type = IPv6;
- rte_memcpy(ic_session->src_ip.ipv6,
- ipv6->hdr.src_addr, 16);
- rte_memcpy(ic_session->dst_ip.ipv6,
- ipv6->hdr.dst_addr, 16);
+ memcpy(ic_session->src_ip.ipv6, ipv6->hdr.src_addr,
+ 16);
+ memcpy(ic_session->dst_ip.ipv6, ipv6->hdr.dst_addr,
+ 16);
} else {
const struct rte_flow_item_ipv4 *ipv4 = ip_spec;
ic_session->src_ip.type = IPv4;
diff --git a/drivers/net/txgbe/txgbe_pf.c b/drivers/net/txgbe/txgbe_pf.c
index 176f79005cde..a0f5a67d9c78 100644
--- a/drivers/net/txgbe/txgbe_pf.c
+++ b/drivers/net/txgbe/txgbe_pf.c
@@ -435,7 +435,7 @@ txgbe_vf_reset(struct rte_eth_dev *eth_dev, uint16_t vf, uint32_t *msgbuf)
/* reply to reset with ack and vf mac address */
msgbuf[0] = TXGBE_VF_RESET | TXGBE_VT_MSGTYPE_ACK;
- rte_memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
+ memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
/*
* Piggyback the multicast filter type so VF can compute the
* correct vectors
@@ -457,7 +457,7 @@ txgbe_vf_set_mac_addr(struct rte_eth_dev *eth_dev,
struct rte_ether_addr *ea = (struct rte_ether_addr *)new_mac;
if (rte_is_valid_assigned_ether_addr(ea)) {
- rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
+ memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
return hw->mac.set_rar(hw, rar_entry, new_mac, vf, true);
}
return -1;
diff --git a/drivers/net/txgbe/txgbe_tm.c b/drivers/net/txgbe/txgbe_tm.c
index 3171be73d05d..7d77b01dfef2 100644
--- a/drivers/net/txgbe/txgbe_tm.c
+++ b/drivers/net/txgbe/txgbe_tm.c
@@ -280,8 +280,8 @@ txgbe_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&tm_conf->shaper_profile_list,
shaper_profile, node);
@@ -625,8 +625,8 @@ txgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->no = 0;
tm_node->parent = NULL;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
tm_conf->root = tm_node;
/* increase the reference counter of the shaper profile */
@@ -706,8 +706,7 @@ txgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->reference_count = 0;
tm_node->parent = parent_node;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
if (parent_node_type == TXGBE_TM_NODE_TYPE_PORT) {
tm_node->no = parent_node->reference_count;
TAILQ_INSERT_TAIL(&tm_conf->tc_list,
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 22/71] raw/ifpga: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (20 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 21/71] net/txgbe: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-05 9:13 ` Xu, Rosen
2024-03-01 17:15 ` [PATCH v2 23/71] raw/skeleton: " Stephen Hemminger
` (50 subsequent siblings)
72 siblings, 1 reply; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Rosen Xu
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +--
drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +--
drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +--
drivers/raw/ifpga/afu_pmd_n3000.c | 8 ++++----
drivers/raw/ifpga/ifpga_rawdev.c | 11 +++++------
5 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/drivers/raw/ifpga/afu_pmd_he_hssi.c b/drivers/raw/ifpga/afu_pmd_he_hssi.c
index 859f28dcc1f0..c2aaed9203ae 100644
--- a/drivers/raw/ifpga/afu_pmd_he_hssi.c
+++ b/drivers/raw/ifpga/afu_pmd_he_hssi.c
@@ -15,7 +15,6 @@
#include <rte_eal.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_io.h>
#include <rte_vfio.h>
#include <bus_pci_driver.h>
@@ -314,7 +313,7 @@ static int he_hssi_config(struct afu_rawdev *dev, void *config,
if (cfg->port >= NUM_HE_HSSI_PORTS)
return -EINVAL;
- rte_memcpy(&priv->he_hssi_cfg, cfg, sizeof(priv->he_hssi_cfg));
+ memcpy(&priv->he_hssi_cfg, cfg, sizeof(priv->he_hssi_cfg));
return 0;
}
diff --git a/drivers/raw/ifpga/afu_pmd_he_lpbk.c b/drivers/raw/ifpga/afu_pmd_he_lpbk.c
index c7c5cda48c35..ffb7075c84d2 100644
--- a/drivers/raw/ifpga/afu_pmd_he_lpbk.c
+++ b/drivers/raw/ifpga/afu_pmd_he_lpbk.c
@@ -15,7 +15,6 @@
#include <rte_eal.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_io.h>
#include <rte_vfio.h>
#include <bus_pci_driver.h>
@@ -363,7 +362,7 @@ static int he_lpbk_config(struct afu_rawdev *dev, void *config,
if ((cfg->end < cfg->begin) || (cfg->end > MAX_CACHE_LINES))
return -EINVAL;
- rte_memcpy(&priv->he_lpbk_cfg, cfg, sizeof(priv->he_lpbk_cfg));
+ memcpy(&priv->he_lpbk_cfg, cfg, sizeof(priv->he_lpbk_cfg));
return 0;
}
diff --git a/drivers/raw/ifpga/afu_pmd_he_mem.c b/drivers/raw/ifpga/afu_pmd_he_mem.c
index a1db533eeb93..b799e40d2db9 100644
--- a/drivers/raw/ifpga/afu_pmd_he_mem.c
+++ b/drivers/raw/ifpga/afu_pmd_he_mem.c
@@ -14,7 +14,6 @@
#include <rte_eal.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_io.h>
#include <rte_vfio.h>
#include <bus_pci_driver.h>
@@ -126,7 +125,7 @@ static int he_mem_tg_config(struct afu_rawdev *dev, void *config,
if (config_size != sizeof(struct rte_pmd_afu_he_mem_tg_cfg))
return -EINVAL;
- rte_memcpy(&priv->he_mem_tg_cfg, config, sizeof(priv->he_mem_tg_cfg));
+ memcpy(&priv->he_mem_tg_cfg, config, sizeof(priv->he_mem_tg_cfg));
return 0;
}
diff --git a/drivers/raw/ifpga/afu_pmd_n3000.c b/drivers/raw/ifpga/afu_pmd_n3000.c
index 67b394126595..9236c0b15371 100644
--- a/drivers/raw/ifpga/afu_pmd_n3000.c
+++ b/drivers/raw/ifpga/afu_pmd_n3000.c
@@ -1867,8 +1867,8 @@ static int n3000_afu_config(struct afu_rawdev *dev, void *config,
if ((cfg->nlb_cfg.end < cfg->nlb_cfg.begin) ||
(cfg->nlb_cfg.end > MAX_CACHE_LINES))
return -EINVAL;
- rte_memcpy(&priv->nlb_cfg, &cfg->nlb_cfg,
- sizeof(struct rte_pmd_afu_nlb_cfg));
+ memcpy(&priv->nlb_cfg, &cfg->nlb_cfg,
+ sizeof(struct rte_pmd_afu_nlb_cfg));
} else if (cfg->type == RTE_PMD_AFU_N3000_DMA) {
if (cfg->dma_cfg.index >= NUM_N3000_DMA)
return -EINVAL;
@@ -1887,8 +1887,8 @@ static int n3000_afu_config(struct afu_rawdev *dev, void *config,
cfg->dma_cfg.length);
}
}
- rte_memcpy(&priv->dma_cfg, &cfg->dma_cfg,
- sizeof(struct rte_pmd_afu_dma_cfg));
+ memcpy(&priv->dma_cfg, &cfg->dma_cfg,
+ sizeof(struct rte_pmd_afu_dma_cfg));
} else {
IFPGA_RAWDEV_PMD_ERR("Invalid type of N3000 AFU");
return -EINVAL;
diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index f89bd3f9e2c3..d5d47e14dd0e 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -14,7 +14,6 @@
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_devargs.h>
-#include <rte_memcpy.h>
#include <rte_pci.h>
#include <bus_pci_driver.h>
#include <rte_kvargs.h>
@@ -258,7 +257,7 @@ static int ifpga_rawdev_fill_info(struct ifpga_rawdev *ifpga_dev)
if (point < 12)
return -1;
point -= 12;
- rte_memcpy(ifpga_dev->parent_bdf, &link[point], 12);
+ memcpy(ifpga_dev->parent_bdf, &link[point], 12);
point = strlen(link1);
if (point < 26)
@@ -948,10 +947,10 @@ ifpga_rawdev_pr(struct rte_rawdev *dev,
if (ret)
return ret;
- rte_memcpy(&afu_pr_conf->afu_id.uuid.uuid_low, uuid.b,
- sizeof(u64));
- rte_memcpy(&afu_pr_conf->afu_id.uuid.uuid_high, uuid.b + 8,
- sizeof(u64));
+ memcpy(&afu_pr_conf->afu_id.uuid.uuid_low, uuid.b,
+ sizeof(u64));
+ memcpy(&afu_pr_conf->afu_id.uuid.uuid_high, uuid.b + 8,
+ sizeof(u64));
IFPGA_RAWDEV_PMD_INFO("%s: uuid_l=0x%lx, uuid_h=0x%lx\n",
__func__,
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 23/71] raw/skeleton: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (21 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 22/71] raw/ifpga: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 24/71] net/hns3: " Stephen Hemminger
` (49 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Sachin Saxena, Hemant Agrawal
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/raw/skeleton/skeleton_rawdev.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
index 6e99d35536d7..967b3964f24a 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.c
+++ b/drivers/raw/skeleton/skeleton_rawdev.c
@@ -245,8 +245,8 @@ static int skeleton_rawdev_queue_def_conf(struct rte_rawdev *dev,
skelq = &skeldev->queues[queue_id];
if (queue_id < SKELETON_MAX_QUEUES)
- rte_memcpy(queue_conf, skelq,
- sizeof(struct skeleton_rawdev_queue));
+ memcpy(queue_conf, skelq,
+ sizeof(struct skeleton_rawdev_queue));
return 0;
}
@@ -281,8 +281,7 @@ static int skeleton_rawdev_queue_setup(struct rte_rawdev *dev,
if (skeldev->num_queues > queue_id &&
q->depth < SKELETON_QUEUE_MAX_DEPTH) {
- rte_memcpy(q, queue_conf,
- sizeof(struct skeleton_rawdev_queue));
+ memcpy(q, queue_conf, sizeof(struct skeleton_rawdev_queue));
clear_queue_bufs(queue_id);
} else {
SKELETON_PMD_ERR("Invalid queue configuration");
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 24/71] net/hns3: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (22 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 23/71] raw/skeleton: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 25/71] net/i40e: " Stephen Hemminger
` (48 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jie Hai, Yisen Zhuang
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/hns3/hns3_fdir.c | 2 +-
drivers/net/hns3/hns3_flow.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
index d100e58d102b..332cbb847be3 100644
--- a/drivers/net/hns3/hns3_fdir.c
+++ b/drivers/net/hns3/hns3_fdir.c
@@ -996,7 +996,7 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns,
return -ENOMEM;
}
- rte_memcpy(&node->fdir_conf, rule, sizeof(struct hns3_fdir_rule));
+ memcpy(&node->fdir_conf, rule, sizeof(struct hns3_fdir_rule));
ret = hns3_insert_fdir_filter(hw, fdir_info, node);
if (ret < 0) {
rte_free(node);
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 7fbe65313ca2..96b91bed6b18 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -2416,8 +2416,8 @@ hns3_flow_query(struct rte_eth_dev *dev, struct rte_flow *flow,
}
rss_conf = (struct rte_flow_action_rss *)data;
rss_rule = (struct hns3_rss_conf_ele *)flow->rule;
- rte_memcpy(rss_conf, &rss_rule->filter_info.conf,
- sizeof(struct rte_flow_action_rss));
+ memcpy(rss_conf, &rss_rule->filter_info.conf,
+ sizeof(struct rte_flow_action_rss));
break;
default:
return rte_flow_error_set(error, ENOTSUP,
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 25/71] net/i40e: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (23 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 24/71] net/hns3: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 26/71] net/iavf: " Stephen Hemminger
` (47 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Yuying Zhang
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/i40e/i40e_ethdev.c | 109 ++++++++++++++------------------
drivers/net/i40e/i40e_fdir.c | 28 ++++----
drivers/net/i40e/i40e_flow.c | 56 ++++++++--------
drivers/net/i40e/i40e_pf.c | 3 +-
drivers/net/i40e/i40e_tm.c | 11 ++--
drivers/net/i40e/rte_pmd_i40e.c | 34 +++++-----
6 files changed, 108 insertions(+), 133 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 4d21341382d8..9ccfe88a3318 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -22,7 +22,6 @@
#include <ethdev_pci.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_alarm.h>
#include <dev_driver.h>
#include <rte_tailq.h>
@@ -4310,7 +4309,7 @@ i40e_macaddr_add(struct rte_eth_dev *dev,
return -EINVAL;
}
- rte_memcpy(&mac_filter.mac_addr, mac_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(&mac_filter.mac_addr, mac_addr, RTE_ETHER_ADDR_LEN);
if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_VLAN_FILTER)
mac_filter.filter_type = I40E_MACVLAN_PERFECT_MATCH;
else
@@ -5195,7 +5194,7 @@ i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi,
vsi->info.valid_sections =
rte_cpu_to_le_16(I40E_AQ_VSI_PROP_VLAN_VALID);
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
hw = I40E_VSI_TO_HW(vsi);
@@ -5234,8 +5233,8 @@ i40e_vsi_update_tc_bandwidth(struct i40e_vsi *vsi, uint8_t enabled_tcmap)
return ret;
}
- rte_memcpy(vsi->info.qs_handle, tc_bw_data.qs_handles,
- sizeof(vsi->info.qs_handle));
+ memcpy(vsi->info.qs_handle, tc_bw_data.qs_handles,
+ sizeof(vsi->info.qs_handle));
return I40E_SUCCESS;
}
@@ -5492,8 +5491,7 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi)
if (vsi->type != I40E_VSI_MAIN)
return I40E_ERR_CONFIG;
memset(&def_filter, 0, sizeof(def_filter));
- rte_memcpy(def_filter.mac_addr, hw->mac.perm_addr,
- ETH_ADDR_LEN);
+ memcpy(def_filter.mac_addr, hw->mac.perm_addr, ETH_ADDR_LEN);
def_filter.vlan_tag = 0;
def_filter.flags = I40E_AQC_MACVLAN_DEL_PERFECT_MATCH |
I40E_AQC_MACVLAN_DEL_IGNORE_VLAN;
@@ -5511,16 +5509,15 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi)
return I40E_ERR_NO_MEMORY;
}
mac = &f->mac_info.mac_addr;
- rte_memcpy(&mac->addr_bytes, hw->mac.perm_addr,
- ETH_ADDR_LEN);
+ memcpy(&mac->addr_bytes, hw->mac.perm_addr, ETH_ADDR_LEN);
f->mac_info.filter_type = I40E_MACVLAN_PERFECT_MATCH;
TAILQ_INSERT_TAIL(&vsi->mac_list, f, next);
vsi->mac_num++;
return ret;
}
- rte_memcpy(&filter.mac_addr,
- (struct rte_ether_addr *)(hw->mac.perm_addr), ETH_ADDR_LEN);
+ memcpy(&filter.mac_addr, (struct rte_ether_addr *)(hw->mac.perm_addr),
+ ETH_ADDR_LEN);
filter.filter_type = I40E_MACVLAN_PERFECT_MATCH;
return i40e_vsi_add_mac(vsi, &filter);
}
@@ -5839,8 +5836,8 @@ i40e_vsi_setup(struct i40e_pf *pf,
PMD_DRV_LOG(ERR, "Failed to get VSI params");
goto fail_msix_alloc;
}
- rte_memcpy(&vsi->info, &ctxt.info,
- sizeof(struct i40e_aqc_vsi_properties_data));
+ memcpy(&vsi->info, &ctxt.info,
+ sizeof(struct i40e_aqc_vsi_properties_data));
vsi->vsi_id = ctxt.vsi_number;
vsi->info.valid_sections = 0;
@@ -5857,8 +5854,8 @@ i40e_vsi_setup(struct i40e_pf *pf,
rte_cpu_to_le_16(I40E_AQ_VSI_PROP_VLAN_VALID);
vsi->info.port_vlan_flags = I40E_AQ_VSI_PVLAN_MODE_ALL |
I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH;
- rte_memcpy(&ctxt.info, &vsi->info,
- sizeof(struct i40e_aqc_vsi_properties_data));
+ memcpy(&ctxt.info, &vsi->info,
+ sizeof(struct i40e_aqc_vsi_properties_data));
ret = i40e_vsi_config_tc_queue_mapping(vsi, &ctxt.info,
I40E_DEFAULT_TCMAP);
if (ret != I40E_SUCCESS) {
@@ -5878,16 +5875,15 @@ i40e_vsi_setup(struct i40e_pf *pf,
goto fail_msix_alloc;
}
- rte_memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
- sizeof(vsi->info.tc_mapping));
- rte_memcpy(&vsi->info.queue_mapping,
- &ctxt.info.queue_mapping,
- sizeof(vsi->info.queue_mapping));
+ memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
+ sizeof(vsi->info.tc_mapping));
+ memcpy(&vsi->info.queue_mapping, &ctxt.info.queue_mapping,
+ sizeof(vsi->info.queue_mapping));
vsi->info.mapping_flags = ctxt.info.mapping_flags;
vsi->info.valid_sections = 0;
- rte_memcpy(pf->dev_addr.addr_bytes, hw->mac.perm_addr,
- ETH_ADDR_LEN);
+ memcpy(pf->dev_addr.addr_bytes, hw->mac.perm_addr,
+ ETH_ADDR_LEN);
/**
* Updating default filter settings are necessary to prevent
@@ -6030,7 +6026,7 @@ i40e_vsi_setup(struct i40e_pf *pf,
if (vsi->type != I40E_VSI_FDIR) {
/* MAC/VLAN configuration for non-FDIR VSI*/
- rte_memcpy(&filter.mac_addr, &broadcast, RTE_ETHER_ADDR_LEN);
+ memcpy(&filter.mac_addr, &broadcast, RTE_ETHER_ADDR_LEN);
filter.filter_type = I40E_MACVLAN_PERFECT_MATCH;
ret = i40e_vsi_add_mac(vsi, &filter);
@@ -6143,7 +6139,7 @@ i40e_vsi_config_vlan_stripping(struct i40e_vsi *vsi, bool on)
vsi->info.port_vlan_flags &= ~(I40E_AQ_VSI_PVLAN_EMOD_MASK);
vsi->info.port_vlan_flags |= vlan_flags;
ctxt.seid = vsi->seid;
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL);
if (ret)
PMD_DRV_LOG(INFO, "Update VSI failed to %s vlan stripping",
@@ -7010,8 +7006,8 @@ i40e_add_macvlan_filters(struct i40e_vsi *vsi,
memset(req_list, 0, ele_buff_size);
for (i = 0; i < actual_num; i++) {
- rte_memcpy(req_list[i].mac_addr,
- &filter[num + i].macaddr, ETH_ADDR_LEN);
+ memcpy(req_list[i].mac_addr, &filter[num + i].macaddr,
+ ETH_ADDR_LEN);
req_list[i].vlan_tag =
rte_cpu_to_le_16(filter[num + i].vlan_id);
@@ -7086,8 +7082,8 @@ i40e_remove_macvlan_filters(struct i40e_vsi *vsi,
memset(req_list, 0, ele_buff_size);
for (i = 0; i < actual_num; i++) {
- rte_memcpy(req_list[i].mac_addr,
- &filter[num + i].macaddr, ETH_ADDR_LEN);
+ memcpy(req_list[i].mac_addr, &filter[num + i].macaddr,
+ ETH_ADDR_LEN);
req_list[i].vlan_tag =
rte_cpu_to_le_16(filter[num + i].vlan_id);
@@ -7243,8 +7239,8 @@ i40e_find_all_vlan_for_mac(struct i40e_vsi *vsi,
"vlan number doesn't match");
return I40E_ERR_PARAM;
}
- rte_memcpy(&mv_f[i].macaddr,
- addr, ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, addr,
+ ETH_ADDR_LEN);
mv_f[i].vlan_id =
j * I40E_UINT32_BIT_SIZE + k;
i++;
@@ -7272,8 +7268,7 @@ i40e_find_all_mac_for_vlan(struct i40e_vsi *vsi,
PMD_DRV_LOG(ERR, "buffer number not match");
return I40E_ERR_PARAM;
}
- rte_memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr, ETH_ADDR_LEN);
mv_f[i].vlan_id = vlan;
mv_f[i].filter_type = f->mac_info.filter_type;
i++;
@@ -7308,8 +7303,8 @@ i40e_vsi_remove_all_macvlan_filter(struct i40e_vsi *vsi)
i = 0;
if (vsi->vlan_num == 0) {
TAILQ_FOREACH(f, &vsi->mac_list, next) {
- rte_memcpy(&mv_f[i].macaddr,
- &f->mac_info.mac_addr, ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr,
+ ETH_ADDR_LEN);
mv_f[i].filter_type = f->mac_info.filter_type;
mv_f[i].vlan_id = 0;
i++;
@@ -7478,8 +7473,7 @@ i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter)
for (i = 0; i < vlan_num; i++) {
mv_f[i].filter_type = mac_filter->filter_type;
- rte_memcpy(&mv_f[i].macaddr, &mac_filter->mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &mac_filter->mac_addr, ETH_ADDR_LEN);
}
if (mac_filter->filter_type == I40E_MACVLAN_PERFECT_MATCH ||
@@ -7501,8 +7495,7 @@ i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter)
ret = I40E_ERR_NO_MEMORY;
goto DONE;
}
- rte_memcpy(&f->mac_info.mac_addr, &mac_filter->mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&f->mac_info.mac_addr, &mac_filter->mac_addr, ETH_ADDR_LEN);
f->mac_info.filter_type = mac_filter->filter_type;
TAILQ_INSERT_TAIL(&vsi->mac_list, f, next);
vsi->mac_num++;
@@ -7548,8 +7541,7 @@ i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct rte_ether_addr *addr)
for (i = 0; i < vlan_num; i++) {
mv_f[i].filter_type = filter_type;
- rte_memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr, ETH_ADDR_LEN);
}
if (filter_type == I40E_MACVLAN_PERFECT_MATCH ||
filter_type == I40E_MACVLAN_HASH_MATCH) {
@@ -7835,9 +7827,8 @@ i40e_tunnel_filter_convert(
tunnel_filter->input.flags = cld_filter->element.flags;
tunnel_filter->input.tenant_id = cld_filter->element.tenant_id;
tunnel_filter->queue = cld_filter->element.queue_number;
- rte_memcpy(tunnel_filter->input.general_fields,
- cld_filter->general_fields,
- sizeof(cld_filter->general_fields));
+ memcpy(tunnel_filter->input.general_fields,
+ cld_filter->general_fields, sizeof(cld_filter->general_fields));
return 0;
}
@@ -8384,9 +8375,8 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf,
ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV4;
ipv4_addr = rte_be_to_cpu_32(tunnel_filter->ip_addr.ipv4_addr);
ipv4_addr_le = rte_cpu_to_le_32(ipv4_addr);
- rte_memcpy(&pfilter->element.ipaddr.v4.data,
- &ipv4_addr_le,
- sizeof(pfilter->element.ipaddr.v4.data));
+ memcpy(&pfilter->element.ipaddr.v4.data, &ipv4_addr_le,
+ sizeof(pfilter->element.ipaddr.v4.data));
} else {
ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV6;
for (i = 0; i < 4; i++) {
@@ -8394,9 +8384,8 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf,
rte_cpu_to_le_32(rte_be_to_cpu_32(
tunnel_filter->ip_addr.ipv6_addr[i]));
}
- rte_memcpy(&pfilter->element.ipaddr.v6.data,
- &convert_ipv6,
- sizeof(pfilter->element.ipaddr.v6.data));
+ memcpy(&pfilter->element.ipaddr.v6.data, &convert_ipv6,
+ sizeof(pfilter->element.ipaddr.v6.data));
}
/* check tunneled type */
@@ -8641,7 +8630,7 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf,
return -ENOMEM;
}
- rte_memcpy(tunnel, &check_filter, sizeof(check_filter));
+ memcpy(tunnel, &check_filter, sizeof(check_filter));
ret = i40e_sw_tunnel_filter_insert(pf, tunnel);
if (ret < 0)
rte_free(tunnel);
@@ -9766,8 +9755,7 @@ static int
i40e_ethertype_filter_convert(const struct rte_eth_ethertype_filter *input,
struct i40e_ethertype_filter *filter)
{
- rte_memcpy(&filter->input.mac_addr, &input->mac_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&filter->input.mac_addr, &input->mac_addr, RTE_ETHER_ADDR_LEN);
filter->input.ether_type = input->ether_type;
filter->flags = input->flags;
filter->queue = input->queue;
@@ -9914,8 +9902,7 @@ i40e_ethertype_filter_set(struct i40e_pf *pf,
return -ENOMEM;
}
- rte_memcpy(ethertype_filter, &check_filter,
- sizeof(check_filter));
+ memcpy(ethertype_filter, &check_filter, sizeof(check_filter));
ret = i40e_sw_ethertype_filter_insert(pf, ethertype_filter);
if (ret < 0)
rte_free(ethertype_filter);
@@ -10795,11 +10782,10 @@ i40e_vsi_config_tc(struct i40e_vsi *vsi, uint8_t tc_map)
goto out;
}
/* update the local VSI info with updated queue map */
- rte_memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
- sizeof(vsi->info.tc_mapping));
- rte_memcpy(&vsi->info.queue_mapping,
- &ctxt.info.queue_mapping,
- sizeof(vsi->info.queue_mapping));
+ memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
+ sizeof(vsi->info.tc_mapping));
+ memcpy(&vsi->info.queue_mapping, &ctxt.info.queue_mapping,
+ sizeof(vsi->info.queue_mapping));
vsi->info.mapping_flags = ctxt.info.mapping_flags;
vsi->info.valid_sections = 0;
@@ -11551,9 +11537,8 @@ i40e_tunnel_filter_restore(struct i40e_pf *pf)
cld_filter.element.flags = f->input.flags;
cld_filter.element.tenant_id = f->input.tenant_id;
cld_filter.element.queue_number = f->queue;
- rte_memcpy(cld_filter.general_fields,
- f->input.general_fields,
- sizeof(f->input.general_fields));
+ memcpy(cld_filter.general_fields, f->input.general_fields,
+ sizeof(f->input.general_fields));
if (((f->input.flags &
I40E_AQC_ADD_CLOUD_FILTER_0X11) ==
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 47f79ecf11cc..554b763e9f84 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -464,10 +464,10 @@ fill_ip6_head(const struct i40e_fdir_input *fdir_input, unsigned char *raw_pkt,
* need to be presented in a reversed order with respect
* to the expected received packets.
*/
- rte_memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip,
- IPV6_ADDR_LEN);
- rte_memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,
- IPV6_ADDR_LEN);
+ memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip,
+ IPV6_ADDR_LEN);
+ memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,
+ IPV6_ADDR_LEN);
len += sizeof(struct rte_ipv6_hdr);
return len;
@@ -528,18 +528,16 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
[I40E_FILTER_PCTYPE_NONF_IPV6_OTHER] = IPPROTO_NONE,
};
- rte_memcpy(raw_pkt, &fdir_input->flow.l2_flow.dst,
- sizeof(struct rte_ether_addr));
- rte_memcpy(raw_pkt + sizeof(struct rte_ether_addr),
- &fdir_input->flow.l2_flow.src,
- sizeof(struct rte_ether_addr));
+ memcpy(raw_pkt, &fdir_input->flow.l2_flow.dst,
+ sizeof(struct rte_ether_addr));
+ memcpy(raw_pkt + sizeof(struct rte_ether_addr),
+ &fdir_input->flow.l2_flow.src, sizeof(struct rte_ether_addr));
raw_pkt += 2 * sizeof(struct rte_ether_addr);
if (vlan && fdir_input->flow_ext.vlan_tci) {
- rte_memcpy(raw_pkt, vlan_frame, sizeof(vlan_frame));
- rte_memcpy(raw_pkt + sizeof(uint16_t),
- &fdir_input->flow_ext.vlan_tci,
- sizeof(uint16_t));
+ memcpy(raw_pkt, vlan_frame, sizeof(vlan_frame));
+ memcpy(raw_pkt + sizeof(uint16_t),
+ &fdir_input->flow_ext.vlan_tci, sizeof(uint16_t));
raw_pkt += sizeof(vlan_frame);
len += sizeof(vlan_frame);
}
@@ -1003,7 +1001,7 @@ static int
i40e_fdir_filter_convert(const struct i40e_fdir_filter_conf *input,
struct i40e_fdir_filter *filter)
{
- rte_memcpy(&filter->fdir, input, sizeof(struct i40e_fdir_filter_conf));
+ memcpy(&filter->fdir, input, sizeof(struct i40e_fdir_filter_conf));
if (input->input.flow_ext.pkt_template) {
filter->fdir.input.flow.raw_flow.packet = NULL;
filter->fdir.input.flow.raw_flow.length =
@@ -1060,7 +1058,7 @@ i40e_sw_fdir_filter_insert(struct i40e_pf *pf, struct i40e_fdir_filter *filter)
return -1;
hash_filter = &fdir_info->fdir_filter_array[ret];
- rte_memcpy(hash_filter, filter, sizeof(*filter));
+ memcpy(hash_filter, filter, sizeof(*filter));
fdir_info->hash_map[ret] = hash_filter;
TAILQ_INSERT_TAIL(&fdir_info->fdir_list, hash_filter, rules);
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 92165c8422d5..9afb7a540d21 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -1175,7 +1175,7 @@ i40e_pattern_skip_void_item(struct rte_flow_item *items,
pb = pe + 1;
}
/* Copy the END item. */
- rte_memcpy(items, pe, sizeof(struct rte_flow_item));
+ memcpy(items, pe, sizeof(struct rte_flow_item));
}
/* Check if the pattern matches a supported item type array */
@@ -1986,10 +1986,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
filter->input.flow_ext.oip_type =
I40E_FDIR_IPTYPE_IPV6;
- rte_memcpy(filter->input.flow.ipv6_flow.src_ip,
- ipv6_spec->hdr.src_addr, 16);
- rte_memcpy(filter->input.flow.ipv6_flow.dst_ip,
- ipv6_spec->hdr.dst_addr, 16);
+ memcpy(filter->input.flow.ipv6_flow.src_ip,
+ ipv6_spec->hdr.src_addr, 16);
+ memcpy(filter->input.flow.ipv6_flow.dst_ip,
+ ipv6_spec->hdr.dst_addr, 16);
/* Check if it is fragment. */
if (ipv6_spec->hdr.proto ==
@@ -2926,14 +2926,14 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev,
}
if (!vxlan_flag) {
- rte_memcpy(&filter->outer_mac,
- ð_spec->hdr.dst_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&filter->outer_mac,
+ ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
filter_type |= RTE_ETH_TUNNEL_FILTER_OMAC;
} else {
- rte_memcpy(&filter->inner_mac,
- ð_spec->hdr.dst_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&filter->inner_mac,
+ ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
filter_type |= RTE_ETH_TUNNEL_FILTER_IMAC;
}
}
@@ -3026,8 +3026,8 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev,
return -rte_errno;
}
- rte_memcpy(((uint8_t *)&tenant_id_be + 1),
- vxlan_spec->hdr.vni, 3);
+ memcpy(((uint8_t *)&tenant_id_be + 1),
+ vxlan_spec->hdr.vni, 3);
filter->tenant_id =
rte_be_to_cpu_32(tenant_id_be);
filter_type |= RTE_ETH_TUNNEL_FILTER_TENID;
@@ -3156,14 +3156,14 @@ i40e_flow_parse_nvgre_pattern(__rte_unused struct rte_eth_dev *dev,
}
if (!nvgre_flag) {
- rte_memcpy(&filter->outer_mac,
- ð_spec->hdr.dst_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&filter->outer_mac,
+ ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
filter_type |= RTE_ETH_TUNNEL_FILTER_OMAC;
} else {
- rte_memcpy(&filter->inner_mac,
- ð_spec->hdr.dst_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&filter->inner_mac,
+ ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
filter_type |= RTE_ETH_TUNNEL_FILTER_IMAC;
}
}
@@ -3278,8 +3278,8 @@ i40e_flow_parse_nvgre_pattern(__rte_unused struct rte_eth_dev *dev,
"Invalid NVGRE item");
return -rte_errno;
}
- rte_memcpy(((uint8_t *)&tenant_id_be + 1),
- nvgre_spec->tni, 3);
+ memcpy(((uint8_t *)&tenant_id_be + 1),
+ nvgre_spec->tni, 3);
filter->tenant_id =
rte_be_to_cpu_32(tenant_id_be);
filter_type |= RTE_ETH_TUNNEL_FILTER_TENID;
@@ -3447,8 +3447,8 @@ i40e_flow_parse_mpls_pattern(__rte_unused struct rte_eth_dev *dev,
"Invalid MPLS label mask");
return -rte_errno;
}
- rte_memcpy(((uint8_t *)&label_be + 1),
- mpls_spec->label_tc_s, 3);
+ memcpy(((uint8_t *)&label_be + 1),
+ mpls_spec->label_tc_s, 3);
filter->tenant_id = rte_be_to_cpu_32(label_be) >> 4;
break;
default:
@@ -4051,9 +4051,8 @@ i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
cld_filter.element.flags = filter->input.flags;
cld_filter.element.tenant_id = filter->input.tenant_id;
cld_filter.element.queue_number = filter->queue;
- rte_memcpy(cld_filter.general_fields,
- filter->input.general_fields,
- sizeof(cld_filter.general_fields));
+ memcpy(cld_filter.general_fields, filter->input.general_fields,
+ sizeof(cld_filter.general_fields));
if (!filter->is_to_vf)
vsi = pf->main_vsi;
@@ -4271,9 +4270,8 @@ i40e_flow_query(struct rte_eth_dev *dev __rte_unused,
"action not supported");
return -rte_errno;
}
- rte_memcpy(rss_conf,
- &rss_rule->rss_filter_info.conf,
- sizeof(struct rte_flow_action_rss));
+ memcpy(rss_conf, &rss_rule->rss_filter_info.conf,
+ sizeof(struct rte_flow_action_rss));
break;
default:
return rte_flow_error_set(error, ENOTSUP,
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index 15d9ff868f3a..f8073ef9cb47 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -16,7 +16,6 @@
#include <rte_ether.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include "i40e_logs.h"
#include "base/i40e_prototype.h"
@@ -869,7 +868,7 @@ i40e_pf_host_process_cmd_add_ether_address(struct i40e_pf_vf *vf,
for (i = 0; i < addr_list->num_elements; i++) {
mac = (struct rte_ether_addr *)(addr_list->list[i].addr);
- rte_memcpy(&filter.mac_addr, mac, RTE_ETHER_ADDR_LEN);
+ memcpy(&filter.mac_addr, mac, RTE_ETHER_ADDR_LEN);
filter.filter_type = I40E_MACVLAN_PERFECT_MATCH;
if (rte_is_zero_ether_addr(mac) ||
i40e_vsi_add_mac(vf->vsi, &filter)) {
diff --git a/drivers/net/i40e/i40e_tm.c b/drivers/net/i40e/i40e_tm.c
index cab296e1a4af..3f77a7b3a056 100644
--- a/drivers/net/i40e/i40e_tm.c
+++ b/drivers/net/i40e/i40e_tm.c
@@ -279,8 +279,8 @@ i40e_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&pf->tm_conf.shaper_profile_list,
shaper_profile, node);
@@ -526,8 +526,8 @@ i40e_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->reference_count = 0;
tm_node->parent = NULL;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
pf->tm_conf.root = tm_node;
/* increase the reference counter of the shaper profile */
@@ -600,8 +600,7 @@ i40e_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->reference_count = 0;
tm_node->parent = parent_node;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
if (parent_node_type == I40E_TM_NODE_TYPE_PORT) {
TAILQ_INSERT_TAIL(&pf->tm_conf.tc_list,
tm_node, node);
diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index 9d39984ea1fc..03d0b61902a9 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -90,7 +90,7 @@ rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on)
vsi->info.sec_flags &= ~I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK;
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
hw = I40E_VSI_TO_HW(vsi);
@@ -192,7 +192,7 @@ rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on)
vsi->info.sec_flags &= ~I40E_AQ_VSI_SEC_FLAG_ENABLE_VLAN_CHK;
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
hw = I40E_VSI_TO_HW(vsi);
@@ -237,9 +237,8 @@ i40e_vsi_rm_mac_filter(struct i40e_vsi *vsi)
for (i = 0; i < vlan_num; i++) {
mv_f[i].filter_type = filter_type;
- rte_memcpy(&mv_f[i].macaddr,
- &f->mac_info.mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr,
+ ETH_ADDR_LEN);
}
if (filter_type == I40E_MACVLAN_PERFECT_MATCH ||
filter_type == I40E_MACVLAN_HASH_MATCH) {
@@ -298,9 +297,8 @@ i40e_vsi_restore_mac_filter(struct i40e_vsi *vsi)
for (i = 0; i < vlan_num; i++) {
mv_f[i].filter_type = f->mac_info.filter_type;
- rte_memcpy(&mv_f[i].macaddr,
- &f->mac_info.mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr,
+ ETH_ADDR_LEN);
}
if (f->mac_info.filter_type == I40E_MACVLAN_PERFECT_MATCH ||
@@ -380,7 +378,7 @@ i40e_vsi_set_tx_loopback(struct i40e_vsi *vsi, uint8_t on)
vsi->info.switch_id &= ~I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB;
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL);
@@ -705,7 +703,7 @@ int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id,
vsi->info.port_vlan_flags &= ~I40E_AQ_VSI_PVLAN_INSERT_PVID;
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
hw = I40E_VSI_TO_HW(vsi);
@@ -767,7 +765,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id,
}
if (on) {
- rte_memcpy(&filter.mac_addr, &broadcast, RTE_ETHER_ADDR_LEN);
+ memcpy(&filter.mac_addr, &broadcast, RTE_ETHER_ADDR_LEN);
filter.filter_type = I40E_MACVLAN_PERFECT_MATCH;
ret = i40e_vsi_add_mac(vsi, &filter);
} else {
@@ -839,7 +837,7 @@ int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on)
}
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
hw = I40E_VSI_TO_HW(vsi);
@@ -2586,11 +2584,10 @@ i40e_vsi_update_queue_region_mapping(struct i40e_hw *hw,
return ret;
}
/* update the local VSI info with updated queue map */
- rte_memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
- sizeof(vsi->info.tc_mapping));
- rte_memcpy(&vsi->info.queue_mapping,
- &ctxt.info.queue_mapping,
- sizeof(vsi->info.queue_mapping));
+ memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
+ sizeof(vsi->info.tc_mapping));
+ memcpy(&vsi->info.queue_mapping, &ctxt.info.queue_mapping,
+ sizeof(vsi->info.queue_mapping));
vsi->info.mapping_flags = ctxt.info.mapping_flags;
vsi->info.valid_sections = 0;
@@ -2961,8 +2958,7 @@ i40e_queue_region_get_all_info(struct i40e_pf *pf,
{
struct i40e_queue_regions *info = &pf->queue_region;
- rte_memcpy(regions_ptr, info,
- sizeof(struct i40e_queue_regions));
+ memcpy(regions_ptr, info, sizeof(struct i40e_queue_regions));
return 0;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 26/71] net/iavf: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (24 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 25/71] net/i40e: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 27/71] net/ice: " Stephen Hemminger
` (46 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jingjing Wu
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/iavf/iavf_fdir.c | 93 +++++++++++++---------------
drivers/net/iavf/iavf_fsub.c | 50 +++++++--------
drivers/net/iavf/iavf_generic_flow.c | 2 +-
drivers/net/iavf/iavf_tm.c | 11 ++--
drivers/net/iavf/iavf_vchnl.c | 9 ++-
5 files changed, 77 insertions(+), 88 deletions(-)
diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c
index 811a10287b70..35257c43f135 100644
--- a/drivers/net/iavf/iavf_fdir.c
+++ b/drivers/net/iavf/iavf_fdir.c
@@ -374,7 +374,7 @@ iavf_fdir_create(struct iavf_adapter *ad,
if (filter->mark_flag == 1)
iavf_fdir_rx_proc_enable(ad, 1);
- rte_memcpy(rule, filter, sizeof(*rule));
+ memcpy(rule, filter, sizeof(*rule));
flow->rule = rule;
return 0;
@@ -672,15 +672,13 @@ iavf_fdir_refine_input_set(const uint64_t input_set,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV4, PROT);
memset(&ipv4_spec, 0, sizeof(ipv4_spec));
ipv4_spec.hdr.next_proto_id = proto_id;
- rte_memcpy(hdr->buffer, &ipv4_spec.hdr,
- sizeof(ipv4_spec.hdr));
+ memcpy(hdr->buffer, &ipv4_spec.hdr, sizeof(ipv4_spec.hdr));
return true;
case VIRTCHNL_PROTO_HDR_IPV6:
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV6, PROT);
memset(&ipv6_spec, 0, sizeof(ipv6_spec));
ipv6_spec.hdr.proto = proto_id;
- rte_memcpy(hdr->buffer, &ipv6_spec.hdr,
- sizeof(ipv6_spec.hdr));
+ memcpy(hdr->buffer, &ipv6_spec.hdr, sizeof(ipv6_spec.hdr));
return true;
default:
return false;
@@ -885,8 +883,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
ETHERTYPE);
}
- rte_memcpy(hdr1->buffer, eth_spec,
- sizeof(struct rte_ether_hdr));
+ memcpy(hdr1->buffer, eth_spec,
+ sizeof(struct rte_ether_hdr));
}
hdrs->count = ++layer;
@@ -976,8 +974,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
input_set |= IAVF_PROT_IPV4_INNER;
}
- rte_memcpy(hdr->buffer, &ipv4_spec->hdr,
- sizeof(ipv4_spec->hdr));
+ memcpy(hdr->buffer, &ipv4_spec->hdr,
+ sizeof(ipv4_spec->hdr));
hdrs->count = ++layer;
@@ -1066,8 +1064,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
input_set |= IAVF_PROT_IPV6_INNER;
}
- rte_memcpy(hdr->buffer, &ipv6_spec->hdr,
- sizeof(ipv6_spec->hdr));
+ memcpy(hdr->buffer, &ipv6_spec->hdr,
+ sizeof(ipv6_spec->hdr));
hdrs->count = ++layer;
break;
@@ -1101,8 +1099,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1, ETH,
ETHERTYPE);
- rte_memcpy(hdr->buffer, &ipv6_frag_spec->hdr,
- sizeof(ipv6_frag_spec->hdr));
+ memcpy(hdr->buffer, &ipv6_frag_spec->hdr,
+ sizeof(ipv6_frag_spec->hdr));
} else if (ipv6_frag_mask->hdr.id == UINT32_MAX) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
@@ -1153,13 +1151,11 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
}
if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
- rte_memcpy(hdr->buffer,
- &udp_spec->hdr,
- sizeof(udp_spec->hdr));
+ memcpy(hdr->buffer, &udp_spec->hdr,
+ sizeof(udp_spec->hdr));
else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
- rte_memcpy(hdr->buffer,
- &udp_spec->hdr,
- sizeof(udp_spec->hdr));
+ memcpy(hdr->buffer, &udp_spec->hdr,
+ sizeof(udp_spec->hdr));
}
hdrs->count = ++layer;
@@ -1210,13 +1206,11 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
}
if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
- rte_memcpy(hdr->buffer,
- &tcp_spec->hdr,
- sizeof(tcp_spec->hdr));
+ memcpy(hdr->buffer, &tcp_spec->hdr,
+ sizeof(tcp_spec->hdr));
else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
- rte_memcpy(hdr->buffer,
- &tcp_spec->hdr,
- sizeof(tcp_spec->hdr));
+ memcpy(hdr->buffer, &tcp_spec->hdr,
+ sizeof(tcp_spec->hdr));
}
hdrs->count = ++layer;
@@ -1256,13 +1250,11 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
}
if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
- rte_memcpy(hdr->buffer,
- &sctp_spec->hdr,
- sizeof(sctp_spec->hdr));
+ memcpy(hdr->buffer, &sctp_spec->hdr,
+ sizeof(sctp_spec->hdr));
else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
- rte_memcpy(hdr->buffer,
- &sctp_spec->hdr,
- sizeof(sctp_spec->hdr));
+ memcpy(hdr->buffer, &sctp_spec->hdr,
+ sizeof(sctp_spec->hdr));
}
hdrs->count = ++layer;
@@ -1291,8 +1283,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, GTPU_IP, TEID);
}
- rte_memcpy(hdr->buffer,
- gtp_spec, sizeof(*gtp_spec));
+ memcpy(hdr->buffer, gtp_spec,
+ sizeof(*gtp_spec));
}
tun_inner = 1;
@@ -1346,8 +1338,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
psc.qfi = gtp_psc_spec->hdr.qfi;
psc.type = gtp_psc_spec->hdr.type;
psc.next = 0;
- rte_memcpy(hdr->buffer, &psc,
- sizeof(struct iavf_gtp_psc_spec_hdr));
+ memcpy(hdr->buffer, &psc,
+ sizeof(struct iavf_gtp_psc_spec_hdr));
}
hdrs->count = ++layer;
@@ -1367,8 +1359,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, L2TPV3, SESS_ID);
}
- rte_memcpy(hdr->buffer, l2tpv3oip_spec,
- sizeof(*l2tpv3oip_spec));
+ memcpy(hdr->buffer, l2tpv3oip_spec,
+ sizeof(*l2tpv3oip_spec));
}
hdrs->count = ++layer;
@@ -1388,8 +1380,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, ESP, SPI);
}
- rte_memcpy(hdr->buffer, &esp_spec->hdr,
- sizeof(esp_spec->hdr));
+ memcpy(hdr->buffer, &esp_spec->hdr,
+ sizeof(esp_spec->hdr));
}
hdrs->count = ++layer;
@@ -1409,8 +1401,7 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, AH, SPI);
}
- rte_memcpy(hdr->buffer, ah_spec,
- sizeof(*ah_spec));
+ memcpy(hdr->buffer, ah_spec, sizeof(*ah_spec));
}
hdrs->count = ++layer;
@@ -1430,8 +1421,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, PFCP, S_FIELD);
}
- rte_memcpy(hdr->buffer, pfcp_spec,
- sizeof(*pfcp_spec));
+ memcpy(hdr->buffer, pfcp_spec,
+ sizeof(*pfcp_spec));
}
hdrs->count = ++layer;
@@ -1455,8 +1446,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
PC_RTC_ID);
}
- rte_memcpy(hdr->buffer, ecpri_spec,
- sizeof(*ecpri_spec));
+ memcpy(hdr->buffer, ecpri_spec,
+ sizeof(*ecpri_spec));
}
hdrs->count = ++layer;
@@ -1471,8 +1462,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, GRE);
if (gre_spec && gre_mask) {
- rte_memcpy(hdr->buffer, gre_spec,
- sizeof(*gre_spec));
+ memcpy(hdr->buffer, gre_spec,
+ sizeof(*gre_spec));
}
tun_inner = 1;
@@ -1520,8 +1511,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
SESS_ID);
}
- rte_memcpy(hdr->buffer, l2tpv2_spec,
- sizeof(*l2tpv2_spec));
+ memcpy(hdr->buffer, l2tpv2_spec,
+ sizeof(*l2tpv2_spec));
}
tun_inner = 1;
@@ -1538,8 +1529,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, PPP);
if (ppp_spec && ppp_mask) {
- rte_memcpy(hdr->buffer, ppp_spec,
- sizeof(*ppp_spec));
+ memcpy(hdr->buffer, ppp_spec,
+ sizeof(*ppp_spec));
}
hdrs->count = ++layer;
diff --git a/drivers/net/iavf/iavf_fsub.c b/drivers/net/iavf/iavf_fsub.c
index 74e1e7099b8c..d98cde0fa59d 100644
--- a/drivers/net/iavf/iavf_fsub.c
+++ b/drivers/net/iavf/iavf_fsub.c
@@ -92,7 +92,7 @@ iavf_fsub_create(struct iavf_adapter *ad, struct rte_flow *flow,
goto free_entry;
}
- rte_memcpy(rule, filter, sizeof(*rule));
+ memcpy(rule, filter, sizeof(*rule));
flow->rule = rule;
rte_free(meta);
@@ -272,10 +272,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
input_set_byte += 2;
}
- rte_memcpy(hdr1->buffer_spec, eth_spec,
- sizeof(struct rte_ether_hdr));
- rte_memcpy(hdr1->buffer_mask, eth_mask,
- sizeof(struct rte_ether_hdr));
+ memcpy(hdr1->buffer_spec, eth_spec,
+ sizeof(struct rte_ether_hdr));
+ memcpy(hdr1->buffer_mask, eth_mask,
+ sizeof(struct rte_ether_hdr));
} else {
/* flow subscribe filter will add dst mac in kernel */
input_set_byte += 6;
@@ -325,10 +325,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
input_set_byte++;
}
- rte_memcpy(hdr->buffer_spec, &ipv4_spec->hdr,
- sizeof(ipv4_spec->hdr));
- rte_memcpy(hdr->buffer_mask, &ipv4_mask->hdr,
- sizeof(ipv4_spec->hdr));
+ memcpy(hdr->buffer_spec, &ipv4_spec->hdr,
+ sizeof(ipv4_spec->hdr));
+ memcpy(hdr->buffer_mask, &ipv4_mask->hdr,
+ sizeof(ipv4_spec->hdr));
}
hdrs->count = ++layer;
@@ -388,10 +388,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
input_set_byte += 4;
}
- rte_memcpy(hdr->buffer_spec, &ipv6_spec->hdr,
- sizeof(ipv6_spec->hdr));
- rte_memcpy(hdr->buffer_mask, &ipv6_mask->hdr,
- sizeof(ipv6_spec->hdr));
+ memcpy(hdr->buffer_spec, &ipv6_spec->hdr,
+ sizeof(ipv6_spec->hdr));
+ memcpy(hdr->buffer_mask, &ipv6_mask->hdr,
+ sizeof(ipv6_spec->hdr));
}
hdrs->count = ++layer;
@@ -425,10 +425,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
input_set_byte += 2;
}
- rte_memcpy(hdr->buffer_spec, &udp_spec->hdr,
- sizeof(udp_spec->hdr));
- rte_memcpy(hdr->buffer_mask, &udp_mask->hdr,
- sizeof(udp_mask->hdr));
+ memcpy(hdr->buffer_spec, &udp_spec->hdr,
+ sizeof(udp_spec->hdr));
+ memcpy(hdr->buffer_mask, &udp_mask->hdr,
+ sizeof(udp_mask->hdr));
}
hdrs->count = ++layer;
@@ -466,10 +466,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
input_set_byte += 2;
}
- rte_memcpy(hdr->buffer_spec, &tcp_spec->hdr,
- sizeof(tcp_spec->hdr));
- rte_memcpy(hdr->buffer_mask, &tcp_mask->hdr,
- sizeof(tcp_mask->hdr));
+ memcpy(hdr->buffer_spec, &tcp_spec->hdr,
+ sizeof(tcp_spec->hdr));
+ memcpy(hdr->buffer_mask, &tcp_mask->hdr,
+ sizeof(tcp_mask->hdr));
}
hdrs->count = ++layer;
@@ -498,10 +498,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
return -rte_errno;
}
- rte_memcpy(hdr->buffer_spec, &vlan_spec->hdr,
- sizeof(vlan_spec->hdr));
- rte_memcpy(hdr->buffer_mask, &vlan_mask->hdr,
- sizeof(vlan_mask->hdr));
+ memcpy(hdr->buffer_spec, &vlan_spec->hdr,
+ sizeof(vlan_spec->hdr));
+ memcpy(hdr->buffer_mask, &vlan_mask->hdr,
+ sizeof(vlan_mask->hdr));
}
hdrs->count = ++layer;
diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c
index 6f6e95fc453f..0bcfb5bf242b 100644
--- a/drivers/net/iavf/iavf_generic_flow.c
+++ b/drivers/net/iavf/iavf_generic_flow.c
@@ -2019,7 +2019,7 @@ iavf_pattern_skip_void_item(struct rte_flow_item *items,
pb = pe + 1;
}
/* Copy the END item. */
- rte_memcpy(items, pe, sizeof(struct rte_flow_item));
+ memcpy(items, pe, sizeof(struct rte_flow_item));
}
/* Check if the pattern matches a supported item type array */
diff --git a/drivers/net/iavf/iavf_tm.c b/drivers/net/iavf/iavf_tm.c
index 32bb3be45e1b..a6ad6bb0a28d 100644
--- a/drivers/net/iavf/iavf_tm.c
+++ b/drivers/net/iavf/iavf_tm.c
@@ -342,8 +342,8 @@ iavf_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->id = node_id;
tm_node->parent = NULL;
tm_node->reference_count = 0;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
vf->tm_conf.root = tm_node;
return 0;
}
@@ -403,8 +403,7 @@ iavf_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->reference_count = 0;
tm_node->parent = parent_node;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
if (parent_node_type == IAVF_TM_NODE_TYPE_PORT) {
TAILQ_INSERT_TAIL(&vf->tm_conf.tc_list,
tm_node, node);
@@ -543,8 +542,8 @@ iavf_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&vf->tm_conf.shaper_profile_list,
shaper_profile, node);
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 1111d30f57d1..711186c1b552 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -920,7 +920,7 @@ iavf_get_vlan_offload_caps_v2(struct iavf_adapter *adapter)
return ret;
}
- rte_memcpy(&vf->vlan_v2_caps, vf->aq_resp, sizeof(vf->vlan_v2_caps));
+ memcpy(&vf->vlan_v2_caps, vf->aq_resp, sizeof(vf->vlan_v2_caps));
return 0;
}
@@ -1427,8 +1427,8 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add)
addr = &adapter->dev_data->mac_addrs[i];
if (rte_is_zero_ether_addr(addr))
continue;
- rte_memcpy(list->list[j].addr, addr->addr_bytes,
- sizeof(addr->addr_bytes));
+ memcpy(list->list[j].addr, addr->addr_bytes,
+ sizeof(addr->addr_bytes));
list->list[j].type = (j == 0 ?
VIRTCHNL_ETHER_ADDR_PRIMARY :
VIRTCHNL_ETHER_ADDR_EXTRA);
@@ -1547,8 +1547,7 @@ iavf_add_del_eth_addr(struct iavf_adapter *adapter, struct rte_ether_addr *addr,
list->vsi_id = vf->vsi_res->vsi_id;
list->num_elements = 1;
list->list[0].type = type;
- rte_memcpy(list->list[0].addr, addr->addr_bytes,
- sizeof(addr->addr_bytes));
+ memcpy(list->list[0].addr, addr->addr_bytes, sizeof(addr->addr_bytes));
args.ops = add ? VIRTCHNL_OP_ADD_ETH_ADDR : VIRTCHNL_OP_DEL_ETH_ADDR;
args.in_args = cmd_buffer;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 27/71] net/ice: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (25 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 26/71] net/iavf: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 28/71] net/idpf: " Stephen Hemminger
` (45 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/ice/ice_dcf.c | 5 ++--
drivers/net/ice/ice_dcf_parent.c | 2 +-
drivers/net/ice/ice_dcf_sched.c | 11 ++++-----
drivers/net/ice/ice_diagnose.c | 4 ++--
drivers/net/ice/ice_ethdev.c | 14 +++++------
drivers/net/ice/ice_fdir_filter.c | 37 +++++++++++++++---------------
drivers/net/ice/ice_generic_flow.c | 2 +-
drivers/net/ice/ice_hash.c | 2 +-
drivers/net/ice/ice_tm.c | 11 ++++-----
9 files changed, 43 insertions(+), 45 deletions(-)
diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c
index 7f8f5163acef..42e5b30b2b5e 100644
--- a/drivers/net/ice/ice_dcf.c
+++ b/drivers/net/ice/ice_dcf.c
@@ -731,7 +731,7 @@ dcf_get_vlan_offload_caps_v2(struct ice_dcf_hw *hw)
return ret;
}
- rte_memcpy(&hw->vlan_v2_caps, &vlan_v2_caps, sizeof(vlan_v2_caps));
+ memcpy(&hw->vlan_v2_caps, &vlan_v2_caps, sizeof(vlan_v2_caps));
return 0;
}
@@ -1407,8 +1407,7 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw,
return -ENOMEM;
}
- rte_memcpy(list->list[0].addr, addr->addr_bytes,
- sizeof(addr->addr_bytes));
+ memcpy(list->list[0].addr, addr->addr_bytes, sizeof(addr->addr_bytes));
PMD_DRV_LOG(DEBUG, "add/rm mac:" RTE_ETHER_ADDR_PRT_FMT,
RTE_ETHER_ADDR_BYTES(addr));
diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c
index 6e845f458acd..0c53755c9d04 100644
--- a/drivers/net/ice/ice_dcf_parent.c
+++ b/drivers/net/ice/ice_dcf_parent.c
@@ -407,7 +407,7 @@ ice_dcf_load_pkg(struct ice_adapter *adapter)
use_dsn = ice_dcf_execute_virtchnl_cmd(&dcf_adapter->real_hw, &vc_cmd) == 0;
if (use_dsn)
- rte_memcpy(&dsn, pkg_info.dsn, sizeof(dsn));
+ memcpy(&dsn, pkg_info.dsn, sizeof(dsn));
return ice_load_pkg(adapter, use_dsn, dsn);
}
diff --git a/drivers/net/ice/ice_dcf_sched.c b/drivers/net/ice/ice_dcf_sched.c
index b08bc5f1dee0..465ae75d5c97 100644
--- a/drivers/net/ice/ice_dcf_sched.c
+++ b/drivers/net/ice/ice_dcf_sched.c
@@ -308,8 +308,8 @@ ice_dcf_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->id = node_id;
tm_node->parent = NULL;
tm_node->reference_count = 0;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
hw->tm_conf.root = tm_node;
return 0;
@@ -373,8 +373,7 @@ ice_dcf_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->shaper_profile = shaper_profile;
tm_node->reference_count = 0;
tm_node->parent = parent_node;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
if (parent_node_type == ICE_DCF_TM_NODE_TYPE_PORT) {
TAILQ_INSERT_TAIL(&hw->tm_conf.tc_list,
tm_node, node);
@@ -520,8 +519,8 @@ ice_dcf_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&hw->tm_conf.shaper_profile_list,
shaper_profile, node);
diff --git a/drivers/net/ice/ice_diagnose.c b/drivers/net/ice/ice_diagnose.c
index 3be819d7f8f4..c22f71e48efa 100644
--- a/drivers/net/ice/ice_diagnose.c
+++ b/drivers/net/ice/ice_diagnose.c
@@ -362,13 +362,13 @@ ice_dump_pkg(struct rte_eth_dev *dev, uint8_t **buff, uint32_t *size)
count = *size / ICE_PKG_BUF_SIZE;
for (i = 0; i < count; i++) {
next_buff = (uint8_t *)(*buff) + i * ICE_PKG_BUF_SIZE;
- rte_memcpy(pkg_buff.buf, next_buff, ICE_PKG_BUF_SIZE);
+ memcpy(pkg_buff.buf, next_buff, ICE_PKG_BUF_SIZE);
if (ice_aq_upload_section(hw,
(struct ice_buf_hdr *)&pkg_buff.buf[0],
ICE_PKG_BUF_SIZE,
NULL))
return -EINVAL;
- rte_memcpy(next_buff, pkg_buff.buf, ICE_PKG_BUF_SIZE);
+ memcpy(next_buff, pkg_buff.buf, ICE_PKG_BUF_SIZE);
}
cache_size = sizeof(struct ice_package_header) + *size;
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index f07b236ad4b6..93e364811d2e 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -3387,11 +3387,11 @@ static int ice_init_rss(struct ice_pf *pf)
RTE_MIN(rss_conf->rss_key_len,
vsi->rss_key_size));
- rte_memcpy(key.standard_rss_key, vsi->rss_key,
- ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE);
- rte_memcpy(key.extended_hash_key,
- &vsi->rss_key[ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE],
- ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE);
+ memcpy(key.standard_rss_key, vsi->rss_key,
+ ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE);
+ memcpy(key.extended_hash_key,
+ &vsi->rss_key[ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE],
+ ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE);
ret = ice_aq_set_rss_key(hw, vsi->idx, &key);
if (ret)
goto out;
@@ -4483,7 +4483,7 @@ ice_vsi_config_vlan_filter(struct ice_vsi *vsi, bool on)
vsi->info.sw_flags2 &= ~sw_flags2;
vsi->info.sw_id = hw->port_info->sw_id;
- (void)rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.info.valid_sections =
rte_cpu_to_le_16(ICE_AQ_VSI_PROP_SW_VALID |
ICE_AQ_VSI_PROP_SECURITY_VALID);
@@ -5301,7 +5301,7 @@ ice_vsi_vlan_pvid_set(struct ice_vsi *vsi, struct ice_vsi_vlan_pvid_info *info)
ICE_AQ_VSI_INNER_VLAN_EMODE_M);
vsi->info.inner_vlan_flags |= vlan_flags;
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.info.valid_sections =
rte_cpu_to_le_16(ICE_AQ_VSI_PROP_VLAN_VALID);
ctxt.vsi_num = vsi->vsi_id;
diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 0b7920ad4475..de7b531aa023 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -1224,13 +1224,13 @@ ice_fdir_extract_fltr_key(struct ice_fdir_fltr_pattern *key,
memset(key, 0, sizeof(*key));
key->flow_type = input->flow_type;
- rte_memcpy(&key->ip, &input->ip, sizeof(key->ip));
- rte_memcpy(&key->mask, &input->mask, sizeof(key->mask));
- rte_memcpy(&key->ext_data, &input->ext_data, sizeof(key->ext_data));
- rte_memcpy(&key->ext_mask, &input->ext_mask, sizeof(key->ext_mask));
+ memcpy(&key->ip, &input->ip, sizeof(key->ip));
+ memcpy(&key->mask, &input->mask, sizeof(key->mask));
+ memcpy(&key->ext_data, &input->ext_data, sizeof(key->ext_data));
+ memcpy(&key->ext_mask, &input->ext_mask, sizeof(key->ext_mask));
- rte_memcpy(&key->gtpu_data, &input->gtpu_data, sizeof(key->gtpu_data));
- rte_memcpy(&key->gtpu_mask, &input->gtpu_mask, sizeof(key->gtpu_mask));
+ memcpy(&key->gtpu_data, &input->gtpu_data, sizeof(key->gtpu_data));
+ memcpy(&key->gtpu_mask, &input->gtpu_mask, sizeof(key->gtpu_mask));
key->tunnel_type = filter->tunnel_type;
}
@@ -1358,7 +1358,7 @@ ice_fdir_create_filter(struct ice_adapter *ad,
if (!entry)
goto error;
- rte_memcpy(entry, filter, sizeof(*filter));
+ memcpy(entry, filter, sizeof(*filter));
flow->rule = entry;
@@ -1419,7 +1419,7 @@ ice_fdir_create_filter(struct ice_adapter *ad,
if (filter->mark_flag == 1)
ice_fdir_rx_parsing_enable(ad, 1);
- rte_memcpy(entry, filter, sizeof(*entry));
+ memcpy(entry, filter, sizeof(*entry));
ret = ice_fdir_entry_insert(pf, entry, &key);
if (ret) {
rte_flow_error_set(error, -ret,
@@ -1720,8 +1720,8 @@ ice_fdir_parse_action(struct ice_adapter *ad,
act_count = actions->conf;
filter->input.cnt_ena = ICE_FXD_FLTR_QW0_STAT_ENA_PKTS;
- rte_memcpy(&filter->act_count, act_count,
- sizeof(filter->act_count));
+ memcpy(&filter->act_count, act_count,
+ sizeof(filter->act_count));
break;
default:
@@ -1978,12 +1978,13 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
p_ext_data = (tunnel_type && is_outer) ?
&filter->input.ext_data_outer :
&filter->input.ext_data;
- rte_memcpy(&p_ext_data->src_mac,
- ð_spec->hdr.src_addr, RTE_ETHER_ADDR_LEN);
- rte_memcpy(&p_ext_data->dst_mac,
- ð_spec->hdr.dst_addr, RTE_ETHER_ADDR_LEN);
- rte_memcpy(&p_ext_data->ether_type,
- ð_spec->hdr.ether_type, sizeof(eth_spec->hdr.ether_type));
+ memcpy(&p_ext_data->src_mac, ð_spec->hdr.src_addr,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(&p_ext_data->dst_mac, ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(&p_ext_data->ether_type,
+ ð_spec->hdr.ether_type,
+ sizeof(eth_spec->hdr.ether_type));
break;
case RTE_FLOW_ITEM_TYPE_IPV4:
flow_type = ICE_FLTR_PTYPE_NONF_IPV4_OTHER;
@@ -2108,8 +2109,8 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
if (ipv6_mask->hdr.hop_limits == UINT8_MAX)
*input_set |= ICE_INSET_IPV6_HOP_LIMIT;
- rte_memcpy(&p_v6->dst_ip, ipv6_spec->hdr.dst_addr, 16);
- rte_memcpy(&p_v6->src_ip, ipv6_spec->hdr.src_addr, 16);
+ memcpy(&p_v6->dst_ip, ipv6_spec->hdr.dst_addr, 16);
+ memcpy(&p_v6->src_ip, ipv6_spec->hdr.src_addr, 16);
vtc_flow_cpu = rte_be_to_cpu_32(ipv6_spec->hdr.vtc_flow);
p_v6->tc = (uint8_t)(vtc_flow_cpu >> ICE_FDIR_IPV6_TC_OFFSET);
p_v6->proto = ipv6_spec->hdr.proto;
diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c
index 50d760004f90..9e7de43575b9 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -1969,7 +1969,7 @@ ice_pattern_skip_void_item(struct rte_flow_item *items,
pb = pe + 1;
}
/* Copy the END item. */
- rte_memcpy(items, pe, sizeof(struct rte_flow_item));
+ memcpy(items, pe, sizeof(struct rte_flow_item));
}
/* Check if the pattern matches a supported item type array */
diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index f92364153376..80b44713a9d1 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -715,7 +715,7 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad,
pkt_len, ICE_BLK_RSS, true, &prof))
return -rte_errno;
- rte_memcpy(&meta->raw.prof, &prof, sizeof(prof));
+ memcpy(&meta->raw.prof, &prof, sizeof(prof));
rte_free(pkt_buf);
rte_free(msk_buf);
diff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c
index fbab0b8808b9..a8b20ef889fc 100644
--- a/drivers/net/ice/ice_tm.c
+++ b/drivers/net/ice/ice_tm.c
@@ -293,8 +293,8 @@ ice_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&pf->tm_conf.shaper_profile_list,
shaper_profile, node);
@@ -403,8 +403,8 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->shaper_profile = shaper_profile;
tm_node->children =
(void *)((uint8_t *)tm_node + sizeof(struct ice_tm_node));
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
pf->tm_conf.root = tm_node;
return 0;
}
@@ -480,8 +480,7 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,
PMD_DRV_LOG(WARNING, "weight != 1 not supported in level %d",
level_id);
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
tm_node->parent->reference_count++;
return 0;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 28/71] net/idpf: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (26 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 27/71] net/ice: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 29/71] net/ipn3ke: " Stephen Hemminger
` (44 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jingjing Wu
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/idpf/idpf_ethdev.c | 7 ++++---
drivers/net/idpf/idpf_rxtx.c | 10 ++++++----
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index 86151c9ec9fa..9cf33c4b7058 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -1088,8 +1088,8 @@ idpf_handle_virtchnl_msg(struct idpf_adapter_ext *adapter_ex)
return;
}
- rte_memcpy(adapter->mbx_resp, ctlq_msg.ctx.indirect.payload->va,
- IDPF_DFLT_MBX_BUF_SIZE);
+ memcpy(adapter->mbx_resp, ctlq_msg.ctx.indirect.payload->va,
+ IDPF_DFLT_MBX_BUF_SIZE);
mbx_op = rte_le_to_cpu_16(ctlq_msg.opcode);
vc_op = rte_le_to_cpu_32(ctlq_msg.cookie.mbx.chnl_opcode);
@@ -1202,7 +1202,8 @@ idpf_adapter_ext_init(struct rte_pci_device *pci_dev, struct idpf_adapter_ext *a
strncpy(adapter->name, pci_dev->device.name, PCI_PRI_STR_SIZE);
- rte_memcpy(&base->caps, &req_caps, sizeof(struct virtchnl2_get_capabilities));
+ memcpy(&base->caps, &req_caps,
+ sizeof(struct virtchnl2_get_capabilities));
ret = idpf_adapter_init(base);
if (ret != 0) {
diff --git a/drivers/net/idpf/idpf_rxtx.c b/drivers/net/idpf/idpf_rxtx.c
index 64f22355804e..da659e16531c 100644
--- a/drivers/net/idpf/idpf_rxtx.c
+++ b/drivers/net/idpf/idpf_rxtx.c
@@ -76,7 +76,7 @@ idpf_dma_zone_reserve(struct rte_eth_dev *dev, uint16_t queue_idx,
else
ring_size = RTE_ALIGN(len * sizeof(struct idpf_base_tx_desc),
IDPF_DMA_MEM_ALIGN);
- rte_memcpy(ring_name, "idpf Tx ring", sizeof("idpf Tx ring"));
+ memcpy(ring_name, "idpf Tx ring", sizeof("idpf Tx ring"));
break;
case VIRTCHNL2_QUEUE_TYPE_RX:
if (splitq)
@@ -85,17 +85,19 @@ idpf_dma_zone_reserve(struct rte_eth_dev *dev, uint16_t queue_idx,
else
ring_size = RTE_ALIGN(len * sizeof(struct virtchnl2_singleq_rx_buf_desc),
IDPF_DMA_MEM_ALIGN);
- rte_memcpy(ring_name, "idpf Rx ring", sizeof("idpf Rx ring"));
+ memcpy(ring_name, "idpf Rx ring", sizeof("idpf Rx ring"));
break;
case VIRTCHNL2_QUEUE_TYPE_TX_COMPLETION:
ring_size = RTE_ALIGN(len * sizeof(struct idpf_splitq_tx_compl_desc),
IDPF_DMA_MEM_ALIGN);
- rte_memcpy(ring_name, "idpf Tx compl ring", sizeof("idpf Tx compl ring"));
+ memcpy(ring_name, "idpf Tx compl ring",
+ sizeof("idpf Tx compl ring"));
break;
case VIRTCHNL2_QUEUE_TYPE_RX_BUFFER:
ring_size = RTE_ALIGN(len * sizeof(struct virtchnl2_splitq_rx_buf_desc),
IDPF_DMA_MEM_ALIGN);
- rte_memcpy(ring_name, "idpf Rx buf ring", sizeof("idpf Rx buf ring"));
+ memcpy(ring_name, "idpf Rx buf ring",
+ sizeof("idpf Rx buf ring"));
break;
default:
PMD_INIT_LOG(ERR, "Invalid queue type");
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 29/71] net/ipn3ke: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (27 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 28/71] net/idpf: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 30/71] net/ixgbe: " Stephen Hemminger
` (43 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Rosen Xu
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/ipn3ke/ipn3ke_flow.c | 32 ++++++++++++-------------
drivers/net/ipn3ke/ipn3ke_representor.c | 16 ++++++-------
drivers/net/ipn3ke/ipn3ke_tm.c | 6 ++---
3 files changed, 26 insertions(+), 28 deletions(-)
diff --git a/drivers/net/ipn3ke/ipn3ke_flow.c b/drivers/net/ipn3ke/ipn3ke_flow.c
index d20a29b9a2d6..eeb0ec55d9a6 100644
--- a/drivers/net/ipn3ke/ipn3ke_flow.c
+++ b/drivers/net/ipn3ke/ipn3ke_flow.c
@@ -100,15 +100,14 @@ ipn3ke_pattern_vxlan(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_ETH:
eth = item->spec;
- rte_memcpy(&parser->key[0],
- eth->hdr.src_addr.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&parser->key[0], eth->hdr.src_addr.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
break;
case RTE_FLOW_ITEM_TYPE_VXLAN:
vxlan = item->spec;
- rte_memcpy(&parser->key[6], vxlan->hdr.vni, 3);
+ memcpy(&parser->key[6], vxlan->hdr.vni, 3);
break;
default:
@@ -164,9 +163,8 @@ ipn3ke_pattern_mac(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_ETH:
eth = item->spec;
- rte_memcpy(parser->key,
- eth->hdr.src_addr.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(parser->key, eth->hdr.src_addr.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
break;
default:
@@ -369,13 +367,13 @@ ipn3ke_pattern_ip_tcp(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_IPV4:
ipv4 = item->spec;
- rte_memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
+ memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
break;
case RTE_FLOW_ITEM_TYPE_TCP:
tcp = item->spec;
- rte_memcpy(&parser->key[4], &tcp->hdr.src_port, 2);
+ memcpy(&parser->key[4], &tcp->hdr.src_port, 2);
break;
default:
@@ -434,13 +432,13 @@ ipn3ke_pattern_ip_udp(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_IPV4:
ipv4 = item->spec;
- rte_memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
+ memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
break;
case RTE_FLOW_ITEM_TYPE_UDP:
udp = item->spec;
- rte_memcpy(&parser->key[4], &udp->hdr.src_port, 2);
+ memcpy(&parser->key[4], &udp->hdr.src_port, 2);
break;
default:
@@ -502,19 +500,19 @@ ipn3ke_pattern_ip_nvgre(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_IPV4:
ipv4 = item->spec;
- rte_memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
+ memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
break;
case RTE_FLOW_ITEM_TYPE_UDP:
udp = item->spec;
- rte_memcpy(&parser->key[4], &udp->hdr.src_port, 2);
+ memcpy(&parser->key[4], &udp->hdr.src_port, 2);
break;
case RTE_FLOW_ITEM_TYPE_NVGRE:
nvgre = item->spec;
- rte_memcpy(&parser->key[6], nvgre->tni, 3);
+ memcpy(&parser->key[6], nvgre->tni, 3);
break;
default:
@@ -576,19 +574,19 @@ ipn3ke_pattern_vxlan_ip_udp(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_VXLAN:
vxlan = item->spec;
- rte_memcpy(&parser->key[0], vxlan->hdr.vni, 3);
+ memcpy(&parser->key[0], vxlan->hdr.vni, 3);
break;
case RTE_FLOW_ITEM_TYPE_IPV4:
ipv4 = item->spec;
- rte_memcpy(&parser->key[3], &ipv4->hdr.src_addr, 4);
+ memcpy(&parser->key[3], &ipv4->hdr.src_addr, 4);
break;
case RTE_FLOW_ITEM_TYPE_UDP:
udp = item->spec;
- rte_memcpy(&parser->key[7], &udp->hdr.src_port, 2);
+ memcpy(&parser->key[7], &udp->hdr.src_port, 2);
break;
default:
diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c
index 8145f1bb2a0e..99527d18793a 100644
--- a/drivers/net/ipn3ke/ipn3ke_representor.c
+++ b/drivers/net/ipn3ke/ipn3ke_representor.c
@@ -137,17 +137,17 @@ ipn3ke_rpst_dev_start(struct rte_eth_dev *dev)
if (hw->retimer.mac_type == IFPGA_RAWDEV_RETIMER_MAC_TYPE_10GE_XFI) {
/* Set mac address */
- rte_memcpy(((char *)(&val)),
- (char *)&dev->data->mac_addrs->addr_bytes[0],
- sizeof(uint32_t));
+ memcpy(((char *)(&val)),
+ (char *)&dev->data->mac_addrs->addr_bytes[0],
+ sizeof(uint32_t));
(*hw->f_mac_write)(hw,
val,
IPN3KE_MAC_PRIMARY_MAC_ADDR0,
rpst->port_id,
0);
- rte_memcpy(((char *)(&val)),
- (char *)&dev->data->mac_addrs->addr_bytes[4],
- sizeof(uint16_t));
+ memcpy(((char *)(&val)),
+ (char *)&dev->data->mac_addrs->addr_bytes[4],
+ sizeof(uint16_t));
(*hw->f_mac_write)(hw,
val,
IPN3KE_MAC_PRIMARY_MAC_ADDR1,
@@ -2753,13 +2753,13 @@ ipn3ke_rpst_mac_addr_set(struct rte_eth_dev *ethdev,
rte_ether_addr_copy(&mac_addr[0], &rpst->mac_addr);
/* Set mac address */
- rte_memcpy(((char *)(&val)), &mac_addr[0], sizeof(uint32_t));
+ memcpy(((char *)(&val)), &mac_addr[0], sizeof(uint32_t));
(*hw->f_mac_write)(hw,
val,
IPN3KE_MAC_PRIMARY_MAC_ADDR0,
rpst->port_id,
0);
- rte_memcpy(((char *)(&val)), &mac_addr[4], sizeof(uint16_t));
+ memcpy(((char *)(&val)), &mac_addr[4], sizeof(uint16_t));
(*hw->f_mac_write)(hw,
val,
IPN3KE_MAC_PRIMARY_MAC_ADDR0,
diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c b/drivers/net/ipn3ke/ipn3ke_tm.c
index 0260227900ae..b7097083d2d6 100644
--- a/drivers/net/ipn3ke/ipn3ke_tm.c
+++ b/drivers/net/ipn3ke/ipn3ke_tm.c
@@ -814,7 +814,7 @@ ipn3ke_tm_shaper_profile_add(struct rte_eth_dev *dev,
rte_strerror(EINVAL));
} else {
sp->valid = 1;
- rte_memcpy(&sp->params, profile, sizeof(sp->params));
+ memcpy(&sp->params, profile, sizeof(sp->params));
}
tm->h.n_shaper_profiles++;
@@ -960,7 +960,7 @@ ipn3ke_tm_tdrop_profile_add(struct rte_eth_dev *dev,
IPN3KE_TDROP_TH2_MASK);
tp->th1 = th1;
tp->th2 = th2;
- rte_memcpy(&tp->params, profile, sizeof(tp->params));
+ memcpy(&tp->params, profile, sizeof(tp->params));
/* Add to list */
tm->h.n_tdrop_profiles++;
@@ -1308,7 +1308,7 @@ ipn3ke_tm_node_add(struct rte_eth_dev *dev,
n->tdrop_profile = ipn3ke_hw_tm_tdrop_profile_search(hw,
params->leaf.wred.wred_profile_id);
- rte_memcpy(&n->params, params, sizeof(n->params));
+ memcpy(&n->params, params, sizeof(n->params));
return 0;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 30/71] net/ixgbe: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (28 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 29/71] net/ipn3ke: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 31/71] net/memif: " Stephen Hemminger
` (42 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/ixgbe/ixgbe_ethdev.c | 9 ++---
drivers/net/ixgbe/ixgbe_fdir.c | 7 ++--
drivers/net/ixgbe/ixgbe_flow.c | 65 ++++++++++++++-----------------
drivers/net/ixgbe/ixgbe_ipsec.c | 8 ++--
drivers/net/ixgbe/ixgbe_pf.c | 5 +--
drivers/net/ixgbe/ixgbe_tm.c | 11 +++---
drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +-
7 files changed, 48 insertions(+), 61 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 0cd3d0b105f4..6040cac9a896 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -6597,9 +6597,8 @@ ixgbe_add_del_ntuple_filter(struct rte_eth_dev *dev,
sizeof(struct ixgbe_5tuple_filter), 0);
if (filter == NULL)
return -ENOMEM;
- rte_memcpy(&filter->filter_info,
- &filter_5tuple,
- sizeof(struct ixgbe_5tuple_filter_info));
+ memcpy(&filter->filter_info, &filter_5tuple,
+ sizeof(struct ixgbe_5tuple_filter_info));
filter->queue = ntuple_filter->queue;
ret = ixgbe_add_5tuple_filter(dev, filter);
if (ret < 0) {
@@ -7596,9 +7595,7 @@ ixgbe_dev_l2_tunnel_filter_add(struct rte_eth_dev *dev,
if (!node)
return -ENOMEM;
- rte_memcpy(&node->key,
- &key,
- sizeof(struct ixgbe_l2_tn_key));
+ memcpy(&node->key, &key, sizeof(struct ixgbe_l2_tn_key));
node->pool = l2_tunnel->pool;
ret = ixgbe_insert_l2_tn_filter(l2_tn_info, node);
if (ret < 0) {
diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c
index 06d6e2126de5..b168ab82781b 100644
--- a/drivers/net/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/ixgbe/ixgbe_fdir.c
@@ -74,7 +74,7 @@
else \
ipv6_addr[i] = 0; \
} \
- rte_memcpy((ipaddr), ipv6_addr, sizeof(ipv6_addr));\
+ memcpy((ipaddr), ipv6_addr, sizeof(ipv6_addr));\
} while (0)
#define IXGBE_FDIRIP6M_INNER_MAC_SHIFT 4
@@ -1217,9 +1217,8 @@ ixgbe_fdir_filter_program(struct rte_eth_dev *dev,
0);
if (!node)
return -ENOMEM;
- rte_memcpy(&node->ixgbe_fdir,
- &rule->ixgbe_fdir,
- sizeof(union ixgbe_atr_input));
+ memcpy(&node->ixgbe_fdir, &rule->ixgbe_fdir,
+ sizeof(union ixgbe_atr_input));
node->fdirflags = fdircmd_flags;
node->fdirhash = fdirhash;
node->queue = queue;
diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index 687341c6b8d3..8a13f47f2b8c 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -1944,10 +1944,10 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
if (item->spec) {
rule->b_spec = TRUE;
ipv6_spec = item->spec;
- rte_memcpy(rule->ixgbe_fdir.formatted.src_ip,
- ipv6_spec->hdr.src_addr, 16);
- rte_memcpy(rule->ixgbe_fdir.formatted.dst_ip,
- ipv6_spec->hdr.dst_addr, 16);
+ memcpy(rule->ixgbe_fdir.formatted.src_ip,
+ ipv6_spec->hdr.src_addr, 16);
+ memcpy(rule->ixgbe_fdir.formatted.dst_ip,
+ ipv6_spec->hdr.dst_addr, 16);
}
/**
@@ -3070,9 +3070,9 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&ntuple_filter_ptr->filter_info,
- &ntuple_filter,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter_ptr->filter_info,
+ &ntuple_filter,
+ sizeof(struct rte_eth_ntuple_filter));
TAILQ_INSERT_TAIL(&filter_ntuple_list,
ntuple_filter_ptr, entries);
flow->rule = ntuple_filter_ptr;
@@ -3096,9 +3096,9 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(ðertype_filter_ptr->filter_info,
- ðertype_filter,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter_ptr->filter_info,
+ ðertype_filter,
+ sizeof(struct rte_eth_ethertype_filter));
TAILQ_INSERT_TAIL(&filter_ethertype_list,
ethertype_filter_ptr, entries);
flow->rule = ethertype_filter_ptr;
@@ -3120,9 +3120,8 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&syn_filter_ptr->filter_info,
- &syn_filter,
- sizeof(struct rte_eth_syn_filter));
+ memcpy(&syn_filter_ptr->filter_info, &syn_filter,
+ sizeof(struct rte_eth_syn_filter));
TAILQ_INSERT_TAIL(&filter_syn_list,
syn_filter_ptr,
entries);
@@ -3141,9 +3140,8 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
if (fdir_rule.b_mask) {
if (!fdir_info->mask_added) {
/* It's the first time the mask is set. */
- rte_memcpy(&fdir_info->mask,
- &fdir_rule.mask,
- sizeof(struct ixgbe_hw_fdir_mask));
+ memcpy(&fdir_info->mask, &fdir_rule.mask,
+ sizeof(struct ixgbe_hw_fdir_mask));
if (fdir_rule.mask.flex_bytes_mask) {
ret = ixgbe_fdir_set_flexbytes_offset(dev,
@@ -3185,9 +3183,9 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&fdir_rule_ptr->filter_info,
- &fdir_rule,
- sizeof(struct ixgbe_fdir_rule));
+ memcpy(&fdir_rule_ptr->filter_info,
+ &fdir_rule,
+ sizeof(struct ixgbe_fdir_rule));
TAILQ_INSERT_TAIL(&filter_fdir_list,
fdir_rule_ptr, entries);
flow->rule = fdir_rule_ptr;
@@ -3222,9 +3220,8 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&l2_tn_filter_ptr->filter_info,
- &l2_tn_filter,
- sizeof(struct ixgbe_l2_tunnel_conf));
+ memcpy(&l2_tn_filter_ptr->filter_info, &l2_tn_filter,
+ sizeof(struct ixgbe_l2_tunnel_conf));
TAILQ_INSERT_TAIL(&filter_l2_tunnel_list,
l2_tn_filter_ptr, entries);
flow->rule = l2_tn_filter_ptr;
@@ -3351,9 +3348,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_NTUPLE:
ntuple_filter_ptr = (struct ixgbe_ntuple_filter_ele *)
pmd_flow->rule;
- rte_memcpy(&ntuple_filter,
- &ntuple_filter_ptr->filter_info,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter, &ntuple_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ntuple_filter));
ret = ixgbe_add_del_ntuple_filter(dev, &ntuple_filter, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_ntuple_list,
@@ -3364,9 +3360,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_ETHERTYPE:
ethertype_filter_ptr = (struct ixgbe_ethertype_filter_ele *)
pmd_flow->rule;
- rte_memcpy(ðertype_filter,
- ðertype_filter_ptr->filter_info,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter, ðertype_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ethertype_filter));
ret = ixgbe_add_del_ethertype_filter(dev,
ðertype_filter, FALSE);
if (!ret) {
@@ -3378,9 +3373,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_SYN:
syn_filter_ptr = (struct ixgbe_eth_syn_filter_ele *)
pmd_flow->rule;
- rte_memcpy(&syn_filter,
- &syn_filter_ptr->filter_info,
- sizeof(struct rte_eth_syn_filter));
+ memcpy(&syn_filter, &syn_filter_ptr->filter_info,
+ sizeof(struct rte_eth_syn_filter));
ret = ixgbe_syn_filter_set(dev, &syn_filter, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_syn_list,
@@ -3390,9 +3384,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
break;
case RTE_ETH_FILTER_FDIR:
fdir_rule_ptr = (struct ixgbe_fdir_rule_ele *)pmd_flow->rule;
- rte_memcpy(&fdir_rule,
- &fdir_rule_ptr->filter_info,
- sizeof(struct ixgbe_fdir_rule));
+ memcpy(&fdir_rule, &fdir_rule_ptr->filter_info,
+ sizeof(struct ixgbe_fdir_rule));
ret = ixgbe_fdir_filter_program(dev, &fdir_rule, TRUE, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_fdir_list,
@@ -3405,8 +3398,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_L2_TUNNEL:
l2_tn_filter_ptr = (struct ixgbe_eth_l2_tunnel_conf_ele *)
pmd_flow->rule;
- rte_memcpy(&l2_tn_filter, &l2_tn_filter_ptr->filter_info,
- sizeof(struct ixgbe_l2_tunnel_conf));
+ memcpy(&l2_tn_filter, &l2_tn_filter_ptr->filter_info,
+ sizeof(struct ixgbe_l2_tunnel_conf));
ret = ixgbe_dev_l2_tunnel_filter_del(dev, &l2_tn_filter);
if (!ret) {
TAILQ_REMOVE(&filter_l2_tunnel_list,
diff --git a/drivers/net/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c
index d3313085560d..d8ed095dce0c 100644
--- a/drivers/net/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ixgbe/ixgbe_ipsec.c
@@ -680,10 +680,10 @@ ixgbe_crypto_add_ingress_sa_from_flow(const void *sess,
const struct rte_flow_item_ipv6 *ipv6 = ip_spec;
ic_session->src_ip.type = IPv6;
ic_session->dst_ip.type = IPv6;
- rte_memcpy(ic_session->src_ip.ipv6,
- ipv6->hdr.src_addr, 16);
- rte_memcpy(ic_session->dst_ip.ipv6,
- ipv6->hdr.dst_addr, 16);
+ memcpy(ic_session->src_ip.ipv6, ipv6->hdr.src_addr,
+ 16);
+ memcpy(ic_session->dst_ip.ipv6, ipv6->hdr.dst_addr,
+ 16);
} else {
const struct rte_flow_item_ipv4 *ipv4 = ip_spec;
ic_session->src_ip.type = IPv4;
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index 0a0f639e3986..f16bd45dbf6a 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -16,7 +16,6 @@
#include <rte_eal.h>
#include <rte_ether.h>
#include <ethdev_driver.h>
-#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
@@ -450,7 +449,7 @@ ixgbe_vf_reset(struct rte_eth_dev *dev, uint16_t vf, uint32_t *msgbuf)
/* reply to reset with ack and vf mac address */
msgbuf[0] = IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_ACK;
- rte_memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
+ memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
/*
* Piggyback the multicast filter type so VF can compute the
* correct vectors
@@ -472,7 +471,7 @@ ixgbe_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
if (rte_is_valid_assigned_ether_addr(
(struct rte_ether_addr *)new_mac)) {
- rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
+ memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
return hw->mac.ops.set_rar(hw, rar_entry, new_mac, vf, IXGBE_RAH_AV);
}
return -1;
diff --git a/drivers/net/ixgbe/ixgbe_tm.c b/drivers/net/ixgbe/ixgbe_tm.c
index ac8976062fa7..00d9de43936b 100644
--- a/drivers/net/ixgbe/ixgbe_tm.c
+++ b/drivers/net/ixgbe/ixgbe_tm.c
@@ -289,8 +289,8 @@ ixgbe_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&tm_conf->shaper_profile_list,
shaper_profile, node);
@@ -637,8 +637,8 @@ ixgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->no = 0;
tm_node->parent = NULL;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
tm_conf->root = tm_node;
/* increase the reference counter of the shaper profile */
@@ -718,8 +718,7 @@ ixgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->reference_count = 0;
tm_node->parent = parent_node;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
if (parent_node_type == IXGBE_TM_NODE_TYPE_PORT) {
tm_node->no = parent_node->reference_count;
TAILQ_INSERT_TAIL(&tm_conf->tc_list,
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c
index f76ef6392194..ba700fe02313 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.c
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c
@@ -37,8 +37,8 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf,
if (rte_is_valid_assigned_ether_addr(
(struct rte_ether_addr *)new_mac)) {
- rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(vfinfo[vf].vf_mac_addresses, new_mac,
+ RTE_ETHER_ADDR_LEN);
return hw->mac.ops.set_rar(hw, rar_entry, new_mac, vf,
IXGBE_RAH_AV);
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 31/71] net/memif: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (29 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 30/71] net/ixgbe: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 32/71] net/qede: " Stephen Hemminger
` (41 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jakub Grajciar
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/memif/memif_socket.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
index 649f8d0e618f..f5a3354c4652 100644
--- a/drivers/net/memif/memif_socket.c
+++ b/drivers/net/memif/memif_socket.c
@@ -48,7 +48,7 @@ memif_msg_send(int fd, memif_msg_t *msg, int afd)
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
- rte_memcpy(CMSG_DATA(cmsg), &afd, sizeof(int));
+ memcpy(CMSG_DATA(cmsg), &afd, sizeof(int));
}
return sendmsg(fd, &mh, 0);
@@ -675,7 +675,7 @@ memif_msg_receive(struct memif_control_channel *cc)
if (cmsg->cmsg_type == SCM_CREDENTIALS)
cr = (struct ucred *)CMSG_DATA(cmsg);
else if (cmsg->cmsg_type == SCM_RIGHTS)
- rte_memcpy(&afd, CMSG_DATA(cmsg), sizeof(int));
+ memcpy(&afd, CMSG_DATA(cmsg), sizeof(int));
}
cmsg = CMSG_NXTHDR(&mh, cmsg);
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 32/71] net/qede: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (30 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 31/71] net/memif: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 33/71] baseband/acc: " Stephen Hemminger
` (40 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Devendra Singh Rawat, Alok Prasad
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/qede/qede_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index fd63262f3a47..32fa2016d260 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -180,7 +180,7 @@ static void qed_handle_bulletin_change(struct ecore_hwfn *hwfn)
is_mac_exist = ecore_vf_bulletin_get_forced_mac(hwfn, mac,
&is_mac_forced);
if (is_mac_exist && is_mac_forced)
- rte_memcpy(hwfn->hw_info.hw_mac_addr, mac, ETH_ALEN);
+ memcpy(hwfn->hw_info.hw_mac_addr, mac, ETH_ALEN);
/* Always update link configuration according to bulletin */
qed_link_update(hwfn);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 33/71] baseband/acc: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (31 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 32/71] net/qede: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-02 1:01 ` Chautru, Nicolas
2024-03-01 17:15 ` [PATCH v2 34/71] baseband/la12xx: " Stephen Hemminger
` (39 subsequent siblings)
72 siblings, 1 reply; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Nicolas Chautru
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/baseband/acc/rte_acc100_pmd.c | 17 ++++++++---------
drivers/baseband/acc/rte_vrb_pmd.c | 21 ++++++++++-----------
2 files changed, 18 insertions(+), 20 deletions(-)
diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c
index 4f666e514b72..6a6212f3deed 100644
--- a/drivers/baseband/acc/rte_acc100_pmd.c
+++ b/drivers/baseband/acc/rte_acc100_pmd.c
@@ -2975,15 +2975,13 @@ enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
uint8_t *prev_ptr = (uint8_t *) prev_desc;
uint8_t *new_ptr = (uint8_t *) desc;
/* Copy first 4 words and BDESCs */
- rte_memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
- rte_memcpy(new_ptr + ACC_5GUL_OFFSET_0,
- prev_ptr + ACC_5GUL_OFFSET_0,
- ACC_5GUL_SIZE_1);
+ memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
+ memcpy(new_ptr + ACC_5GUL_OFFSET_0,
+ prev_ptr + ACC_5GUL_OFFSET_0, ACC_5GUL_SIZE_1);
desc->req.op_addr = prev_desc->req.op_addr;
/* Copy FCW */
- rte_memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
- prev_ptr + ACC_DESC_FCW_OFFSET,
- ACC_FCW_LD_BLEN);
+ memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
+ prev_ptr + ACC_DESC_FCW_OFFSET, ACC_FCW_LD_BLEN);
acc100_dma_desc_ld_update(op, &desc->req, input, h_output,
&in_offset, &h_out_offset,
&h_out_length, harq_layout);
@@ -3130,7 +3128,8 @@ enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
desc = acc_desc(q, total_enqueued_cbs);
desc->req.data_ptrs[0].address = q->ring_addr_iova + fcw_offset;
desc->req.data_ptrs[0].blen = ACC_FCW_LD_BLEN;
- rte_memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld, ACC_FCW_LD_BLEN);
+ memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
+ ACC_FCW_LD_BLEN);
ret = acc100_dma_desc_ld_fill(op, &desc->req, &input,
h_output, &in_offset, &h_out_offset,
&h_out_length,
@@ -4430,7 +4429,7 @@ acc100_configure(const char *dev_name, struct rte_acc_conf *conf)
struct acc_device *d = bbdev->data->dev_private;
/* Store configuration */
- rte_memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
+ memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
value = acc_reg_read(d, HwPfPcieGpexBridgeControl);
bool firstCfg = (value != ACC100_CFG_PCI_BRIDGE);
diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c
index 88b1104fab47..3e5376a12e39 100644
--- a/drivers/baseband/acc/rte_vrb_pmd.c
+++ b/drivers/baseband/acc/rte_vrb_pmd.c
@@ -2450,15 +2450,13 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
uint8_t *prev_ptr = (uint8_t *) prev_desc;
uint8_t *new_ptr = (uint8_t *) desc;
/* Copy first 4 words and BDESCs. */
- rte_memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
- rte_memcpy(new_ptr + ACC_5GUL_OFFSET_0,
- prev_ptr + ACC_5GUL_OFFSET_0,
- ACC_5GUL_SIZE_1);
+ memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
+ memcpy(new_ptr + ACC_5GUL_OFFSET_0,
+ prev_ptr + ACC_5GUL_OFFSET_0, ACC_5GUL_SIZE_1);
desc->req.op_addr = prev_desc->req.op_addr;
/* Copy FCW. */
- rte_memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
- prev_ptr + ACC_DESC_FCW_OFFSET,
- ACC_FCW_LD_BLEN);
+ memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
+ prev_ptr + ACC_DESC_FCW_OFFSET, ACC_FCW_LD_BLEN);
vrb_dma_desc_ld_update(op, &desc->req, input, h_output,
&in_offset, &h_out_offset,
&h_out_length, harq_layout);
@@ -2566,7 +2564,8 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
fcw_offset = (desc_idx << 8) + ACC_DESC_FCW_OFFSET;
desc->req.data_ptrs[0].address = q->ring_addr_iova + fcw_offset;
desc->req.data_ptrs[0].blen = ACC_FCW_LD_BLEN;
- rte_memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld, ACC_FCW_LD_BLEN);
+ memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
+ ACC_FCW_LD_BLEN);
desc->req.fcw_ld.tb_trailer_size = (c - r - 1) * trail_len;
ret = vrb_dma_desc_ld_fill(op, &desc->req, &input,
h_output, &in_offset, &h_out_offset,
@@ -3991,7 +3990,7 @@ enqueue_mldts_split_op(struct acc_queue *q, struct rte_bbdev_mldts_op *op,
if (symb == 0)
desc->req.cbs_in_tb = num_syms;
else
- rte_memcpy(&desc->req.fcw_mldts, fcw, ACC_FCW_MLDTS_BLEN);
+ memcpy(&desc->req.fcw_mldts, fcw, ACC_FCW_MLDTS_BLEN);
desc->req.data_ptrs[1].address = rte_pktmbuf_iova_offset(input_q, in_offset);
desc->req.data_ptrs[1].blen = q_size;
in_offset += q_size;
@@ -4337,7 +4336,7 @@ vrb1_configure(const char *dev_name, struct rte_acc_conf *conf)
struct acc_device *d = bbdev->data->dev_private;
/* Store configuration. */
- rte_memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
+ memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
/* Check we are already out of PG. */
status = acc_reg_read(d, VRB1_PfHiSectionPowerGatingAck);
@@ -4744,7 +4743,7 @@ vrb2_configure(const char *dev_name, struct rte_acc_conf *conf)
struct acc_device *d = bbdev->data->dev_private;
/* Store configuration. */
- rte_memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
+ memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
/* Explicitly releasing AXI as this may be stopped after PF FLR/BME. */
address = VRB2_PfDmaAxiControl;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 34/71] baseband/la12xx: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (32 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 33/71] baseband/acc: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 35/71] common/idpf: " Stephen Hemminger
` (38 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Gagandeep Singh, Hemant Agrawal
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/baseband/la12xx/bbdev_la12xx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c
index bb754a539580..23e2fdb81116 100644
--- a/drivers/baseband/la12xx/bbdev_la12xx.c
+++ b/drivers/baseband/la12xx/bbdev_la12xx.c
@@ -597,8 +597,8 @@ dequeue_single_op(struct bbdev_la12xx_q_priv *q_priv, void *dst)
op = q_priv->bbdev_op[ci];
- rte_memcpy(dst, q_priv->msg_ch_vaddr[ci],
- sizeof(struct bbdev_ipc_enqueue_op));
+ memcpy(dst, q_priv->msg_ch_vaddr[ci],
+ sizeof(struct bbdev_ipc_enqueue_op));
/* Move Consumer Index forward */
ci++;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 35/71] common/idpf: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (33 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 34/71] baseband/la12xx: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 36/71] common/qat: " Stephen Hemminger
` (37 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jingjing Wu
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/common/idpf/idpf_common_device.c | 4 ++--
drivers/common/idpf/idpf_common_virtchnl.c | 8 +++++---
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/common/idpf/idpf_common_device.c b/drivers/common/idpf/idpf_common_device.c
index cc4207a46e5e..2cb66371c4bd 100644
--- a/drivers/common/idpf/idpf_common_device.c
+++ b/drivers/common/idpf/idpf_common_device.c
@@ -459,8 +459,8 @@ idpf_vport_init(struct idpf_vport *vport,
vport->num_rx_q = vport_info->num_rx_q;
vport->num_rx_bufq = vport_info->num_rx_bufq;
vport->max_mtu = vport_info->max_mtu;
- rte_memcpy(vport->default_mac_addr,
- vport_info->default_mac_addr, ETH_ALEN);
+ memcpy(vport->default_mac_addr, vport_info->default_mac_addr,
+ ETH_ALEN);
vport->rss_algorithm = vport_info->rss_algorithm;
vport->rss_key_size = RTE_MIN(IDPF_RSS_KEY_LEN,
vport_info->rss_key_size);
diff --git a/drivers/common/idpf/idpf_common_virtchnl.c b/drivers/common/idpf/idpf_common_virtchnl.c
index 6455f640da25..96232c29d64f 100644
--- a/drivers/common/idpf/idpf_common_virtchnl.c
+++ b/drivers/common/idpf/idpf_common_virtchnl.c
@@ -294,7 +294,8 @@ idpf_vc_caps_get(struct idpf_adapter *adapter)
return err;
}
- rte_memcpy(&adapter->caps, args.out_buffer, sizeof(struct virtchnl2_get_capabilities));
+ memcpy(&adapter->caps, args.out_buffer,
+ sizeof(struct virtchnl2_get_capabilities));
return 0;
}
@@ -331,7 +332,8 @@ idpf_vc_vport_create(struct idpf_vport *vport,
return err;
}
- rte_memcpy(&(vport->vport_info.info), args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
+ memcpy(&(vport->vport_info.info), args.out_buffer,
+ IDPF_DFLT_MBX_BUF_SIZE);
return 0;
}
@@ -387,7 +389,7 @@ idpf_vc_queue_grps_add(struct idpf_vport *vport,
return err;
}
- rte_memcpy(p2p_queue_grps_out, args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
+ memcpy(p2p_queue_grps_out, args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
return 0;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 36/71] common/qat: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (34 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 35/71] common/idpf: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 37/71] compress/qat: " Stephen Hemminger
` (36 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Kai Ji
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/common/qat/qat_qp.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c
index f95dd33375a0..0c30c4d8c18d 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 =
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 37/71] compress/qat: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (35 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 36/71] common/qat: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 38/71] crypto/ccp: " Stephen Hemminger
` (35 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Kai Ji, Fan Zhang, Ashish Gupta
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/compress/qat/qat_comp.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c
index 559948a46a12..5bcbefe395bf 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",
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 38/71] crypto/ccp: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (36 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 37/71] compress/qat: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 39/71] crypto/cnxk: " Stephen Hemminger
` (34 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Sunil Uttarwar
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/crypto/ccp/ccp_crypto.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/crypto/ccp/ccp_crypto.c b/drivers/crypto/ccp/ccp_crypto.c
index 4b84b3303e18..4a70bc5d6e05 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;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 39/71] crypto/cnxk: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (37 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 38/71] crypto/ccp: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 40/71] crypto/dpaa_sec: " Stephen Hemminger
` (33 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Ankur Dwivedi, Anoob Joseph, Tejasree Kondoj
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +-
drivers/crypto/cnxk/cnxk_se.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
index 1dd1dbac9afc..a67af3ec35a1 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 c211884ddaea..e6c1e1586b9b 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 {
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 40/71] crypto/dpaa_sec: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (38 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 39/71] crypto/cnxk: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 41/71] crypto/ipsec_mb: " Stephen Hemminger
` (32 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Gagandeep Singh
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 44528eaf7f7a..3e7b78656bb4 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -676,7 +676,7 @@ dpaa_sec_dump(struct dpaa_sec_op_ctx *ctx, struct dpaa_sec_qp *qp)
}
cdb = &sess->cdb;
- rte_memcpy(&c_cdb, cdb, sizeof(struct sec_cdb));
+ memcpy(&c_cdb, cdb, sizeof(struct sec_cdb));
#ifdef RTE_LIB_SECURITY
printf("\nsession protocol type = %d\n", sess->proto_alg);
#endif
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 41/71] crypto/ipsec_mb: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (39 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 40/71] crypto/dpaa_sec: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 42/71] crypto/qat: " Stephen Hemminger
` (31 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Kai Ji, Pablo de Lara
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/ipsec_mb/pmd_snow3g.c b/drivers/crypto/ipsec_mb/pmd_snow3g.c
index a96779f05942..f3f519f2d451 100644
--- a/drivers/crypto/ipsec_mb/pmd_snow3g.c
+++ b/drivers/crypto/ipsec_mb/pmd_snow3g.c
@@ -291,8 +291,8 @@ process_snow3g_hash_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops,
/* Copy back digest from src to auth.digest.data */
if (digest_appended)
- rte_memcpy(ops[i]->sym->auth.digest.data,
- dst, SNOW3G_DIGEST_LENGTH);
+ memcpy(ops[i]->sym->auth.digest.data, dst,
+ SNOW3G_DIGEST_LENGTH);
}
processed_ops++;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 42/71] crypto/qat: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (40 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 41/71] crypto/ipsec_mb: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 43/71] crypto/scheduler: " Stephen Hemminger
` (30 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Kai Ji
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
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
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 43/71] crypto/scheduler: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (41 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 42/71] crypto/qat: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 44/71] event/cnxk: " Stephen Hemminger
` (29 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Kai Ji
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/crypto/scheduler/rte_cryptodev_scheduler.c | 6 +++---
drivers/crypto/scheduler/scheduler_failover.c | 12 ++++++------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
index 9a21edd32a9c..ed1833a7c61d 100644
--- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
+++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
@@ -79,7 +79,7 @@ sync_caps(struct rte_cryptodev_capabilities *caps,
/* remove a uncommon cap from the array */
for (j = i; j < sync_nb_caps - 1; j++)
- rte_memcpy(&caps[j], &caps[j+1], sizeof(*cap));
+ memcpy(&caps[j], &caps[j + 1], sizeof(*cap));
memset(&caps[sync_nb_caps - 1], 0, sizeof(*cap));
sync_nb_caps--;
@@ -216,8 +216,8 @@ sync_sec_caps(uint32_t worker_idx,
* caps, from the arrays
*/
for (j = i; j < nb_sec_caps - 1; j++) {
- rte_memcpy(&sec_caps[j], &sec_caps[j+1],
- sizeof(*sec_cap));
+ memcpy(&sec_caps[j], &sec_caps[j + 1],
+ sizeof(*sec_cap));
rte_memcpy(&sec_crypto_caps[j][0],
&sec_crypto_caps[j+1][0],
diff --git a/drivers/crypto/scheduler/scheduler_failover.c b/drivers/crypto/scheduler/scheduler_failover.c
index 52ff2ffbb7f6..e7c6d19d25b8 100644
--- a/drivers/crypto/scheduler/scheduler_failover.c
+++ b/drivers/crypto/scheduler/scheduler_failover.c
@@ -171,12 +171,12 @@ scheduler_start(struct rte_cryptodev *dev)
sched_ctx->workers[PRIMARY_WORKER_IDX].qp_id = i;
sched_ctx->workers[SECONDARY_WORKER_IDX].qp_id = i;
- rte_memcpy(&qp_ctx->primary_worker,
- &sched_ctx->workers[PRIMARY_WORKER_IDX],
- sizeof(struct scheduler_worker));
- rte_memcpy(&qp_ctx->secondary_worker,
- &sched_ctx->workers[SECONDARY_WORKER_IDX],
- sizeof(struct scheduler_worker));
+ memcpy(&qp_ctx->primary_worker,
+ &sched_ctx->workers[PRIMARY_WORKER_IDX],
+ sizeof(struct scheduler_worker));
+ memcpy(&qp_ctx->secondary_worker,
+ &sched_ctx->workers[SECONDARY_WORKER_IDX],
+ sizeof(struct scheduler_worker));
}
return 0;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 44/71] event/cnxk: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (42 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 43/71] crypto/scheduler: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 45/71] event/dlb2: " Stephen Hemminger
` (28 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Pavan Nikhilesh, Shijith Thotton
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/event/cnxk/cnxk_tim_evdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/event/cnxk/cnxk_tim_evdev.c b/drivers/event/cnxk/cnxk_tim_evdev.c
index 6d59fdf90983..2027c4644c5d 100644
--- a/drivers/event/cnxk/cnxk_tim_evdev.c
+++ b/drivers/event/cnxk/cnxk_tim_evdev.c
@@ -115,8 +115,8 @@ cnxk_tim_ring_info_get(const struct rte_event_timer_adapter *adptr,
adptr_info->min_resolution_ns = tim_ring->ena_periodic ?
tim_ring->max_tout :
tim_ring->tck_nsec;
- rte_memcpy(&adptr_info->conf, &adptr->data->conf,
- sizeof(struct rte_event_timer_adapter_conf));
+ memcpy(&adptr_info->conf, &adptr->data->conf,
+ sizeof(struct rte_event_timer_adapter_conf));
}
static int
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 45/71] event/dlb2: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (43 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 44/71] event/cnxk: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-05 17:07 ` Sevincer, Abdullah
2024-03-06 15:24 ` Sevincer, Abdullah
2024-03-01 17:15 ` [PATCH v2 46/71] event/dpaa2: " Stephen Hemminger
` (27 subsequent siblings)
72 siblings, 2 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Abdullah Sevincer
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/event/dlb2/dlb2.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index 271bbce54a3a..5c1cd35dbda6 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -225,7 +225,7 @@ dlb2_hw_query_resources(struct dlb2_eventdev *dlb2)
handle->info.hw_rsrc_max.reorder_window_size =
dlb2->hw_rsrc_query_results.num_hist_list_entries;
- rte_memcpy(dlb2_info, &handle->info.hw_rsrc_max, sizeof(*dlb2_info));
+ memcpy(dlb2_info, &handle->info.hw_rsrc_max, sizeof(*dlb2_info));
return 0;
}
@@ -1671,7 +1671,7 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,
qm_port->issued_releases = 0;
/* Save config message too. */
- rte_memcpy(&qm_port->cfg.ldb, &cfg, sizeof(qm_port->cfg.ldb));
+ memcpy(&qm_port->cfg.ldb, &cfg, sizeof(qm_port->cfg.ldb));
/* update state */
qm_port->state = PORT_STARTED; /* enabled at create time */
@@ -1872,7 +1872,7 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2,
qm_port->issued_releases = 0;
/* Save config message too. */
- rte_memcpy(&qm_port->cfg.dir, &cfg, sizeof(qm_port->cfg.dir));
+ memcpy(&qm_port->cfg.dir, &cfg, sizeof(qm_port->cfg.dir));
/* update state */
qm_port->state = PORT_STARTED; /* enabled at create time */
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 46/71] event/dpaa2: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (44 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 45/71] event/dlb2: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 47/71] event/octeontx: " Stephen Hemminger
` (26 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/event/dpaa2/dpaa2_eventdev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 1273455673ad..0331bb6fb91d 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -159,7 +159,7 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[],
"Unable to allocate event object");
goto send_partial;
}
- rte_memcpy(ev_temp, event, sizeof(struct rte_event));
+ memcpy(ev_temp, event, sizeof(struct rte_event));
DPAA2_SET_FD_ADDR((&fd_arr[loop]), (size_t)ev_temp);
DPAA2_SET_FD_LEN((&fd_arr[loop]),
sizeof(struct rte_event));
@@ -230,7 +230,7 @@ static void dpaa2_eventdev_process_parallel(struct qbman_swp *swp,
RTE_SET_USED(rxq);
- rte_memcpy(ev, ev_temp, sizeof(struct rte_event));
+ memcpy(ev, ev_temp, sizeof(struct rte_event));
rte_free(ev_temp);
qbman_swp_dqrr_consume(swp, dq);
@@ -249,7 +249,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
RTE_SET_USED(swp);
RTE_SET_USED(rxq);
- rte_memcpy(ev, ev_temp, sizeof(struct rte_event));
+ memcpy(ev, ev_temp, sizeof(struct rte_event));
rte_free(ev_temp);
*dpaa2_seqn(ev->mbuf) = dqrr_index + 1;
DPAA2_PER_LCORE_DQRR_SIZE++;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 47/71] event/octeontx: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (45 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 46/71] event/dpaa2: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 48/71] mempool/dpaa: " Stephen Hemminger
` (25 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Pavan Nikhilesh, Jerin Jacob
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/event/octeontx/timvf_evdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c
index 090b3ed18378..6409d6d1615b 100644
--- a/drivers/event/octeontx/timvf_evdev.c
+++ b/drivers/event/octeontx/timvf_evdev.c
@@ -42,8 +42,8 @@ timvf_ring_info_get(const struct rte_event_timer_adapter *adptr,
struct timvf_ring *timr = adptr->data->adapter_priv;
adptr_info->max_tmo_ns = timr->max_tout;
adptr_info->min_resolution_ns = timr->tck_nsec;
- rte_memcpy(&adptr_info->conf, &adptr->data->conf,
- sizeof(struct rte_event_timer_adapter_conf));
+ memcpy(&adptr_info->conf, &adptr->data->conf,
+ sizeof(struct rte_event_timer_adapter_conf));
}
static int
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 48/71] mempool/dpaa: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (46 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 47/71] event/octeontx: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 49/71] mempool/dpaa2: " Stephen Hemminger
` (24 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/mempool/dpaa/dpaa_mempool.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c
index 0b484b3d9c7d..f72b51b47271 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.c
+++ b/drivers/mempool/dpaa/dpaa_mempool.c
@@ -115,8 +115,8 @@ dpaa_mbuf_create_pool(struct rte_mempool *mp)
return -ENOMEM;
}
- rte_memcpy(bp_info, (void *)&rte_dpaa_bpid_info[bpid],
- sizeof(struct dpaa_bp_info));
+ memcpy(bp_info, (void *)&rte_dpaa_bpid_info[bpid],
+ sizeof(struct dpaa_bp_info));
mp->pool_data = (void *)bp_info;
DPAA_MEMPOOL_INFO("BMAN pool created for bpid =%d", bpid);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 49/71] mempool/dpaa2: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (47 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 48/71] mempool/dpaa: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 50/71] ml/cnxk: " Stephen Hemminger
` (23 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 4c9245cb814c..8899c0f8e683 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -125,8 +125,8 @@ rte_hw_mbuf_create_pool(struct rte_mempool *mp)
rte_dpaa2_bpid_info[bpid].bp_list = bp_list;
rte_dpaa2_bpid_info[bpid].bpid = bpid;
- rte_memcpy(bp_info, (void *)&rte_dpaa2_bpid_info[bpid],
- sizeof(struct dpaa2_bp_info));
+ memcpy(bp_info, (void *)&rte_dpaa2_bpid_info[bpid],
+ sizeof(struct dpaa2_bp_info));
mp->pool_data = (void *)bp_info;
DPAA2_MEMPOOL_DEBUG("BP List created for bpid =%d", dpbp_attr.bpid);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 50/71] ml/cnxk: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (48 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 49/71] mempool/dpaa2: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 51/71] net/af_xdp: " Stephen Hemminger
` (22 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Srikanth Yalavarthi
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/ml/cnxk/cn10k_ml_model.c | 8 +++++---
drivers/ml/cnxk/cn10k_ml_ops.c | 11 +++++++----
drivers/ml/cnxk/cnxk_ml_ops.c | 2 +-
drivers/ml/cnxk/mvtvm_ml_model.c | 8 +++++---
drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +++++---
5 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/drivers/ml/cnxk/cn10k_ml_model.c b/drivers/ml/cnxk/cn10k_ml_model.c
index 0325cd54f1f0..4e39a584fa82 100644
--- a/drivers/ml/cnxk/cn10k_ml_model.c
+++ b/drivers/ml/cnxk/cn10k_ml_model.c
@@ -560,7 +560,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]);
@@ -579,7 +579,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;
@@ -590,7 +591,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 834e55e88e9b..e53ada7b1ce4 100644
--- a/drivers/ml/cnxk/cn10k_ml_ops.c
+++ b/drivers/ml/cnxk/cn10k_ml_ops.c
@@ -668,11 +668,13 @@ 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);
/* Set layer name */
- rte_memcpy(layer->name, layer->glow.metadata.model.name, MRVL_ML_MODEL_NAME_LEN);
+ memcpy(layer->name, layer->glow.metadata.model.name,
+ MRVL_ML_MODEL_NAME_LEN);
/* Enable support for batch_size of 256 */
if (layer->glow.metadata.model.batch_size == 0)
@@ -748,11 +750,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/cnxk_ml_ops.c b/drivers/ml/cnxk/cnxk_ml_ops.c
index 971362b24202..f9d0f50e1fc4 100644
--- a/drivers/ml/cnxk/cnxk_ml_ops.c
+++ b/drivers/ml/cnxk/cnxk_ml_ops.c
@@ -1400,7 +1400,7 @@ cnxk_ml_model_info_get(struct rte_ml_dev *dev, uint16_t model_id,
}
info = (struct rte_ml_model_info *)model->info;
- rte_memcpy(model_info, info, sizeof(struct rte_ml_model_info));
+ memcpy(model_info, info, sizeof(struct rte_ml_model_info));
model_info->input_info = info->input_info;
model_info->output_info = info->output_info;
diff --git a/drivers/ml/cnxk/mvtvm_ml_model.c b/drivers/ml/cnxk/mvtvm_ml_model.c
index e3234ae44226..99b4774a2e11 100644
--- a/drivers/ml/cnxk/mvtvm_ml_model.c
+++ b/drivers/ml/cnxk/mvtvm_ml_model.c
@@ -310,7 +310,7 @@ mvtvm_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo
goto tvm_mrvl_model;
metadata = &model->mvtvm.metadata;
- rte_memcpy(info->name, metadata->model.name, TVMDP_NAME_STRLEN);
+ memcpy(info->name, metadata->model.name, TVMDP_NAME_STRLEN);
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]);
@@ -327,7 +327,8 @@ mvtvm_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, metadata->input[i].name, MRVL_ML_INPUT_NAME_LEN);
+ memcpy(input[i].name, metadata->input[i].name,
+ MRVL_ML_INPUT_NAME_LEN);
input[i].nb_dims = metadata->input[i].ndim;
input[i].shape = &model->mvtvm.info.input[i].shape[0];
input[i].type = model->mvtvm.info.input[i].qtype;
@@ -338,7 +339,8 @@ mvtvm_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, metadata->output[i].name, MRVL_ML_OUTPUT_NAME_LEN);
+ memcpy(output[i].name, metadata->output[i].name,
+ MRVL_ML_OUTPUT_NAME_LEN);
output[i].nb_dims = metadata->output[i].ndim;
output[i].shape = &model->mvtvm.info.output[i].shape[0];
output[i].type = model->mvtvm.info.output[i].qtype;
diff --git a/drivers/ml/cnxk/mvtvm_ml_ops.c b/drivers/ml/cnxk/mvtvm_ml_ops.c
index e825c3fb23e6..fca7e0c3c0bc 100644
--- a/drivers/ml/cnxk/mvtvm_ml_ops.c
+++ b/drivers/ml/cnxk/mvtvm_ml_ops.c
@@ -194,7 +194,7 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *
/* Copy mod.so */
model->mvtvm.object.so.addr = mz->addr;
model->mvtvm.object.so.size = object[0].size;
- rte_memcpy(model->mvtvm.object.so.name, object[0].name, TVMDP_NAME_STRLEN);
+ memcpy(model->mvtvm.object.so.name, object[0].name, TVMDP_NAME_STRLEN);
rte_memcpy(model->mvtvm.object.so.addr, object[0].buffer, object[0].size);
rte_free(object[0].buffer);
@@ -203,7 +203,8 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *
RTE_PTR_ADD(model->mvtvm.object.so.addr,
RTE_ALIGN_CEIL(model->mvtvm.object.so.size, RTE_CACHE_LINE_MIN_SIZE));
model->mvtvm.object.json.size = object[1].size;
- rte_memcpy(model->mvtvm.object.json.name, object[1].name, TVMDP_NAME_STRLEN);
+ memcpy(model->mvtvm.object.json.name, object[1].name,
+ TVMDP_NAME_STRLEN);
rte_memcpy(model->mvtvm.object.json.addr, object[1].buffer, object[1].size);
rte_free(object[1].buffer);
@@ -212,7 +213,8 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *
RTE_PTR_ADD(model->mvtvm.object.json.addr,
RTE_ALIGN_CEIL(model->mvtvm.object.json.size, RTE_CACHE_LINE_MIN_SIZE));
model->mvtvm.object.params.size = object[2].size;
- rte_memcpy(model->mvtvm.object.params.name, object[2].name, TVMDP_NAME_STRLEN);
+ memcpy(model->mvtvm.object.params.name, object[2].name,
+ TVMDP_NAME_STRLEN);
rte_memcpy(model->mvtvm.object.params.addr, object[2].buffer, object[2].size);
rte_free(object[2].buffer);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 51/71] net/af_xdp: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (49 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 50/71] ml/cnxk: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 52/71] net/avp: " Stephen Hemminger
` (21 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Ciara Loftus
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 2d151e45c7cd..8efc0e707a78 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -2094,7 +2094,7 @@ get_iface_info(const char *if_name,
if (ioctl(sock, SIOCGIFHWADDR, &ifr))
goto error;
- rte_memcpy(eth_addr, ifr.ifr_hwaddr.sa_data, RTE_ETHER_ADDR_LEN);
+ memcpy(eth_addr, ifr.ifr_hwaddr.sa_data, RTE_ETHER_ADDR_LEN);
close(sock);
return 0;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 52/71] net/avp: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (50 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 51/71] net/af_xdp: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 53/71] net/axgbe: " Stephen Hemminger
` (20 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Steven Webster, Matt Peters
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/avp/avp_ethdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index 53d9e38c939b..9bd05301720e 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -248,7 +248,7 @@ avp_dev_process_request(struct avp_dev *avp, struct rte_avp_request *request)
while (avp_fifo_get(avp->resp_q, (void **)&resp_addr, 1))
PMD_DRV_LOG(DEBUG, "Discarding stale response\n");
- rte_memcpy(avp->sync_addr, request, sizeof(*request));
+ memcpy(avp->sync_addr, request, sizeof(*request));
count = avp_fifo_put(avp->req_q, &avp->host_sync_addr, 1);
if (count < 1) {
PMD_DRV_LOG(ERR, "Cannot send request %u to host\n",
@@ -285,7 +285,7 @@ avp_dev_process_request(struct avp_dev *avp, struct rte_avp_request *request)
}
/* copy to user buffer */
- rte_memcpy(request, avp->sync_addr, sizeof(*request));
+ memcpy(request, avp->sync_addr, sizeof(*request));
ret = 0;
PMD_DRV_LOG(DEBUG, "Result %d received for request %u\n",
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 53/71] net/axgbe: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (51 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 52/71] net/avp: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 54/71] net/bnx2x: " Stephen Hemminger
` (19 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Selwin Sebastian
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/axgbe/axgbe_ethdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c
index dd681f15a01e..7ac30106e335 100644
--- a/drivers/net/axgbe/axgbe_ethdev.c
+++ b/drivers/net/axgbe/axgbe_ethdev.c
@@ -594,7 +594,7 @@ axgbe_dev_rss_hash_update(struct rte_eth_dev *dev,
if (rss_conf->rss_key != NULL &&
rss_conf->rss_key_len == AXGBE_RSS_HASH_KEY_SIZE) {
- rte_memcpy(pdata->rss_key, rss_conf->rss_key,
+ memcpy(pdata->rss_key, rss_conf->rss_key,
AXGBE_RSS_HASH_KEY_SIZE);
/* Program the hash key */
ret = axgbe_write_rss_hash_key(pdata);
@@ -637,7 +637,7 @@ axgbe_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
if (rss_conf->rss_key != NULL &&
rss_conf->rss_key_len >= AXGBE_RSS_HASH_KEY_SIZE) {
- rte_memcpy(rss_conf->rss_key, pdata->rss_key,
+ memcpy(rss_conf->rss_key, pdata->rss_key,
AXGBE_RSS_HASH_KEY_SIZE);
}
rss_conf->rss_key_len = AXGBE_RSS_HASH_KEY_SIZE;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 54/71] net/bnx2x: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (52 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 53/71] net/axgbe: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 55/71] net/bnxt: " Stephen Hemminger
` (18 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Julien Aube
Automatically generated by devtools/cocci/rte_memcpy.cocci.
Note: the indentation in this file does not follow the coding
standard of DPDK, so it will get some checkpatch warnings.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/bnx2x/bnx2x.c | 32 +++++++++++++++-----------------
drivers/net/bnx2x/bnx2x_stats.c | 10 +++++-----
drivers/net/bnx2x/bnx2x_vfpf.c | 19 ++++++++++---------
3 files changed, 30 insertions(+), 31 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 597ee4335977..16a9ff7f8c06 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -2242,18 +2242,18 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0)
tx_parse_bd->parsing_data =
(mac_type << ETH_TX_PARSE_BD_E2_ETH_ADDR_TYPE_SHIFT);
- rte_memcpy(&tx_parse_bd->data.mac_addr.dst_hi,
- &eh->dst_addr.addr_bytes[0], 2);
- rte_memcpy(&tx_parse_bd->data.mac_addr.dst_mid,
- &eh->dst_addr.addr_bytes[2], 2);
- rte_memcpy(&tx_parse_bd->data.mac_addr.dst_lo,
- &eh->dst_addr.addr_bytes[4], 2);
- rte_memcpy(&tx_parse_bd->data.mac_addr.src_hi,
- &eh->src_addr.addr_bytes[0], 2);
- rte_memcpy(&tx_parse_bd->data.mac_addr.src_mid,
- &eh->src_addr.addr_bytes[2], 2);
- rte_memcpy(&tx_parse_bd->data.mac_addr.src_lo,
- &eh->src_addr.addr_bytes[4], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.dst_hi,
+ &eh->dst_addr.addr_bytes[0], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.dst_mid,
+ &eh->dst_addr.addr_bytes[2], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.dst_lo,
+ &eh->dst_addr.addr_bytes[4], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.src_hi,
+ &eh->src_addr.addr_bytes[0], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.src_mid,
+ &eh->src_addr.addr_bytes[2], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.src_lo,
+ &eh->src_addr.addr_bytes[4], 2);
tx_parse_bd->data.mac_addr.dst_hi =
rte_cpu_to_be_16(tx_parse_bd->data.mac_addr.dst_hi);
@@ -6675,8 +6675,7 @@ bnx2x_config_rss_pf(struct bnx2x_softc *sc, struct ecore_rss_config_obj *rss_obj
/* Hash bits */
params.rss_result_mask = MULTI_MASK;
- rte_memcpy(params.ind_table, rss_obj->ind_table,
- sizeof(params.ind_table));
+ memcpy(params.ind_table, rss_obj->ind_table, sizeof(params.ind_table));
if (config_hash) {
/* RSS keys */
@@ -6742,8 +6741,7 @@ bnx2x_set_mac_one(struct bnx2x_softc *sc, uint8_t * mac,
/* fill a user request section if needed */
if (!rte_bit_relaxed_get32(RAMROD_CONT, ramrod_flags)) {
- rte_memcpy(ramrod_param.user_req.u.mac.mac, mac,
- ETH_ALEN);
+ memcpy(ramrod_param.user_req.u.mac.mac, mac, ETH_ALEN);
rte_bit_relaxed_set32(mac_type,
&ramrod_param.user_req.vlan_mac_flags);
@@ -6958,7 +6956,7 @@ static void bnx2x_link_report_locked(struct bnx2x_softc *sc)
ELINK_DEBUG_P1(sc, "link status change count = %x", sc->link_cnt);
/* report new link params and remember the state for the next time */
- rte_memcpy(&sc->last_reported_link, &cur_data, sizeof(cur_data));
+ memcpy(&sc->last_reported_link, &cur_data, sizeof(cur_data));
if (rte_bit_relaxed_get32(BNX2X_LINK_REPORT_LINK_DOWN,
&cur_data.link_report_flags)) {
diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_stats.c
index c07b01510a06..23c74c21c635 100644
--- a/drivers/net/bnx2x/bnx2x_stats.c
+++ b/drivers/net/bnx2x/bnx2x_stats.c
@@ -114,8 +114,8 @@ bnx2x_hw_stats_post(struct bnx2x_softc *sc)
/* Update MCP's statistics if possible */
if (sc->func_stx) {
- rte_memcpy(BNX2X_SP(sc, func_stats), &sc->func_stats,
- sizeof(sc->func_stats));
+ memcpy(BNX2X_SP(sc, func_stats), &sc->func_stats,
+ sizeof(sc->func_stats));
}
/* loader */
@@ -817,10 +817,10 @@ bnx2x_hw_stats_update(struct bnx2x_softc *sc)
etherstatspktsover1522octets);
}
- rte_memcpy(old, new, sizeof(struct nig_stats));
+ memcpy(old, new, sizeof(struct nig_stats));
- rte_memcpy(&(estats->rx_stat_ifhcinbadoctets_hi), &(pstats->mac_stx[1]),
- sizeof(struct mac_stx));
+ memcpy(&(estats->rx_stat_ifhcinbadoctets_hi), &(pstats->mac_stx[1]),
+ sizeof(struct mac_stx));
estats->brb_drop_hi = pstats->brb_drop_hi;
estats->brb_drop_lo = pstats->brb_drop_lo;
diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c
index 63953c2979ce..678c9e7d7d7c 100644
--- a/drivers/net/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/bnx2x/bnx2x_vfpf.c
@@ -52,9 +52,9 @@ bnx2x_check_bull(struct bnx2x_softc *sc)
/* check the mac address and VLAN and allocate memory if valid */
if (valid_bitmap & (1 << MAC_ADDR_VALID) && memcmp(bull->mac, sc->old_bulletin.mac, ETH_ALEN))
- rte_memcpy(&sc->link_params.mac_addr, bull->mac, ETH_ALEN);
+ memcpy(&sc->link_params.mac_addr, bull->mac, ETH_ALEN);
if (valid_bitmap & (1 << VLAN_VALID))
- rte_memcpy(&bull->vlan, &sc->old_bulletin.vlan, RTE_VLAN_HLEN);
+ memcpy(&bull->vlan, &sc->old_bulletin.vlan, RTE_VLAN_HLEN);
sc->old_bulletin = *bull;
@@ -569,7 +569,7 @@ bnx2x_vf_set_mac(struct bnx2x_softc *sc, int set)
bnx2x_check_bull(sc);
- rte_memcpy(query->filters[0].mac, sc->link_params.mac_addr, ETH_ALEN);
+ memcpy(query->filters[0].mac, sc->link_params.mac_addr, ETH_ALEN);
bnx2x_add_tlv(sc, query, query->first_tlv.tl.length,
BNX2X_VF_TLV_LIST_END,
@@ -583,10 +583,10 @@ bnx2x_vf_set_mac(struct bnx2x_softc *sc, int set)
while (BNX2X_VF_STATUS_FAILURE == reply->status &&
bnx2x_check_bull(sc)) {
/* A new mac was configured by PF for us */
- rte_memcpy(sc->link_params.mac_addr, sc->pf2vf_bulletin->mac,
- ETH_ALEN);
- rte_memcpy(query->filters[0].mac, sc->pf2vf_bulletin->mac,
- ETH_ALEN);
+ memcpy(sc->link_params.mac_addr, sc->pf2vf_bulletin->mac,
+ ETH_ALEN);
+ memcpy(query->filters[0].mac, sc->pf2vf_bulletin->mac,
+ ETH_ALEN);
rc = bnx2x_do_req4pf(sc, sc->vf2pf_mbox_mapping.paddr);
if (rc)
@@ -622,10 +622,11 @@ bnx2x_vf_config_rss(struct bnx2x_softc *sc,
BNX2X_VF_TLV_LIST_END,
sizeof(struct channel_list_end_tlv));
- rte_memcpy(query->rss_key, params->rss_key, sizeof(params->rss_key));
+ memcpy(query->rss_key, params->rss_key, sizeof(params->rss_key));
query->rss_key_size = T_ETH_RSS_KEY;
- rte_memcpy(query->ind_table, params->ind_table, T_ETH_INDIRECTION_TABLE_SIZE);
+ memcpy(query->ind_table, params->ind_table,
+ T_ETH_INDIRECTION_TABLE_SIZE);
query->ind_table_size = T_ETH_INDIRECTION_TABLE_SIZE;
query->rss_result_mask = params->rss_result_mask;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 55/71] net/bnxt: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (53 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 54/71] net/bnx2x: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 56/71] net/bonding: " Stephen Hemminger
` (17 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Ajit Khaparde, Somnath Kotur
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/bnxt/bnxt_flow.c | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index f25bc6ff78c7..6466aa394af1 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -233,8 +233,9 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
"DMAC is invalid!\n");
return -rte_errno;
}
- rte_memcpy(filter->dst_macaddr,
- ð_spec->hdr.dst_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(filter->dst_macaddr,
+ ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
en |= use_ntuple ?
NTUPLE_FLTR_ALLOC_INPUT_EN_DST_MACADDR :
EM_FLOW_ALLOC_INPUT_EN_DST_MACADDR;
@@ -257,8 +258,9 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
"SMAC is invalid!\n");
return -rte_errno;
}
- rte_memcpy(filter->src_macaddr,
- ð_spec->hdr.src_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(filter->src_macaddr,
+ ð_spec->hdr.src_addr,
+ RTE_ETHER_ADDR_LEN);
en |= use_ntuple ?
NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_MACADDR :
EM_FLOW_ALLOC_INPUT_EN_SRC_MACADDR;
@@ -423,23 +425,23 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
en |= EM_FLOW_ALLOC_INPUT_EN_SRC_IPADDR |
EM_FLOW_ALLOC_INPUT_EN_DST_IPADDR;
- rte_memcpy(filter->src_ipaddr,
- ipv6_spec->hdr.src_addr, 16);
- rte_memcpy(filter->dst_ipaddr,
- ipv6_spec->hdr.dst_addr, 16);
+ memcpy(filter->src_ipaddr, ipv6_spec->hdr.src_addr,
+ 16);
+ memcpy(filter->dst_ipaddr, ipv6_spec->hdr.dst_addr,
+ 16);
if (!bnxt_check_zero_bytes(ipv6_mask->hdr.src_addr,
16)) {
- rte_memcpy(filter->src_ipaddr_mask,
- ipv6_mask->hdr.src_addr, 16);
+ memcpy(filter->src_ipaddr_mask,
+ ipv6_mask->hdr.src_addr, 16);
en |= !use_ntuple ? 0 :
NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR_MASK;
}
if (!bnxt_check_zero_bytes(ipv6_mask->hdr.dst_addr,
16)) {
- rte_memcpy(filter->dst_ipaddr_mask,
- ipv6_mask->hdr.dst_addr, 16);
+ memcpy(filter->dst_ipaddr_mask,
+ ipv6_mask->hdr.dst_addr, 16);
en |= !use_ntuple ? 0 :
NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR_MASK;
}
@@ -591,8 +593,8 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
return -rte_errno;
}
- rte_memcpy(((uint8_t *)&tenant_id_be + 1),
- vxlan_spec->hdr.vni, 3);
+ memcpy(((uint8_t *)&tenant_id_be + 1),
+ vxlan_spec->hdr.vni, 3);
filter->vni =
rte_be_to_cpu_32(tenant_id_be);
filter->tunnel_type =
@@ -645,8 +647,8 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
"Invalid TNI mask");
return -rte_errno;
}
- rte_memcpy(((uint8_t *)&tenant_id_be + 1),
- nvgre_spec->tni, 3);
+ memcpy(((uint8_t *)&tenant_id_be + 1),
+ nvgre_spec->tni, 3);
filter->vni =
rte_be_to_cpu_32(tenant_id_be);
filter->tunnel_type =
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 56/71] net/bonding: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (54 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 55/71] net/bnxt: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 57/71] net/cnxk: " Stephen Hemminger
` (16 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Chas Williams, Min Hu (Connor)
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/bonding/rte_eth_bond_8023ad.c | 4 ++--
drivers/net/bonding/rte_eth_bond_flow.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 79f1b3f1a0f2..8ddf5dc80aff 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -1539,10 +1539,10 @@ rte_eth_bond_8023ad_member_info(uint16_t port_id, uint16_t member_id,
info->selected = port->selected;
info->actor_state = port->actor_state;
- rte_memcpy(&info->actor, &port->actor, sizeof(port->actor));
+ memcpy(&info->actor, &port->actor, sizeof(port->actor));
info->partner_state = port->partner_state;
- rte_memcpy(&info->partner, &port->partner, sizeof(port->partner));
+ memcpy(&info->partner, &port->partner, sizeof(port->partner));
info->agg_port_id = port->aggregator_port_id;
return 0;
diff --git a/drivers/net/bonding/rte_eth_bond_flow.c b/drivers/net/bonding/rte_eth_bond_flow.c
index 5d0be5caf54b..bb9d347e2be4 100644
--- a/drivers/net/bonding/rte_eth_bond_flow.c
+++ b/drivers/net/bonding/rte_eth_bond_flow.c
@@ -182,7 +182,7 @@ bond_flow_query_count(struct rte_eth_dev *dev, struct rte_flow *flow,
count->hits = 0;
count->bytes_set = 0;
count->hits_set = 0;
- rte_memcpy(&member_count, count, sizeof(member_count));
+ memcpy(&member_count, count, sizeof(member_count));
for (i = 0; i < internals->member_count; i++) {
ret = rte_flow_query(internals->members[i].port_id,
flow->flows[i], action,
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 57/71] net/cnxk: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (55 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 56/71] net/bonding: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 58/71] net/cpfl: " Stephen Hemminger
` (15 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Nithin Dabilpuram, Kiran Kumar K,
Sunil Kumar Kori, Satha Rao
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/cnxk/cnxk_ethdev_ops.c | 2 +-
drivers/net/cnxk/cnxk_tm.c | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c
index 5de2919047c1..ee407b177ec0 100644
--- a/drivers/net/cnxk/cnxk_ethdev_ops.c
+++ b/drivers/net/cnxk/cnxk_ethdev_ops.c
@@ -451,7 +451,7 @@ cnxk_nix_mac_addr_set(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr)
}
/* Update mac address to cnxk ethernet device */
- rte_memcpy(dev->mac_addr, addr->addr_bytes, RTE_ETHER_ADDR_LEN);
+ memcpy(dev->mac_addr, addr->addr_bytes, RTE_ETHER_ADDR_LEN);
exit:
return rc;
diff --git a/drivers/net/cnxk/cnxk_tm.c b/drivers/net/cnxk/cnxk_tm.c
index c799193cb89b..5c8b0997ca7c 100644
--- a/drivers/net/cnxk/cnxk_tm.c
+++ b/drivers/net/cnxk/cnxk_tm.c
@@ -300,8 +300,7 @@ cnxk_nix_tm_shaper_profile_add(struct rte_eth_dev *eth_dev, uint32_t id,
profile->profile.pkt_len_adj = params->pkt_length_adjust;
profile->profile.pkt_mode = params->packet_mode;
profile->profile.free_fn = rte_free;
- rte_memcpy(&profile->params, params,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&profile->params, params, sizeof(struct rte_tm_shaper_params));
rc = roc_nix_tm_shaper_profile_add(nix, &profile->profile);
@@ -373,7 +372,7 @@ cnxk_nix_tm_node_add(struct rte_eth_dev *eth_dev, uint32_t node_id,
if (!node)
return -ENOMEM;
- rte_memcpy(&node->params, params, sizeof(struct rte_tm_node_params));
+ memcpy(&node->params, params, sizeof(struct rte_tm_node_params));
node->nix_node.id = node_id;
node->nix_node.parent_id = parent_node_id;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 58/71] net/cpfl: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (56 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 57/71] net/cnxk: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 59/71] net/cxgbe: " Stephen Hemminger
` (14 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Yuying Zhang
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/cpfl/cpfl_ethdev.c | 3 ++-
drivers/net/cpfl/cpfl_vchnl.c | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c
index ef19aa1b6a96..1037aec68d2d 100644
--- a/drivers/net/cpfl/cpfl_ethdev.c
+++ b/drivers/net/cpfl/cpfl_ethdev.c
@@ -2292,7 +2292,8 @@ cpfl_adapter_ext_init(struct rte_pci_device *pci_dev, struct cpfl_adapter_ext *a
strncpy(adapter->name, pci_dev->device.name, PCI_PRI_STR_SIZE);
- rte_memcpy(&base->caps, &req_caps, sizeof(struct virtchnl2_get_capabilities));
+ memcpy(&base->caps, &req_caps,
+ sizeof(struct virtchnl2_get_capabilities));
ret = idpf_adapter_init(base);
if (ret != 0) {
diff --git a/drivers/net/cpfl/cpfl_vchnl.c b/drivers/net/cpfl/cpfl_vchnl.c
index 7d277a0e8e83..e914014d8a9b 100644
--- a/drivers/net/cpfl/cpfl_vchnl.c
+++ b/drivers/net/cpfl/cpfl_vchnl.c
@@ -32,7 +32,7 @@ cpfl_cc_vport_list_get(struct cpfl_adapter_ext *adapter,
return err;
}
- rte_memcpy(response, args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
+ memcpy(response, args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
return 0;
}
@@ -66,7 +66,7 @@ cpfl_cc_vport_info_get(struct cpfl_adapter_ext *adapter,
return err;
}
- rte_memcpy(response, args.out_buffer, sizeof(*response));
+ memcpy(response, args.out_buffer, sizeof(*response));
return 0;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 59/71] net/cxgbe: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (57 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 58/71] net/cpfl: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 60/71] net/dpaa2: " Stephen Hemminger
` (13 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Rahul Lakkireddy
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/cxgbe/clip_tbl.c | 2 +-
drivers/net/cxgbe/cxgbe_filter.c | 8 ++++----
drivers/net/cxgbe/l2t.c | 4 ++--
drivers/net/cxgbe/smt.c | 20 +++++++++-----------
4 files changed, 16 insertions(+), 18 deletions(-)
diff --git a/drivers/net/cxgbe/clip_tbl.c b/drivers/net/cxgbe/clip_tbl.c
index b709e26f6aa9..d30fa6425f28 100644
--- a/drivers/net/cxgbe/clip_tbl.c
+++ b/drivers/net/cxgbe/clip_tbl.c
@@ -115,7 +115,7 @@ static struct clip_entry *t4_clip_alloc(struct rte_eth_dev *dev,
if (ce) {
t4_os_lock(&ce->lock);
if (__atomic_load_n(&ce->refcnt, __ATOMIC_RELAXED) == 0) {
- rte_memcpy(ce->addr, lip, sizeof(ce->addr));
+ memcpy(ce->addr, lip, sizeof(ce->addr));
if (v6) {
ce->type = FILTER_TYPE_IPV6;
__atomic_store_n(&ce->refcnt, 1,
diff --git a/drivers/net/cxgbe/cxgbe_filter.c b/drivers/net/cxgbe/cxgbe_filter.c
index 5a7efe7a733e..3d1d087ec215 100644
--- a/drivers/net/cxgbe/cxgbe_filter.c
+++ b/drivers/net/cxgbe/cxgbe_filter.c
@@ -851,10 +851,10 @@ static int set_filter_wr(struct rte_eth_dev *dev, unsigned int fidx)
fwr->ivlanm = cpu_to_be16(f->fs.mask.ivlan);
fwr->ovlan = cpu_to_be16(f->fs.val.ovlan);
fwr->ovlanm = cpu_to_be16(f->fs.mask.ovlan);
- rte_memcpy(fwr->lip, f->fs.val.lip, sizeof(fwr->lip));
- rte_memcpy(fwr->lipm, f->fs.mask.lip, sizeof(fwr->lipm));
- rte_memcpy(fwr->fip, f->fs.val.fip, sizeof(fwr->fip));
- rte_memcpy(fwr->fipm, f->fs.mask.fip, sizeof(fwr->fipm));
+ memcpy(fwr->lip, f->fs.val.lip, sizeof(fwr->lip));
+ memcpy(fwr->lipm, f->fs.mask.lip, sizeof(fwr->lipm));
+ memcpy(fwr->fip, f->fs.val.fip, sizeof(fwr->fip));
+ memcpy(fwr->fipm, f->fs.mask.fip, sizeof(fwr->fipm));
fwr->lp = cpu_to_be16(f->fs.val.lport);
fwr->lpm = cpu_to_be16(f->fs.mask.lport);
fwr->fp = cpu_to_be16(f->fs.val.fport);
diff --git a/drivers/net/cxgbe/l2t.c b/drivers/net/cxgbe/l2t.c
index 21f4019ae626..7721c7953ec0 100644
--- a/drivers/net/cxgbe/l2t.c
+++ b/drivers/net/cxgbe/l2t.c
@@ -82,7 +82,7 @@ static int write_l2e(struct rte_eth_dev *dev, struct l2t_entry *e, int sync,
V_L2T_W_NOREPLY(!sync));
req->l2t_idx = cpu_to_be16(l2t_idx);
req->vlan = cpu_to_be16(e->vlan);
- rte_memcpy(req->dst_mac, e->dmac, RTE_ETHER_ADDR_LEN);
+ memcpy(req->dst_mac, e->dmac, RTE_ETHER_ADDR_LEN);
if (loopback)
memset(req->dst_mac, 0, RTE_ETHER_ADDR_LEN);
@@ -155,7 +155,7 @@ static struct l2t_entry *t4_l2t_alloc_switching(struct rte_eth_dev *dev,
e->state = L2T_STATE_SWITCHING;
e->vlan = vlan;
e->lport = port;
- rte_memcpy(e->dmac, eth_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(e->dmac, eth_addr, RTE_ETHER_ADDR_LEN);
__atomic_store_n(&e->refcnt, 1, __ATOMIC_RELAXED);
ret = write_l2e(dev, e, 0, !L2T_LPBK, !L2T_ARPMISS);
if (ret < 0)
diff --git a/drivers/net/cxgbe/smt.c b/drivers/net/cxgbe/smt.c
index 4e14a73753de..a74b2e0794e6 100644
--- a/drivers/net/cxgbe/smt.c
+++ b/drivers/net/cxgbe/smt.c
@@ -55,26 +55,24 @@ static int write_smt_entry(struct rte_eth_dev *dev, struct smt_entry *e)
*/
if (e->idx & 1) {
req->pfvf1 = 0x0;
- rte_memcpy(req->src_mac1, e->src_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(req->src_mac1, e->src_mac, RTE_ETHER_ADDR_LEN);
/* fill pfvf0/src_mac0 with entry
* at prev index from smt-tab.
*/
req->pfvf0 = 0x0;
- rte_memcpy(req->src_mac0, s->smtab[e->idx - 1].src_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(req->src_mac0, s->smtab[e->idx - 1].src_mac,
+ RTE_ETHER_ADDR_LEN);
} else {
req->pfvf0 = 0x0;
- rte_memcpy(req->src_mac0, e->src_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(req->src_mac0, e->src_mac, RTE_ETHER_ADDR_LEN);
/* fill pfvf1/src_mac1 with entry
* at next index from smt-tab
*/
req->pfvf1 = 0x0;
- rte_memcpy(req->src_mac1, s->smtab[e->idx + 1].src_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(req->src_mac1, s->smtab[e->idx + 1].src_mac,
+ RTE_ETHER_ADDR_LEN);
}
row = (e->hw_idx >> 1);
} else {
@@ -87,8 +85,8 @@ static int write_smt_entry(struct rte_eth_dev *dev, struct smt_entry *e)
/* fill pfvf0/src_mac0 from smt-tab */
t6req->pfvf0 = 0x0;
- rte_memcpy(t6req->src_mac0, s->smtab[e->idx].src_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(t6req->src_mac0, s->smtab[e->idx].src_mac,
+ RTE_ETHER_ADDR_LEN);
row = e->hw_idx;
req = (struct cpl_smt_write_req *)t6req;
}
@@ -158,7 +156,7 @@ static struct smt_entry *t4_smt_alloc_switching(struct rte_eth_dev *dev,
t4_os_lock(&e->lock);
if (__atomic_load_n(&e->refcnt, __ATOMIC_RELAXED) == 0) {
e->pfvf = pfvf;
- rte_memcpy(e->src_mac, smac, RTE_ETHER_ADDR_LEN);
+ memcpy(e->src_mac, smac, RTE_ETHER_ADDR_LEN);
ret = write_smt_entry(dev, e);
if (ret) {
e->pfvf = 0;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 60/71] net/dpaa2: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (58 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 59/71] net/cxgbe: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 61/71] net/e1000: " Stephen Hemminger
` (12 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 1 -
drivers/net/dpaa2/dpaa2_ethdev.c | 1 -
drivers/net/dpaa2/dpaa2_recycle.c | 1 -
drivers/net/dpaa2/dpaa2_rxtx.c | 1 -
drivers/net/dpaa2/dpaa2_sparser.c | 1 -
drivers/net/dpaa2/dpaa2_tm.c | 2 +-
6 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
index 4d33b51fead9..747fa4053276 100644
--- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
+++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
@@ -11,7 +11,6 @@
#include <rte_mbuf.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <rte_cycles.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 97edc0042030..5799770fde5d 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -11,7 +11,6 @@
#include <rte_mbuf.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <rte_cycles.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/dpaa2/dpaa2_recycle.c b/drivers/net/dpaa2/dpaa2_recycle.c
index fbfdf360d1ef..cda08a6cee69 100644
--- a/drivers/net/dpaa2/dpaa2_recycle.c
+++ b/drivers/net/dpaa2/dpaa2_recycle.c
@@ -10,7 +10,6 @@
#include <rte_mbuf.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <rte_cycles.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 23f7c4132d9e..b83015a94c62 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -11,7 +11,6 @@
#include <rte_mbuf.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <dev_driver.h>
#include <rte_hexdump.h>
diff --git a/drivers/net/dpaa2/dpaa2_sparser.c b/drivers/net/dpaa2/dpaa2_sparser.c
index 36a14526a5c5..e2976282bfee 100644
--- a/drivers/net/dpaa2/dpaa2_sparser.c
+++ b/drivers/net/dpaa2/dpaa2_sparser.c
@@ -5,7 +5,6 @@
#include <rte_mbuf.h>
#include <rte_ethdev.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <dev_driver.h>
diff --git a/drivers/net/dpaa2/dpaa2_tm.c b/drivers/net/dpaa2/dpaa2_tm.c
index 8fe5bfa013bb..1749b1be2295 100644
--- a/drivers/net/dpaa2/dpaa2_tm.c
+++ b/drivers/net/dpaa2/dpaa2_tm.c
@@ -324,7 +324,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,
NULL, NULL);
profile->id = shaper_profile_id;
- rte_memcpy(&profile->params, params, sizeof(profile->params));
+ memcpy(&profile->params, params, sizeof(profile->params));
LIST_INSERT_HEAD(&priv->shaper_profiles, profile, next);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 61/71] net/e1000: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (59 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 60/71] net/dpaa2: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 62/71] net/enic: " Stephen Hemminger
` (11 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/e1000/em_rxtx.c | 1 -
drivers/net/e1000/igb_flow.c | 22 ++++++++++------------
drivers/net/e1000/igb_pf.c | 7 +++----
drivers/net/e1000/igb_rxtx.c | 1 -
4 files changed, 13 insertions(+), 18 deletions(-)
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index df5fbb782361..3a069ce33ecd 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -20,7 +20,6 @@
#include <rte_pci.h>
#include <bus_pci_driver.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c
index ea9b290e1cb5..8bca48496035 100644
--- a/drivers/net/e1000/igb_flow.c
+++ b/drivers/net/e1000/igb_flow.c
@@ -1484,9 +1484,9 @@ igb_flow_create(struct rte_eth_dev *dev,
goto out;
}
- rte_memcpy(&ntuple_filter_ptr->filter_info,
- &ntuple_filter,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter_ptr->filter_info,
+ &ntuple_filter,
+ sizeof(struct rte_eth_ntuple_filter));
TAILQ_INSERT_TAIL(&igb_filter_ntuple_list,
ntuple_filter_ptr, entries);
flow->rule = ntuple_filter_ptr;
@@ -1511,9 +1511,9 @@ igb_flow_create(struct rte_eth_dev *dev,
goto out;
}
- rte_memcpy(ðertype_filter_ptr->filter_info,
- ðertype_filter,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter_ptr->filter_info,
+ ðertype_filter,
+ sizeof(struct rte_eth_ethertype_filter));
TAILQ_INSERT_TAIL(&igb_filter_ethertype_list,
ethertype_filter_ptr, entries);
flow->rule = ethertype_filter_ptr;
@@ -1536,9 +1536,8 @@ igb_flow_create(struct rte_eth_dev *dev,
goto out;
}
- rte_memcpy(&syn_filter_ptr->filter_info,
- &syn_filter,
- sizeof(struct rte_eth_syn_filter));
+ memcpy(&syn_filter_ptr->filter_info, &syn_filter,
+ sizeof(struct rte_eth_syn_filter));
TAILQ_INSERT_TAIL(&igb_filter_syn_list,
syn_filter_ptr,
entries);
@@ -1562,9 +1561,8 @@ igb_flow_create(struct rte_eth_dev *dev,
goto out;
}
- rte_memcpy(&flex_filter_ptr->filter_info,
- &flex_filter,
- sizeof(struct igb_flex_filter));
+ memcpy(&flex_filter_ptr->filter_info, &flex_filter,
+ sizeof(struct igb_flex_filter));
TAILQ_INSERT_TAIL(&igb_filter_flex_list,
flex_filter_ptr, entries);
flow->rule = flex_filter_ptr;
diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c
index c7588ea57eaa..efb806af5692 100644
--- a/drivers/net/e1000/igb_pf.c
+++ b/drivers/net/e1000/igb_pf.c
@@ -17,7 +17,6 @@
#include <rte_eal.h>
#include <rte_ether.h>
#include <ethdev_driver.h>
-#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
@@ -290,7 +289,7 @@ igb_vf_reset(struct rte_eth_dev *dev, uint16_t vf, uint32_t *msgbuf)
/* reply to reset with ack and vf mac address */
msgbuf[0] = E1000_VF_RESET | E1000_VT_MSGTYPE_ACK;
- rte_memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
+ memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
e1000_write_mbx(hw, msgbuf, 3, vf);
return 0;
@@ -308,8 +307,8 @@ igb_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
if (rte_is_unicast_ether_addr((struct rte_ether_addr *)new_mac)) {
if (!rte_is_zero_ether_addr((struct rte_ether_addr *)new_mac))
- rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac,
- sizeof(vfinfo[vf].vf_mac_addresses));
+ memcpy(vfinfo[vf].vf_mac_addresses, new_mac,
+ sizeof(vfinfo[vf].vf_mac_addresses));
hw->mac.ops.rar_set(hw, new_mac, rar_entry);
rah = E1000_READ_REG(hw, E1000_RAH(rar_entry));
rah |= (0x1 << (E1000_RAH_POOLSEL_SHIFT + vf));
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 5cafd6f1ce30..4a41a3cea5fc 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -19,7 +19,6 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_eal.h>
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 62/71] net/enic: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (60 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 61/71] net/e1000: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 63/71] net/failsafe: " Stephen Hemminger
` (10 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, John Daley, Hyong Youb Kim
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/enic/enic_main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index a6aaa760ca91..a940c160c9f1 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1221,8 +1221,8 @@ static int enic_set_rsskey(struct enic *enic, uint8_t *user_key)
/* Save for later queries */
if (!err) {
- rte_memcpy(&enic->rss_key, rss_key_buf_va,
- sizeof(union vnic_rss_key));
+ memcpy(&enic->rss_key, rss_key_buf_va,
+ sizeof(union vnic_rss_key));
}
enic_free_consistent(enic, sizeof(union vnic_rss_key),
rss_key_buf_va, rss_key_buf_pa);
@@ -1243,7 +1243,7 @@ int enic_set_rss_reta(struct enic *enic, union vnic_rss_cpu *rss_cpu)
if (!rss_cpu_buf_va)
return -ENOMEM;
- rte_memcpy(rss_cpu_buf_va, rss_cpu, sizeof(union vnic_rss_cpu));
+ memcpy(rss_cpu_buf_va, rss_cpu, sizeof(union vnic_rss_cpu));
err = enic_set_rss_cpu(enic,
rss_cpu_buf_pa,
@@ -1254,7 +1254,7 @@ int enic_set_rss_reta(struct enic *enic, union vnic_rss_cpu *rss_cpu)
/* Save for later queries */
if (!err)
- rte_memcpy(&enic->rss_cpu, rss_cpu, sizeof(union vnic_rss_cpu));
+ memcpy(&enic->rss_cpu, rss_cpu, sizeof(union vnic_rss_cpu));
return err;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 63/71] net/failsafe: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (61 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 62/71] net/enic: " Stephen Hemminger
@ 2024-03-01 17:15 ` Stephen Hemminger
2024-03-01 17:16 ` [PATCH v2 64/71] net/gve/base: " Stephen Hemminger
` (9 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:15 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Gaetan Rivet
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/failsafe/failsafe_ops.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index 9c013e04195c..47d453ef8028 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -902,16 +902,16 @@ fs_stats_get(struct rte_eth_dev *dev,
ret = fs_lock(dev, 0);
if (ret != 0)
return ret;
- rte_memcpy(stats, &PRIV(dev)->stats_accumulator, sizeof(*stats));
+ memcpy(stats, &PRIV(dev)->stats_accumulator, sizeof(*stats));
FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {
struct rte_eth_stats *snapshot = &sdev->stats_snapshot.stats;
uint64_t *timestamp = &sdev->stats_snapshot.timestamp;
- rte_memcpy(&backup, snapshot, sizeof(backup));
+ memcpy(&backup, snapshot, sizeof(backup));
ret = rte_eth_stats_get(PORT_ID(sdev), snapshot);
if (ret) {
if (!fs_err(sdev, ret)) {
- rte_memcpy(snapshot, &backup, sizeof(backup));
+ memcpy(snapshot, &backup, sizeof(backup));
goto inc;
}
ERROR("Operation rte_eth_stats_get failed for sub_device %d with error %d",
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 64/71] net/gve/base: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (62 preceding siblings ...)
2024-03-01 17:15 ` [PATCH v2 63/71] net/failsafe: " Stephen Hemminger
@ 2024-03-01 17:16 ` Stephen Hemminger
2024-03-01 17:16 ` [PATCH v2 65/71] net/hinic: " Stephen Hemminger
` (8 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:16 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Junfeng Guo, Jeroen de Borst, Rushil Gupta,
Joshua Washington
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/gve/base/gve_adminq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/gve/base/gve_adminq.c b/drivers/net/gve/base/gve_adminq.c
index 629d15cfbe77..24b00a1fbf5b 100644
--- a/drivers/net/gve/base/gve_adminq.c
+++ b/drivers/net/gve/base/gve_adminq.c
@@ -785,7 +785,7 @@ int gve_adminq_describe_device(struct gve_priv *priv)
}
priv->max_mtu = mtu;
priv->num_event_counters = be16_to_cpu(descriptor->counters);
- rte_memcpy(priv->dev_addr.addr_bytes, descriptor->mac, ETH_ALEN);
+ memcpy(priv->dev_addr.addr_bytes, descriptor->mac, ETH_ALEN);
PMD_DRV_LOG(INFO, "MAC addr: " RTE_ETHER_ADDR_PRT_FMT,
RTE_ETHER_ADDR_BYTES(&priv->dev_addr));
priv->tx_pages_per_qpl = be16_to_cpu(descriptor->tx_pages_per_qpl);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 65/71] net/hinic: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (63 preceding siblings ...)
2024-03-01 17:16 ` [PATCH v2 64/71] net/gve/base: " Stephen Hemminger
@ 2024-03-01 17:16 ` Stephen Hemminger
2024-03-01 17:16 ` [PATCH v2 66/71] net/mvpp2: " Stephen Hemminger
` (7 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:16 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Ziyang Xuan, Xiaoyun Wang, Guoyang Zhou
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/hinic/hinic_pmd_flow.c | 40 ++++++++++++++----------------
1 file changed, 18 insertions(+), 22 deletions(-)
diff --git a/drivers/net/hinic/hinic_pmd_flow.c b/drivers/net/hinic/hinic_pmd_flow.c
index d1a564a16303..cb61c989fd36 100644
--- a/drivers/net/hinic/hinic_pmd_flow.c
+++ b/drivers/net/hinic/hinic_pmd_flow.c
@@ -983,8 +983,7 @@ static int hinic_normal_item_check_ip(const struct rte_flow_item **in_out_item,
}
ipv6_spec = (const struct rte_flow_item_ipv6 *)item->spec;
- rte_memcpy(rule->hinic_fdir.dst_ipv6,
- ipv6_spec->hdr.dst_addr, 16);
+ memcpy(rule->hinic_fdir.dst_ipv6, ipv6_spec->hdr.dst_addr, 16);
/*
* Check if the next not void item is TCP or UDP or ICMP.
@@ -2193,8 +2192,8 @@ static int hinic_add_del_ntuple_filter(struct rte_eth_dev *dev,
sizeof(struct hinic_5tuple_filter), 0);
if (filter == NULL)
return -ENOMEM;
- rte_memcpy(&filter->filter_info, &filter_5tuple,
- sizeof(struct hinic_5tuple_filter_info));
+ memcpy(&filter->filter_info, &filter_5tuple,
+ sizeof(struct hinic_5tuple_filter_info));
filter->queue = ntuple_filter->queue;
filter_info->qid = ntuple_filter->queue;
@@ -2912,8 +2911,7 @@ static int hinic_add_del_tcam_fdir_filter(struct rte_eth_dev *dev,
sizeof(struct hinic_tcam_filter), 0);
if (tcam_filter == NULL)
return -ENOMEM;
- (void)rte_memcpy(&tcam_filter->tcam_key,
- &tcam_key, sizeof(struct tag_tcam_key));
+ memcpy(&tcam_filter->tcam_key, &tcam_key, sizeof(struct tag_tcam_key));
tcam_filter->queue = fdir_tcam_rule.data.qid;
ret = hinic_add_tcam_filter(dev, tcam_filter, &fdir_tcam_rule);
@@ -2990,9 +2988,9 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
&ntuple_filter, FALSE);
goto out;
}
- rte_memcpy(&ntuple_filter_ptr->filter_info,
- &ntuple_filter,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter_ptr->filter_info,
+ &ntuple_filter,
+ sizeof(struct rte_eth_ntuple_filter));
TAILQ_INSERT_TAIL(&nic_dev->filter_ntuple_list,
ntuple_filter_ptr, entries);
flow->rule = ntuple_filter_ptr;
@@ -3022,9 +3020,9 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
ðertype_filter, FALSE);
goto out;
}
- rte_memcpy(ðertype_filter_ptr->filter_info,
- ðertype_filter,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter_ptr->filter_info,
+ ðertype_filter,
+ sizeof(struct rte_eth_ethertype_filter));
TAILQ_INSERT_TAIL(&nic_dev->filter_ethertype_list,
ethertype_filter_ptr, entries);
flow->rule = ethertype_filter_ptr;
@@ -3065,8 +3063,8 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
goto out;
}
- rte_memcpy(&fdir_rule_ptr->filter_info, &fdir_rule,
- sizeof(struct hinic_fdir_rule));
+ memcpy(&fdir_rule_ptr->filter_info, &fdir_rule,
+ sizeof(struct hinic_fdir_rule));
TAILQ_INSERT_TAIL(&nic_dev->filter_fdir_rule_list,
fdir_rule_ptr, entries);
flow->rule = fdir_rule_ptr;
@@ -3109,8 +3107,8 @@ static int hinic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
case RTE_ETH_FILTER_NTUPLE:
ntuple_filter_ptr = (struct hinic_ntuple_filter_ele *)
pmd_flow->rule;
- rte_memcpy(&ntuple_filter, &ntuple_filter_ptr->filter_info,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter, &ntuple_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ntuple_filter));
ret = hinic_add_del_ntuple_filter(dev, &ntuple_filter, FALSE);
if (!ret) {
TAILQ_REMOVE(&nic_dev->filter_ntuple_list,
@@ -3121,9 +3119,8 @@ static int hinic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
case RTE_ETH_FILTER_ETHERTYPE:
ethertype_filter_ptr = (struct hinic_ethertype_filter_ele *)
pmd_flow->rule;
- rte_memcpy(ðertype_filter,
- ðertype_filter_ptr->filter_info,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter, ðertype_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ethertype_filter));
ret = hinic_add_del_ethertype_filter(dev,
ðertype_filter, FALSE);
if (!ret) {
@@ -3134,9 +3131,8 @@ static int hinic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
break;
case RTE_ETH_FILTER_FDIR:
fdir_rule_ptr = (struct hinic_fdir_rule_ele *)pmd_flow->rule;
- rte_memcpy(&fdir_rule,
- &fdir_rule_ptr->filter_info,
- sizeof(struct hinic_fdir_rule));
+ memcpy(&fdir_rule, &fdir_rule_ptr->filter_info,
+ sizeof(struct hinic_fdir_rule));
if (fdir_rule.mode == HINIC_FDIR_MODE_NORMAL) {
ret = hinic_add_del_fdir_filter(dev, &fdir_rule, FALSE);
} else if (fdir_rule.mode == HINIC_FDIR_MODE_TCAM) {
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 66/71] net/mvpp2: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (64 preceding siblings ...)
2024-03-01 17:16 ` [PATCH v2 65/71] net/hinic: " Stephen Hemminger
@ 2024-03-01 17:16 ` Stephen Hemminger
2024-03-01 17:16 ` [PATCH v2 67/71] app/test-pmd: " Stephen Hemminger
` (6 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:16 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Liron Himi
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/mvpp2/mrvl_tm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/mvpp2/mrvl_tm.c b/drivers/net/mvpp2/mrvl_tm.c
index 9fac80b867be..a5cdae6d1d0d 100644
--- a/drivers/net/mvpp2/mrvl_tm.c
+++ b/drivers/net/mvpp2/mrvl_tm.c
@@ -437,7 +437,7 @@ mrvl_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,
NULL, NULL);
profile->id = shaper_profile_id;
- rte_memcpy(&profile->params, params, sizeof(profile->params));
+ memcpy(&profile->params, params, sizeof(profile->params));
LIST_INSERT_HEAD(&priv->shaper_profiles, profile, next);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 67/71] app/test-pmd: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (65 preceding siblings ...)
2024-03-01 17:16 ` [PATCH v2 66/71] net/mvpp2: " Stephen Hemminger
@ 2024-03-01 17:16 ` Stephen Hemminger
2024-03-01 17:16 ` [PATCH v2 68/71] app/graph: " Stephen Hemminger
` (5 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:16 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Aman Singh, Yuying Zhang, Ori Kam
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-pmd/cmdline.c | 48 ++++++++++++++++++-------------------
app/test-pmd/cmdline_flow.c | 24 +++++++++----------
app/test-pmd/config.c | 8 +++----
app/test-pmd/csumonly.c | 1 -
app/test-pmd/flowgen.c | 1 -
app/test-pmd/iofwd.c | 1 -
app/test-pmd/macfwd.c | 1 -
app/test-pmd/macswap.c | 1 -
app/test-pmd/noisy_vnf.c | 1 -
app/test-pmd/rxonly.c | 1 -
app/test-pmd/testpmd.c | 1 -
11 files changed, 40 insertions(+), 48 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 566057caa523..898fb69a2f4d 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -9529,7 +9529,7 @@ static void cmd_set_vxlan_parsed(void *parsed_result,
vxlan_encap_conf.select_ipv4 = 0;
else
return;
- rte_memcpy(vxlan_encap_conf.vni, &id.vni[1], 3);
+ memcpy(vxlan_encap_conf.vni, &id.vni[1], 3);
vxlan_encap_conf.udp_src = rte_cpu_to_be_16(res->udp_src);
vxlan_encap_conf.udp_dst = rte_cpu_to_be_16(res->udp_dst);
vxlan_encap_conf.ip_tos = res->tos;
@@ -9543,10 +9543,10 @@ static void cmd_set_vxlan_parsed(void *parsed_result,
}
if (vxlan_encap_conf.select_vlan)
vxlan_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
- rte_memcpy(vxlan_encap_conf.eth_src, res->eth_src.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- rte_memcpy(vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(vxlan_encap_conf.eth_src, res->eth_src.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
}
static cmdline_parse_inst_t cmd_set_vxlan = {
@@ -9724,7 +9724,7 @@ static void cmd_set_nvgre_parsed(void *parsed_result,
nvgre_encap_conf.select_ipv4 = 0;
else
return;
- rte_memcpy(nvgre_encap_conf.tni, &id.tni[1], 3);
+ memcpy(nvgre_encap_conf.tni, &id.tni[1], 3);
if (nvgre_encap_conf.select_ipv4) {
IPV4_ADDR_TO_UINT(res->ip_src, nvgre_encap_conf.ipv4_src);
IPV4_ADDR_TO_UINT(res->ip_dst, nvgre_encap_conf.ipv4_dst);
@@ -9734,10 +9734,10 @@ static void cmd_set_nvgre_parsed(void *parsed_result,
}
if (nvgre_encap_conf.select_vlan)
nvgre_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
- rte_memcpy(nvgre_encap_conf.eth_src, res->eth_src.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- rte_memcpy(nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(nvgre_encap_conf.eth_src, res->eth_src.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
}
static cmdline_parse_inst_t cmd_set_nvgre = {
@@ -9851,10 +9851,10 @@ static void cmd_set_l2_encap_parsed(void *parsed_result,
return;
if (l2_encap_conf.select_vlan)
l2_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
- rte_memcpy(l2_encap_conf.eth_src, res->eth_src.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- rte_memcpy(l2_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(l2_encap_conf.eth_src, res->eth_src.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(l2_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
}
static cmdline_parse_inst_t cmd_set_l2_encap = {
@@ -10033,7 +10033,7 @@ static void cmd_set_mplsogre_encap_parsed(void *parsed_result,
mplsogre_encap_conf.select_ipv4 = 0;
else
return;
- rte_memcpy(mplsogre_encap_conf.label, &id.label, 3);
+ memcpy(mplsogre_encap_conf.label, &id.label, 3);
if (mplsogre_encap_conf.select_ipv4) {
IPV4_ADDR_TO_UINT(res->ip_src, mplsogre_encap_conf.ipv4_src);
IPV4_ADDR_TO_UINT(res->ip_dst, mplsogre_encap_conf.ipv4_dst);
@@ -10043,10 +10043,10 @@ static void cmd_set_mplsogre_encap_parsed(void *parsed_result,
}
if (mplsogre_encap_conf.select_vlan)
mplsogre_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
- rte_memcpy(mplsogre_encap_conf.eth_src, res->eth_src.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- rte_memcpy(mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(mplsogre_encap_conf.eth_src, res->eth_src.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
}
static cmdline_parse_inst_t cmd_set_mplsogre_encap = {
@@ -10269,7 +10269,7 @@ static void cmd_set_mplsoudp_encap_parsed(void *parsed_result,
mplsoudp_encap_conf.select_ipv4 = 0;
else
return;
- rte_memcpy(mplsoudp_encap_conf.label, &id.label, 3);
+ memcpy(mplsoudp_encap_conf.label, &id.label, 3);
mplsoudp_encap_conf.udp_src = rte_cpu_to_be_16(res->udp_src);
mplsoudp_encap_conf.udp_dst = rte_cpu_to_be_16(res->udp_dst);
if (mplsoudp_encap_conf.select_ipv4) {
@@ -10281,10 +10281,10 @@ static void cmd_set_mplsoudp_encap_parsed(void *parsed_result,
}
if (mplsoudp_encap_conf.select_vlan)
mplsoudp_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
- rte_memcpy(mplsoudp_encap_conf.eth_src, res->eth_src.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- rte_memcpy(mplsoudp_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(mplsoudp_encap_conf.eth_src, res->eth_src.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(mplsoudp_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
}
static cmdline_parse_inst_t cmd_set_mplsoudp_encap = {
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index b4389e51506b..17b73d2407c4 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -13732,7 +13732,7 @@ cmd_set_raw_parsed_sample(const struct buffer *in)
fprintf(stderr, "Error - Not supported action\n");
return;
}
- rte_memcpy(data, action, sizeof(struct rte_flow_action));
+ memcpy(data, action, sizeof(struct rte_flow_action));
data++;
}
}
@@ -13893,8 +13893,8 @@ cmd_set_raw_parsed(const struct buffer *in)
/* We have to add GTP header extra word. */
*total_size += sizeof(ext_word);
- rte_memcpy(data_tail - (*total_size),
- &ext_word, sizeof(ext_word));
+ memcpy(data_tail - (*total_size), &ext_word,
+ sizeof(ext_word));
}
size = sizeof(struct rte_gtp_hdr);
break;
@@ -13939,21 +13939,21 @@ cmd_set_raw_parsed(const struct buffer *in)
if (opt->checksum_rsvd.checksum) {
*total_size +=
sizeof(opt->checksum_rsvd);
- rte_memcpy(data_tail - (*total_size),
- &opt->checksum_rsvd,
- sizeof(opt->checksum_rsvd));
+ memcpy(data_tail - (*total_size),
+ &opt->checksum_rsvd,
+ sizeof(opt->checksum_rsvd));
}
if (opt->key.key) {
*total_size += sizeof(opt->key.key);
- rte_memcpy(data_tail - (*total_size),
- &opt->key.key,
- sizeof(opt->key.key));
+ memcpy(data_tail - (*total_size),
+ &opt->key.key,
+ sizeof(opt->key.key));
}
if (opt->sequence.sequence) {
*total_size += sizeof(opt->sequence.sequence);
- rte_memcpy(data_tail - (*total_size),
- &opt->sequence.sequence,
- sizeof(opt->sequence.sequence));
+ memcpy(data_tail - (*total_size),
+ &opt->sequence.sequence,
+ sizeof(opt->sequence.sequence));
}
}
proto = 0x2F;
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 08d7d0e2f87c..2b81f3ef3d2d 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2639,8 +2639,8 @@ port_flow_template_table_create(portid_t port_id, uint32_t id,
}
pt->nb_pattern_templates = nb_pattern_templates;
pt->nb_actions_templates = nb_actions_templates;
- rte_memcpy(&pt->flow_attr, &table_attr->flow_attr,
- sizeof(struct rte_flow_attr));
+ memcpy(&pt->flow_attr, &table_attr->flow_attr,
+ sizeof(struct rte_flow_attr));
printf("Template table #%u created\n", pt->id);
return 0;
}
@@ -3261,8 +3261,8 @@ port_queue_action_handle_update(portid_t port_id,
update = action->conf;
break;
case RTE_FLOW_ACTION_TYPE_METER_MARK:
- rte_memcpy(&mtr_update.meter_mark, action->conf,
- sizeof(struct rte_flow_action_meter_mark));
+ memcpy(&mtr_update.meter_mark, action->conf,
+ sizeof(struct rte_flow_action_meter_mark));
if (mtr_update.meter_mark.profile)
mtr_update.profile_valid = 1;
if (mtr_update.meter_mark.policy)
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index d73f08b2c6c2..b94ddc3526af 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -19,7 +19,6 @@
#include <rte_debug.h>
#include <rte_cycles.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c
index 53b5f24f11e7..d9454a4d22e1 100644
--- a/app/test-pmd/flowgen.c
+++ b/app/test-pmd/flowgen.c
@@ -19,7 +19,6 @@
#include <rte_debug.h>
#include <rte_cycles.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
diff --git a/app/test-pmd/iofwd.c b/app/test-pmd/iofwd.c
index ba06fae4a6b0..c9727d285622 100644
--- a/app/test-pmd/iofwd.c
+++ b/app/test-pmd/iofwd.c
@@ -24,7 +24,6 @@
#include <rte_per_lcore.h>
#include <rte_lcore.h>
#include <rte_branch_prediction.h>
-#include <rte_memcpy.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_interrupts.h>
diff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c
index d19ace739557..ba63aedd797d 100644
--- a/app/test-pmd/macfwd.c
+++ b/app/test-pmd/macfwd.c
@@ -19,7 +19,6 @@
#include <rte_debug.h>
#include <rte_cycles.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
diff --git a/app/test-pmd/macswap.c b/app/test-pmd/macswap.c
index 57f77003fe44..e1f9be490157 100644
--- a/app/test-pmd/macswap.c
+++ b/app/test-pmd/macswap.c
@@ -19,7 +19,6 @@
#include <rte_debug.h>
#include <rte_cycles.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
diff --git a/app/test-pmd/noisy_vnf.c b/app/test-pmd/noisy_vnf.c
index 81d1187cfe9e..cf951e953251 100644
--- a/app/test-pmd/noisy_vnf.c
+++ b/app/test-pmd/noisy_vnf.c
@@ -24,7 +24,6 @@
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
-#include <rte_memcpy.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_ethdev.h>
diff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c
index 315f9286cdbe..cc73cf4ebf44 100644
--- a/app/test-pmd/rxonly.c
+++ b/app/test-pmd/rxonly.c
@@ -19,7 +19,6 @@
#include <rte_debug.h>
#include <rte_cycles.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 9e4e99e53b9a..6a2339a24145 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -30,7 +30,6 @@
#include <rte_debug.h>
#include <rte_cycles.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_launch.h>
#include <rte_bus.h>
#include <rte_eal.h>
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 68/71] app/graph: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (66 preceding siblings ...)
2024-03-01 17:16 ` [PATCH v2 67/71] app/test-pmd: " Stephen Hemminger
@ 2024-03-01 17:16 ` Stephen Hemminger
2024-03-01 17:16 ` [PATCH v2 69/71] app/test-eventdev: " Stephen Hemminger
` (4 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:16 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Sunil Kumar Kori, Rakesh Kudurumalla
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/graph/neigh.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/graph/neigh.c b/app/graph/neigh.c
index 22be7361e310..a99d2b6981a2 100644
--- a/app/graph/neigh.c
+++ b/app/graph/neigh.c
@@ -91,14 +91,14 @@ ip6_rewrite_node_add(struct neigh_ipv6_config *v6_config)
memset(data, 0, len);
/* Copy dst mac */
- rte_memcpy((void *)&data[0], (void *)&v6_config->mac, RTE_ETHER_ADDR_LEN);
+ memcpy((void *)&data[0], (void *)&v6_config->mac, RTE_ETHER_ADDR_LEN);
/* Copy src mac */
rc = rte_eth_macaddr_get(portid, &smac);
if (rc < 0)
return rc;
- rte_memcpy(&data[RTE_ETHER_ADDR_LEN], smac.addr_bytes, RTE_ETHER_ADDR_LEN);
+ memcpy(&data[RTE_ETHER_ADDR_LEN], smac.addr_bytes, RTE_ETHER_ADDR_LEN);
return rte_node_ip6_rewrite_add(portid, data, len, portid);
}
@@ -121,7 +121,7 @@ ip4_rewrite_node_add(struct neigh_ipv4_config *v4_config)
memset(data, 0, len);
/* Copy dst mac */
- rte_memcpy((void *)&data[0], (void *)&v4_config->mac, RTE_ETHER_ADDR_LEN);
+ memcpy((void *)&data[0], (void *)&v4_config->mac, RTE_ETHER_ADDR_LEN);
/* Copy src mac */
rc = rte_eth_macaddr_get(portid, &smac);
@@ -130,7 +130,7 @@ ip4_rewrite_node_add(struct neigh_ipv4_config *v4_config)
return rc;
}
- rte_memcpy(&data[RTE_ETHER_ADDR_LEN], smac.addr_bytes, RTE_ETHER_ADDR_LEN);
+ memcpy(&data[RTE_ETHER_ADDR_LEN], smac.addr_bytes, RTE_ETHER_ADDR_LEN);
return rte_node_ip4_rewrite_add(portid, data, len, portid);
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 69/71] app/test-eventdev: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (67 preceding siblings ...)
2024-03-01 17:16 ` [PATCH v2 68/71] app/graph: " Stephen Hemminger
@ 2024-03-01 17:16 ` Stephen Hemminger
2024-03-01 17:16 ` [PATCH v2 70/71] app/test: " Stephen Hemminger
` (3 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:16 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jerin Jacob
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-eventdev/test_pipeline_common.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
index b111690b7cd4..49bfd0c363f5 100644
--- a/app/test-eventdev/test_pipeline_common.c
+++ b/app/test-eventdev/test_pipeline_common.c
@@ -177,22 +177,17 @@ pipeline_tx_first(struct test_pipeline *t, struct evt_options *opt)
mbuf->pkt_len = pkt_sz;
/* Copy Ethernet header */
- rte_memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, 0),
- ð_hdr, sizeof(struct rte_ether_hdr));
+ memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, 0),
+ ð_hdr, sizeof(struct rte_ether_hdr));
/* Copy Ipv4 header */
- rte_memcpy(rte_pktmbuf_mtod_offset(
- mbuf, char *,
- sizeof(struct rte_ether_hdr)),
- &ip_hdr, sizeof(struct rte_ipv4_hdr));
+ memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, sizeof(struct rte_ether_hdr)),
+ &ip_hdr, sizeof(struct rte_ipv4_hdr));
/* Copy UDP header */
- rte_memcpy(
- rte_pktmbuf_mtod_offset(
- mbuf, char *,
- sizeof(struct rte_ipv4_hdr) +
- sizeof(struct rte_ether_hdr)),
- &udp_hdr, sizeof(struct rte_udp_hdr));
+ memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, sizeof(struct rte_ipv4_hdr)
+ + sizeof(struct rte_ether_hdr)),
+ &udp_hdr, sizeof(struct rte_udp_hdr));
pkt_udp_hdr = rte_pktmbuf_mtod_offset(
mbuf, struct rte_udp_hdr *,
sizeof(struct rte_ipv4_hdr) +
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 70/71] app/test: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (68 preceding siblings ...)
2024-03-01 17:16 ` [PATCH v2 69/71] app/test-eventdev: " Stephen Hemminger
@ 2024-03-01 17:16 ` Stephen Hemminger
2024-03-01 17:16 ` [PATCH v2 71/71] examples: " Stephen Hemminger
` (2 subsequent siblings)
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:16 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Jasvinder Singh, Akhil Goyal, Fan Zhang,
Byron Marohn, Yipeng Wang, Abhinandan Gujjar,
Amit Prakash Shukla, Jerin Jacob, Konstantin Ananyev,
Vladimir Medvedkin, Chas Williams, Min Hu (Connor),
Sameh Gobriel, Sachin Saxena, Hemant Agrawal, Anoob Joseph,
Harry van Haaren
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test/commands.c | 1 -
app/test/packet_burst_generator.c | 4 +--
app/test/test_crc.c | 5 ++--
app/test/test_cryptodev.c | 18 ++++++-------
app/test/test_cryptodev_asym.c | 1 -
app/test/test_cryptodev_security_pdcp.c | 1 -
app/test/test_efd.c | 1 -
app/test/test_efd_perf.c | 1 -
app/test/test_event_crypto_adapter.c | 12 ++++-----
app/test/test_event_dma_adapter.c | 4 +--
app/test/test_eventdev.c | 1 -
app/test/test_ipsec.c | 6 ++---
app/test/test_link_bonding_mode4.c | 8 +++---
app/test/test_mbuf.c | 1 -
app/test/test_member.c | 1 -
app/test/test_member_perf.c | 1 -
app/test/test_rawdev.c | 1 -
app/test/test_security_inline_proto.c | 36 ++++++++++++-------------
app/test/test_service_cores.c | 1 -
app/test/virtual_pmd.c | 3 +--
20 files changed, 46 insertions(+), 61 deletions(-)
diff --git a/app/test/commands.c b/app/test/commands.c
index 497d8e9952ea..74494a0ef440 100644
--- a/app/test/commands.c
+++ b/app/test/commands.c
@@ -16,7 +16,6 @@
#include <rte_log.h>
#include <rte_debug.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_cycles.h>
diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c
index 867a88da0055..fcca2d238ece 100644
--- a/app/test/packet_burst_generator.c
+++ b/app/test/packet_burst_generator.c
@@ -148,8 +148,8 @@ initialize_ipv6_header(struct rte_ipv6_hdr *ip_hdr, uint8_t *src_addr,
ip_hdr->proto = IPPROTO_UDP;
ip_hdr->hop_limits = IP_DEFTTL;
- rte_memcpy(ip_hdr->src_addr, src_addr, sizeof(ip_hdr->src_addr));
- rte_memcpy(ip_hdr->dst_addr, dst_addr, sizeof(ip_hdr->dst_addr));
+ memcpy(ip_hdr->src_addr, src_addr, sizeof(ip_hdr->src_addr));
+ memcpy(ip_hdr->dst_addr, dst_addr, sizeof(ip_hdr->dst_addr));
return (uint16_t) (pkt_data_len + sizeof(struct rte_ipv6_hdr));
}
diff --git a/app/test/test_crc.c b/app/test/test_crc.c
index b85fca35fe2d..30fe00450606 100644
--- a/app/test/test_crc.c
+++ b/app/test/test_crc.c
@@ -6,7 +6,6 @@
#include <rte_hexdump.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_net_crc.h>
#define CRC_VEC_LEN 32
@@ -83,7 +82,7 @@ test_crc_calc(void)
return -7;
for (i = 0; i < CRC32_VEC_LEN1; i += 12)
- rte_memcpy(&test_data[i], crc32_vec1, 12);
+ memcpy(&test_data[i], crc32_vec1, 12);
result = crc_calc(test_data, CRC32_VEC_LEN1, type);
if (result != crc32_vec1_res) {
@@ -93,7 +92,7 @@ test_crc_calc(void)
/* 32-bit ethernet CRC: Test 3 */
for (i = 0; i < CRC32_VEC_LEN2; i += 12)
- rte_memcpy(&test_data[i], crc32_vec1, 12);
+ memcpy(&test_data[i], crc32_vec1, 12);
result = crc_calc(test_data, CRC32_VEC_LEN2, type);
if (result != crc32_vec2_res) {
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 38a65aa88f04..d87bcbb05b86 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -2345,8 +2345,8 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
sym_op->auth.data.length = QUOTE_512_BYTES;
/* Copy IV at the end of the crypto operation */
- rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET),
- aes_cbc_iv, CIPHER_IV_LENGTH_AES_CBC);
+ memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET),
+ aes_cbc_iv, CIPHER_IV_LENGTH_AES_CBC);
/* Set crypto operation cipher parameters */
sym_op->cipher.data.offset = 0;
@@ -2480,9 +2480,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(void *sess,
DIGEST_BYTE_LENGTH_SHA512);
TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
- rte_memcpy(ut_params->digest,
- digest,
- DIGEST_BYTE_LENGTH_SHA512);
+ memcpy(ut_params->digest, digest, DIGEST_BYTE_LENGTH_SHA512);
/* Generate Crypto op data structure */
ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
@@ -2505,8 +2503,8 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(void *sess,
sym_op->auth.data.length = QUOTE_512_BYTES;
/* Copy IV at the end of the crypto operation */
- rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET),
- iv, CIPHER_IV_LENGTH_AES_CBC);
+ memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET),
+ iv, CIPHER_IV_LENGTH_AES_CBC);
sym_op->cipher.data.offset = 0;
sym_op->cipher.data.length = QUOTE_512_BYTES;
@@ -8863,7 +8861,7 @@ create_aead_operation(enum rte_crypto_aead_operation op,
uint8_t *, IV_OFFSET);
if (tdata->iv.len == 0) {
- rte_memcpy(iv_ptr, tdata->iv.data, AES_GCM_J0_LENGTH);
+ memcpy(iv_ptr, tdata->iv.data, AES_GCM_J0_LENGTH);
debug_hexdump(stdout, "iv:", iv_ptr,
AES_GCM_J0_LENGTH);
} else {
@@ -13659,8 +13657,8 @@ test_multi_session_random_usage(void)
for (i = 0; i < MB_SESSION_NUMBER; i++) {
- rte_memcpy(&ut_paramz[i].ut_params, &unittest_params,
- sizeof(struct crypto_unittest_params));
+ memcpy(&ut_paramz[i].ut_params, &unittest_params,
+ sizeof(struct crypto_unittest_params));
test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
&ut_paramz[i].ut_params,
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 17daf734e8c4..88561a8f25d5 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -8,7 +8,6 @@
#include <rte_hexdump.h>
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_pause.h>
#include <rte_cryptodev.h>
diff --git a/app/test/test_cryptodev_security_pdcp.c b/app/test/test_cryptodev_security_pdcp.c
index a7641bab7a6f..39926cbee37a 100644
--- a/app/test/test_cryptodev_security_pdcp.c
+++ b/app/test/test_cryptodev_security_pdcp.c
@@ -10,7 +10,6 @@
#include <rte_hexdump.h>
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_pause.h>
#include <rte_bus_vdev.h>
#include <rte_byteorder.h>
diff --git a/app/test/test_efd.c b/app/test/test_efd.c
index 1c0986b9bcd9..306f851c52de 100644
--- a/app/test/test_efd.c
+++ b/app/test/test_efd.c
@@ -13,7 +13,6 @@ test_efd(void)
#else
-#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_efd.h>
#include <rte_byteorder.h>
diff --git a/app/test/test_efd_perf.c b/app/test/test_efd_perf.c
index b212e96767a2..7f5a8b9a5603 100644
--- a/app/test/test_efd_perf.c
+++ b/app/test/test_efd_perf.c
@@ -22,7 +22,6 @@ test_efd_perf(void)
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_efd.h>
-#include <rte_memcpy.h>
#include <rte_thash.h>
#define NUM_KEYSIZES 10
diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 0c56744ba031..4992c5bc5035 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -454,7 +454,7 @@ test_op_forward_mode(uint8_t session_less)
m_data.request_info.cdev_id = request_info.cdev_id;
m_data.request_info.queue_pair_id = request_info.queue_pair_id;
m_data.response_info.event = response_info.event;
- rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
+ memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
}
sym_op->m_src = m;
@@ -653,8 +653,8 @@ test_asym_op_forward_mode(uint8_t session_less)
m_data.request_info.cdev_id = request_info.cdev_id;
m_data.request_info.queue_pair_id = request_info.queue_pair_id;
m_data.response_info.event = response_info.event;
- rte_memcpy((uint8_t *)op + op->private_data_offset,
- &m_data, sizeof(m_data));
+ memcpy((uint8_t *)op + op->private_data_offset, &m_data,
+ sizeof(m_data));
}
/* Fill in event info and update event_ptr with rte_crypto_op */
memset(&ev, 0, sizeof(ev));
@@ -820,7 +820,7 @@ test_op_new_mode(uint8_t session_less)
op->private_data_offset = len;
/* Fill in private data information */
m_data.response_info.event = response_info.event;
- rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
+ memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
}
sym_op->m_src = m;
@@ -977,8 +977,8 @@ test_asym_op_new_mode(uint8_t session_less)
sizeof(struct rte_crypto_asym_xform));
/* Fill in private data information */
m_data.response_info.event = response_info.event;
- rte_memcpy((uint8_t *)op + op->private_data_offset,
- &m_data, sizeof(m_data));
+ memcpy((uint8_t *)op + op->private_data_offset, &m_data,
+ sizeof(m_data));
}
ret = send_op_recv_ev(op);
diff --git a/app/test/test_event_dma_adapter.c b/app/test/test_event_dma_adapter.c
index 35b417b69f7b..af2e44a703e4 100644
--- a/app/test/test_event_dma_adapter.c
+++ b/app/test/test_event_dma_adapter.c
@@ -269,8 +269,8 @@ test_op_forward_mode(void)
op->vchan = TEST_DMA_VCHAN_ID;
response_info.event = dma_response_info.event;
- rte_memcpy((uint8_t *)op + sizeof(struct rte_event_dma_adapter_op), &response_info,
- sizeof(struct rte_event));
+ memcpy((uint8_t *)op + sizeof(struct rte_event_dma_adapter_op),
+ &response_info, sizeof(struct rte_event));
/* Fill in event info and update event_ptr with rte_event_dma_adapter_op */
memset(&ev[i], 0, sizeof(struct rte_event));
diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c
index e4e234dc9867..d2ae9b4930d0 100644
--- a/app/test/test_eventdev.c
+++ b/app/test/test_eventdev.c
@@ -8,7 +8,6 @@
#include <rte_hexdump.h>
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#ifdef RTE_EXEC_ENV_WINDOWS
static int
diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c
index 6cb1bac1e732..25aabdb616da 100644
--- a/app/test/test_ipsec.c
+++ b/app/test/test_ipsec.c
@@ -601,10 +601,10 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string,
/* copy outer IP and ESP header */
ipv4_outer.total_length = rte_cpu_to_be_16(t_len);
ipv4_outer.packet_id = rte_cpu_to_be_16(seq);
- rte_memcpy(dst, &ipv4_outer, sizeof(ipv4_outer));
+ memcpy(dst, &ipv4_outer, sizeof(ipv4_outer));
dst += sizeof(ipv4_outer);
m->l3_len = sizeof(ipv4_outer);
- rte_memcpy(dst, &esph, sizeof(esph));
+ memcpy(dst, &esph, sizeof(esph));
dst += sizeof(esph);
if (string != NULL) {
@@ -616,7 +616,7 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string,
sizeof(esp_pad_bytes)));
dst += padlen;
/* copy ESP tail header */
- rte_memcpy(dst, &espt, sizeof(espt));
+ memcpy(dst, &espt, sizeof(espt));
} else
memset(dst, 0, t_len);
diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c
index ff13dbed93f3..e4827c1e8091 100644
--- a/app/test/test_link_bonding_mode4.c
+++ b/app/test/test_link_bonding_mode4.c
@@ -1399,8 +1399,8 @@ test_mode4_ext_ctrl(void)
for (i = 0; i < MEMBER_COUNT; i++) {
lacp_tx_buf[i] = rte_pktmbuf_alloc(test_params.mbuf_pool);
- rte_memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *),
- &lacpdu, sizeof(lacpdu));
+ memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *), &lacpdu,
+ sizeof(lacpdu));
rte_pktmbuf_pkt_len(lacp_tx_buf[i]) = sizeof(lacpdu);
}
@@ -1453,8 +1453,8 @@ test_mode4_ext_lacp(void)
for (i = 0; i < MEMBER_COUNT; i++) {
lacp_tx_buf[i] = rte_pktmbuf_alloc(test_params.mbuf_pool);
- rte_memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *),
- &lacpdu, sizeof(lacpdu));
+ memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *), &lacpdu,
+ sizeof(lacpdu));
rte_pktmbuf_pkt_len(lacp_tx_buf[i]) = sizeof(lacpdu);
}
diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 51ea6ef1c472..9303f2492f89 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -19,7 +19,6 @@
#include <rte_debug.h>
#include <rte_log.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
diff --git a/app/test/test_member.c b/app/test/test_member.c
index 5a4d2750db36..7281a644bd21 100644
--- a/app/test/test_member.c
+++ b/app/test/test_member.c
@@ -7,7 +7,6 @@
#include <math.h>
#include "test.h"
-#include <rte_memcpy.h>
#include <rte_malloc.h>
#ifdef RTE_EXEC_ENV_WINDOWS
diff --git a/app/test/test_member_perf.c b/app/test/test_member_perf.c
index db6b8a18efd9..f40fdba91e80 100644
--- a/app/test/test_member_perf.c
+++ b/app/test/test_member_perf.c
@@ -11,7 +11,6 @@
#include <rte_cycles.h>
#include <rte_malloc.h>
#include <rte_random.h>
-#include <rte_memcpy.h>
#include <rte_thash.h>
#include <math.h>
diff --git a/app/test/test_rawdev.c b/app/test/test_rawdev.c
index d34691dacf5f..120e61dcc29c 100644
--- a/app/test/test_rawdev.c
+++ b/app/test/test_rawdev.c
@@ -7,7 +7,6 @@
#include <rte_common.h>
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_dev.h>
#ifdef RTE_EXEC_ENV_WINDOWS
diff --git a/app/test/test_security_inline_proto.c b/app/test/test_security_inline_proto.c
index 481382b64e85..8268a0855ba7 100644
--- a/app/test/test_security_inline_proto.c
+++ b/app/test/test_security_inline_proto.c
@@ -245,8 +245,8 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,
/* Copy cipher session parameters */
if (sa->aead) {
- rte_memcpy(sess_conf->crypto_xform, &sa->xform.aead,
- sizeof(struct rte_crypto_sym_xform));
+ memcpy(sess_conf->crypto_xform, &sa->xform.aead,
+ sizeof(struct rte_crypto_sym_xform));
sess_conf->crypto_xform->aead.key.data = sa->key.data;
/* Verify crypto capabilities */
if (test_sec_crypto_caps_aead_verify(sec_cap, sess_conf->crypto_xform) != 0) {
@@ -256,13 +256,13 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,
}
} else {
if (dir == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) {
- rte_memcpy(&sess_conf->crypto_xform->cipher,
- &sa->xform.chain.cipher.cipher,
- sizeof(struct rte_crypto_cipher_xform));
+ memcpy(&sess_conf->crypto_xform->cipher,
+ &sa->xform.chain.cipher.cipher,
+ sizeof(struct rte_crypto_cipher_xform));
- rte_memcpy(&sess_conf->crypto_xform->next->auth,
- &sa->xform.chain.auth.auth,
- sizeof(struct rte_crypto_auth_xform));
+ memcpy(&sess_conf->crypto_xform->next->auth,
+ &sa->xform.chain.auth.auth,
+ sizeof(struct rte_crypto_auth_xform));
sess_conf->crypto_xform->cipher.key.data =
sa->key.data;
sess_conf->crypto_xform->next->auth.key.data =
@@ -282,12 +282,12 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,
return TEST_SKIPPED;
}
} else {
- rte_memcpy(&sess_conf->crypto_xform->next->cipher,
- &sa->xform.chain.cipher.cipher,
- sizeof(struct rte_crypto_cipher_xform));
- rte_memcpy(&sess_conf->crypto_xform->auth,
- &sa->xform.chain.auth.auth,
- sizeof(struct rte_crypto_auth_xform));
+ memcpy(&sess_conf->crypto_xform->next->cipher,
+ &sa->xform.chain.cipher.cipher,
+ sizeof(struct rte_crypto_cipher_xform));
+ memcpy(&sess_conf->crypto_xform->auth,
+ &sa->xform.chain.auth.auth,
+ sizeof(struct rte_crypto_auth_xform));
sess_conf->crypto_xform->auth.key.data =
sa->auth_key.data;
sess_conf->crypto_xform->next->cipher.key.data =
@@ -463,12 +463,12 @@ init_packet(struct rte_mempool *mp, const uint8_t *data, unsigned int len, bool
return NULL;
if (outer_ipv4) {
- rte_memcpy(rte_pktmbuf_append(pkt, RTE_ETHER_HDR_LEN),
- &dummy_ipv4_eth_hdr, RTE_ETHER_HDR_LEN);
+ memcpy(rte_pktmbuf_append(pkt, RTE_ETHER_HDR_LEN),
+ &dummy_ipv4_eth_hdr, RTE_ETHER_HDR_LEN);
pkt->l3_len = sizeof(struct rte_ipv4_hdr);
} else {
- rte_memcpy(rte_pktmbuf_append(pkt, RTE_ETHER_HDR_LEN),
- &dummy_ipv6_eth_hdr, RTE_ETHER_HDR_LEN);
+ memcpy(rte_pktmbuf_append(pkt, RTE_ETHER_HDR_LEN),
+ &dummy_ipv6_eth_hdr, RTE_ETHER_HDR_LEN);
pkt->l3_len = sizeof(struct rte_ipv6_hdr);
}
pkt->l2_len = RTE_ETHER_HDR_LEN;
diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c
index c12d52d8f16c..fb08821b87eb 100644
--- a/app/test/test_service_cores.c
+++ b/app/test/test_service_cores.c
@@ -6,7 +6,6 @@
#include <rte_hexdump.h>
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_cycles.h>
#include <rte_service.h>
diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
index b7d74a467a22..ae48923df78f 100644
--- a/app/test/virtual_pmd.c
+++ b/app/test/virtual_pmd.c
@@ -8,7 +8,6 @@
#include <rte_pci.h>
#include <bus_pci_driver.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_memory.h>
#include <rte_ring.h>
@@ -186,7 +185,7 @@ virtual_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
struct virtual_ethdev_private *dev_private = dev->data->dev_private;
if (stats)
- rte_memcpy(stats, &dev_private->eth_stats, sizeof(*stats));
+ memcpy(stats, &dev_private->eth_stats, sizeof(*stats));
return 0;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v2 71/71] examples: replace use of fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (69 preceding siblings ...)
2024-03-01 17:16 ` [PATCH v2 70/71] app/test: " Stephen Hemminger
@ 2024-03-01 17:16 ` Stephen Hemminger
2024-03-01 17:50 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Tyler Retzlaff
2024-03-02 11:14 ` Mattias Rönnblom
72 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-01 17:16 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Nicolas Chautru, Tomasz Kantecki,
Kirill Rybalchenko, Maxime Coquelin, Chenbo Xia
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/bbdev_app/main.c | 2 +-
examples/l2fwd-cat/cat.c | 4 +---
examples/ptpclient/ptpclient.c | 11 +++++------
examples/vhost/main.c | 5 ++---
examples/vmdq/main.c | 6 ++----
examples/vmdq_dcb/main.c | 15 +++++----------
6 files changed, 16 insertions(+), 27 deletions(-)
diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 16599ae9cee3..52c8eabba778 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -359,7 +359,7 @@ add_ether_hdr(struct rte_mbuf *pkt_src, struct rte_mbuf *pkt_dst)
eth_to = rte_pktmbuf_mtod(pkt_dst, struct rte_ether_hdr *);
/* copy header */
- rte_memcpy(eth_to, eth_from, sizeof(struct rte_ether_hdr));
+ memcpy(eth_to, eth_from, sizeof(struct rte_ether_hdr));
}
static inline void
diff --git a/examples/l2fwd-cat/cat.c b/examples/l2fwd-cat/cat.c
index 00e4cde48b48..d1689fca2912 100644
--- a/examples/l2fwd-cat/cat.c
+++ b/examples/l2fwd-cat/cat.c
@@ -12,7 +12,6 @@
#include <stdio.h>
#include <rte_common.h>
-#include <rte_memcpy.h>
#include <pqos.h>
@@ -314,8 +313,7 @@ parse_l3ca(const char *l3ca)
if (cmask != 0 && is_contiguous(cmask) == 0)
goto err;
- rte_memcpy(&m_config[idx].cpumask,
- &cpuset, sizeof(rte_cpuset_t));
+ memcpy(&m_config[idx].cpumask, &cpuset, sizeof(rte_cpuset_t));
if (cmask != 0) {
m_config[idx].cdp = 1;
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 2535d848a1e9..e918bc05db34 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -359,9 +359,9 @@ parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx)
ptp_data->seqID_SYNC = rte_be_to_cpu_16(ptp_hdr->seq_id);
if (ptp_data->ptpset == 0) {
- rte_memcpy(&ptp_data->master_clock_id,
- &ptp_hdr->source_port_id.clock_id,
- sizeof(struct clock_id));
+ memcpy(&ptp_data->master_clock_id,
+ &ptp_hdr->source_port_id.clock_id,
+ sizeof(struct clock_id));
ptp_data->ptpset = 1;
}
@@ -466,9 +466,8 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
client_clkid->id[6] = eth_hdr->src_addr.addr_bytes[4];
client_clkid->id[7] = eth_hdr->src_addr.addr_bytes[5];
- rte_memcpy(&ptp_data->client_clock_id,
- client_clkid,
- sizeof(struct clock_id));
+ memcpy(&ptp_data->client_clock_id, client_clkid,
+ sizeof(struct clock_id));
/* Enable flag for hardware timestamping. */
created_pkt->ol_flags |= RTE_MBUF_F_TX_IEEE1588_TMST;
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 3fc1b151d182..5691ec110ac8 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -405,9 +405,8 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_devices)
conf.pool_map[i].pools = (1UL << i);
}
- (void)(rte_memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &conf,
- sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
+ (void)(memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
+ (void)(memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &conf, sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
return 0;
}
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 4a3ce6884c5c..d928f4a45ccf 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -17,7 +17,6 @@
#include <rte_common.h>
#include <rte_log.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_cycles.h>
@@ -151,9 +150,8 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_pools)
conf.pool_map[i].pools = (1UL << (i % num_pools));
}
- (void)(rte_memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &conf,
- sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
+ (void)(memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
+ (void)(memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &conf, sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
if (rss_enable) {
eth_conf->rxmode.mq_mode = RTE_ETH_MQ_RX_VMDQ_RSS;
eth_conf->rx_adv_conf.rss_conf.rss_hf = RTE_ETH_RSS_IP |
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 4ccc2fe4b01c..f93eca59367b 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -17,7 +17,6 @@
#include <rte_common.h>
#include <rte_log.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_cycles.h>
@@ -161,15 +160,11 @@ get_eth_conf(struct rte_eth_conf *eth_conf)
tx_conf.dcb_tc[i] = i % num_tcs;
}
dcb_conf.nb_tcs = (enum rte_eth_nb_tcs)num_tcs;
- (void)(rte_memcpy(eth_conf, &vmdq_dcb_conf_default, sizeof(*eth_conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_dcb_conf, &conf,
- sizeof(conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.dcb_rx_conf, &dcb_conf,
- sizeof(dcb_conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &vmdq_conf,
- sizeof(vmdq_conf)));
- (void)(rte_memcpy(ð_conf->tx_adv_conf.vmdq_dcb_tx_conf, &tx_conf,
- sizeof(tx_conf)));
+ (void)(memcpy(eth_conf, &vmdq_dcb_conf_default, sizeof(*eth_conf)));
+ (void)(memcpy(ð_conf->rx_adv_conf.vmdq_dcb_conf, &conf, sizeof(conf)));
+ (void)(memcpy(ð_conf->rx_adv_conf.dcb_rx_conf, &dcb_conf, sizeof(dcb_conf)));
+ (void)(memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &vmdq_conf, sizeof(vmdq_conf)));
+ (void)(memcpy(ð_conf->tx_adv_conf.vmdq_dcb_tx_conf, &tx_conf, sizeof(tx_conf)));
if (rss_enable) {
eth_conf->rxmode.mq_mode = RTE_ETH_MQ_RX_VMDQ_DCB_RSS;
eth_conf->rx_adv_conf.rss_conf.rss_hf = RTE_ETH_RSS_IP |
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* Re: [PATCH v2 00/71] replace use of fixed size rte_mempcy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (70 preceding siblings ...)
2024-03-01 17:16 ` [PATCH v2 71/71] examples: " Stephen Hemminger
@ 2024-03-01 17:50 ` Tyler Retzlaff
2024-03-02 11:14 ` Mattias Rönnblom
72 siblings, 0 replies; 205+ messages in thread
From: Tyler Retzlaff @ 2024-03-01 17:50 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
On Fri, Mar 01, 2024 at 09:14:56AM -0800, Stephen Hemminger wrote:
> The DPDK has a lot of "cargo cult" usage of rte_memcpy.
> This patch set replaces cases where rte_memcpy is used with a fixed
> size constant size.
>
> Typical example is:
> rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
> which can be replaced with:
> memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
>
> This has two benefits. Gcc (and clang) are smart enough that for
> all small fixed size values, they just generate the necessary instructions
> to do it inline. It also means that fortify, Coverity, and ASAN
> analyzers can check these memcpy's.
>
> So faster, better, safer.
>
> The first patch is a simple coccinelle script to do the replacement
> and the rest are the results broken out by module.
>
> The coccinelle script can be used again to make sure more bad
> usage doesn't creep in with new drivers.
>
> v2 - fix CI failure on some OS by adding string.h
> remove rte_memcpy.h if no longer used
>
> Stephen Hemminger (71):
> cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
> eal: replace use of fixed size rte_memcpy
> ethdev: replace use of fixed size rte_memcpy
> eventdev: replace use of fixed size rte_memcpy
> cryptodev: replace use of fixed size rte_memcpy
> ip_frag: replace use of fixed size rte_memcpy
> net: replace use of fixed size rte_memcpy
> lpm: replace use of fixed size rte_memcpy
> node: replace use of fixed size rte_memcpy
> pdcp: replace use of fixed size rte_memcpy
> pipeline: replace use of fixed size rte_memcpy
> rib: replace use of fixed size rte_memcpy
> security: replace use of fixed size rte_memcpy
> net/mlx5: replace use of fixed size rte_memcpy
> net/nfp: replace use of fixed size rte_memcpy
> net/ngbe: replace use of fixed size rte_memcpy
> net/null: replace use of fixed size rte_memcpy
> net/pcap: replace use of fixed size rte_memcpy
> net/sfc: replace use of fixed size rte_memcpy
> net/tap: replace use of fixed size rte_memcpy
> net/txgbe: replace use of fixed size rte_memcpy
> raw/ifpga: replace use of fixed size rte_memcpy
> raw/skeleton: replace use of fixed size rte_memcpy
> net/hns3: replace use of fixed size rte_memcpy
> net/i40e: replace use of fixed size rte_memcpy
> net/iavf: replace use of fixed size rte_memcpy
> net/ice: replace use of fixed size rte_memcpy
> net/idpf: replace use of fixed size rte_memcpy
> net/ipn3ke: replace use of fixed size rte_memcpy
> net/ixgbe: replace use of fixed size rte_memcpy
> net/memif: replace use of fixed size rte_memcpy
> net/qede: replace use of fixed size rte_memcpy
> baseband/acc: replace use of fixed size rte_memcpy
> baseband/la12xx: replace use of fixed size rte_memcpy
> common/idpf: replace use of fixed size rte_memcpy
> common/qat: replace use of fixed size rte_memcpy
> compress/qat: replace use of fixed size rte_memcpy
> crypto/ccp: replace use of fixed size rte_memcpy
> crypto/cnxk: replace use of fixed size rte_memcpy
> crypto/dpaa_sec: replace use of fixed size rte_memcpy
> crypto/ipsec_mb: replace use of fixed size rte_memcpy
> crypto/qat: replace use of fixed size rte_memcpy
> crypto/scheduler: replace use of fixed size rte_memcpy
> event/cnxk: replace use of fixed size rte_memcpy
> event/dlb2: replace use of fixed size rte_memcpy
> event/dpaa2: replace use of fixed size rte_memcpy
> event/octeontx: replace use of fixed size rte_memcpy
> mempool/dpaa: replace use of fixed size rte_memcpy
> mempool/dpaa2: replace use of fixed size rte_memcpy
> ml/cnxk: replace use of fixed size rte_memcpy
> net/af_xdp: replace use of fixed size rte_memcpy
> net/avp: replace use of fixed size rte_memcpy
> net/axgbe: replace use of fixed size rte_memcpy
> net/bnx2x: replace use of fixed size rte_memcpy
> net/bnxt: replace use of fixed size rte_memcpy
> net/bonding: replace use of fixed size rte_memcpy
> net/cnxk: replace use of fixed size rte_memcpy
> net/cpfl: replace use of fixed size rte_memcpy
> net/cxgbe: replace use of fixed size rte_memcpy
> net/dpaa2: replace use of fixed size rte_memcpy
> net/e1000: replace use of fixed size rte_memcpy
> net/enic: replace use of fixed size rte_memcpy
> net/failsafe: replace use of fixed size rte_memcpy
> net/gve/base: replace use of fixed size rte_memcpy
> net/hinic: replace use of fixed size rte_memcpy
> net/mvpp2: replace use of fixed size rte_memcpy
> app/test-pmd: replace use of fixed size rte_memcpy
> app/graph: replace use of fixed size rte_memcpy
> app/test-eventdev: replace use of fixed size rte_memcpy
> app/test: replace use of fixed size rte_memcpy
> examples: replace use of fixed size rte_memcpy
>
> app/graph/neigh.c | 8 +-
> app/test-eventdev/test_pipeline_common.c | 19 ++-
> app/test-pmd/cmdline.c | 48 ++++----
> app/test-pmd/cmdline_flow.c | 24 ++--
> app/test-pmd/config.c | 8 +-
> app/test-pmd/csumonly.c | 1 -
> app/test-pmd/flowgen.c | 1 -
> app/test-pmd/iofwd.c | 1 -
> app/test-pmd/macfwd.c | 1 -
> app/test-pmd/macswap.c | 1 -
> app/test-pmd/noisy_vnf.c | 1 -
> app/test-pmd/rxonly.c | 1 -
> app/test-pmd/testpmd.c | 1 -
> app/test/commands.c | 1 -
> app/test/packet_burst_generator.c | 4 +-
> app/test/test_crc.c | 5 +-
> app/test/test_cryptodev.c | 18 ++-
> app/test/test_cryptodev_asym.c | 1 -
> app/test/test_cryptodev_security_pdcp.c | 1 -
> app/test/test_efd.c | 1 -
> app/test/test_efd_perf.c | 1 -
> app/test/test_event_crypto_adapter.c | 12 +-
> app/test/test_event_dma_adapter.c | 4 +-
> app/test/test_eventdev.c | 1 -
> app/test/test_ipsec.c | 6 +-
> app/test/test_link_bonding_mode4.c | 8 +-
> app/test/test_mbuf.c | 1 -
> app/test/test_member.c | 1 -
> app/test/test_member_perf.c | 1 -
> app/test/test_rawdev.c | 1 -
> app/test/test_security_inline_proto.c | 36 +++---
> app/test/test_service_cores.c | 1 -
> app/test/virtual_pmd.c | 3 +-
> devtools/cocci/rte_memcpy.cocci | 11 ++
> drivers/baseband/acc/rte_acc100_pmd.c | 17 ++-
> drivers/baseband/acc/rte_vrb_pmd.c | 21 ++--
> drivers/baseband/la12xx/bbdev_la12xx.c | 4 +-
> drivers/common/idpf/idpf_common_device.c | 4 +-
> drivers/common/idpf/idpf_common_virtchnl.c | 8 +-
> drivers/common/qat/qat_qp.c | 10 +-
> drivers/compress/qat/qat_comp.c | 8 +-
> drivers/crypto/ccp/ccp_crypto.c | 14 +--
> drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +-
> drivers/crypto/cnxk/cnxk_se.h | 2 +-
> drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
> drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +-
> drivers/crypto/qat/qat_sym_session.c | 52 ++++-----
> .../scheduler/rte_cryptodev_scheduler.c | 6 +-
> drivers/crypto/scheduler/scheduler_failover.c | 12 +-
> drivers/event/cnxk/cnxk_tim_evdev.c | 4 +-
> drivers/event/dlb2/dlb2.c | 6 +-
> drivers/event/dpaa2/dpaa2_eventdev.c | 6 +-
> drivers/event/octeontx/timvf_evdev.c | 4 +-
> drivers/mempool/dpaa/dpaa_mempool.c | 4 +-
> drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 +-
> drivers/ml/cnxk/cn10k_ml_model.c | 8 +-
> drivers/ml/cnxk/cn10k_ml_ops.c | 11 +-
> drivers/ml/cnxk/cnxk_ml_ops.c | 2 +-
> drivers/ml/cnxk/mvtvm_ml_model.c | 8 +-
> drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +-
> drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
> drivers/net/avp/avp_ethdev.c | 4 +-
> drivers/net/axgbe/axgbe_ethdev.c | 4 +-
> drivers/net/bnx2x/bnx2x.c | 32 +++--
> drivers/net/bnx2x/bnx2x_stats.c | 10 +-
> drivers/net/bnx2x/bnx2x_vfpf.c | 19 +--
> drivers/net/bnxt/bnxt_flow.c | 34 +++---
> drivers/net/bonding/rte_eth_bond_8023ad.c | 4 +-
> drivers/net/bonding/rte_eth_bond_flow.c | 2 +-
> drivers/net/cnxk/cnxk_ethdev_ops.c | 2 +-
> drivers/net/cnxk/cnxk_tm.c | 5 +-
> drivers/net/cpfl/cpfl_ethdev.c | 3 +-
> drivers/net/cpfl/cpfl_vchnl.c | 4 +-
> drivers/net/cxgbe/clip_tbl.c | 2 +-
> drivers/net/cxgbe/cxgbe_filter.c | 8 +-
> drivers/net/cxgbe/l2t.c | 4 +-
> drivers/net/cxgbe/smt.c | 20 ++--
> drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 1 -
> drivers/net/dpaa2/dpaa2_ethdev.c | 1 -
> drivers/net/dpaa2/dpaa2_recycle.c | 1 -
> drivers/net/dpaa2/dpaa2_rxtx.c | 1 -
> drivers/net/dpaa2/dpaa2_sparser.c | 1 -
> drivers/net/dpaa2/dpaa2_tm.c | 2 +-
> drivers/net/e1000/em_rxtx.c | 1 -
> drivers/net/e1000/igb_flow.c | 22 ++--
> drivers/net/e1000/igb_pf.c | 7 +-
> drivers/net/e1000/igb_rxtx.c | 1 -
> drivers/net/enic/enic_main.c | 8 +-
> drivers/net/failsafe/failsafe_ops.c | 6 +-
> drivers/net/gve/base/gve_adminq.c | 2 +-
> drivers/net/hinic/hinic_pmd_flow.c | 40 +++----
> drivers/net/hns3/hns3_fdir.c | 2 +-
> drivers/net/hns3/hns3_flow.c | 4 +-
> drivers/net/i40e/i40e_ethdev.c | 109 ++++++++----------
> drivers/net/i40e/i40e_fdir.c | 28 +++--
> drivers/net/i40e/i40e_flow.c | 56 +++++----
> drivers/net/i40e/i40e_pf.c | 3 +-
> drivers/net/i40e/i40e_tm.c | 11 +-
> drivers/net/i40e/rte_pmd_i40e.c | 34 +++---
> drivers/net/iavf/iavf_fdir.c | 93 +++++++--------
> drivers/net/iavf/iavf_fsub.c | 50 ++++----
> drivers/net/iavf/iavf_generic_flow.c | 2 +-
> drivers/net/iavf/iavf_tm.c | 11 +-
> drivers/net/iavf/iavf_vchnl.c | 9 +-
> drivers/net/ice/ice_dcf.c | 5 +-
> drivers/net/ice/ice_dcf_parent.c | 2 +-
> drivers/net/ice/ice_dcf_sched.c | 11 +-
> drivers/net/ice/ice_diagnose.c | 4 +-
> drivers/net/ice/ice_ethdev.c | 14 +--
> drivers/net/ice/ice_fdir_filter.c | 37 +++---
> drivers/net/ice/ice_generic_flow.c | 2 +-
> drivers/net/ice/ice_hash.c | 2 +-
> drivers/net/ice/ice_tm.c | 11 +-
> drivers/net/idpf/idpf_ethdev.c | 7 +-
> drivers/net/idpf/idpf_rxtx.c | 10 +-
> drivers/net/ipn3ke/ipn3ke_flow.c | 32 +++--
> drivers/net/ipn3ke/ipn3ke_representor.c | 16 +--
> drivers/net/ipn3ke/ipn3ke_tm.c | 6 +-
> drivers/net/ixgbe/ixgbe_ethdev.c | 9 +-
> drivers/net/ixgbe/ixgbe_fdir.c | 7 +-
> drivers/net/ixgbe/ixgbe_flow.c | 65 +++++------
> drivers/net/ixgbe/ixgbe_ipsec.c | 8 +-
> drivers/net/ixgbe/ixgbe_pf.c | 5 +-
> drivers/net/ixgbe/ixgbe_tm.c | 11 +-
> drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +-
> drivers/net/memif/memif_socket.c | 4 +-
> drivers/net/mlx5/mlx5_devx.c | 4 +-
> drivers/net/mlx5/mlx5_flow.c | 38 +++---
> drivers/net/mlx5/mlx5_flow_aso.c | 6 +-
> drivers/net/mlx5/mlx5_flow_hw.c | 16 +--
> drivers/net/mlx5/mlx5_rx.c | 6 +-
> drivers/net/mlx5/mlx5_rxtx_vec.c | 8 +-
> drivers/net/mvpp2/mrvl_tm.c | 2 +-
> drivers/net/nfp/flower/nfp_conntrack.c | 2 +-
> drivers/net/nfp/flower/nfp_flower_flow.c | 16 +--
> .../net/nfp/flower/nfp_flower_representor.c | 2 +-
> drivers/net/nfp/nfp_mtr.c | 10 +-
> drivers/net/ngbe/ngbe_pf.c | 4 +-
> drivers/net/null/rte_eth_null.c | 6 +-
> drivers/net/pcap/pcap_ethdev.c | 2 +-
> drivers/net/pcap/pcap_osdep_freebsd.c | 2 +-
> drivers/net/pcap/pcap_osdep_linux.c | 2 +-
> drivers/net/qede/qede_main.c | 2 +-
> drivers/net/sfc/sfc.c | 2 +-
> drivers/net/sfc/sfc_ef10_tx.c | 2 +-
> drivers/net/sfc/sfc_ethdev.c | 11 +-
> drivers/net/sfc/sfc_flow.c | 20 ++--
> drivers/net/sfc/sfc_flow_rss.c | 2 +-
> drivers/net/sfc/sfc_mae.c | 2 +-
> drivers/net/sfc/sfc_rx.c | 2 +-
> drivers/net/sfc/sfc_tso.c | 2 +-
> drivers/net/sfc/sfc_tso.h | 9 +-
> drivers/net/tap/rte_eth_tap.c | 14 +--
> drivers/net/txgbe/txgbe_ethdev.c | 9 +-
> drivers/net/txgbe/txgbe_fdir.c | 6 +-
> drivers/net/txgbe/txgbe_flow.c | 65 +++++------
> drivers/net/txgbe/txgbe_ipsec.c | 8 +-
> drivers/net/txgbe/txgbe_pf.c | 4 +-
> drivers/net/txgbe/txgbe_tm.c | 11 +-
> drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +-
> drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +-
> drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +-
> drivers/raw/ifpga/afu_pmd_n3000.c | 8 +-
> drivers/raw/ifpga/ifpga_rawdev.c | 11 +-
> drivers/raw/skeleton/skeleton_rawdev.c | 7 +-
> examples/bbdev_app/main.c | 2 +-
> examples/l2fwd-cat/cat.c | 4 +-
> examples/ptpclient/ptpclient.c | 11 +-
> examples/vhost/main.c | 5 +-
> examples/vmdq/main.c | 6 +-
> examples/vmdq_dcb/main.c | 15 +--
> lib/cryptodev/rte_cryptodev.c | 2 +-
> lib/eal/common/eal_common_options.c | 7 +-
> lib/ethdev/rte_ethdev.c | 3 +-
> lib/ethdev/rte_flow.c | 5 +-
> lib/eventdev/rte_event_crypto_adapter.c | 2 +-
> lib/eventdev/rte_event_dma_adapter.c | 4 +-
> lib/eventdev/rte_event_timer_adapter.c | 2 +-
> lib/fib/trie.c | 2 +-
> lib/ip_frag/rte_ipv6_fragmentation.c | 4 +-
> lib/ip_frag/rte_ipv6_reassembly.c | 6 +-
> lib/lpm/rte_lpm6.c | 3 +-
> lib/net/rte_ether.c | 2 +-
> lib/node/ip6_lookup.c | 8 +-
> lib/pdcp/pdcp_process.c | 36 +++---
> lib/pipeline/rte_table_action.c | 8 +-
> lib/rib/rte_rib6.h | 5 +-
> lib/security/rte_security.c | 4 +-
> 188 files changed, 881 insertions(+), 998 deletions(-)
> create mode 100644 devtools/cocci/rte_memcpy.cocci
>
> --
Series-acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> 2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* Re: [PATCH 00/71] replace use of fixed size rte_memcpy
2024-03-01 12:55 ` Konstantin Ananyev
@ 2024-03-01 18:55 ` Ajit Khaparde
0 siblings, 0 replies; 205+ messages in thread
From: Ajit Khaparde @ 2024-03-01 18:55 UTC (permalink / raw)
To: Konstantin Ananyev; +Cc: Stephen Hemminger, dev
[-- Attachment #1: Type: text/plain, Size: 15308 bytes --]
On Fri, Mar 1, 2024 at 4:55 AM Konstantin Ananyev
<konstantin.ananyev@huawei.com> wrote:
>
>
>
> > The DPDK has a lot of "cargo cult" usage of rte_memcpy.
> > This patch set replaces cases where rte_memcpy is used with a fixed
> > size constant size.
> >
> > Typical example is:
> > rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
> > which can be replaced with:
> > memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
> >
> > This has two benefits. Gcc (and clang) are smart enough that for
> > all small fixed size values, they just generate the necessary instructions
> > to do it inline. It also means that fortify, Coverity, and ASAN
> > analyzers can check these memcpy's.
> >
> > So faster, better, safer.
> >
> > The first patch is a simple coccinelle script to do the replacement
> > and the rest are the results broken out by module.
> >
> > The coccinelle script can be used again to make sure more bad
> > usage doesn't creep in with new drivers.
> >
> > Stephen Hemminger (71):
> > cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
> > eal: replace use of fixed size rte_memcpy
> > ethdev: replace use of fixed size rte_memcpy
> > eventdev: replace use of fixed size rte_memcpy
> > cryptodev: replace use of fixed size rte_memcpy
> > ip_frag: replace use of fixed size rte_memcpy
> > net: replace use of fixed size rte_memcpy
> > lpm: replace use of fixed size rte_memcpy
> > node: replace use of fixed size rte_memcpy
> > pdcp: replace use of fixed size rte_memcpy
> > pipeline: replace use of fixed size rte_memcpy
> > rib: replace use of fixed size rte_memcpy
> > security: replace use of fixed size rte_memcpy
> > net/mlx5: replace use of fixed size rte_memcpy
> > net/nfp: replace use of fixed size rte_memcpy
> > net/ngbe: replace use of fixed size rte_memcpy
> > net/null: replace use of fixed size rte_memcpy
> > net/pcap: replace use of fixed size rte_memcpy
> > net/sfc: replace use of fixed size rte_memcpy
> > net/tap: replace use of fixed size rte_memcpy
> > net/txgbe: replace use of fixed size rte_memcpy
> > raw/ifpga: replace use of fixed size rte_memcpy
> > raw/skeleton: replace use of fixed size rte_memcpy
> > net/hns3: replace use of fixed size rte_memcpy
> > net/i40e: replace use of fixed size rte_memcpy
> > net/iavf: replace use of fixed size rte_memcpy
> > net/ice: replace use of fixed size rte_memcpy
> > net/idpf: replace use of fixed size rte_memcpy
> > net/ipn3ke: replace use of fixed size rte_memcpy
> > net/ixgbe: replace use of fixed size rte_memcpy
> > net/memif: replace use of fixed size rte_memcpy
> > net/qede: replace use of fixed size rte_memcpy
> > baseband/acc: replace use of fixed size rte_memcpy
> > baseband/la12xx: replace use of fixed size rte_memcpy
> > common/idpf: replace use of fixed size rte_memcpy
> > common/qat: replace use of fixed size rte_memcpy
> > compress/qat: replace use of fixed size rte_memcpy
> > crypto/ccp: replace use of fixed size rte_memcpy
> > crypto/cnxk: replace use of fixed size rte_memcpy
> > crypto/dpaa_sec: replace use of fixed size rte_memcpy
> > crypto/ipsec_mb: replace use of fixed size rte_memcpy
> > crypto/qat: replace use of fixed size rte_memcpy
> > crypto/scheduler: replace use of fixed size rte_memcpy
> > event/cnxk: replace use of fixed size rte_memcpy
> > event/dlb2: replace use of fixed size rte_memcpy
> > event/dpaa2: replace use of fixed size rte_memcpy
> > event/octeontx: replace use of fixed size rte_memcpy
> > mempool/dpaa: replace use of fixed size rte_memcpy
> > mempool/dpaa2: replace use of fixed size rte_memcpy
> > ml/cnxk: replace use of fixed size rte_memcpy
> > net/af_xdp: replace use of fixed size rte_memcpy
> > net/avp: replace use of fixed size rte_memcpy
> > net/axgbe: replace use of fixed size rte_memcpy
> > net/bnx2x: replace use of fixed size rte_memcpy
> > net/bnxt: replace use of fixed size rte_memcpy
> > net/bonding: replace use of fixed size rte_memcpy
> > net/cnxk: replace use of fixed size rte_memcpy
> > net/cpfl: replace use of fixed size rte_memcpy
> > net/cxgbe: replace use of fixed size rte_memcpy
> > net/dpaa2: replace use of fixed size rte_memcpy
> > net/e1000: replace use of fixed size rte_memcpy
> > net/enic: replace use of fixed size rte_memcpy
> > net/failsafe: replace use of fixed size rte_memcpy
> > net/gve/base: replace use of fixed size rte_memcpy
> > net/hinic: replace use of fixed size rte_memcpy
> > net/mvpp2: replace use of fixed size rte_memcpy
> > app/test-pmd: replace use of fixed size rte_memcpy
> > app/graph: replace use of fixed size rte_memcpy
> > app/test-eventdev: replace use of fixed size rte_memcpy
> > app/test: replace use of fixed size rte_memcpy
> > examples: replace use of fixed size rte_memcpy
> >
> > app/graph/neigh.c | 8 +-
> > app/test-eventdev/test_pipeline_common.c | 19 ++-
> > app/test-pmd/cmdline.c | 48 ++++----
> > app/test-pmd/cmdline_flow.c | 24 ++--
> > app/test-pmd/config.c | 8 +-
> > app/test/packet_burst_generator.c | 4 +-
> > app/test/test_crc.c | 4 +-
> > app/test/test_cryptodev.c | 18 ++-
> > app/test/test_event_crypto_adapter.c | 12 +-
> > app/test/test_event_dma_adapter.c | 4 +-
> > app/test/test_ipsec.c | 6 +-
> > app/test/test_link_bonding_mode4.c | 8 +-
> > app/test/test_security_inline_proto.c | 36 +++---
> > app/test/virtual_pmd.c | 2 +-
> > devtools/cocci/rte_memcpy.cocci | 11 ++
> > drivers/baseband/acc/rte_acc100_pmd.c | 19 ++-
> > drivers/baseband/acc/rte_vrb_pmd.c | 21 ++--
> > drivers/baseband/la12xx/bbdev_la12xx.c | 4 +-
> > drivers/common/idpf/idpf_common_device.c | 4 +-
> > drivers/common/idpf/idpf_common_virtchnl.c | 8 +-
> > drivers/common/qat/qat_qp.c | 10 +-
> > drivers/compress/qat/qat_comp.c | 8 +-
> > drivers/crypto/ccp/ccp_crypto.c | 14 +--
> > drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +-
> > drivers/crypto/cnxk/cnxk_se.h | 2 +-
> > drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
> > drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +-
> > drivers/crypto/qat/qat_sym_session.c | 52 ++++-----
> > .../scheduler/rte_cryptodev_scheduler.c | 6 +-
> > drivers/crypto/scheduler/scheduler_failover.c | 12 +-
> > drivers/event/cnxk/cnxk_tim_evdev.c | 4 +-
> > drivers/event/dlb2/dlb2.c | 6 +-
> > drivers/event/dpaa2/dpaa2_eventdev.c | 6 +-
> > drivers/event/octeontx/timvf_evdev.c | 4 +-
> > drivers/mempool/dpaa/dpaa_mempool.c | 4 +-
> > drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 +-
> > drivers/ml/cnxk/cn10k_ml_model.c | 8 +-
> > drivers/ml/cnxk/cn10k_ml_ops.c | 11 +-
> > drivers/ml/cnxk/cnxk_ml_ops.c | 2 +-
> > drivers/ml/cnxk/mvtvm_ml_model.c | 8 +-
> > drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +-
> > drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
> > drivers/net/avp/avp_ethdev.c | 4 +-
> > drivers/net/axgbe/axgbe_ethdev.c | 4 +-
> > drivers/net/bnx2x/bnx2x.c | 32 +++---
> > drivers/net/bnx2x/bnx2x_stats.c | 10 +-
> > drivers/net/bnx2x/bnx2x_vfpf.c | 19 +--
> > drivers/net/bnxt/bnxt_flow.c | 34 +++---
> > drivers/net/bonding/rte_eth_bond_8023ad.c | 4 +-
> > drivers/net/bonding/rte_eth_bond_flow.c | 2 +-
> > drivers/net/cnxk/cnxk_ethdev_ops.c | 2 +-
> > drivers/net/cnxk/cnxk_tm.c | 5 +-
> > drivers/net/cpfl/cpfl_ethdev.c | 3 +-
> > drivers/net/cpfl/cpfl_vchnl.c | 4 +-
> > drivers/net/cxgbe/clip_tbl.c | 2 +-
> > drivers/net/cxgbe/cxgbe_filter.c | 8 +-
> > drivers/net/cxgbe/l2t.c | 4 +-
> > drivers/net/cxgbe/smt.c | 20 ++--
> > drivers/net/dpaa2/dpaa2_tm.c | 2 +-
> > drivers/net/e1000/igb_flow.c | 22 ++--
> > drivers/net/e1000/igb_pf.c | 6 +-
> > drivers/net/enic/enic_main.c | 8 +-
> > drivers/net/failsafe/failsafe_ops.c | 6 +-
> > drivers/net/gve/base/gve_adminq.c | 2 +-
> > drivers/net/hinic/hinic_pmd_flow.c | 40 +++----
> > drivers/net/hns3/hns3_fdir.c | 2 +-
> > drivers/net/hns3/hns3_flow.c | 4 +-
> > drivers/net/i40e/i40e_ethdev.c | 108 ++++++++----------
> > drivers/net/i40e/i40e_fdir.c | 28 +++--
> > drivers/net/i40e/i40e_flow.c | 56 +++++----
> > drivers/net/i40e/i40e_pf.c | 2 +-
> > drivers/net/i40e/i40e_tm.c | 11 +-
> > drivers/net/i40e/rte_pmd_i40e.c | 34 +++---
> > drivers/net/iavf/iavf_fdir.c | 93 +++++++--------
> > drivers/net/iavf/iavf_fsub.c | 50 ++++----
> > drivers/net/iavf/iavf_generic_flow.c | 2 +-
> > drivers/net/iavf/iavf_tm.c | 11 +-
> > drivers/net/iavf/iavf_vchnl.c | 9 +-
> > drivers/net/ice/ice_dcf.c | 5 +-
> > drivers/net/ice/ice_dcf_parent.c | 2 +-
> > drivers/net/ice/ice_dcf_sched.c | 11 +-
> > drivers/net/ice/ice_diagnose.c | 4 +-
> > drivers/net/ice/ice_ethdev.c | 14 +--
> > drivers/net/ice/ice_fdir_filter.c | 37 +++---
> > drivers/net/ice/ice_generic_flow.c | 2 +-
> > drivers/net/ice/ice_hash.c | 2 +-
> > drivers/net/ice/ice_tm.c | 11 +-
> > drivers/net/idpf/idpf_ethdev.c | 7 +-
> > drivers/net/idpf/idpf_rxtx.c | 10 +-
> > drivers/net/ipn3ke/ipn3ke_flow.c | 32 +++---
> > drivers/net/ipn3ke/ipn3ke_representor.c | 16 +--
> > drivers/net/ipn3ke/ipn3ke_tm.c | 6 +-
> > drivers/net/ixgbe/ixgbe_ethdev.c | 9 +-
> > drivers/net/ixgbe/ixgbe_fdir.c | 7 +-
> > drivers/net/ixgbe/ixgbe_flow.c | 65 +++++------
> > drivers/net/ixgbe/ixgbe_ipsec.c | 8 +-
> > drivers/net/ixgbe/ixgbe_pf.c | 4 +-
> > drivers/net/ixgbe/ixgbe_tm.c | 11 +-
> > drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +-
> > drivers/net/memif/memif_socket.c | 4 +-
> > drivers/net/mlx5/mlx5_devx.c | 4 +-
> > drivers/net/mlx5/mlx5_flow.c | 38 +++---
> > drivers/net/mlx5/mlx5_flow_aso.c | 6 +-
> > drivers/net/mlx5/mlx5_flow_hw.c | 16 +--
> > drivers/net/mlx5/mlx5_rx.c | 6 +-
> > drivers/net/mlx5/mlx5_rxtx_vec.c | 8 +-
> > drivers/net/mvpp2/mrvl_tm.c | 2 +-
> > drivers/net/nfp/flower/nfp_conntrack.c | 2 +-
> > drivers/net/nfp/flower/nfp_flower_flow.c | 16 +--
> > .../net/nfp/flower/nfp_flower_representor.c | 2 +-
> > drivers/net/nfp/nfp_mtr.c | 10 +-
> > drivers/net/ngbe/ngbe_pf.c | 4 +-
> > drivers/net/null/rte_eth_null.c | 6 +-
> > drivers/net/pcap/pcap_ethdev.c | 2 +-
> > drivers/net/pcap/pcap_osdep_freebsd.c | 2 +-
> > drivers/net/pcap/pcap_osdep_linux.c | 2 +-
> > drivers/net/qede/qede_main.c | 2 +-
> > drivers/net/sfc/sfc.c | 2 +-
> > drivers/net/sfc/sfc_ef10_tx.c | 2 +-
> > drivers/net/sfc/sfc_ethdev.c | 11 +-
> > drivers/net/sfc/sfc_flow.c | 20 ++--
> > drivers/net/sfc/sfc_flow_rss.c | 2 +-
> > drivers/net/sfc/sfc_mae.c | 2 +-
> > drivers/net/sfc/sfc_rx.c | 2 +-
> > drivers/net/sfc/sfc_tso.c | 2 +-
> > drivers/net/sfc/sfc_tso.h | 9 +-
> > drivers/net/tap/rte_eth_tap.c | 14 +--
> > drivers/net/txgbe/txgbe_ethdev.c | 9 +-
> > drivers/net/txgbe/txgbe_fdir.c | 6 +-
> > drivers/net/txgbe/txgbe_flow.c | 65 +++++------
> > drivers/net/txgbe/txgbe_ipsec.c | 8 +-
> > drivers/net/txgbe/txgbe_pf.c | 4 +-
> > drivers/net/txgbe/txgbe_tm.c | 11 +-
> > drivers/raw/ifpga/afu_pmd_he_hssi.c | 2 +-
> > drivers/raw/ifpga/afu_pmd_he_lpbk.c | 2 +-
> > drivers/raw/ifpga/afu_pmd_he_mem.c | 2 +-
> > drivers/raw/ifpga/afu_pmd_n3000.c | 8 +-
> > drivers/raw/ifpga/ifpga_rawdev.c | 10 +-
> > drivers/raw/skeleton/skeleton_rawdev.c | 7 +-
> > examples/bbdev_app/main.c | 2 +-
> > examples/l2fwd-cat/cat.c | 3 +-
> > examples/ptpclient/ptpclient.c | 11 +-
> > examples/vhost/main.c | 5 +-
> > examples/vmdq/main.c | 5 +-
> > examples/vmdq_dcb/main.c | 14 +--
> > lib/cryptodev/rte_cryptodev.c | 2 +-
> > lib/eal/common/eal_common_options.c | 7 +-
> > lib/ethdev/rte_ethdev.c | 3 +-
> > lib/ethdev/rte_flow.c | 5 +-
> > lib/eventdev/rte_event_crypto_adapter.c | 2 +-
> > lib/eventdev/rte_event_dma_adapter.c | 4 +-
> > lib/eventdev/rte_event_timer_adapter.c | 2 +-
> > lib/fib/trie.c | 2 +-
> > lib/ip_frag/rte_ipv6_fragmentation.c | 4 +-
> > lib/ip_frag/rte_ipv6_reassembly.c | 6 +-
> > lib/lpm/rte_lpm6.c | 3 +-
> > lib/net/rte_ether.c | 2 +-
> > lib/node/ip6_lookup.c | 8 +-
> > lib/pdcp/pdcp_process.c | 36 +++---
> > lib/pipeline/rte_table_action.c | 8 +-
> > lib/rib/rte_rib6.h | 3 +-
> > lib/security/rte_security.c | 4 +-
> > 162 files changed, 880 insertions(+), 960 deletions(-)
> > create mode 100644 devtools/cocci/rte_memcpy.cocci
> >
> > --
>
> Series-Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
For bnxt PMD and the series -
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>
> > 2.43.0
>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]
^ permalink raw reply [flat|nested] 205+ messages in thread
* RE: [PATCH v2 33/71] baseband/acc: replace use of fixed size rte_memcpy
2024-03-01 17:15 ` [PATCH v2 33/71] baseband/acc: " Stephen Hemminger
@ 2024-03-02 1:01 ` Chautru, Nicolas
2024-03-02 3:23 ` Stephen Hemminger
0 siblings, 1 reply; 205+ messages in thread
From: Chautru, Nicolas @ 2024-03-02 1:01 UTC (permalink / raw)
To: Stephen Hemminger, dev, Maxime Coquelin
Hi Stephen,
It messed with the indentation, didn't it?
Thanks
Nic
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Friday, March 1, 2024 9:15 AM
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Chautru, Nicolas
> <nicolas.chautru@intel.com>
> Subject: [PATCH v2 33/71] baseband/acc: replace use of fixed size
> rte_memcpy
>
> Automatically generated by devtools/cocci/rte_memcpy.cocci
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> drivers/baseband/acc/rte_acc100_pmd.c | 17 ++++++++---------
> drivers/baseband/acc/rte_vrb_pmd.c | 21 ++++++++++-----------
> 2 files changed, 18 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/baseband/acc/rte_acc100_pmd.c
> b/drivers/baseband/acc/rte_acc100_pmd.c
> index 4f666e514b72..6a6212f3deed 100644
> --- a/drivers/baseband/acc/rte_acc100_pmd.c
> +++ b/drivers/baseband/acc/rte_acc100_pmd.c
> @@ -2975,15 +2975,13 @@ enqueue_ldpc_dec_one_op_cb(struct
> acc_queue *q, struct rte_bbdev_dec_op *op,
> uint8_t *prev_ptr = (uint8_t *) prev_desc;
> uint8_t *new_ptr = (uint8_t *) desc;
> /* Copy first 4 words and BDESCs */
> - rte_memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
> - rte_memcpy(new_ptr + ACC_5GUL_OFFSET_0,
> - prev_ptr + ACC_5GUL_OFFSET_0,
> - ACC_5GUL_SIZE_1);
> + memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
> + memcpy(new_ptr + ACC_5GUL_OFFSET_0,
> + prev_ptr + ACC_5GUL_OFFSET_0, ACC_5GUL_SIZE_1);
> desc->req.op_addr = prev_desc->req.op_addr;
> /* Copy FCW */
> - rte_memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
> - prev_ptr + ACC_DESC_FCW_OFFSET,
> - ACC_FCW_LD_BLEN);
> + memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
> + prev_ptr + ACC_DESC_FCW_OFFSET,
> ACC_FCW_LD_BLEN);
> acc100_dma_desc_ld_update(op, &desc->req, input,
> h_output,
> &in_offset, &h_out_offset,
> &h_out_length, harq_layout);
> @@ -3130,7 +3128,8 @@ enqueue_ldpc_dec_one_op_tb(struct acc_queue
> *q, struct rte_bbdev_dec_op *op,
> desc = acc_desc(q, total_enqueued_cbs);
> desc->req.data_ptrs[0].address = q->ring_addr_iova +
> fcw_offset;
> desc->req.data_ptrs[0].blen = ACC_FCW_LD_BLEN;
> - rte_memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
> ACC_FCW_LD_BLEN);
> + memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
> + ACC_FCW_LD_BLEN);
> ret = acc100_dma_desc_ld_fill(op, &desc->req, &input,
> h_output, &in_offset, &h_out_offset,
> &h_out_length,
> @@ -4430,7 +4429,7 @@ acc100_configure(const char *dev_name, struct
> rte_acc_conf *conf)
> struct acc_device *d = bbdev->data->dev_private;
>
> /* Store configuration */
> - rte_memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
> + memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
>
> value = acc_reg_read(d, HwPfPcieGpexBridgeControl);
> bool firstCfg = (value != ACC100_CFG_PCI_BRIDGE); diff --git
> a/drivers/baseband/acc/rte_vrb_pmd.c
> b/drivers/baseband/acc/rte_vrb_pmd.c
> index 88b1104fab47..3e5376a12e39 100644
> --- a/drivers/baseband/acc/rte_vrb_pmd.c
> +++ b/drivers/baseband/acc/rte_vrb_pmd.c
> @@ -2450,15 +2450,13 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct
> acc_queue *q, struct rte_bbdev_dec_op *op,
> uint8_t *prev_ptr = (uint8_t *) prev_desc;
> uint8_t *new_ptr = (uint8_t *) desc;
> /* Copy first 4 words and BDESCs. */
> - rte_memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
> - rte_memcpy(new_ptr + ACC_5GUL_OFFSET_0,
> - prev_ptr + ACC_5GUL_OFFSET_0,
> - ACC_5GUL_SIZE_1);
> + memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
> + memcpy(new_ptr + ACC_5GUL_OFFSET_0,
> + prev_ptr + ACC_5GUL_OFFSET_0, ACC_5GUL_SIZE_1);
> desc->req.op_addr = prev_desc->req.op_addr;
> /* Copy FCW. */
> - rte_memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
> - prev_ptr + ACC_DESC_FCW_OFFSET,
> - ACC_FCW_LD_BLEN);
> + memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
> + prev_ptr + ACC_DESC_FCW_OFFSET,
> ACC_FCW_LD_BLEN);
> vrb_dma_desc_ld_update(op, &desc->req, input, h_output,
> &in_offset, &h_out_offset,
> &h_out_length, harq_layout);
> @@ -2566,7 +2564,8 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct
> acc_queue *q, struct rte_bbdev_dec_op *op,
> fcw_offset = (desc_idx << 8) + ACC_DESC_FCW_OFFSET;
> desc->req.data_ptrs[0].address = q->ring_addr_iova +
> fcw_offset;
> desc->req.data_ptrs[0].blen = ACC_FCW_LD_BLEN;
> - rte_memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
> ACC_FCW_LD_BLEN);
> + memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
> + ACC_FCW_LD_BLEN);
> desc->req.fcw_ld.tb_trailer_size = (c - r - 1) * trail_len;
> ret = vrb_dma_desc_ld_fill(op, &desc->req, &input,
> h_output, &in_offset, &h_out_offset, @@ -
> 3991,7 +3990,7 @@ enqueue_mldts_split_op(struct acc_queue *q, struct
> rte_bbdev_mldts_op *op,
> if (symb == 0)
> desc->req.cbs_in_tb = num_syms;
> else
> - rte_memcpy(&desc->req.fcw_mldts, fcw,
> ACC_FCW_MLDTS_BLEN);
> + memcpy(&desc->req.fcw_mldts, fcw,
> ACC_FCW_MLDTS_BLEN);
> desc->req.data_ptrs[1].address =
> rte_pktmbuf_iova_offset(input_q, in_offset);
> desc->req.data_ptrs[1].blen = q_size;
> in_offset += q_size;
> @@ -4337,7 +4336,7 @@ vrb1_configure(const char *dev_name, struct
> rte_acc_conf *conf)
> struct acc_device *d = bbdev->data->dev_private;
>
> /* Store configuration. */
> - rte_memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
> + memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
>
> /* Check we are already out of PG. */
> status = acc_reg_read(d, VRB1_PfHiSectionPowerGatingAck); @@ -
> 4744,7 +4743,7 @@ vrb2_configure(const char *dev_name, struct
> rte_acc_conf *conf)
> struct acc_device *d = bbdev->data->dev_private;
>
> /* Store configuration. */
> - rte_memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
> + memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
>
> /* Explicitly releasing AXI as this may be stopped after PF FLR/BME.
> */
> address = VRB2_PfDmaAxiControl;
> --
> 2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* Re: [PATCH v2 33/71] baseband/acc: replace use of fixed size rte_memcpy
2024-03-02 1:01 ` Chautru, Nicolas
@ 2024-03-02 3:23 ` Stephen Hemminger
2024-03-04 18:39 ` Chautru, Nicolas
0 siblings, 1 reply; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-02 3:23 UTC (permalink / raw)
To: Chautru, Nicolas; +Cc: dev, Maxime Coquelin
On Sat, 2 Mar 2024 01:01:02 +0000
"Chautru, Nicolas" <nicolas.chautru@intel.com> wrote:
> Hi Stephen,
> It messed with the indentation, didn't it?
> Thanks
> Nic
It ended up with the more standard indentation style rather than
DPDK special indent with extra tab.
^ permalink raw reply [flat|nested] 205+ messages in thread
* Re: [PATCH v2 00/71] replace use of fixed size rte_mempcy
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
` (71 preceding siblings ...)
2024-03-01 17:50 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Tyler Retzlaff
@ 2024-03-02 11:14 ` Mattias Rönnblom
2024-03-02 12:01 ` Mattias Rönnblom
72 siblings, 1 reply; 205+ messages in thread
From: Mattias Rönnblom @ 2024-03-02 11:14 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 2024-03-01 18:14, Stephen Hemminger wrote:
> The DPDK has a lot of "cargo cult" usage of rte_memcpy.
> This patch set replaces cases where rte_memcpy is used with a fixed
> size constant size.
>
> Typical example is:
> rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
> which can be replaced with:
> memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
>
> This has two benefits. Gcc (and clang) are smart enough that for
> all small fixed size values, they just generate the necessary instructions
> to do it inline. It also means that fortify, Coverity, and ASAN
> analyzers can check these memcpy's.
>
Instead of smearing out the knowledge of when to use rte_memcpy(), and
when to use memcpy() across the code base, wouldn't it be better to
*always* call rte_memcpy() in the fast path, and leave the policy
decision to the rte_memcpy() implementation?
In rte_memcpy(), add:
if (__builtin_constant_p(n) && n < RTE_LIBC_MEMCPY_SIZE_THRESHOLD)
memcpy(/../);
..or something to that effect.
Could you have a #ifdef for dumb static analysis tools? To make it look
like you are always using memcpy()?
> So faster, better, safer.
>
What is "faster" based on?
My experience with replacing rte_memcpy() with memcpy() (or vice versa)
is mixed.
I've also tried just dropping the DPDK-custom memcpy() implementation
altogether, and that caused a performance drop (in a particular app, on
a particular compiler and CPU).
> The first patch is a simple coccinelle script to do the replacement
> and the rest are the results broken out by module.
>
> The coccinelle script can be used again to make sure more bad
> usage doesn't creep in with new drivers.
>
> v2 - fix CI failure on some OS by adding string.h
> remove rte_memcpy.h if no longer used
>
> Stephen Hemminger (71):
> cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
> eal: replace use of fixed size rte_memcpy
> ethdev: replace use of fixed size rte_memcpy
> eventdev: replace use of fixed size rte_memcpy
> cryptodev: replace use of fixed size rte_memcpy
> ip_frag: replace use of fixed size rte_memcpy
> net: replace use of fixed size rte_memcpy
> lpm: replace use of fixed size rte_memcpy
> node: replace use of fixed size rte_memcpy
> pdcp: replace use of fixed size rte_memcpy
> pipeline: replace use of fixed size rte_memcpy
> rib: replace use of fixed size rte_memcpy
> security: replace use of fixed size rte_memcpy
> net/mlx5: replace use of fixed size rte_memcpy
> net/nfp: replace use of fixed size rte_memcpy
> net/ngbe: replace use of fixed size rte_memcpy
> net/null: replace use of fixed size rte_memcpy
> net/pcap: replace use of fixed size rte_memcpy
> net/sfc: replace use of fixed size rte_memcpy
> net/tap: replace use of fixed size rte_memcpy
> net/txgbe: replace use of fixed size rte_memcpy
> raw/ifpga: replace use of fixed size rte_memcpy
> raw/skeleton: replace use of fixed size rte_memcpy
> net/hns3: replace use of fixed size rte_memcpy
> net/i40e: replace use of fixed size rte_memcpy
> net/iavf: replace use of fixed size rte_memcpy
> net/ice: replace use of fixed size rte_memcpy
> net/idpf: replace use of fixed size rte_memcpy
> net/ipn3ke: replace use of fixed size rte_memcpy
> net/ixgbe: replace use of fixed size rte_memcpy
> net/memif: replace use of fixed size rte_memcpy
> net/qede: replace use of fixed size rte_memcpy
> baseband/acc: replace use of fixed size rte_memcpy
> baseband/la12xx: replace use of fixed size rte_memcpy
> common/idpf: replace use of fixed size rte_memcpy
> common/qat: replace use of fixed size rte_memcpy
> compress/qat: replace use of fixed size rte_memcpy
> crypto/ccp: replace use of fixed size rte_memcpy
> crypto/cnxk: replace use of fixed size rte_memcpy
> crypto/dpaa_sec: replace use of fixed size rte_memcpy
> crypto/ipsec_mb: replace use of fixed size rte_memcpy
> crypto/qat: replace use of fixed size rte_memcpy
> crypto/scheduler: replace use of fixed size rte_memcpy
> event/cnxk: replace use of fixed size rte_memcpy
> event/dlb2: replace use of fixed size rte_memcpy
> event/dpaa2: replace use of fixed size rte_memcpy
> event/octeontx: replace use of fixed size rte_memcpy
> mempool/dpaa: replace use of fixed size rte_memcpy
> mempool/dpaa2: replace use of fixed size rte_memcpy
> ml/cnxk: replace use of fixed size rte_memcpy
> net/af_xdp: replace use of fixed size rte_memcpy
> net/avp: replace use of fixed size rte_memcpy
> net/axgbe: replace use of fixed size rte_memcpy
> net/bnx2x: replace use of fixed size rte_memcpy
> net/bnxt: replace use of fixed size rte_memcpy
> net/bonding: replace use of fixed size rte_memcpy
> net/cnxk: replace use of fixed size rte_memcpy
> net/cpfl: replace use of fixed size rte_memcpy
> net/cxgbe: replace use of fixed size rte_memcpy
> net/dpaa2: replace use of fixed size rte_memcpy
> net/e1000: replace use of fixed size rte_memcpy
> net/enic: replace use of fixed size rte_memcpy
> net/failsafe: replace use of fixed size rte_memcpy
> net/gve/base: replace use of fixed size rte_memcpy
> net/hinic: replace use of fixed size rte_memcpy
> net/mvpp2: replace use of fixed size rte_memcpy
> app/test-pmd: replace use of fixed size rte_memcpy
> app/graph: replace use of fixed size rte_memcpy
> app/test-eventdev: replace use of fixed size rte_memcpy
> app/test: replace use of fixed size rte_memcpy
> examples: replace use of fixed size rte_memcpy
>
> app/graph/neigh.c | 8 +-
> app/test-eventdev/test_pipeline_common.c | 19 ++-
> app/test-pmd/cmdline.c | 48 ++++----
> app/test-pmd/cmdline_flow.c | 24 ++--
> app/test-pmd/config.c | 8 +-
> app/test-pmd/csumonly.c | 1 -
> app/test-pmd/flowgen.c | 1 -
> app/test-pmd/iofwd.c | 1 -
> app/test-pmd/macfwd.c | 1 -
> app/test-pmd/macswap.c | 1 -
> app/test-pmd/noisy_vnf.c | 1 -
> app/test-pmd/rxonly.c | 1 -
> app/test-pmd/testpmd.c | 1 -
> app/test/commands.c | 1 -
> app/test/packet_burst_generator.c | 4 +-
> app/test/test_crc.c | 5 +-
> app/test/test_cryptodev.c | 18 ++-
> app/test/test_cryptodev_asym.c | 1 -
> app/test/test_cryptodev_security_pdcp.c | 1 -
> app/test/test_efd.c | 1 -
> app/test/test_efd_perf.c | 1 -
> app/test/test_event_crypto_adapter.c | 12 +-
> app/test/test_event_dma_adapter.c | 4 +-
> app/test/test_eventdev.c | 1 -
> app/test/test_ipsec.c | 6 +-
> app/test/test_link_bonding_mode4.c | 8 +-
> app/test/test_mbuf.c | 1 -
> app/test/test_member.c | 1 -
> app/test/test_member_perf.c | 1 -
> app/test/test_rawdev.c | 1 -
> app/test/test_security_inline_proto.c | 36 +++---
> app/test/test_service_cores.c | 1 -
> app/test/virtual_pmd.c | 3 +-
> devtools/cocci/rte_memcpy.cocci | 11 ++
> drivers/baseband/acc/rte_acc100_pmd.c | 17 ++-
> drivers/baseband/acc/rte_vrb_pmd.c | 21 ++--
> drivers/baseband/la12xx/bbdev_la12xx.c | 4 +-
> drivers/common/idpf/idpf_common_device.c | 4 +-
> drivers/common/idpf/idpf_common_virtchnl.c | 8 +-
> drivers/common/qat/qat_qp.c | 10 +-
> drivers/compress/qat/qat_comp.c | 8 +-
> drivers/crypto/ccp/ccp_crypto.c | 14 +--
> drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +-
> drivers/crypto/cnxk/cnxk_se.h | 2 +-
> drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
> drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +-
> drivers/crypto/qat/qat_sym_session.c | 52 ++++-----
> .../scheduler/rte_cryptodev_scheduler.c | 6 +-
> drivers/crypto/scheduler/scheduler_failover.c | 12 +-
> drivers/event/cnxk/cnxk_tim_evdev.c | 4 +-
> drivers/event/dlb2/dlb2.c | 6 +-
> drivers/event/dpaa2/dpaa2_eventdev.c | 6 +-
> drivers/event/octeontx/timvf_evdev.c | 4 +-
> drivers/mempool/dpaa/dpaa_mempool.c | 4 +-
> drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 +-
> drivers/ml/cnxk/cn10k_ml_model.c | 8 +-
> drivers/ml/cnxk/cn10k_ml_ops.c | 11 +-
> drivers/ml/cnxk/cnxk_ml_ops.c | 2 +-
> drivers/ml/cnxk/mvtvm_ml_model.c | 8 +-
> drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +-
> drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
> drivers/net/avp/avp_ethdev.c | 4 +-
> drivers/net/axgbe/axgbe_ethdev.c | 4 +-
> drivers/net/bnx2x/bnx2x.c | 32 +++--
> drivers/net/bnx2x/bnx2x_stats.c | 10 +-
> drivers/net/bnx2x/bnx2x_vfpf.c | 19 +--
> drivers/net/bnxt/bnxt_flow.c | 34 +++---
> drivers/net/bonding/rte_eth_bond_8023ad.c | 4 +-
> drivers/net/bonding/rte_eth_bond_flow.c | 2 +-
> drivers/net/cnxk/cnxk_ethdev_ops.c | 2 +-
> drivers/net/cnxk/cnxk_tm.c | 5 +-
> drivers/net/cpfl/cpfl_ethdev.c | 3 +-
> drivers/net/cpfl/cpfl_vchnl.c | 4 +-
> drivers/net/cxgbe/clip_tbl.c | 2 +-
> drivers/net/cxgbe/cxgbe_filter.c | 8 +-
> drivers/net/cxgbe/l2t.c | 4 +-
> drivers/net/cxgbe/smt.c | 20 ++--
> drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 1 -
> drivers/net/dpaa2/dpaa2_ethdev.c | 1 -
> drivers/net/dpaa2/dpaa2_recycle.c | 1 -
> drivers/net/dpaa2/dpaa2_rxtx.c | 1 -
> drivers/net/dpaa2/dpaa2_sparser.c | 1 -
> drivers/net/dpaa2/dpaa2_tm.c | 2 +-
> drivers/net/e1000/em_rxtx.c | 1 -
> drivers/net/e1000/igb_flow.c | 22 ++--
> drivers/net/e1000/igb_pf.c | 7 +-
> drivers/net/e1000/igb_rxtx.c | 1 -
> drivers/net/enic/enic_main.c | 8 +-
> drivers/net/failsafe/failsafe_ops.c | 6 +-
> drivers/net/gve/base/gve_adminq.c | 2 +-
> drivers/net/hinic/hinic_pmd_flow.c | 40 +++----
> drivers/net/hns3/hns3_fdir.c | 2 +-
> drivers/net/hns3/hns3_flow.c | 4 +-
> drivers/net/i40e/i40e_ethdev.c | 109 ++++++++----------
> drivers/net/i40e/i40e_fdir.c | 28 +++--
> drivers/net/i40e/i40e_flow.c | 56 +++++----
> drivers/net/i40e/i40e_pf.c | 3 +-
> drivers/net/i40e/i40e_tm.c | 11 +-
> drivers/net/i40e/rte_pmd_i40e.c | 34 +++---
> drivers/net/iavf/iavf_fdir.c | 93 +++++++--------
> drivers/net/iavf/iavf_fsub.c | 50 ++++----
> drivers/net/iavf/iavf_generic_flow.c | 2 +-
> drivers/net/iavf/iavf_tm.c | 11 +-
> drivers/net/iavf/iavf_vchnl.c | 9 +-
> drivers/net/ice/ice_dcf.c | 5 +-
> drivers/net/ice/ice_dcf_parent.c | 2 +-
> drivers/net/ice/ice_dcf_sched.c | 11 +-
> drivers/net/ice/ice_diagnose.c | 4 +-
> drivers/net/ice/ice_ethdev.c | 14 +--
> drivers/net/ice/ice_fdir_filter.c | 37 +++---
> drivers/net/ice/ice_generic_flow.c | 2 +-
> drivers/net/ice/ice_hash.c | 2 +-
> drivers/net/ice/ice_tm.c | 11 +-
> drivers/net/idpf/idpf_ethdev.c | 7 +-
> drivers/net/idpf/idpf_rxtx.c | 10 +-
> drivers/net/ipn3ke/ipn3ke_flow.c | 32 +++--
> drivers/net/ipn3ke/ipn3ke_representor.c | 16 +--
> drivers/net/ipn3ke/ipn3ke_tm.c | 6 +-
> drivers/net/ixgbe/ixgbe_ethdev.c | 9 +-
> drivers/net/ixgbe/ixgbe_fdir.c | 7 +-
> drivers/net/ixgbe/ixgbe_flow.c | 65 +++++------
> drivers/net/ixgbe/ixgbe_ipsec.c | 8 +-
> drivers/net/ixgbe/ixgbe_pf.c | 5 +-
> drivers/net/ixgbe/ixgbe_tm.c | 11 +-
> drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +-
> drivers/net/memif/memif_socket.c | 4 +-
> drivers/net/mlx5/mlx5_devx.c | 4 +-
> drivers/net/mlx5/mlx5_flow.c | 38 +++---
> drivers/net/mlx5/mlx5_flow_aso.c | 6 +-
> drivers/net/mlx5/mlx5_flow_hw.c | 16 +--
> drivers/net/mlx5/mlx5_rx.c | 6 +-
> drivers/net/mlx5/mlx5_rxtx_vec.c | 8 +-
> drivers/net/mvpp2/mrvl_tm.c | 2 +-
> drivers/net/nfp/flower/nfp_conntrack.c | 2 +-
> drivers/net/nfp/flower/nfp_flower_flow.c | 16 +--
> .../net/nfp/flower/nfp_flower_representor.c | 2 +-
> drivers/net/nfp/nfp_mtr.c | 10 +-
> drivers/net/ngbe/ngbe_pf.c | 4 +-
> drivers/net/null/rte_eth_null.c | 6 +-
> drivers/net/pcap/pcap_ethdev.c | 2 +-
> drivers/net/pcap/pcap_osdep_freebsd.c | 2 +-
> drivers/net/pcap/pcap_osdep_linux.c | 2 +-
> drivers/net/qede/qede_main.c | 2 +-
> drivers/net/sfc/sfc.c | 2 +-
> drivers/net/sfc/sfc_ef10_tx.c | 2 +-
> drivers/net/sfc/sfc_ethdev.c | 11 +-
> drivers/net/sfc/sfc_flow.c | 20 ++--
> drivers/net/sfc/sfc_flow_rss.c | 2 +-
> drivers/net/sfc/sfc_mae.c | 2 +-
> drivers/net/sfc/sfc_rx.c | 2 +-
> drivers/net/sfc/sfc_tso.c | 2 +-
> drivers/net/sfc/sfc_tso.h | 9 +-
> drivers/net/tap/rte_eth_tap.c | 14 +--
> drivers/net/txgbe/txgbe_ethdev.c | 9 +-
> drivers/net/txgbe/txgbe_fdir.c | 6 +-
> drivers/net/txgbe/txgbe_flow.c | 65 +++++------
> drivers/net/txgbe/txgbe_ipsec.c | 8 +-
> drivers/net/txgbe/txgbe_pf.c | 4 +-
> drivers/net/txgbe/txgbe_tm.c | 11 +-
> drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +-
> drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +-
> drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +-
> drivers/raw/ifpga/afu_pmd_n3000.c | 8 +-
> drivers/raw/ifpga/ifpga_rawdev.c | 11 +-
> drivers/raw/skeleton/skeleton_rawdev.c | 7 +-
> examples/bbdev_app/main.c | 2 +-
> examples/l2fwd-cat/cat.c | 4 +-
> examples/ptpclient/ptpclient.c | 11 +-
> examples/vhost/main.c | 5 +-
> examples/vmdq/main.c | 6 +-
> examples/vmdq_dcb/main.c | 15 +--
> lib/cryptodev/rte_cryptodev.c | 2 +-
> lib/eal/common/eal_common_options.c | 7 +-
> lib/ethdev/rte_ethdev.c | 3 +-
> lib/ethdev/rte_flow.c | 5 +-
> lib/eventdev/rte_event_crypto_adapter.c | 2 +-
> lib/eventdev/rte_event_dma_adapter.c | 4 +-
> lib/eventdev/rte_event_timer_adapter.c | 2 +-
> lib/fib/trie.c | 2 +-
> lib/ip_frag/rte_ipv6_fragmentation.c | 4 +-
> lib/ip_frag/rte_ipv6_reassembly.c | 6 +-
> lib/lpm/rte_lpm6.c | 3 +-
> lib/net/rte_ether.c | 2 +-
> lib/node/ip6_lookup.c | 8 +-
> lib/pdcp/pdcp_process.c | 36 +++---
> lib/pipeline/rte_table_action.c | 8 +-
> lib/rib/rte_rib6.h | 5 +-
> lib/security/rte_security.c | 4 +-
> 188 files changed, 881 insertions(+), 998 deletions(-)
> create mode 100644 devtools/cocci/rte_memcpy.cocci
>
^ permalink raw reply [flat|nested] 205+ messages in thread
* Re: [PATCH v2 01/71] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
2024-03-01 17:14 ` [PATCH v2 01/71] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy Stephen Hemminger
@ 2024-03-02 11:19 ` Mattias Rönnblom
2024-03-02 17:02 ` Stephen Hemminger
0 siblings, 1 reply; 205+ messages in thread
From: Mattias Rönnblom @ 2024-03-02 11:19 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 2024-03-01 18:14, Stephen Hemminger wrote:
> Rte_memcpy should not be used for the simple case of copying
> a fix size structure because it is slower and will hide problems
> from code analysis tools. Coverity, fortify and other analyzers
> special case memcpy().
>
> Gcc (and Clang) are smart enough to inline copies which
> will be faster.
>
Are you suggesting rte_memcpy() calls aren't inlined?
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> devtools/cocci/rte_memcpy.cocci | 11 +++++++++++
> 1 file changed, 11 insertions(+)
> create mode 100644 devtools/cocci/rte_memcpy.cocci
>
> diff --git a/devtools/cocci/rte_memcpy.cocci b/devtools/cocci/rte_memcpy.cocci
> new file mode 100644
> index 000000000000..fa1038fc066d
> --- /dev/null
> +++ b/devtools/cocci/rte_memcpy.cocci
> @@ -0,0 +1,11 @@
> +//
> +// rte_memcpy should not be used for simple fixed size structure
> +// because compiler's are smart enough to inline these.
> +//
What do you do in code where it's not known if the size will be constant
or not?
> +@@
> +expression src, dst; constant size;
> +@@
> +(
> +- rte_memcpy(dst, src, size)
> ++ memcpy(dst, src, size)
> +)
^ permalink raw reply [flat|nested] 205+ messages in thread
* Re: [PATCH v2 00/71] replace use of fixed size rte_mempcy
2024-03-02 11:14 ` Mattias Rönnblom
@ 2024-03-02 12:01 ` Mattias Rönnblom
2024-03-02 13:05 ` Morten Brørup
2024-03-02 16:35 ` Stephen Hemminger
0 siblings, 2 replies; 205+ messages in thread
From: Mattias Rönnblom @ 2024-03-02 12:01 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 2024-03-02 12:14, Mattias Rönnblom wrote:
> On 2024-03-01 18:14, Stephen Hemminger wrote:
>> The DPDK has a lot of "cargo cult" usage of rte_memcpy.
>> This patch set replaces cases where rte_memcpy is used with a fixed
>> size constant size.
>>
>> Typical example is:
>> rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
>> which can be replaced with:
>> memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
>>
>> This has two benefits. Gcc (and clang) are smart enough that for
>> all small fixed size values, they just generate the necessary
>> instructions
>> to do it inline. It also means that fortify, Coverity, and ASAN
>> analyzers can check these memcpy's.
>>
>
> Instead of smearing out the knowledge of when to use rte_memcpy(), and
> when to use memcpy() across the code base, wouldn't it be better to
> *always* call rte_memcpy() in the fast path, and leave the policy
> decision to the rte_memcpy() implementation?
>
> In rte_memcpy(), add:
> if (__builtin_constant_p(n) && n < RTE_LIBC_MEMCPY_SIZE_THRESHOLD)
> memcpy(/../);
> ..or something to that effect.
>
> Could you have a #ifdef for dumb static analysis tools? To make it look
> like you are always using memcpy()?
>
>> So faster, better, safer.
>>
>
> What is "faster" based on?
>
I ran some DSW benchmarks, and if you add
diff --git a/lib/eal/x86/include/rte_memcpy.h
b/lib/eal/x86/include/rte_memcpy.h
index 72a92290e0..64cd82d78d 100644
--- a/lib/eal/x86/include/rte_memcpy.h
+++ b/lib/eal/x86/include/rte_memcpy.h
@@ -862,6 +862,11 @@ rte_memcpy_aligned(void *dst, const void *src,
size_t n)
static __rte_always_inline void *
rte_memcpy(void *dst, const void *src, size_t n)
{
+ if (__builtin_constant_p(n) && n <= 32) {
+ memcpy(dst, src, n);
+ return dst;
+ }
+
if (!(((uintptr_t)dst | (uintptr_t)src) & ALIGNMENT_MASK))
return rte_memcpy_aligned(dst, src, n);
else
...the overhead increases from roughly 48 core clock cycles/event to 59
cc/event. The same for "n < 128". (I'm not sure what counts as "small"
here.)
So something rte_memcpy() does for small and constant memory copies does
make things go *significantly* faster, at least in certain cases.
(Linux, GCC 11.4, Intel Gracemont.)
> My experience with replacing rte_memcpy() with memcpy() (or vice versa)
> is mixed.
>
> I've also tried just dropping the DPDK-custom memcpy() implementation
> altogether, and that caused a performance drop (in a particular app, on
> a particular compiler and CPU).
>
>> The first patch is a simple coccinelle script to do the replacement
>> and the rest are the results broken out by module.
>>
>> The coccinelle script can be used again to make sure more bad
>> usage doesn't creep in with new drivers.
>>
>> v2 - fix CI failure on some OS by adding string.h
>> remove rte_memcpy.h if no longer used
>>
>> Stephen Hemminger (71):
>> cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
>> eal: replace use of fixed size rte_memcpy
>> ethdev: replace use of fixed size rte_memcpy
>> eventdev: replace use of fixed size rte_memcpy
>> cryptodev: replace use of fixed size rte_memcpy
>> ip_frag: replace use of fixed size rte_memcpy
>> net: replace use of fixed size rte_memcpy
>> lpm: replace use of fixed size rte_memcpy
>> node: replace use of fixed size rte_memcpy
>> pdcp: replace use of fixed size rte_memcpy
>> pipeline: replace use of fixed size rte_memcpy
>> rib: replace use of fixed size rte_memcpy
>> security: replace use of fixed size rte_memcpy
>> net/mlx5: replace use of fixed size rte_memcpy
>> net/nfp: replace use of fixed size rte_memcpy
>> net/ngbe: replace use of fixed size rte_memcpy
>> net/null: replace use of fixed size rte_memcpy
>> net/pcap: replace use of fixed size rte_memcpy
>> net/sfc: replace use of fixed size rte_memcpy
>> net/tap: replace use of fixed size rte_memcpy
>> net/txgbe: replace use of fixed size rte_memcpy
>> raw/ifpga: replace use of fixed size rte_memcpy
>> raw/skeleton: replace use of fixed size rte_memcpy
>> net/hns3: replace use of fixed size rte_memcpy
>> net/i40e: replace use of fixed size rte_memcpy
>> net/iavf: replace use of fixed size rte_memcpy
>> net/ice: replace use of fixed size rte_memcpy
>> net/idpf: replace use of fixed size rte_memcpy
>> net/ipn3ke: replace use of fixed size rte_memcpy
>> net/ixgbe: replace use of fixed size rte_memcpy
>> net/memif: replace use of fixed size rte_memcpy
>> net/qede: replace use of fixed size rte_memcpy
>> baseband/acc: replace use of fixed size rte_memcpy
>> baseband/la12xx: replace use of fixed size rte_memcpy
>> common/idpf: replace use of fixed size rte_memcpy
>> common/qat: replace use of fixed size rte_memcpy
>> compress/qat: replace use of fixed size rte_memcpy
>> crypto/ccp: replace use of fixed size rte_memcpy
>> crypto/cnxk: replace use of fixed size rte_memcpy
>> crypto/dpaa_sec: replace use of fixed size rte_memcpy
>> crypto/ipsec_mb: replace use of fixed size rte_memcpy
>> crypto/qat: replace use of fixed size rte_memcpy
>> crypto/scheduler: replace use of fixed size rte_memcpy
>> event/cnxk: replace use of fixed size rte_memcpy
>> event/dlb2: replace use of fixed size rte_memcpy
>> event/dpaa2: replace use of fixed size rte_memcpy
>> event/octeontx: replace use of fixed size rte_memcpy
>> mempool/dpaa: replace use of fixed size rte_memcpy
>> mempool/dpaa2: replace use of fixed size rte_memcpy
>> ml/cnxk: replace use of fixed size rte_memcpy
>> net/af_xdp: replace use of fixed size rte_memcpy
>> net/avp: replace use of fixed size rte_memcpy
>> net/axgbe: replace use of fixed size rte_memcpy
>> net/bnx2x: replace use of fixed size rte_memcpy
>> net/bnxt: replace use of fixed size rte_memcpy
>> net/bonding: replace use of fixed size rte_memcpy
>> net/cnxk: replace use of fixed size rte_memcpy
>> net/cpfl: replace use of fixed size rte_memcpy
>> net/cxgbe: replace use of fixed size rte_memcpy
>> net/dpaa2: replace use of fixed size rte_memcpy
>> net/e1000: replace use of fixed size rte_memcpy
>> net/enic: replace use of fixed size rte_memcpy
>> net/failsafe: replace use of fixed size rte_memcpy
>> net/gve/base: replace use of fixed size rte_memcpy
>> net/hinic: replace use of fixed size rte_memcpy
>> net/mvpp2: replace use of fixed size rte_memcpy
>> app/test-pmd: replace use of fixed size rte_memcpy
>> app/graph: replace use of fixed size rte_memcpy
>> app/test-eventdev: replace use of fixed size rte_memcpy
>> app/test: replace use of fixed size rte_memcpy
>> examples: replace use of fixed size rte_memcpy
>>
>> app/graph/neigh.c | 8 +-
>> app/test-eventdev/test_pipeline_common.c | 19 ++-
>> app/test-pmd/cmdline.c | 48 ++++----
>> app/test-pmd/cmdline_flow.c | 24 ++--
>> app/test-pmd/config.c | 8 +-
>> app/test-pmd/csumonly.c | 1 -
>> app/test-pmd/flowgen.c | 1 -
>> app/test-pmd/iofwd.c | 1 -
>> app/test-pmd/macfwd.c | 1 -
>> app/test-pmd/macswap.c | 1 -
>> app/test-pmd/noisy_vnf.c | 1 -
>> app/test-pmd/rxonly.c | 1 -
>> app/test-pmd/testpmd.c | 1 -
>> app/test/commands.c | 1 -
>> app/test/packet_burst_generator.c | 4 +-
>> app/test/test_crc.c | 5 +-
>> app/test/test_cryptodev.c | 18 ++-
>> app/test/test_cryptodev_asym.c | 1 -
>> app/test/test_cryptodev_security_pdcp.c | 1 -
>> app/test/test_efd.c | 1 -
>> app/test/test_efd_perf.c | 1 -
>> app/test/test_event_crypto_adapter.c | 12 +-
>> app/test/test_event_dma_adapter.c | 4 +-
>> app/test/test_eventdev.c | 1 -
>> app/test/test_ipsec.c | 6 +-
>> app/test/test_link_bonding_mode4.c | 8 +-
>> app/test/test_mbuf.c | 1 -
>> app/test/test_member.c | 1 -
>> app/test/test_member_perf.c | 1 -
>> app/test/test_rawdev.c | 1 -
>> app/test/test_security_inline_proto.c | 36 +++---
>> app/test/test_service_cores.c | 1 -
>> app/test/virtual_pmd.c | 3 +-
>> devtools/cocci/rte_memcpy.cocci | 11 ++
>> drivers/baseband/acc/rte_acc100_pmd.c | 17 ++-
>> drivers/baseband/acc/rte_vrb_pmd.c | 21 ++--
>> drivers/baseband/la12xx/bbdev_la12xx.c | 4 +-
>> drivers/common/idpf/idpf_common_device.c | 4 +-
>> drivers/common/idpf/idpf_common_virtchnl.c | 8 +-
>> drivers/common/qat/qat_qp.c | 10 +-
>> drivers/compress/qat/qat_comp.c | 8 +-
>> drivers/crypto/ccp/ccp_crypto.c | 14 +--
>> drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +-
>> drivers/crypto/cnxk/cnxk_se.h | 2 +-
>> drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
>> drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +-
>> drivers/crypto/qat/qat_sym_session.c | 52 ++++-----
>> .../scheduler/rte_cryptodev_scheduler.c | 6 +-
>> drivers/crypto/scheduler/scheduler_failover.c | 12 +-
>> drivers/event/cnxk/cnxk_tim_evdev.c | 4 +-
>> drivers/event/dlb2/dlb2.c | 6 +-
>> drivers/event/dpaa2/dpaa2_eventdev.c | 6 +-
>> drivers/event/octeontx/timvf_evdev.c | 4 +-
>> drivers/mempool/dpaa/dpaa_mempool.c | 4 +-
>> drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 4 +-
>> drivers/ml/cnxk/cn10k_ml_model.c | 8 +-
>> drivers/ml/cnxk/cn10k_ml_ops.c | 11 +-
>> drivers/ml/cnxk/cnxk_ml_ops.c | 2 +-
>> drivers/ml/cnxk/mvtvm_ml_model.c | 8 +-
>> drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +-
>> drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
>> drivers/net/avp/avp_ethdev.c | 4 +-
>> drivers/net/axgbe/axgbe_ethdev.c | 4 +-
>> drivers/net/bnx2x/bnx2x.c | 32 +++--
>> drivers/net/bnx2x/bnx2x_stats.c | 10 +-
>> drivers/net/bnx2x/bnx2x_vfpf.c | 19 +--
>> drivers/net/bnxt/bnxt_flow.c | 34 +++---
>> drivers/net/bonding/rte_eth_bond_8023ad.c | 4 +-
>> drivers/net/bonding/rte_eth_bond_flow.c | 2 +-
>> drivers/net/cnxk/cnxk_ethdev_ops.c | 2 +-
>> drivers/net/cnxk/cnxk_tm.c | 5 +-
>> drivers/net/cpfl/cpfl_ethdev.c | 3 +-
>> drivers/net/cpfl/cpfl_vchnl.c | 4 +-
>> drivers/net/cxgbe/clip_tbl.c | 2 +-
>> drivers/net/cxgbe/cxgbe_filter.c | 8 +-
>> drivers/net/cxgbe/l2t.c | 4 +-
>> drivers/net/cxgbe/smt.c | 20 ++--
>> drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 1 -
>> drivers/net/dpaa2/dpaa2_ethdev.c | 1 -
>> drivers/net/dpaa2/dpaa2_recycle.c | 1 -
>> drivers/net/dpaa2/dpaa2_rxtx.c | 1 -
>> drivers/net/dpaa2/dpaa2_sparser.c | 1 -
>> drivers/net/dpaa2/dpaa2_tm.c | 2 +-
>> drivers/net/e1000/em_rxtx.c | 1 -
>> drivers/net/e1000/igb_flow.c | 22 ++--
>> drivers/net/e1000/igb_pf.c | 7 +-
>> drivers/net/e1000/igb_rxtx.c | 1 -
>> drivers/net/enic/enic_main.c | 8 +-
>> drivers/net/failsafe/failsafe_ops.c | 6 +-
>> drivers/net/gve/base/gve_adminq.c | 2 +-
>> drivers/net/hinic/hinic_pmd_flow.c | 40 +++----
>> drivers/net/hns3/hns3_fdir.c | 2 +-
>> drivers/net/hns3/hns3_flow.c | 4 +-
>> drivers/net/i40e/i40e_ethdev.c | 109 ++++++++----------
>> drivers/net/i40e/i40e_fdir.c | 28 +++--
>> drivers/net/i40e/i40e_flow.c | 56 +++++----
>> drivers/net/i40e/i40e_pf.c | 3 +-
>> drivers/net/i40e/i40e_tm.c | 11 +-
>> drivers/net/i40e/rte_pmd_i40e.c | 34 +++---
>> drivers/net/iavf/iavf_fdir.c | 93 +++++++--------
>> drivers/net/iavf/iavf_fsub.c | 50 ++++----
>> drivers/net/iavf/iavf_generic_flow.c | 2 +-
>> drivers/net/iavf/iavf_tm.c | 11 +-
>> drivers/net/iavf/iavf_vchnl.c | 9 +-
>> drivers/net/ice/ice_dcf.c | 5 +-
>> drivers/net/ice/ice_dcf_parent.c | 2 +-
>> drivers/net/ice/ice_dcf_sched.c | 11 +-
>> drivers/net/ice/ice_diagnose.c | 4 +-
>> drivers/net/ice/ice_ethdev.c | 14 +--
>> drivers/net/ice/ice_fdir_filter.c | 37 +++---
>> drivers/net/ice/ice_generic_flow.c | 2 +-
>> drivers/net/ice/ice_hash.c | 2 +-
>> drivers/net/ice/ice_tm.c | 11 +-
>> drivers/net/idpf/idpf_ethdev.c | 7 +-
>> drivers/net/idpf/idpf_rxtx.c | 10 +-
>> drivers/net/ipn3ke/ipn3ke_flow.c | 32 +++--
>> drivers/net/ipn3ke/ipn3ke_representor.c | 16 +--
>> drivers/net/ipn3ke/ipn3ke_tm.c | 6 +-
>> drivers/net/ixgbe/ixgbe_ethdev.c | 9 +-
>> drivers/net/ixgbe/ixgbe_fdir.c | 7 +-
>> drivers/net/ixgbe/ixgbe_flow.c | 65 +++++------
>> drivers/net/ixgbe/ixgbe_ipsec.c | 8 +-
>> drivers/net/ixgbe/ixgbe_pf.c | 5 +-
>> drivers/net/ixgbe/ixgbe_tm.c | 11 +-
>> drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +-
>> drivers/net/memif/memif_socket.c | 4 +-
>> drivers/net/mlx5/mlx5_devx.c | 4 +-
>> drivers/net/mlx5/mlx5_flow.c | 38 +++---
>> drivers/net/mlx5/mlx5_flow_aso.c | 6 +-
>> drivers/net/mlx5/mlx5_flow_hw.c | 16 +--
>> drivers/net/mlx5/mlx5_rx.c | 6 +-
>> drivers/net/mlx5/mlx5_rxtx_vec.c | 8 +-
>> drivers/net/mvpp2/mrvl_tm.c | 2 +-
>> drivers/net/nfp/flower/nfp_conntrack.c | 2 +-
>> drivers/net/nfp/flower/nfp_flower_flow.c | 16 +--
>> .../net/nfp/flower/nfp_flower_representor.c | 2 +-
>> drivers/net/nfp/nfp_mtr.c | 10 +-
>> drivers/net/ngbe/ngbe_pf.c | 4 +-
>> drivers/net/null/rte_eth_null.c | 6 +-
>> drivers/net/pcap/pcap_ethdev.c | 2 +-
>> drivers/net/pcap/pcap_osdep_freebsd.c | 2 +-
>> drivers/net/pcap/pcap_osdep_linux.c | 2 +-
>> drivers/net/qede/qede_main.c | 2 +-
>> drivers/net/sfc/sfc.c | 2 +-
>> drivers/net/sfc/sfc_ef10_tx.c | 2 +-
>> drivers/net/sfc/sfc_ethdev.c | 11 +-
>> drivers/net/sfc/sfc_flow.c | 20 ++--
>> drivers/net/sfc/sfc_flow_rss.c | 2 +-
>> drivers/net/sfc/sfc_mae.c | 2 +-
>> drivers/net/sfc/sfc_rx.c | 2 +-
>> drivers/net/sfc/sfc_tso.c | 2 +-
>> drivers/net/sfc/sfc_tso.h | 9 +-
>> drivers/net/tap/rte_eth_tap.c | 14 +--
>> drivers/net/txgbe/txgbe_ethdev.c | 9 +-
>> drivers/net/txgbe/txgbe_fdir.c | 6 +-
>> drivers/net/txgbe/txgbe_flow.c | 65 +++++------
>> drivers/net/txgbe/txgbe_ipsec.c | 8 +-
>> drivers/net/txgbe/txgbe_pf.c | 4 +-
>> drivers/net/txgbe/txgbe_tm.c | 11 +-
>> drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +-
>> drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +-
>> drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +-
>> drivers/raw/ifpga/afu_pmd_n3000.c | 8 +-
>> drivers/raw/ifpga/ifpga_rawdev.c | 11 +-
>> drivers/raw/skeleton/skeleton_rawdev.c | 7 +-
>> examples/bbdev_app/main.c | 2 +-
>> examples/l2fwd-cat/cat.c | 4 +-
>> examples/ptpclient/ptpclient.c | 11 +-
>> examples/vhost/main.c | 5 +-
>> examples/vmdq/main.c | 6 +-
>> examples/vmdq_dcb/main.c | 15 +--
>> lib/cryptodev/rte_cryptodev.c | 2 +-
>> lib/eal/common/eal_common_options.c | 7 +-
>> lib/ethdev/rte_ethdev.c | 3 +-
>> lib/ethdev/rte_flow.c | 5 +-
>> lib/eventdev/rte_event_crypto_adapter.c | 2 +-
>> lib/eventdev/rte_event_dma_adapter.c | 4 +-
>> lib/eventdev/rte_event_timer_adapter.c | 2 +-
>> lib/fib/trie.c | 2 +-
>> lib/ip_frag/rte_ipv6_fragmentation.c | 4 +-
>> lib/ip_frag/rte_ipv6_reassembly.c | 6 +-
>> lib/lpm/rte_lpm6.c | 3 +-
>> lib/net/rte_ether.c | 2 +-
>> lib/node/ip6_lookup.c | 8 +-
>> lib/pdcp/pdcp_process.c | 36 +++---
>> lib/pipeline/rte_table_action.c | 8 +-
>> lib/rib/rte_rib6.h | 5 +-
>> lib/security/rte_security.c | 4 +-
>> 188 files changed, 881 insertions(+), 998 deletions(-)
>> create mode 100644 devtools/cocci/rte_memcpy.cocci
>>
^ permalink raw reply [flat|nested] 205+ messages in thread
* RE: [PATCH v2 00/71] replace use of fixed size rte_mempcy
2024-03-02 12:01 ` Mattias Rönnblom
@ 2024-03-02 13:05 ` Morten Brørup
2024-03-02 16:37 ` Stephen Hemminger
2024-03-02 16:35 ` Stephen Hemminger
1 sibling, 1 reply; 205+ messages in thread
From: Morten Brørup @ 2024-03-02 13:05 UTC (permalink / raw)
To: Mattias Rönnblom, Stephen Hemminger, dev
> From: Mattias Rönnblom [mailto:hofors@lysator.liu.se]
> Sent: Saturday, 2 March 2024 13.02
>
> On 2024-03-02 12:14, Mattias Rönnblom wrote:
> > On 2024-03-01 18:14, Stephen Hemminger wrote:
> >> The DPDK has a lot of "cargo cult" usage of rte_memcpy.
> >> This patch set replaces cases where rte_memcpy is used with a fixed
> >> size constant size.
> >>
> >> Typical example is:
> >> rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
> >> which can be replaced with:
> >> memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
> >>
> >> This has two benefits. Gcc (and clang) are smart enough that for
> >> all small fixed size values, they just generate the necessary
> >> instructions
> >> to do it inline. It also means that fortify, Coverity, and ASAN
> >> analyzers can check these memcpy's.
> >>
> >
> > Instead of smearing out the knowledge of when to use rte_memcpy(), and
> > when to use memcpy() across the code base, wouldn't it be better to
> > *always* call rte_memcpy() in the fast path, and leave the policy
> > decision to the rte_memcpy() implementation?
> >
> > In rte_memcpy(), add:
> > if (__builtin_constant_p(n) && n < RTE_LIBC_MEMCPY_SIZE_THRESHOLD)
> > memcpy(/../);
> > ..or something to that effect.
> >
> > Could you have a #ifdef for dumb static analysis tools? To make it
> look
> > like you are always using memcpy()?
> >
> >> So faster, better, safer.
> >>
> >
> > What is "faster" based on?
> >
>
> I ran some DSW benchmarks, and if you add
>
> diff --git a/lib/eal/x86/include/rte_memcpy.h
> b/lib/eal/x86/include/rte_memcpy.h
> index 72a92290e0..64cd82d78d 100644
> --- a/lib/eal/x86/include/rte_memcpy.h
> +++ b/lib/eal/x86/include/rte_memcpy.h
> @@ -862,6 +862,11 @@ rte_memcpy_aligned(void *dst, const void *src,
> size_t n)
> static __rte_always_inline void *
> rte_memcpy(void *dst, const void *src, size_t n)
> {
> + if (__builtin_constant_p(n) && n <= 32) {
> + memcpy(dst, src, n);
> + return dst;
> + }
> +
> if (!(((uintptr_t)dst | (uintptr_t)src) & ALIGNMENT_MASK))
> return rte_memcpy_aligned(dst, src, n);
> else
>
> ...the overhead increases from roughly 48 core clock cycles/event to 59
> cc/event. The same for "n < 128". (I'm not sure what counts as "small"
> here.)
Thank you for digging deep into this, Mattias.
Your performance data are very interesting.
>
> So something rte_memcpy() does for small and constant memory copies does
> make things go *significantly* faster, at least in certain cases.
Interesting.
Perhaps something with aligned copies...
The performance benefits of well known alignment was something I was looking into when working on non-temporal memcpy functions, because non-temporal load/store has some alignment requirements. (NB: NT memcpy development is hold, until I get more time to work on it again.)
Passing alignment information as a flag to an extended memcpy, to be used by __builtin_constant_p(n), could speed up copying when alignment is known by the developer, but impossible for the compiler to determine at build time.
The rte_memcpy() checks for one specific alignment criteria at runtime. I suppose the branch predictor makes it execute nearly as fast as if determined at build time, but it still consumes a lot more instruction memory.
Perhaps something else...?
>
> (Linux, GCC 11.4, Intel Gracemont.)
>
> > My experience with replacing rte_memcpy() with memcpy() (or vice
> versa)
> > is mixed.
> >
> > I've also tried just dropping the DPDK-custom memcpy() implementation
> > altogether, and that caused a performance drop (in a particular app,
> on
> > a particular compiler and CPU).
I guess the compilers are just not where we want them to be yet.
I don't mind generally replacing rte_memcpy() with memcpy() in the control plane.
But we should use whatever is more efficient in the data plane.
We must also keep in mind that DPDK supports old distros with old compilers. We should not remove a superfluous hand crafted optimization if a supported old compiler hasn't caught up with it yet, i.e. if it isn't superfluous on some of the old compilers supported by DPDK.
^ permalink raw reply [flat|nested] 205+ messages in thread
* Re: [PATCH v2 00/71] replace use of fixed size rte_mempcy
2024-03-02 12:01 ` Mattias Rönnblom
2024-03-02 13:05 ` Morten Brørup
@ 2024-03-02 16:35 ` Stephen Hemminger
1 sibling, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-02 16:35 UTC (permalink / raw)
To: Mattias Rönnblom; +Cc: dev
On Sat, 2 Mar 2024 13:01:51 +0100
Mattias Rönnblom <hofors@lysator.liu.se> wrote:
> I ran some DSW benchmarks, and if you add
>
> diff --git a/lib/eal/x86/include/rte_memcpy.h
> b/lib/eal/x86/include/rte_memcpy.h
> index 72a92290e0..64cd82d78d 100644
> --- a/lib/eal/x86/include/rte_memcpy.h
> +++ b/lib/eal/x86/include/rte_memcpy.h
> @@ -862,6 +862,11 @@ rte_memcpy_aligned(void *dst, const void *src,
> size_t n)
> static __rte_always_inline void *
> rte_memcpy(void *dst, const void *src, size_t n)
> {
> + if (__builtin_constant_p(n) && n <= 32) {
> + memcpy(dst, src, n);
> + return dst;
> + }
> +
The default GCC inline threshold is 64 bytes (ie cache line size)
and that makes sense. Since using __builtin_constant_p could
do:
if (__builtin_constant_p(p) && n < RTE_CACHE_LINE_SIZE)
return __builtin_memcpy(dst, src, n);
^ permalink raw reply [flat|nested] 205+ messages in thread
* Re: [PATCH v2 00/71] replace use of fixed size rte_mempcy
2024-03-02 13:05 ` Morten Brørup
@ 2024-03-02 16:37 ` Stephen Hemminger
2024-03-02 17:32 ` Morten Brørup
0 siblings, 1 reply; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-02 16:37 UTC (permalink / raw)
To: Morten Brørup; +Cc: Mattias Rönnblom, dev
On Sat, 2 Mar 2024 14:05:45 +0100
Morten Brørup <mb@smartsharesystems.com> wrote:
> >
> > > My experience with replacing rte_memcpy() with memcpy() (or vice
> > versa)
> > > is mixed.
> > >
> > > I've also tried just dropping the DPDK-custom memcpy() implementation
> > > altogether, and that caused a performance drop (in a particular app,
> > on
> > > a particular compiler and CPU).
>
> I guess the compilers are just not where we want them to be yet.
>
> I don't mind generally replacing rte_memcpy() with memcpy() in the control plane.
> But we should use whatever is more efficient in the data plane.
>
> We must also keep in mind that DPDK supports old distros with old compilers. We should not remove a superfluous hand crafted optimization if a supported old compiler hasn't caught up with it yet, i.e. if it isn't superfluous on some of the old compilers supported by DPDK.
When I scanned the result.
1. Most copies were small (like Ether address or IPv6 address) and compiler
inlining should beat a function call every time.
2. Larger structure copies were in control path.
^ permalink raw reply [flat|nested] 205+ messages in thread
* Re: [PATCH v2 01/71] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
2024-03-02 11:19 ` Mattias Rönnblom
@ 2024-03-02 17:02 ` Stephen Hemminger
2024-03-02 17:39 ` Morten Brørup
0 siblings, 1 reply; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-02 17:02 UTC (permalink / raw)
To: Mattias Rönnblom; +Cc: dev
On Sat, 2 Mar 2024 12:19:13 +0100
Mattias Rönnblom <hofors@lysator.liu.se> wrote:
> On 2024-03-01 18:14, Stephen Hemminger wrote:
> > Rte_memcpy should not be used for the simple case of copying
> > a fix size structure because it is slower and will hide problems
> > from code analysis tools. Coverity, fortify and other analyzers
> > special case memcpy().
> >
> > Gcc (and Clang) are smart enough to inline copies which
> > will be faster.
> >
>
> Are you suggesting rte_memcpy() calls aren't inlined?
With a simple made up example of copying an IPv6 address.
rte_memcpy() inlines to:
rte_copy_addr:
movdqu xmm0, XMMWORD PTR [rsi]
movups XMMWORD PTR [rdi], xmm0
movdqu xmm0, XMMWORD PTR [rsi]
movups XMMWORD PTR [rdi], xmm0
ret
Vs memcpy becomes.
copy_addr:
movdqu xmm0, XMMWORD PTR [rsi]
movups XMMWORD PTR [rdi], xmm0
ret
Looks like a bug in rte_memcpy_generic? Why is it not handling
16 bytes correctly.
For me, it was more about getting fortify and compiler warnings to
catch bugs. For most code, the output should be the same.
^ permalink raw reply [flat|nested] 205+ messages in thread
* RE: [PATCH v2 00/71] replace use of fixed size rte_mempcy
2024-03-02 16:37 ` Stephen Hemminger
@ 2024-03-02 17:32 ` Morten Brørup
0 siblings, 0 replies; 205+ messages in thread
From: Morten Brørup @ 2024-03-02 17:32 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Mattias Rönnblom, dev
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Saturday, 2 March 2024 17.38
>
> On Sat, 2 Mar 2024 14:05:45 +0100
> Morten Brørup <mb@smartsharesystems.com> wrote:
>
> > >
> > > > My experience with replacing rte_memcpy() with memcpy() (or vice
> > > versa)
> > > > is mixed.
> > > >
> > > > I've also tried just dropping the DPDK-custom memcpy()
> implementation
> > > > altogether, and that caused a performance drop (in a particular
> app,
> > > on
> > > > a particular compiler and CPU).
> >
> > I guess the compilers are just not where we want them to be yet.
> >
> > I don't mind generally replacing rte_memcpy() with memcpy() in the
> control plane.
> > But we should use whatever is more efficient in the data plane.
> >
> > We must also keep in mind that DPDK supports old distros with old
> compilers. We should not remove a superfluous hand crafted optimization
> if a supported old compiler hasn't caught up with it yet, i.e. if it
> isn't superfluous on some of the old compilers supported by DPDK.
>
> When I scanned the result.
> 1. Most copies were small (like Ether address or IPv6 address)
> and compiler
> inlining should beat a function call every time.
Please note that rte_memcpy() is inline, so no function call is involved.
> 2. Larger structure copies were in control path.
Yep, I saw the same two things when scanning v1 of the series before acking it.
If we didn't overlook any fast path copies, this series is a good clean-up
I must admit that I assume that any compiler's built-in memcpy() is able to efficiently copy small structures of build time constant size.
Assumptions are the mother of all FU's, but being wrong on this would be a very big surprise to me.
^ permalink raw reply [flat|nested] 205+ messages in thread
* RE: [PATCH v2 01/71] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
2024-03-02 17:02 ` Stephen Hemminger
@ 2024-03-02 17:39 ` Morten Brørup
0 siblings, 0 replies; 205+ messages in thread
From: Morten Brørup @ 2024-03-02 17:39 UTC (permalink / raw)
To: Stephen Hemminger, Mattias Rönnblom, Leyi Rong,
bruce.richardson, konstantin.v.ananyev
Cc: dev
+To: x86 maintainers, another bug in rte_memcpy()
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Saturday, 2 March 2024 18.02
>
> On Sat, 2 Mar 2024 12:19:13 +0100
> Mattias Rönnblom <hofors@lysator.liu.se> wrote:
>
> > On 2024-03-01 18:14, Stephen Hemminger wrote:
> > > Rte_memcpy should not be used for the simple case of copying
> > > a fix size structure because it is slower and will hide problems
> > > from code analysis tools. Coverity, fortify and other analyzers
> > > special case memcpy().
> > >
> > > Gcc (and Clang) are smart enough to inline copies which
> > > will be faster.
> > >
> >
> > Are you suggesting rte_memcpy() calls aren't inlined?
>
> With a simple made up example of copying an IPv6 address.
>
> rte_memcpy() inlines to:
> rte_copy_addr:
> movdqu xmm0, XMMWORD PTR [rsi]
> movups XMMWORD PTR [rdi], xmm0
> movdqu xmm0, XMMWORD PTR [rsi]
> movups XMMWORD PTR [rdi], xmm0
> ret
>
> Vs memcpy becomes.
>
> copy_addr:
> movdqu xmm0, XMMWORD PTR [rsi]
> movups XMMWORD PTR [rdi], xmm0
> ret
>
> Looks like a bug in rte_memcpy_generic? Why is it not handling
> 16 bytes correctly.
Looks like you have run into another bunch of off-by-one errors like this one:
https://git.dpdk.org/dpdk/commit/lib/eal/x86/include/rte_memcpy.h?id=2ef17be88e8b26f871cfb0265227341e36f486ea
>
> For me, it was more about getting fortify and compiler warnings to
> catch bugs. For most code, the output should be the same.
^ permalink raw reply [flat|nested] 205+ messages in thread
* RE: [PATCH v2 33/71] baseband/acc: replace use of fixed size rte_memcpy
2024-03-02 3:23 ` Stephen Hemminger
@ 2024-03-04 18:39 ` Chautru, Nicolas
0 siblings, 0 replies; 205+ messages in thread
From: Chautru, Nicolas @ 2024-03-04 18:39 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev, Maxime Coquelin
> From: Stephen Hemminger <stephen@networkplumber.org
>> "Chautru, Nicolas" <nicolas.chautru@intel.com> wrote:
>
> > Hi Stephen,
> > It messed with the indentation, didn't it?
> > Thanks
> > Nic
>
> It ended up with the more standard indentation style rather than DPDK special
> indent with extra tab.
I see a mix of space and tabs and indeed not following DPDK indentation. You are fixing that right? Currently that's a nack.
^ permalink raw reply [flat|nested] 205+ messages in thread
* RE: [PATCH v2 22/71] raw/ifpga: replace use of fixed size rte_memcpy
2024-03-01 17:15 ` [PATCH v2 22/71] raw/ifpga: " Stephen Hemminger
@ 2024-03-05 9:13 ` Xu, Rosen
0 siblings, 0 replies; 205+ messages in thread
From: Xu, Rosen @ 2024-03-05 9:13 UTC (permalink / raw)
To: Stephen Hemminger, dev
Hi,
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Saturday, March 2, 2024 1:15 AM
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Xu, Rosen
> <rosen.xu@intel.com>
> Subject: [PATCH v2 22/71] raw/ifpga: replace use of fixed size rte_memcpy
>
> Automatically generated by devtools/cocci/rte_memcpy.cocci
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +--
> drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +--
> drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +--
> drivers/raw/ifpga/afu_pmd_n3000.c | 8 ++++----
> drivers/raw/ifpga/ifpga_rawdev.c | 11 +++++------
> 5 files changed, 12 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/raw/ifpga/afu_pmd_he_hssi.c
> b/drivers/raw/ifpga/afu_pmd_he_hssi.c
> index 859f28dcc1f0..c2aaed9203ae 100644
> --- a/drivers/raw/ifpga/afu_pmd_he_hssi.c
> +++ b/drivers/raw/ifpga/afu_pmd_he_hssi.c
> @@ -15,7 +15,6 @@
>
> #include <rte_eal.h>
> #include <rte_malloc.h>
> -#include <rte_memcpy.h>
> #include <rte_io.h>
> #include <rte_vfio.h>
> #include <bus_pci_driver.h>
> @@ -314,7 +313,7 @@ static int he_hssi_config(struct afu_rawdev *dev,
> void *config,
> if (cfg->port >= NUM_HE_HSSI_PORTS)
> return -EINVAL;
>
> - rte_memcpy(&priv->he_hssi_cfg, cfg, sizeof(priv->he_hssi_cfg));
> + memcpy(&priv->he_hssi_cfg, cfg, sizeof(priv->he_hssi_cfg));
>
> return 0;
> }
> diff --git a/drivers/raw/ifpga/afu_pmd_he_lpbk.c
> b/drivers/raw/ifpga/afu_pmd_he_lpbk.c
> index c7c5cda48c35..ffb7075c84d2 100644
> --- a/drivers/raw/ifpga/afu_pmd_he_lpbk.c
> +++ b/drivers/raw/ifpga/afu_pmd_he_lpbk.c
> @@ -15,7 +15,6 @@
>
> #include <rte_eal.h>
> #include <rte_malloc.h>
> -#include <rte_memcpy.h>
> #include <rte_io.h>
> #include <rte_vfio.h>
> #include <bus_pci_driver.h>
> @@ -363,7 +362,7 @@ static int he_lpbk_config(struct afu_rawdev *dev,
> void *config,
> if ((cfg->end < cfg->begin) || (cfg->end > MAX_CACHE_LINES))
> return -EINVAL;
>
> - rte_memcpy(&priv->he_lpbk_cfg, cfg, sizeof(priv->he_lpbk_cfg));
> + memcpy(&priv->he_lpbk_cfg, cfg, sizeof(priv->he_lpbk_cfg));
>
> return 0;
> }
> diff --git a/drivers/raw/ifpga/afu_pmd_he_mem.c
> b/drivers/raw/ifpga/afu_pmd_he_mem.c
> index a1db533eeb93..b799e40d2db9 100644
> --- a/drivers/raw/ifpga/afu_pmd_he_mem.c
> +++ b/drivers/raw/ifpga/afu_pmd_he_mem.c
> @@ -14,7 +14,6 @@
>
> #include <rte_eal.h>
> #include <rte_malloc.h>
> -#include <rte_memcpy.h>
> #include <rte_io.h>
> #include <rte_vfio.h>
> #include <bus_pci_driver.h>
> @@ -126,7 +125,7 @@ static int he_mem_tg_config(struct afu_rawdev *dev,
> void *config,
> if (config_size != sizeof(struct rte_pmd_afu_he_mem_tg_cfg))
> return -EINVAL;
>
> - rte_memcpy(&priv->he_mem_tg_cfg, config, sizeof(priv-
> >he_mem_tg_cfg));
> + memcpy(&priv->he_mem_tg_cfg, config, sizeof(priv-
> >he_mem_tg_cfg));
>
> return 0;
> }
> diff --git a/drivers/raw/ifpga/afu_pmd_n3000.c
> b/drivers/raw/ifpga/afu_pmd_n3000.c
> index 67b394126595..9236c0b15371 100644
> --- a/drivers/raw/ifpga/afu_pmd_n3000.c
> +++ b/drivers/raw/ifpga/afu_pmd_n3000.c
> @@ -1867,8 +1867,8 @@ static int n3000_afu_config(struct afu_rawdev *dev,
> void *config,
> if ((cfg->nlb_cfg.end < cfg->nlb_cfg.begin) ||
> (cfg->nlb_cfg.end > MAX_CACHE_LINES))
> return -EINVAL;
> - rte_memcpy(&priv->nlb_cfg, &cfg->nlb_cfg,
> - sizeof(struct rte_pmd_afu_nlb_cfg));
> + memcpy(&priv->nlb_cfg, &cfg->nlb_cfg,
> + sizeof(struct rte_pmd_afu_nlb_cfg));
> } else if (cfg->type == RTE_PMD_AFU_N3000_DMA) {
> if (cfg->dma_cfg.index >= NUM_N3000_DMA)
> return -EINVAL;
> @@ -1887,8 +1887,8 @@ static int n3000_afu_config(struct afu_rawdev *dev,
> void *config,
> cfg->dma_cfg.length);
> }
> }
> - rte_memcpy(&priv->dma_cfg, &cfg->dma_cfg,
> - sizeof(struct rte_pmd_afu_dma_cfg));
> + memcpy(&priv->dma_cfg, &cfg->dma_cfg,
> + sizeof(struct rte_pmd_afu_dma_cfg));
> } else {
> IFPGA_RAWDEV_PMD_ERR("Invalid type of N3000 AFU");
> return -EINVAL;
> diff --git a/drivers/raw/ifpga/ifpga_rawdev.c
> b/drivers/raw/ifpga/ifpga_rawdev.c
> index f89bd3f9e2c3..d5d47e14dd0e 100644
> --- a/drivers/raw/ifpga/ifpga_rawdev.c
> +++ b/drivers/raw/ifpga/ifpga_rawdev.c
> @@ -14,7 +14,6 @@
> #include <rte_log.h>
> #include <rte_malloc.h>
> #include <rte_devargs.h>
> -#include <rte_memcpy.h>
> #include <rte_pci.h>
> #include <bus_pci_driver.h>
> #include <rte_kvargs.h>
> @@ -258,7 +257,7 @@ static int ifpga_rawdev_fill_info(struct ifpga_rawdev
> *ifpga_dev)
> if (point < 12)
> return -1;
> point -= 12;
> - rte_memcpy(ifpga_dev->parent_bdf, &link[point], 12);
> + memcpy(ifpga_dev->parent_bdf, &link[point], 12);
>
> point = strlen(link1);
> if (point < 26)
> @@ -948,10 +947,10 @@ ifpga_rawdev_pr(struct rte_rawdev *dev,
> if (ret)
> return ret;
>
> - rte_memcpy(&afu_pr_conf->afu_id.uuid.uuid_low, uuid.b,
> - sizeof(u64));
> - rte_memcpy(&afu_pr_conf->afu_id.uuid.uuid_high, uuid.b
> + 8,
> - sizeof(u64));
> + memcpy(&afu_pr_conf->afu_id.uuid.uuid_low, uuid.b,
> + sizeof(u64));
> + memcpy(&afu_pr_conf->afu_id.uuid.uuid_high, uuid.b + 8,
> + sizeof(u64));
>
> IFPGA_RAWDEV_PMD_INFO("%s: uuid_l=0x%lx,
> uuid_h=0x%lx\n",
> __func__,
> --
> 2.43.0
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
^ permalink raw reply [flat|nested] 205+ messages in thread
* RE: [PATCH v2 45/71] event/dlb2: replace use of fixed size rte_memcpy
2024-03-01 17:15 ` [PATCH v2 45/71] event/dlb2: " Stephen Hemminger
@ 2024-03-05 17:07 ` Sevincer, Abdullah
2024-03-05 18:30 ` Stephen Hemminger
2024-03-06 15:24 ` Sevincer, Abdullah
1 sibling, 1 reply; 205+ messages in thread
From: Sevincer, Abdullah @ 2024-03-05 17:07 UTC (permalink / raw)
To: Stephen Hemminger, dev
Hi Stephen,
Are all rte_memcpy functions now be replaced by memcpy and no more use of rte_memcpy?
^ permalink raw reply [flat|nested] 205+ messages in thread
* Re: [PATCH v2 45/71] event/dlb2: replace use of fixed size rte_memcpy
2024-03-05 17:07 ` Sevincer, Abdullah
@ 2024-03-05 18:30 ` Stephen Hemminger
0 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-03-05 18:30 UTC (permalink / raw)
To: Sevincer, Abdullah; +Cc: dev
On Tue, 5 Mar 2024 17:07:02 +0000
"Sevincer, Abdullah" <abdullah.sevincer@intel.com> wrote:
> Hi Stephen,
>
> Are all rte_memcpy functions now be replaced by memcpy and no more use of rte_memcpy?
>
Long term yes. There is no reason for rte_memcpy to exist, it only exists because
the DPDK team at Intel was able to get a faster result for bulk copies than
the current glibc versions.
Medium term, it would be good to kill rte_memcpy for the fixed size case.
Already done for several other architectures.
Short term, none of this is urgent.
^ permalink raw reply [flat|nested] 205+ messages in thread
* RE: [PATCH v2 45/71] event/dlb2: replace use of fixed size rte_memcpy
2024-03-01 17:15 ` [PATCH v2 45/71] event/dlb2: " Stephen Hemminger
2024-03-05 17:07 ` Sevincer, Abdullah
@ 2024-03-06 15:24 ` Sevincer, Abdullah
1 sibling, 0 replies; 205+ messages in thread
From: Sevincer, Abdullah @ 2024-03-06 15:24 UTC (permalink / raw)
To: Stephen Hemminger, dev
Acked-by: Abdullah Sevincer <abdullah.sevincer@intel.com>
^ permalink raw reply [flat|nested] 205+ messages in thread
* RE: [PATCH v2 14/71] net/mlx5: replace use of fixed size rte_memcpy
2024-03-01 17:15 ` [PATCH v2 14/71] net/mlx5: " Stephen Hemminger
@ 2024-03-08 18:16 ` Dariusz Sosnowski
0 siblings, 0 replies; 205+ messages in thread
From: Dariusz Sosnowski @ 2024-03-08 18:16 UTC (permalink / raw)
To: Stephen Hemminger, dev
Cc: Slava Ovsiienko, Ori Kam, Suanming Mou, Matan Azrad
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Friday, March 1, 2024 18:15
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Dariusz Sosnowski
> <dsosnowski@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; Ori
> Kam <orika@nvidia.com>; Suanming Mou <suanmingm@nvidia.com>; Matan
> Azrad <matan@nvidia.com>
> Subject: [PATCH v2 14/71] net/mlx5: replace use of fixed size rte_memcpy
>
> External email: Use caution opening links or attachments
>
>
> Automatically generated by devtools/cocci/rte_memcpy.cocci
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Best regards,
Dariusz Sosnowski
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
` (75 preceding siblings ...)
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 01/30] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy Stephen Hemminger
` (31 more replies)
76 siblings, 32 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
The DPDK has a lot of unnecessary usage of rte_memcpy.
This patch set replaces cases where rte_memcpy is used with a fixed
size constant size.
Typical example is:
rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
which can be replaced with:
memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
This does not change the resulting binary on almost all architectures
because x86 version of intrisics and glibc are the same, and
other architectures were using __builtin_constant_p().
The main benefit is that analysis tools like fortify, Coverity, and ASAN
analyzers can check these memcpy's.
The first patch is a simple coccinelle script to do the replacement
and the rest are the results broken out by module. The script can be used
again to make sure more bad usage doesn't creep in with new drivers.
v3 - rebase and rerun coccinelle script on 24.03
- consolidate patches by subtree
- remove inclusion of rte_memcpy.h when no longer used.
Stephen Hemminger (30):
cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
eal: replace use of fixed size rte_memcpy
ethdev: replace use of fixed size rte_memcpy
eventdev: replace use of fixed size rte_memcpy
cryptodev: replace use of fixed size rte_memcpy
ip_frag: replace use of fixed size rte_memcpy
net: replace use of fixed size rte_memcpy
lpm: replace use of fixed size rte_memcpy
node: replace use of fixed size rte_memcpy
pdcp: replace use of fixed size rte_memcpy
pipeline: replace use of fixed size rte_memcpy
rib: replace use of fixed size rte_memcpy
security: replace use of fixed size rte_memcpy
bus: remove unneeded rte_memcpy.h include
net: replace use of fixed size rte_memcpy
raw: replace use of fixed size rte_memcpy
baseband: replace use of fixed size rte_memcpy
common: replace use of fixed size rte_memcpy
crypto: replace use of fixed size rte_memcpy
crypto: replace use of fixed size rte_memcpy
event: replace use of fixed size rte_memcpy
mempool: replace use of fixed size rte_memcpy
ml/cnxk: replace use of fixed size rte_memcpy
app/test-pmd: replace use of fixed size rte_memcpy
app/graph: replace use of fixed size rte_memcpy
app/test-eventdev: replace use of fixed size rte_memcpy
app/test: replace use of fixed size rte_memcpy
app/test-pipeline: remove unused rte_memcpy.h include
app/test-bbdev: remove unnecessary include of rte_memcpy.h
examples: replace use of fixed size rte_memcpy
app/graph/neigh.c | 8 +-
app/test-bbdev/test_bbdev.c | 1 -
app/test-eventdev/test_pipeline_common.c | 19 ++-
app/test-pipeline/config.c | 1 -
app/test-pipeline/init.c | 1 -
app/test-pipeline/main.c | 1 -
app/test-pipeline/runtime.c | 1 -
app/test-pmd/cmdline.c | 48 ++++----
app/test-pmd/cmdline_flow.c | 24 ++--
app/test-pmd/config.c | 8 +-
app/test-pmd/csumonly.c | 1 -
app/test-pmd/flowgen.c | 1 -
app/test-pmd/iofwd.c | 1 -
app/test-pmd/macfwd.c | 1 -
app/test-pmd/macswap.c | 1 -
app/test-pmd/noisy_vnf.c | 1 -
app/test-pmd/rxonly.c | 1 -
app/test-pmd/testpmd.c | 1 -
app/test/commands.c | 1 -
app/test/packet_burst_generator.c | 4 +-
app/test/test_crc.c | 5 +-
app/test/test_cryptodev.c | 18 ++-
app/test/test_cryptodev_asym.c | 1 -
app/test/test_cryptodev_security_pdcp.c | 1 -
app/test/test_efd.c | 1 -
app/test/test_efd_perf.c | 1 -
app/test/test_event_crypto_adapter.c | 12 +-
app/test/test_event_dma_adapter.c | 4 +-
app/test/test_eventdev.c | 1 -
app/test/test_ipsec.c | 6 +-
app/test/test_link_bonding_mode4.c | 8 +-
app/test/test_mbuf.c | 1 -
app/test/test_member.c | 1 -
app/test/test_member_perf.c | 1 -
app/test/test_rawdev.c | 1 -
app/test/test_security_inline_proto.c | 36 +++---
app/test/test_service_cores.c | 1 -
app/test/virtual_pmd.c | 3 +-
devtools/cocci/rte_memcpy.cocci | 11 ++
drivers/baseband/acc/rte_acc100_pmd.c | 17 ++-
drivers/baseband/acc/rte_vrb_pmd.c | 21 ++--
drivers/baseband/la12xx/bbdev_la12xx.c | 4 +-
drivers/bus/auxiliary/linux/auxiliary.c | 1 -
drivers/bus/fslmc/fslmc_bus.c | 1 -
drivers/bus/fslmc/fslmc_vfio.c | 1 -
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 1 -
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 1 -
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 1 -
drivers/bus/pci/linux/pci.c | 1 -
drivers/common/idpf/idpf_common_device.c | 4 +-
drivers/common/idpf/idpf_common_virtchnl.c | 10 +-
drivers/common/qat/qat_qp.c | 10 +-
drivers/compress/qat/qat_comp.c | 8 +-
drivers/crypto/ccp/ccp_crypto.c | 14 +--
drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +-
drivers/crypto/cnxk/cnxk_se.h | 2 +-
drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +-
drivers/crypto/qat/qat_sym_session.c | 52 ++++-----
.../scheduler/rte_cryptodev_scheduler.c | 6 +-
drivers/crypto/scheduler/scheduler_failover.c | 12 +-
drivers/event/cnxk/cnxk_eventdev_selftest.c | 1 -
drivers/event/cnxk/cnxk_tim_evdev.c | 4 +-
drivers/event/dlb2/dlb2.c | 4 +-
drivers/event/dpaa/dpaa_eventdev.c | 1 -
drivers/event/dpaa2/dpaa2_eventdev.c | 7 +-
drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 1 -
drivers/event/dpaa2/dpaa2_hw_dpcon.c | 1 -
drivers/event/octeontx/ssovf_evdev_selftest.c | 1 -
drivers/event/octeontx/timvf_evdev.c | 4 +-
drivers/mempool/dpaa/dpaa_mempool.c | 4 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 5 +-
drivers/ml/cnxk/cn10k_ml_model.c | 8 +-
drivers/ml/cnxk/cn10k_ml_ops.c | 11 +-
drivers/ml/cnxk/cnxk_ml_ops.c | 2 +-
drivers/ml/cnxk/mvtvm_ml_model.c | 8 +-
drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +-
drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
drivers/net/avp/avp_ethdev.c | 4 +-
drivers/net/axgbe/axgbe_ethdev.c | 4 +-
drivers/net/bnx2x/bnx2x.c | 32 +++--
drivers/net/bnxt/bnxt_flow.c | 34 +++---
drivers/net/bonding/rte_eth_bond_8023ad.c | 4 +-
drivers/net/bonding/rte_eth_bond_flow.c | 2 +-
drivers/net/cnxk/cnxk_eswitch_devargs.c | 3 +-
drivers/net/cnxk/cnxk_ethdev_ops.c | 2 +-
drivers/net/cnxk/cnxk_rep.c | 3 +-
drivers/net/cnxk/cnxk_rep_flow.c | 6 +-
drivers/net/cnxk/cnxk_rep_msg.c | 8 +-
drivers/net/cnxk/cnxk_rep_ops.c | 2 +-
drivers/net/cnxk/cnxk_tm.c | 5 +-
drivers/net/cpfl/cpfl_ethdev.c | 3 +-
drivers/net/cpfl/cpfl_vchnl.c | 4 +-
drivers/net/cxgbe/clip_tbl.c | 2 +-
drivers/net/cxgbe/cxgbe_filter.c | 8 +-
drivers/net/cxgbe/l2t.c | 4 +-
drivers/net/cxgbe/smt.c | 20 ++--
drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 1 -
drivers/net/dpaa2/dpaa2_ethdev.c | 1 -
drivers/net/dpaa2/dpaa2_recycle.c | 1 -
drivers/net/dpaa2/dpaa2_rxtx.c | 1 -
drivers/net/dpaa2/dpaa2_sparser.c | 1 -
drivers/net/dpaa2/dpaa2_tm.c | 2 +-
drivers/net/e1000/em_rxtx.c | 1 -
drivers/net/e1000/igb_flow.c | 22 ++--
drivers/net/e1000/igb_pf.c | 7 +-
drivers/net/e1000/igb_rxtx.c | 1 -
drivers/net/enic/enic_main.c | 8 +-
drivers/net/failsafe/failsafe_ops.c | 6 +-
drivers/net/gve/base/gve_adminq.c | 2 +-
drivers/net/hinic/hinic_pmd_ethdev.c | 1 -
drivers/net/hinic/hinic_pmd_flow.c | 40 +++----
drivers/net/hns3/hns3_fdir.c | 2 +-
drivers/net/hns3/hns3_flow.c | 4 +-
drivers/net/i40e/i40e_ethdev.c | 109 ++++++++----------
drivers/net/i40e/i40e_fdir.c | 28 +++--
drivers/net/i40e/i40e_flow.c | 56 +++++----
drivers/net/i40e/i40e_pf.c | 3 +-
drivers/net/i40e/i40e_tm.c | 11 +-
drivers/net/i40e/rte_pmd_i40e.c | 34 +++---
drivers/net/iavf/iavf_fdir.c | 93 +++++++--------
drivers/net/iavf/iavf_fsub.c | 50 ++++----
drivers/net/iavf/iavf_generic_flow.c | 2 +-
drivers/net/iavf/iavf_tm.c | 11 +-
drivers/net/iavf/iavf_vchnl.c | 9 +-
drivers/net/ice/ice_dcf.c | 5 +-
drivers/net/ice/ice_dcf_parent.c | 2 +-
drivers/net/ice/ice_dcf_sched.c | 11 +-
drivers/net/ice/ice_diagnose.c | 4 +-
drivers/net/ice/ice_ethdev.c | 14 +--
drivers/net/ice/ice_fdir_filter.c | 37 +++---
drivers/net/ice/ice_generic_flow.c | 2 +-
drivers/net/ice/ice_hash.c | 2 +-
drivers/net/ice/ice_tm.c | 11 +-
drivers/net/idpf/idpf_ethdev.c | 7 +-
drivers/net/idpf/idpf_rxtx.c | 10 +-
drivers/net/ipn3ke/ipn3ke_flow.c | 32 +++--
drivers/net/ipn3ke/ipn3ke_representor.c | 16 +--
drivers/net/ipn3ke/ipn3ke_tm.c | 6 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 9 +-
drivers/net/ixgbe/ixgbe_fdir.c | 7 +-
drivers/net/ixgbe/ixgbe_flow.c | 65 +++++------
drivers/net/ixgbe/ixgbe_ipsec.c | 8 +-
drivers/net/ixgbe/ixgbe_pf.c | 5 +-
drivers/net/ixgbe/ixgbe_tm.c | 11 +-
drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +-
drivers/net/memif/memif_socket.c | 4 +-
drivers/net/mlx5/mlx5_devx.c | 4 +-
drivers/net/mlx5/mlx5_flow.c | 38 +++---
drivers/net/mlx5/mlx5_flow_aso.c | 6 +-
drivers/net/mlx5/mlx5_flow_hw.c | 27 ++---
drivers/net/mlx5/mlx5_rx.c | 6 +-
drivers/net/mlx5/mlx5_rxtx_vec.c | 8 +-
drivers/net/mvpp2/mrvl_tm.c | 2 +-
drivers/net/netvsc/hn_ethdev.c | 1 -
drivers/net/nfp/flower/nfp_conntrack.c | 2 +-
drivers/net/nfp/flower/nfp_flower_flow.c | 16 +--
.../net/nfp/flower/nfp_flower_representor.c | 2 +-
drivers/net/nfp/nfp_mtr.c | 10 +-
drivers/net/ngbe/ngbe_pf.c | 4 +-
drivers/net/null/rte_eth_null.c | 6 +-
drivers/net/pcap/pcap_ethdev.c | 2 +-
drivers/net/pcap/pcap_osdep_freebsd.c | 3 +-
drivers/net/pcap/pcap_osdep_linux.c | 3 +-
drivers/net/qede/qede_main.c | 2 +-
drivers/net/ring/rte_eth_ring.c | 1 -
drivers/net/sfc/sfc.c | 2 +-
drivers/net/sfc/sfc_ef10_tx.c | 2 +-
drivers/net/sfc/sfc_ethdev.c | 11 +-
drivers/net/sfc/sfc_flow.c | 20 ++--
drivers/net/sfc/sfc_flow_rss.c | 2 +-
drivers/net/sfc/sfc_mae.c | 2 +-
drivers/net/sfc/sfc_rx.c | 2 +-
drivers/net/sfc/sfc_tso.c | 2 +-
drivers/net/sfc/sfc_tso.h | 9 +-
drivers/net/tap/rte_eth_tap.c | 14 +--
drivers/net/txgbe/txgbe_ethdev.c | 9 +-
drivers/net/txgbe/txgbe_fdir.c | 6 +-
drivers/net/txgbe/txgbe_flow.c | 65 +++++------
drivers/net/txgbe/txgbe_ipsec.c | 8 +-
drivers/net/txgbe/txgbe_pf.c | 5 +-
drivers/net/txgbe/txgbe_tm.c | 11 +-
drivers/net/vhost/rte_eth_vhost.c | 1 -
drivers/net/virtio/virtio_ethdev.c | 1 -
drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +-
drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +-
drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +-
drivers/raw/ifpga/afu_pmd_n3000.c | 8 +-
drivers/raw/ifpga/ifpga_rawdev.c | 11 +-
drivers/raw/skeleton/skeleton_rawdev.c | 8 +-
drivers/raw/skeleton/skeleton_rawdev_test.c | 1 -
examples/bbdev_app/main.c | 2 +-
examples/bond/main.c | 1 -
examples/ip_fragmentation/main.c | 1 -
examples/ip_reassembly/main.c | 1 -
examples/ipv4_multicast/main.c | 1 -
examples/l2fwd-cat/cat.c | 4 +-
examples/l2fwd-jobstats/main.c | 1 -
examples/l2fwd-keepalive/main.c | 1 -
examples/l2fwd-macsec/main.c | 1 -
examples/l2fwd/main.c | 1 -
examples/l3fwd-power/main.c | 1 -
examples/l3fwd/main.c | 1 -
examples/link_status_interrupt/main.c | 1 -
.../client_server_mp/mp_server/init.c | 1 -
.../client_server_mp/mp_server/main.c | 1 -
examples/multi_process/symmetric_mp/main.c | 1 -
examples/ptpclient/ptpclient.c | 11 +-
examples/qos_sched/app_thread.c | 1 -
examples/qos_sched/main.c | 1 -
examples/server_node_efd/efd_server/init.c | 1 -
examples/server_node_efd/efd_server/main.c | 1 -
examples/vhost/main.c | 6 +-
examples/vmdq/main.c | 6 +-
examples/vmdq_dcb/main.c | 15 +--
lib/cryptodev/rte_cryptodev.c | 2 +-
lib/eal/common/eal_common_options.c | 7 +-
lib/ethdev/rte_ethdev.c | 3 +-
lib/ethdev/rte_flow.c | 5 +-
lib/eventdev/rte_event_crypto_adapter.c | 2 +-
lib/eventdev/rte_event_dma_adapter.c | 4 +-
lib/eventdev/rte_event_timer_adapter.c | 2 +-
lib/fib/trie.c | 2 +-
lib/ip_frag/rte_ipv6_fragmentation.c | 4 +-
lib/ip_frag/rte_ipv6_reassembly.c | 6 +-
lib/lpm/rte_lpm6.c | 3 +-
lib/net/rte_ether.c | 2 +-
lib/node/ip6_lookup.c | 8 +-
lib/pdcp/pdcp_process.c | 36 +++---
lib/pipeline/rte_table_action.c | 8 +-
lib/rib/rte_rib6.h | 5 +-
lib/security/rte_security.c | 4 +-
232 files changed, 886 insertions(+), 1045 deletions(-)
create mode 100644 devtools/cocci/rte_memcpy.cocci
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 01/30] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 02/30] eal: replace use of " Stephen Hemminger
` (30 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Rte_memcpy should not be used for the simple case of copying
a fix size structure because it is slower and will hide problems
from code analysis tools. Coverity, fortify and other analyzers
special case memcpy().
Gcc (and Clang) are smart enough to inline copies which
will be faster.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
devtools/cocci/rte_memcpy.cocci | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 devtools/cocci/rte_memcpy.cocci
diff --git a/devtools/cocci/rte_memcpy.cocci b/devtools/cocci/rte_memcpy.cocci
new file mode 100644
index 0000000000..fa1038fc06
--- /dev/null
+++ b/devtools/cocci/rte_memcpy.cocci
@@ -0,0 +1,11 @@
+//
+// rte_memcpy should not be used for simple fixed size structure
+// because compiler's are smart enough to inline these.
+//
+@@
+expression src, dst; constant size;
+@@
+(
+- rte_memcpy(dst, src, size)
++ memcpy(dst, src, size)
+)
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 02/30] eal: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 01/30] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 03/30] ethdev: " Stephen Hemminger
` (29 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/eal/common/eal_common_options.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index e541f07939..07bfaffdac 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -30,7 +30,6 @@
#include <rte_tailq.h>
#include <rte_version.h>
#include <rte_devargs.h>
-#include <rte_memcpy.h>
#ifndef RTE_EXEC_ENV_WINDOWS
#include <rte_telemetry.h>
#endif
@@ -1253,7 +1252,7 @@ eal_parse_lcores(const char *lcores)
/* without '@', by default using lcore_set as cpuset */
if (*lcores != '@')
- rte_memcpy(&cpuset, &lcore_set, sizeof(cpuset));
+ memcpy(&cpuset, &lcore_set, sizeof(cpuset));
set_count = CPU_COUNT(&lcore_set);
/* start to update lcore_set */
@@ -1275,8 +1274,8 @@ eal_parse_lcores(const char *lcores)
if (check_cpuset(&cpuset) < 0)
goto err;
- rte_memcpy(&lcore_config[idx].cpuset, &cpuset,
- sizeof(rte_cpuset_t));
+ memcpy(&lcore_config[idx].cpuset, &cpuset,
+ sizeof(rte_cpuset_t));
}
/* some cores from the lcore_set can't be handled by EAL */
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 03/30] ethdev: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 01/30] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 02/30] eal: replace use of " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 04/30] eventdev: " Stephen Hemminger
` (28 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Thomas Monjalon, Ferruh Yigit,
Andrew Rybchenko, Ori Kam
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/ethdev/rte_ethdev.c | 3 +--
lib/ethdev/rte_flow.c | 5 ++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index f1c658f49e..ef62a02607 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -15,7 +15,6 @@
#include <rte_log.h>
#include <rte_interrupts.h>
#include <rte_kvargs.h>
-#include <rte_memcpy.h>
#include <rte_common.h>
#include <rte_mempool.h>
#include <rte_malloc.h>
@@ -618,7 +617,7 @@ rte_eth_dev_owner_get(const uint16_t port_id, struct rte_eth_dev_owner *owner)
rte_spinlock_lock(rte_mcfg_ethdev_get_lock());
if (eth_dev_shared_data_prepare() != NULL) {
- rte_memcpy(owner, ðdev->data->owner, sizeof(*owner));
+ memcpy(owner, ðdev->data->owner, sizeof(*owner));
ret = 0;
} else {
ret = -ENOMEM;
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 7ab1100ea0..9b831486eb 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -994,9 +994,8 @@ rte_flow_conv_rule(struct rte_flow_conv_rule *dst,
if (src->attr_ro) {
off = RTE_ALIGN_CEIL(off, sizeof(double));
if (size && size >= off + sizeof(*dst->attr))
- dst->attr = rte_memcpy
- ((void *)((uintptr_t)dst + off),
- src->attr_ro, sizeof(*dst->attr));
+ dst->attr = memcpy((void *)((uintptr_t)dst + off),
+ src->attr_ro, sizeof(*dst->attr));
off += sizeof(*dst->attr);
}
if (src->pattern_ro) {
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 04/30] eventdev: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (2 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 03/30] ethdev: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 05/30] cryptodev: " Stephen Hemminger
` (27 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Abhinandan Gujjar, Jerin Jacob,
Amit Prakash Shukla, Erik Gabriel Carrillo
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/eventdev/rte_event_crypto_adapter.c | 2 +-
lib/eventdev/rte_event_dma_adapter.c | 4 ++--
lib/eventdev/rte_event_timer_adapter.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index db1c7f3906..e2fff2ecc9 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -655,7 +655,7 @@ eca_ops_enqueue_burst(struct event_crypto_adapter *adapter,
continue;
}
- rte_memcpy(ev, &m_data->response_info, sizeof(*ev));
+ memcpy(ev, &m_data->response_info, sizeof(*ev));
ev->event_ptr = ops[i];
ev->event_type = RTE_EVENT_TYPE_CRYPTODEV;
if (adapter->implicit_release_disabled)
diff --git a/lib/eventdev/rte_event_dma_adapter.c b/lib/eventdev/rte_event_dma_adapter.c
index 24dff556db..6784c562b0 100644
--- a/lib/eventdev/rte_event_dma_adapter.c
+++ b/lib/eventdev/rte_event_dma_adapter.c
@@ -447,7 +447,7 @@ rte_event_dma_adapter_create(uint8_t id, uint8_t evdev_id, struct rte_event_port
if (pc == NULL)
return -ENOMEM;
- rte_memcpy(pc, port_config, sizeof(struct rte_event_port_conf));
+ memcpy(pc, port_config, sizeof(struct rte_event_port_conf));
ret = rte_event_dma_adapter_create_ext(id, evdev_id, edma_default_config_cb, mode, pc);
if (ret != 0)
rte_free(pc);
@@ -668,7 +668,7 @@ edma_ops_enqueue_burst(struct event_dma_adapter *adapter, struct rte_event_dma_a
continue;
}
- rte_memcpy(ev, response_info, sizeof(struct rte_event));
+ memcpy(ev, response_info, sizeof(struct rte_event));
ev->event_ptr = ops[i];
ev->event_type = RTE_EVENT_TYPE_DMADEV;
if (adapter->implicit_release_disabled)
diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c
index 5886965d14..9ca52cc6de 100644
--- a/lib/eventdev/rte_event_timer_adapter.c
+++ b/lib/eventdev/rte_event_timer_adapter.c
@@ -549,7 +549,7 @@ event_buffer_add(struct event_buffer *bufp, struct rte_event *eventp)
/* Instead of modulus, bitwise AND with mask to get head_idx. */
head_idx = bufp->head & EVENT_BUFFER_MASK;
buf_eventp = &bufp->events[head_idx];
- rte_memcpy(buf_eventp, eventp, sizeof(struct rte_event));
+ memcpy(buf_eventp, eventp, sizeof(struct rte_event));
/* Wrap automatically when overflow occurs. */
bufp->head++;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 05/30] cryptodev: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (3 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 04/30] eventdev: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 06/30] ip_frag: " Stephen Hemminger
` (26 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Akhil Goyal, Fan Zhang
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/cryptodev/rte_cryptodev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 886eb7adc4..1377777525 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -2854,7 +2854,7 @@ crypto_caps_array(struct rte_tel_data *d,
while ((dev_caps = &capabilities[i++])->op !=
RTE_CRYPTO_OP_TYPE_UNDEFINED) {
memset(&caps_val, 0, CRYPTO_CAPS_SZ * sizeof(caps_val[0]));
- rte_memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
+ memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
for (j = 0; j < CRYPTO_CAPS_SZ; j++)
rte_tel_data_add_array_uint(d, caps_val[j]);
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 06/30] ip_frag: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (4 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 05/30] cryptodev: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 07/30] net: " Stephen Hemminger
` (25 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Konstantin Ananyev
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/ip_frag/rte_ipv6_fragmentation.c | 4 +---
lib/ip_frag/rte_ipv6_reassembly.c | 6 ++----
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/lib/ip_frag/rte_ipv6_fragmentation.c b/lib/ip_frag/rte_ipv6_fragmentation.c
index 56696f32f8..72ce6501c8 100644
--- a/lib/ip_frag/rte_ipv6_fragmentation.c
+++ b/lib/ip_frag/rte_ipv6_fragmentation.c
@@ -5,8 +5,6 @@
#include <stddef.h>
#include <errno.h>
-#include <rte_memcpy.h>
-
#include "ip_frag_common.h"
/**
@@ -23,7 +21,7 @@ __fill_ipv6hdr_frag(struct rte_ipv6_hdr *dst,
{
struct rte_ipv6_fragment_ext *fh;
- rte_memcpy(dst, src, sizeof(*dst));
+ memcpy(dst, src, sizeof(*dst));
dst->payload_len = rte_cpu_to_be_16(len);
dst->proto = IPPROTO_FRAGMENT;
diff --git a/lib/ip_frag/rte_ipv6_reassembly.c b/lib/ip_frag/rte_ipv6_reassembly.c
index 88863a98d1..663b1737a6 100644
--- a/lib/ip_frag/rte_ipv6_reassembly.c
+++ b/lib/ip_frag/rte_ipv6_reassembly.c
@@ -4,8 +4,6 @@
#include <stddef.h>
-#include <rte_memcpy.h>
-
#include "ip_frag_common.h"
/**
@@ -143,8 +141,8 @@ rte_ipv6_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
int32_t ip_len;
int32_t trim;
- rte_memcpy(&key.src_dst[0], ip_hdr->src_addr, 16);
- rte_memcpy(&key.src_dst[2], ip_hdr->dst_addr, 16);
+ memcpy(&key.src_dst[0], ip_hdr->src_addr, 16);
+ memcpy(&key.src_dst[2], ip_hdr->dst_addr, 16);
key.id = frag_hdr->id;
key.key_len = IPV6_KEYLEN;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 07/30] net: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (5 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 06/30] ip_frag: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 08/30] lpm: " Stephen Hemminger
` (24 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/net/rte_ether.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/net/rte_ether.c b/lib/net/rte_ether.c
index f59c20289d..761b38f805 100644
--- a/lib/net/rte_ether.c
+++ b/lib/net/rte_ether.c
@@ -13,7 +13,7 @@ rte_eth_random_addr(uint8_t *addr)
uint64_t rand = rte_rand();
uint8_t *p = (uint8_t *)&rand;
- rte_memcpy(addr, p, RTE_ETHER_ADDR_LEN);
+ memcpy(addr, p, RTE_ETHER_ADDR_LEN);
addr[0] &= (uint8_t)~RTE_ETHER_GROUP_ADDR; /* clear multicast bit */
addr[0] |= RTE_ETHER_LOCAL_ADMIN_ADDR; /* set local assignment bit */
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 08/30] lpm: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (6 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 07/30] net: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 09/30] node: " Stephen Hemminger
` (23 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Bruce Richardson, Vladimir Medvedkin
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/lpm/rte_lpm6.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c
index 46d8f71a2d..242695dd4d 100644
--- a/lib/lpm/rte_lpm6.c
+++ b/lib/lpm/rte_lpm6.c
@@ -11,7 +11,6 @@
#include <rte_log.h>
#include <rte_common.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_eal_memconfig.h>
#include <rte_string_fns.h>
#include <rte_errno.h>
@@ -139,7 +138,7 @@ ip6_mask_addr(uint8_t *ip, uint8_t depth)
static inline void
ip6_copy_addr(uint8_t *dst, const uint8_t *src)
{
- rte_memcpy(dst, src, RTE_LPM6_IPV6_ADDR_SIZE);
+ memcpy(dst, src, RTE_LPM6_IPV6_ADDR_SIZE);
}
/*
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 09/30] node: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (7 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 08/30] lpm: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 10/30] pdcp: " Stephen Hemminger
` (22 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Nithin Dabilpuram, Pavan Nikhilesh
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/node/ip6_lookup.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/node/ip6_lookup.c b/lib/node/ip6_lookup.c
index 309964f60f..b8e567ccd9 100644
--- a/lib/node/ip6_lookup.c
+++ b/lib/node/ip6_lookup.c
@@ -112,28 +112,28 @@ ip6_lookup_node_process_scalar(struct rte_graph *graph, struct rte_node *node,
sizeof(struct rte_ether_hdr));
/* Extract hop_limits as ipv6 hdr is in cache */
node_mbuf_priv1(mbuf0, dyn)->ttl = ipv6_hdr->hop_limits;
- rte_memcpy(ip_batch[0], ipv6_hdr->dst_addr, 16);
+ memcpy(ip_batch[0], ipv6_hdr->dst_addr, 16);
/* Extract DIP of mbuf1 */
ipv6_hdr = rte_pktmbuf_mtod_offset(mbuf1, struct rte_ipv6_hdr *,
sizeof(struct rte_ether_hdr));
/* Extract hop_limits as ipv6 hdr is in cache */
node_mbuf_priv1(mbuf1, dyn)->ttl = ipv6_hdr->hop_limits;
- rte_memcpy(ip_batch[1], ipv6_hdr->dst_addr, 16);
+ memcpy(ip_batch[1], ipv6_hdr->dst_addr, 16);
/* Extract DIP of mbuf2 */
ipv6_hdr = rte_pktmbuf_mtod_offset(mbuf2, struct rte_ipv6_hdr *,
sizeof(struct rte_ether_hdr));
/* Extract hop_limits as ipv6 hdr is in cache */
node_mbuf_priv1(mbuf2, dyn)->ttl = ipv6_hdr->hop_limits;
- rte_memcpy(ip_batch[2], ipv6_hdr->dst_addr, 16);
+ memcpy(ip_batch[2], ipv6_hdr->dst_addr, 16);
/* Extract DIP of mbuf3 */
ipv6_hdr = rte_pktmbuf_mtod_offset(mbuf3, struct rte_ipv6_hdr *,
sizeof(struct rte_ether_hdr));
/* Extract hop_limits as ipv6 hdr is in cache */
node_mbuf_priv1(mbuf3, dyn)->ttl = ipv6_hdr->hop_limits;
- rte_memcpy(ip_batch[3], ipv6_hdr->dst_addr, 16);
+ memcpy(ip_batch[3], ipv6_hdr->dst_addr, 16);
rte_lpm6_lookup_bulk_func(lpm6, ip_batch, next_hop, 4);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 10/30] pdcp: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (8 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 09/30] node: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 11/30] pipeline: " Stephen Hemminger
` (21 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anoob Joseph, Volodymyr Fialko
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/pdcp/pdcp_process.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/lib/pdcp/pdcp_process.c b/lib/pdcp/pdcp_process.c
index 9b9b881124..6c0693f666 100644
--- a/lib/pdcp/pdcp_process.c
+++ b/lib/pdcp/pdcp_process.c
@@ -60,7 +60,7 @@ pdcp_iv_gen_null_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv *e
m = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(m_ptr, &m, 8);
+ memcpy(m_ptr, &m, 8);
}
static void
@@ -72,10 +72,10 @@ pdcp_iv_gen_null_zs(struct rte_crypto_op *cop, const struct entity_priv *en_priv
iv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET);
iv_u64[0] = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64[0], 8);
+ memcpy(iv, &iv_u64[0], 8);
iv_u64[1] = iv_u64[0] ^ en_priv->auth_iv_part.u64[1];
- rte_memcpy(iv + 8, &iv_u64[1], 8);
+ memcpy(iv + 8, &iv_u64[1], 8);
}
static void
@@ -89,7 +89,7 @@ pdcp_iv_gen_aes_ctr_null(struct rte_crypto_op *cop, const struct entity_priv *en
iv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
iv_u64[1] = 0;
- rte_memcpy(iv, iv_u64, 16);
+ memcpy(iv, iv_u64, 16);
}
static void
@@ -101,8 +101,8 @@ pdcp_iv_gen_zs_null(struct rte_crypto_op *cop, const struct entity_priv *en_priv
iv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET);
iv_u64 = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64, 8);
- rte_memcpy(iv + 8, &iv_u64, 8);
+ memcpy(iv, &iv_u64, 8);
+ memcpy(iv + 8, &iv_u64, 8);
}
static void
@@ -115,17 +115,17 @@ pdcp_iv_gen_zs_zs(struct rte_crypto_op *cop, const struct entity_priv *en_priv,
/* Generating cipher IV */
iv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64[0], 8);
- rte_memcpy(iv + 8, &iv_u64[0], 8);
+ memcpy(iv, &iv_u64[0], 8);
+ memcpy(iv + 8, &iv_u64[0], 8);
iv += PDCP_IV_LEN;
/* Generating auth IV */
iv_u64[0] = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64[0], 8);
+ memcpy(iv, &iv_u64[0], 8);
iv_u64[1] = iv_u64[0] ^ en_priv->auth_iv_part.u64[1];
- rte_memcpy(iv + 8, &iv_u64[1], 8);
+ memcpy(iv + 8, &iv_u64[1], 8);
}
static void
@@ -140,12 +140,12 @@ pdcp_iv_gen_zs_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv *en_
iv = rte_crypto_op_ctod_offset(cop, uint8_t *, PDCP_IV_OFFSET);
iv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64[0], 8);
- rte_memcpy(iv + 8, &iv_u64[0], 8);
+ memcpy(iv, &iv_u64[0], 8);
+ memcpy(iv + 8, &iv_u64[0], 8);
m_ptr = (uint8_t *)rte_pktmbuf_prepend(mb, 8);
m = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(m_ptr, &m, 8);
+ memcpy(m_ptr, &m, 8);
}
static void
@@ -162,11 +162,11 @@ pdcp_iv_gen_aes_ctr_aes_cmac(struct rte_crypto_op *cop, const struct entity_priv
iv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
iv_u64[1] = 0;
- rte_memcpy(iv, iv_u64, PDCP_IV_LEN);
+ memcpy(iv, iv_u64, PDCP_IV_LEN);
m_ptr = (uint8_t *)rte_pktmbuf_prepend(mb, 8);
m = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(m_ptr, &m, 8);
+ memcpy(m_ptr, &m, 8);
}
static void
@@ -179,15 +179,15 @@ pdcp_iv_gen_aes_ctr_zs(struct rte_crypto_op *cop, const struct entity_priv *en_p
iv_u64[0] = en_priv->cipher_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
iv_u64[1] = 0;
- rte_memcpy(iv, iv_u64, PDCP_IV_LEN);
+ memcpy(iv, iv_u64, PDCP_IV_LEN);
iv += PDCP_IV_LEN;
iv_u64[0] = en_priv->auth_iv_part.u64[0] | ((uint64_t)(rte_cpu_to_be_32(count)));
- rte_memcpy(iv, &iv_u64[0], 8);
+ memcpy(iv, &iv_u64[0], 8);
iv_u64[1] = iv_u64[0] ^ en_priv->auth_iv_part.u64[1];
- rte_memcpy(iv + 8, &iv_u64[1], 8);
+ memcpy(iv + 8, &iv_u64[1], 8);
}
static int
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 11/30] pipeline: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (9 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 10/30] pdcp: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 12/30] rib: " Stephen Hemminger
` (20 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Cristian Dumitrescu
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/pipeline/rte_table_action.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/pipeline/rte_table_action.c b/lib/pipeline/rte_table_action.c
index 87c3e0e2c9..aec84deed5 100644
--- a/lib/pipeline/rte_table_action.c
+++ b/lib/pipeline/rte_table_action.c
@@ -1441,7 +1441,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip,
tcp->src_port,
data->port);
- rte_memcpy(ip->src_addr, data->addr, 16);
+ memcpy(ip->src_addr, data->addr, 16);
tcp->src_port = data->port;
tcp->cksum = tcp_cksum;
} else {
@@ -1454,7 +1454,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip,
udp->src_port,
data->port);
- rte_memcpy(ip->src_addr, data->addr, 16);
+ memcpy(ip->src_addr, data->addr, 16);
udp->src_port = data->port;
udp->dgram_cksum = udp_cksum;
}
@@ -1469,7 +1469,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip,
tcp->dst_port,
data->port);
- rte_memcpy(ip->dst_addr, data->addr, 16);
+ memcpy(ip->dst_addr, data->addr, 16);
tcp->dst_port = data->port;
tcp->cksum = tcp_cksum;
} else {
@@ -1482,7 +1482,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip,
udp->dst_port,
data->port);
- rte_memcpy(ip->dst_addr, data->addr, 16);
+ memcpy(ip->dst_addr, data->addr, 16);
udp->dst_port = data->port;
udp->dgram_cksum = udp_cksum;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 12/30] rib: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (10 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 11/30] pipeline: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 13/30] security: " Stephen Hemminger
` (19 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Vladimir Medvedkin
Mostly automatically generated by devtools/cocci/rte_memcpy.cocci
The fib/trie.c was relying on headers
rte_rib6 -> rte_memcpy -> rte_vect
since rib6 is no longer using rte_memcpy need to get rte_vect.h
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/fib/trie.c | 2 +-
lib/rib/rte_rib6.h | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/fib/trie.c b/lib/fib/trie.c
index 09470e7287..a77f6c758b 100644
--- a/lib/fib/trie.c
+++ b/lib/fib/trie.c
@@ -9,7 +9,7 @@
#include <rte_debug.h>
#include <rte_malloc.h>
#include <rte_errno.h>
-
+#include <rte_vect.h>
#include <rte_rib6.h>
#include <rte_fib6.h>
#include "trie.h"
diff --git a/lib/rib/rte_rib6.h b/lib/rib/rte_rib6.h
index 775286f965..f366d3d197 100644
--- a/lib/rib/rte_rib6.h
+++ b/lib/rib/rte_rib6.h
@@ -14,7 +14,8 @@
* Level compressed tree implementation for IPv6 Longest Prefix Match
*/
-#include <rte_memcpy.h>
+#include <string.h>
+
#include <rte_common.h>
#ifdef __cplusplus
@@ -61,7 +62,7 @@ rte_rib6_copy_addr(uint8_t *dst, const uint8_t *src)
{
if ((dst == NULL) || (src == NULL))
return;
- rte_memcpy(dst, src, RTE_RIB6_IPV6_ADDR_SIZE);
+ memcpy(dst, src, RTE_RIB6_IPV6_ADDR_SIZE);
}
/**
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 13/30] security: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (11 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 12/30] rib: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 14/30] bus: remove unneeded rte_memcpy.h include Stephen Hemminger
` (18 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Akhil Goyal, Anoob Joseph
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/security/rte_security.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
index e5c862f5f5..28d59ef388 100644
--- a/lib/security/rte_security.c
+++ b/lib/security/rte_security.c
@@ -384,7 +384,7 @@ crypto_caps_array(struct rte_tel_data *d,
while ((dev_caps = &capabilities[i++])->op !=
RTE_CRYPTO_OP_TYPE_UNDEFINED) {
memset(&caps_val, 0, CRYPTO_CAPS_SZ * sizeof(caps_val[0]));
- rte_memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
+ memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
for (j = 0; j < CRYPTO_CAPS_SZ; j++)
rte_tel_data_add_array_uint(d, caps_val[j]);
}
@@ -409,7 +409,7 @@ sec_caps_array(struct rte_tel_data *d,
while ((dev_caps = &capabilities[i++])->action !=
RTE_SECURITY_ACTION_TYPE_NONE) {
memset(&caps_val, 0, SEC_CAPS_SZ * sizeof(caps_val[0]));
- rte_memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
+ memcpy(caps_val, dev_caps, sizeof(capabilities[0]));
for (j = 0; j < SEC_CAPS_SZ; j++)
rte_tel_data_add_array_uint(d, caps_val[j]);
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 14/30] bus: remove unneeded rte_memcpy.h include
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (12 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 13/30] security: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 15/30] net: replace use of fixed size rte_memcpy Stephen Hemminger
` (17 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Parav Pandit, Xueming Li, Hemant Agrawal,
Sachin Saxena, Chenbo Xia, Nipun Gupta
Included here but never used.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/bus/auxiliary/linux/auxiliary.c | 1 -
drivers/bus/fslmc/fslmc_bus.c | 1 -
drivers/bus/fslmc/fslmc_vfio.c | 1 -
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 1 -
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 1 -
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 1 -
drivers/bus/pci/linux/pci.c | 1 -
7 files changed, 7 deletions(-)
diff --git a/drivers/bus/auxiliary/linux/auxiliary.c b/drivers/bus/auxiliary/linux/auxiliary.c
index 02fc9285dc..011278d79b 100644
--- a/drivers/bus/auxiliary/linux/auxiliary.c
+++ b/drivers/bus/auxiliary/linux/auxiliary.c
@@ -8,7 +8,6 @@
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_devargs.h>
-#include <rte_memcpy.h>
#include <eal_filesystem.h>
#include "../private.h"
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index c155f4a2fd..6696aa2575 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -13,7 +13,6 @@
#include <bus_driver.h>
#include <rte_malloc.h>
#include <rte_devargs.h>
-#include <rte_memcpy.h>
#include <ethdev_driver.h>
#include <rte_mbuf_dyn.h>
diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index 5966776a85..2011cd6e77 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -24,7 +24,6 @@
#include <rte_mbuf.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <rte_cycles.h>
#include <rte_kvargs.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
index d7f6e45b7d..cc4d51c7f2 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c
@@ -14,7 +14,6 @@
#include <errno.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <rte_cycles.h>
#include <rte_kvargs.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
index 07256ed7ec..5ff98b2176 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c
@@ -13,7 +13,6 @@
#include <errno.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <rte_cycles.h>
#include <rte_kvargs.h>
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index 4aec7b2cd8..bb8efc1871 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -26,7 +26,6 @@
#include <rte_mbuf.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <rte_cycles.h>
#include <rte_kvargs.h>
diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c
index 3d237398d9..12e58735b7 100644
--- a/drivers/bus/pci/linux/pci.c
+++ b/drivers/bus/pci/linux/pci.c
@@ -10,7 +10,6 @@
#include <rte_bus_pci.h>
#include <rte_malloc.h>
#include <rte_devargs.h>
-#include <rte_memcpy.h>
#include <rte_vfio.h>
#include "eal_filesystem.h"
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 15/30] net: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (13 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 14/30] bus: remove unneeded rte_memcpy.h include Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-04 11:07 ` Slava Ovsiienko
2024-04-02 21:50 ` [PATCH v3 16/30] raw: " Stephen Hemminger
` (16 subsequent siblings)
31 siblings, 1 reply; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Ciara Loftus, Steven Webster, Matt Peters,
Selwin Sebastian, Julien Aube, Ajit Khaparde, Somnath Kotur,
Chas Williams, Min Hu (Connor),
Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
Harman Kalra, Yuying Zhang, Rahul Lakkireddy, Hemant Agrawal,
Sachin Saxena, John Daley, Hyong Youb Kim, Gaetan Rivet,
Jeroen de Borst, Rushil Gupta, Joshua Washington, Ziyang Xuan,
Xiaoyun Wang, Guoyang Zhou, Jie Hai, Yisen Zhuang, Jingjing Wu,
Rosen Xu, Jakub Grajciar, Dariusz Sosnowski,
Viacheslav Ovsiienko, Ori Kam, Suanming Mou, Matan Azrad,
Liron Himi, Long Li, Chaoyong He, Jiawen Wu, Tetsuya Mukawa,
Devendra Singh Rawat, Alok Prasad, Bruce Richardson,
Andrew Rybchenko, Jian Wang, Maxime Coquelin, Chenbo Xia
Automatically generated by devtools/cocci/rte_memcpy.cocci
Also remove unnecessary includes of rte_memcpy.h
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
drivers/net/avp/avp_ethdev.c | 4 +-
drivers/net/axgbe/axgbe_ethdev.c | 4 +-
drivers/net/bnx2x/bnx2x.c | 32 +++--
drivers/net/bnxt/bnxt_flow.c | 34 +++---
drivers/net/bonding/rte_eth_bond_8023ad.c | 4 +-
drivers/net/bonding/rte_eth_bond_flow.c | 2 +-
drivers/net/cnxk/cnxk_eswitch_devargs.c | 3 +-
drivers/net/cnxk/cnxk_ethdev_ops.c | 2 +-
drivers/net/cnxk/cnxk_rep.c | 3 +-
drivers/net/cnxk/cnxk_rep_flow.c | 6 +-
drivers/net/cnxk/cnxk_rep_msg.c | 8 +-
drivers/net/cnxk/cnxk_rep_ops.c | 2 +-
drivers/net/cnxk/cnxk_tm.c | 5 +-
drivers/net/cpfl/cpfl_ethdev.c | 3 +-
drivers/net/cpfl/cpfl_vchnl.c | 4 +-
drivers/net/cxgbe/clip_tbl.c | 2 +-
drivers/net/cxgbe/cxgbe_filter.c | 8 +-
drivers/net/cxgbe/l2t.c | 4 +-
drivers/net/cxgbe/smt.c | 20 ++--
drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 1 -
drivers/net/dpaa2/dpaa2_ethdev.c | 1 -
drivers/net/dpaa2/dpaa2_recycle.c | 1 -
drivers/net/dpaa2/dpaa2_rxtx.c | 1 -
drivers/net/dpaa2/dpaa2_sparser.c | 1 -
drivers/net/dpaa2/dpaa2_tm.c | 2 +-
drivers/net/e1000/em_rxtx.c | 1 -
drivers/net/e1000/igb_flow.c | 22 ++--
drivers/net/e1000/igb_pf.c | 7 +-
drivers/net/e1000/igb_rxtx.c | 1 -
drivers/net/enic/enic_main.c | 8 +-
drivers/net/failsafe/failsafe_ops.c | 6 +-
drivers/net/gve/base/gve_adminq.c | 2 +-
drivers/net/hinic/hinic_pmd_ethdev.c | 1 -
drivers/net/hinic/hinic_pmd_flow.c | 40 +++----
drivers/net/hns3/hns3_fdir.c | 2 +-
drivers/net/hns3/hns3_flow.c | 4 +-
drivers/net/i40e/i40e_ethdev.c | 109 ++++++++----------
drivers/net/i40e/i40e_fdir.c | 28 +++--
drivers/net/i40e/i40e_flow.c | 56 +++++----
drivers/net/i40e/i40e_pf.c | 3 +-
drivers/net/i40e/i40e_tm.c | 11 +-
drivers/net/i40e/rte_pmd_i40e.c | 34 +++---
drivers/net/iavf/iavf_fdir.c | 93 +++++++--------
drivers/net/iavf/iavf_fsub.c | 50 ++++----
drivers/net/iavf/iavf_generic_flow.c | 2 +-
drivers/net/iavf/iavf_tm.c | 11 +-
drivers/net/iavf/iavf_vchnl.c | 9 +-
drivers/net/ice/ice_dcf.c | 5 +-
drivers/net/ice/ice_dcf_parent.c | 2 +-
drivers/net/ice/ice_dcf_sched.c | 11 +-
drivers/net/ice/ice_diagnose.c | 4 +-
drivers/net/ice/ice_ethdev.c | 14 +--
drivers/net/ice/ice_fdir_filter.c | 37 +++---
drivers/net/ice/ice_generic_flow.c | 2 +-
drivers/net/ice/ice_hash.c | 2 +-
drivers/net/ice/ice_tm.c | 11 +-
drivers/net/idpf/idpf_ethdev.c | 7 +-
drivers/net/idpf/idpf_rxtx.c | 10 +-
drivers/net/ipn3ke/ipn3ke_flow.c | 32 +++--
drivers/net/ipn3ke/ipn3ke_representor.c | 16 +--
drivers/net/ipn3ke/ipn3ke_tm.c | 6 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 9 +-
drivers/net/ixgbe/ixgbe_fdir.c | 7 +-
drivers/net/ixgbe/ixgbe_flow.c | 65 +++++------
drivers/net/ixgbe/ixgbe_ipsec.c | 8 +-
drivers/net/ixgbe/ixgbe_pf.c | 5 +-
drivers/net/ixgbe/ixgbe_tm.c | 11 +-
drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +-
drivers/net/memif/memif_socket.c | 4 +-
drivers/net/mlx5/mlx5_devx.c | 4 +-
drivers/net/mlx5/mlx5_flow.c | 38 +++---
drivers/net/mlx5/mlx5_flow_aso.c | 6 +-
drivers/net/mlx5/mlx5_flow_hw.c | 27 ++---
drivers/net/mlx5/mlx5_rx.c | 6 +-
drivers/net/mlx5/mlx5_rxtx_vec.c | 8 +-
drivers/net/mvpp2/mrvl_tm.c | 2 +-
drivers/net/netvsc/hn_ethdev.c | 1 -
drivers/net/nfp/flower/nfp_conntrack.c | 2 +-
drivers/net/nfp/flower/nfp_flower_flow.c | 16 +--
.../net/nfp/flower/nfp_flower_representor.c | 2 +-
drivers/net/nfp/nfp_mtr.c | 10 +-
drivers/net/ngbe/ngbe_pf.c | 4 +-
drivers/net/null/rte_eth_null.c | 6 +-
drivers/net/pcap/pcap_ethdev.c | 2 +-
drivers/net/pcap/pcap_osdep_freebsd.c | 3 +-
drivers/net/pcap/pcap_osdep_linux.c | 3 +-
drivers/net/qede/qede_main.c | 2 +-
drivers/net/ring/rte_eth_ring.c | 1 -
drivers/net/sfc/sfc.c | 2 +-
drivers/net/sfc/sfc_ef10_tx.c | 2 +-
drivers/net/sfc/sfc_ethdev.c | 11 +-
drivers/net/sfc/sfc_flow.c | 20 ++--
| 2 +-
drivers/net/sfc/sfc_mae.c | 2 +-
drivers/net/sfc/sfc_rx.c | 2 +-
drivers/net/sfc/sfc_tso.c | 2 +-
drivers/net/sfc/sfc_tso.h | 9 +-
drivers/net/tap/rte_eth_tap.c | 14 +--
drivers/net/txgbe/txgbe_ethdev.c | 9 +-
drivers/net/txgbe/txgbe_fdir.c | 6 +-
drivers/net/txgbe/txgbe_flow.c | 65 +++++------
drivers/net/txgbe/txgbe_ipsec.c | 8 +-
drivers/net/txgbe/txgbe_pf.c | 5 +-
drivers/net/txgbe/txgbe_tm.c | 11 +-
drivers/net/vhost/rte_eth_vhost.c | 1 -
drivers/net/virtio/virtio_ethdev.c | 1 -
107 files changed, 582 insertions(+), 664 deletions(-)
diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 268a130c49..6977516613 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -2094,7 +2094,7 @@ get_iface_info(const char *if_name,
if (ioctl(sock, SIOCGIFHWADDR, &ifr))
goto error;
- rte_memcpy(eth_addr, ifr.ifr_hwaddr.sa_data, RTE_ETHER_ADDR_LEN);
+ memcpy(eth_addr, ifr.ifr_hwaddr.sa_data, RTE_ETHER_ADDR_LEN);
close(sock);
return 0;
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index 53d9e38c93..9bd0530172 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -248,7 +248,7 @@ avp_dev_process_request(struct avp_dev *avp, struct rte_avp_request *request)
while (avp_fifo_get(avp->resp_q, (void **)&resp_addr, 1))
PMD_DRV_LOG(DEBUG, "Discarding stale response\n");
- rte_memcpy(avp->sync_addr, request, sizeof(*request));
+ memcpy(avp->sync_addr, request, sizeof(*request));
count = avp_fifo_put(avp->req_q, &avp->host_sync_addr, 1);
if (count < 1) {
PMD_DRV_LOG(ERR, "Cannot send request %u to host\n",
@@ -285,7 +285,7 @@ avp_dev_process_request(struct avp_dev *avp, struct rte_avp_request *request)
}
/* copy to user buffer */
- rte_memcpy(request, avp->sync_addr, sizeof(*request));
+ memcpy(request, avp->sync_addr, sizeof(*request));
ret = 0;
PMD_DRV_LOG(DEBUG, "Result %d received for request %u\n",
diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c
index dd681f15a0..7ac30106e3 100644
--- a/drivers/net/axgbe/axgbe_ethdev.c
+++ b/drivers/net/axgbe/axgbe_ethdev.c
@@ -594,7 +594,7 @@ axgbe_dev_rss_hash_update(struct rte_eth_dev *dev,
if (rss_conf->rss_key != NULL &&
rss_conf->rss_key_len == AXGBE_RSS_HASH_KEY_SIZE) {
- rte_memcpy(pdata->rss_key, rss_conf->rss_key,
+ memcpy(pdata->rss_key, rss_conf->rss_key,
AXGBE_RSS_HASH_KEY_SIZE);
/* Program the hash key */
ret = axgbe_write_rss_hash_key(pdata);
@@ -637,7 +637,7 @@ axgbe_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
if (rss_conf->rss_key != NULL &&
rss_conf->rss_key_len >= AXGBE_RSS_HASH_KEY_SIZE) {
- rte_memcpy(rss_conf->rss_key, pdata->rss_key,
+ memcpy(rss_conf->rss_key, pdata->rss_key,
AXGBE_RSS_HASH_KEY_SIZE);
}
rss_conf->rss_key_len = AXGBE_RSS_HASH_KEY_SIZE;
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 597ee43359..16a9ff7f8c 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -2242,18 +2242,18 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0)
tx_parse_bd->parsing_data =
(mac_type << ETH_TX_PARSE_BD_E2_ETH_ADDR_TYPE_SHIFT);
- rte_memcpy(&tx_parse_bd->data.mac_addr.dst_hi,
- &eh->dst_addr.addr_bytes[0], 2);
- rte_memcpy(&tx_parse_bd->data.mac_addr.dst_mid,
- &eh->dst_addr.addr_bytes[2], 2);
- rte_memcpy(&tx_parse_bd->data.mac_addr.dst_lo,
- &eh->dst_addr.addr_bytes[4], 2);
- rte_memcpy(&tx_parse_bd->data.mac_addr.src_hi,
- &eh->src_addr.addr_bytes[0], 2);
- rte_memcpy(&tx_parse_bd->data.mac_addr.src_mid,
- &eh->src_addr.addr_bytes[2], 2);
- rte_memcpy(&tx_parse_bd->data.mac_addr.src_lo,
- &eh->src_addr.addr_bytes[4], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.dst_hi,
+ &eh->dst_addr.addr_bytes[0], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.dst_mid,
+ &eh->dst_addr.addr_bytes[2], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.dst_lo,
+ &eh->dst_addr.addr_bytes[4], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.src_hi,
+ &eh->src_addr.addr_bytes[0], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.src_mid,
+ &eh->src_addr.addr_bytes[2], 2);
+ memcpy(&tx_parse_bd->data.mac_addr.src_lo,
+ &eh->src_addr.addr_bytes[4], 2);
tx_parse_bd->data.mac_addr.dst_hi =
rte_cpu_to_be_16(tx_parse_bd->data.mac_addr.dst_hi);
@@ -6675,8 +6675,7 @@ bnx2x_config_rss_pf(struct bnx2x_softc *sc, struct ecore_rss_config_obj *rss_obj
/* Hash bits */
params.rss_result_mask = MULTI_MASK;
- rte_memcpy(params.ind_table, rss_obj->ind_table,
- sizeof(params.ind_table));
+ memcpy(params.ind_table, rss_obj->ind_table, sizeof(params.ind_table));
if (config_hash) {
/* RSS keys */
@@ -6742,8 +6741,7 @@ bnx2x_set_mac_one(struct bnx2x_softc *sc, uint8_t * mac,
/* fill a user request section if needed */
if (!rte_bit_relaxed_get32(RAMROD_CONT, ramrod_flags)) {
- rte_memcpy(ramrod_param.user_req.u.mac.mac, mac,
- ETH_ALEN);
+ memcpy(ramrod_param.user_req.u.mac.mac, mac, ETH_ALEN);
rte_bit_relaxed_set32(mac_type,
&ramrod_param.user_req.vlan_mac_flags);
@@ -6958,7 +6956,7 @@ static void bnx2x_link_report_locked(struct bnx2x_softc *sc)
ELINK_DEBUG_P1(sc, "link status change count = %x", sc->link_cnt);
/* report new link params and remember the state for the next time */
- rte_memcpy(&sc->last_reported_link, &cur_data, sizeof(cur_data));
+ memcpy(&sc->last_reported_link, &cur_data, sizeof(cur_data));
if (rte_bit_relaxed_get32(BNX2X_LINK_REPORT_LINK_DOWN,
&cur_data.link_report_flags)) {
diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index f25bc6ff78..6466aa394a 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -233,8 +233,9 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
"DMAC is invalid!\n");
return -rte_errno;
}
- rte_memcpy(filter->dst_macaddr,
- ð_spec->hdr.dst_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(filter->dst_macaddr,
+ ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
en |= use_ntuple ?
NTUPLE_FLTR_ALLOC_INPUT_EN_DST_MACADDR :
EM_FLOW_ALLOC_INPUT_EN_DST_MACADDR;
@@ -257,8 +258,9 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
"SMAC is invalid!\n");
return -rte_errno;
}
- rte_memcpy(filter->src_macaddr,
- ð_spec->hdr.src_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(filter->src_macaddr,
+ ð_spec->hdr.src_addr,
+ RTE_ETHER_ADDR_LEN);
en |= use_ntuple ?
NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_MACADDR :
EM_FLOW_ALLOC_INPUT_EN_SRC_MACADDR;
@@ -423,23 +425,23 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
en |= EM_FLOW_ALLOC_INPUT_EN_SRC_IPADDR |
EM_FLOW_ALLOC_INPUT_EN_DST_IPADDR;
- rte_memcpy(filter->src_ipaddr,
- ipv6_spec->hdr.src_addr, 16);
- rte_memcpy(filter->dst_ipaddr,
- ipv6_spec->hdr.dst_addr, 16);
+ memcpy(filter->src_ipaddr, ipv6_spec->hdr.src_addr,
+ 16);
+ memcpy(filter->dst_ipaddr, ipv6_spec->hdr.dst_addr,
+ 16);
if (!bnxt_check_zero_bytes(ipv6_mask->hdr.src_addr,
16)) {
- rte_memcpy(filter->src_ipaddr_mask,
- ipv6_mask->hdr.src_addr, 16);
+ memcpy(filter->src_ipaddr_mask,
+ ipv6_mask->hdr.src_addr, 16);
en |= !use_ntuple ? 0 :
NTUPLE_FLTR_ALLOC_INPUT_EN_SRC_IPADDR_MASK;
}
if (!bnxt_check_zero_bytes(ipv6_mask->hdr.dst_addr,
16)) {
- rte_memcpy(filter->dst_ipaddr_mask,
- ipv6_mask->hdr.dst_addr, 16);
+ memcpy(filter->dst_ipaddr_mask,
+ ipv6_mask->hdr.dst_addr, 16);
en |= !use_ntuple ? 0 :
NTUPLE_FLTR_ALLOC_INPUT_EN_DST_IPADDR_MASK;
}
@@ -591,8 +593,8 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
return -rte_errno;
}
- rte_memcpy(((uint8_t *)&tenant_id_be + 1),
- vxlan_spec->hdr.vni, 3);
+ memcpy(((uint8_t *)&tenant_id_be + 1),
+ vxlan_spec->hdr.vni, 3);
filter->vni =
rte_be_to_cpu_32(tenant_id_be);
filter->tunnel_type =
@@ -645,8 +647,8 @@ bnxt_validate_and_parse_flow_type(const struct rte_flow_attr *attr,
"Invalid TNI mask");
return -rte_errno;
}
- rte_memcpy(((uint8_t *)&tenant_id_be + 1),
- nvgre_spec->tni, 3);
+ memcpy(((uint8_t *)&tenant_id_be + 1),
+ nvgre_spec->tni, 3);
filter->vni =
rte_be_to_cpu_32(tenant_id_be);
filter->tunnel_type =
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 79f1b3f1a0..8ddf5dc80a 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -1539,10 +1539,10 @@ rte_eth_bond_8023ad_member_info(uint16_t port_id, uint16_t member_id,
info->selected = port->selected;
info->actor_state = port->actor_state;
- rte_memcpy(&info->actor, &port->actor, sizeof(port->actor));
+ memcpy(&info->actor, &port->actor, sizeof(port->actor));
info->partner_state = port->partner_state;
- rte_memcpy(&info->partner, &port->partner, sizeof(port->partner));
+ memcpy(&info->partner, &port->partner, sizeof(port->partner));
info->agg_port_id = port->aggregator_port_id;
return 0;
diff --git a/drivers/net/bonding/rte_eth_bond_flow.c b/drivers/net/bonding/rte_eth_bond_flow.c
index 5d0be5caf5..bb9d347e2b 100644
--- a/drivers/net/bonding/rte_eth_bond_flow.c
+++ b/drivers/net/bonding/rte_eth_bond_flow.c
@@ -182,7 +182,7 @@ bond_flow_query_count(struct rte_eth_dev *dev, struct rte_flow *flow,
count->hits = 0;
count->bytes_set = 0;
count->hits_set = 0;
- rte_memcpy(&member_count, count, sizeof(member_count));
+ memcpy(&member_count, count, sizeof(member_count));
for (i = 0; i < internals->member_count; i++) {
ret = rte_flow_query(internals->members[i].port_id,
flow->flows[i], action,
diff --git a/drivers/net/cnxk/cnxk_eswitch_devargs.c b/drivers/net/cnxk/cnxk_eswitch_devargs.c
index 8167ce673a..70045c58c1 100644
--- a/drivers/net/cnxk/cnxk_eswitch_devargs.c
+++ b/drivers/net/cnxk/cnxk_eswitch_devargs.c
@@ -112,7 +112,8 @@ cnxk_eswitch_repr_devargs(struct rte_pci_device *pci_dev, struct cnxk_eswitch_de
goto fail;
}
- rte_memcpy(&eswitch_dev->esw_da[j].da, ð_da[i], sizeof(struct rte_eth_devargs));
+ memcpy(&eswitch_dev->esw_da[j].da, ð_da[i],
+ sizeof(struct rte_eth_devargs));
/* No of representor ports to be created */
eswitch_dev->repr_cnt.nb_repr_created += eswitch_dev->esw_da[j].nb_repr_ports;
j++;
diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c
index c8260fcb9c..4366ef44d2 100644
--- a/drivers/net/cnxk/cnxk_ethdev_ops.c
+++ b/drivers/net/cnxk/cnxk_ethdev_ops.c
@@ -454,7 +454,7 @@ cnxk_nix_mac_addr_set(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr)
}
/* Update mac address to cnxk ethernet device */
- rte_memcpy(dev->mac_addr, addr->addr_bytes, RTE_ETHER_ADDR_LEN);
+ memcpy(dev->mac_addr, addr->addr_bytes, RTE_ETHER_ADDR_LEN);
exit:
return rc;
diff --git a/drivers/net/cnxk/cnxk_rep.c b/drivers/net/cnxk/cnxk_rep.c
index ca0637bde5..35f6be63a6 100644
--- a/drivers/net/cnxk/cnxk_rep.c
+++ b/drivers/net/cnxk/cnxk_rep.c
@@ -383,7 +383,8 @@ cnxk_representee_notification(void *roc_nix, struct roc_eswitch_repte_notify_msg
goto done;
}
- rte_memcpy(msg->notify_msg, notify_msg, sizeof(struct roc_eswitch_repte_notify_msg));
+ memcpy(msg->notify_msg, notify_msg,
+ sizeof(struct roc_eswitch_repte_notify_msg));
plt_rep_dbg("Pushing new notification : msg type %d", msg->notify_msg->type);
pthread_mutex_lock(&eswitch_dev->repte_msg_proc.mutex);
TAILQ_INSERT_TAIL(&repte_msg_proc->msg_list, msg, next);
diff --git a/drivers/net/cnxk/cnxk_rep_flow.c b/drivers/net/cnxk/cnxk_rep_flow.c
index d26f5aa12c..9f09e6a7f0 100644
--- a/drivers/net/cnxk/cnxk_rep_flow.c
+++ b/drivers/net/cnxk/cnxk_rep_flow.c
@@ -81,7 +81,8 @@ prepare_pattern_data(const struct rte_flow_item *pattern, uint16_t nb_pattern,
hdr.mask_sz = term[pattern->type].item_size;
}
- rte_memcpy(RTE_PTR_ADD(pattern_data, len), &hdr, sizeof(cnxk_pattern_hdr_t));
+ memcpy(RTE_PTR_ADD(pattern_data, len), &hdr,
+ sizeof(cnxk_pattern_hdr_t));
len += sizeof(cnxk_pattern_hdr_t);
/* Copy pattern spec data */
@@ -228,7 +229,8 @@ prepare_action_data(const struct rte_flow_action *action, uint16_t nb_action, ui
hdr.type = action->type;
hdr.conf_sz = sz;
- rte_memcpy(RTE_PTR_ADD(action_data, len), &hdr, sizeof(cnxk_action_hdr_t));
+ memcpy(RTE_PTR_ADD(action_data, len), &hdr,
+ sizeof(cnxk_action_hdr_t));
len += sizeof(cnxk_action_hdr_t);
/* Copy action conf data */
diff --git a/drivers/net/cnxk/cnxk_rep_msg.c b/drivers/net/cnxk/cnxk_rep_msg.c
index f3a62a805e..76f07a51de 100644
--- a/drivers/net/cnxk/cnxk_rep_msg.c
+++ b/drivers/net/cnxk/cnxk_rep_msg.c
@@ -58,7 +58,7 @@ receive_control_message(int socketfd, void *data, uint32_t len)
if (cmsg->cmsg_type == SCM_CREDENTIALS) {
cr = (struct ucred *)CMSG_DATA(cmsg);
} else if (cmsg->cmsg_type == SCM_RIGHTS) {
- rte_memcpy(&afd, CMSG_DATA(cmsg), sizeof(int));
+ memcpy(&afd, CMSG_DATA(cmsg), sizeof(int));
plt_rep_dbg("afd %d", afd);
}
}
@@ -90,7 +90,7 @@ send_message_on_socket(int socketfd, void *data, uint32_t len, int afd)
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
- rte_memcpy(CMSG_DATA(cmsg), &afd, sizeof(int));
+ memcpy(CMSG_DATA(cmsg), &afd, sizeof(int));
}
size = sendmsg(socketfd, &mh, MSG_DONTWAIT);
@@ -198,7 +198,7 @@ cnxk_rep_msg_populate_type(void *buffer, uint32_t *length, cnxk_type_t type, uin
data.length = sz;
/* Populate the type data */
- rte_memcpy(RTE_PTR_ADD(buffer, len), &data, sizeof(cnxk_type_data_t));
+ memcpy(RTE_PTR_ADD(buffer, len), &data, sizeof(cnxk_type_data_t));
len += sizeof(cnxk_type_data_t);
*length = len;
@@ -218,7 +218,7 @@ cnxk_rep_msg_populate_header(void *buffer, uint32_t *length)
hdr.signature = CTRL_MSG_SIGNATURE;
/* Populate header data */
- rte_memcpy(RTE_PTR_ADD(buffer, len), &hdr, sizeof(cnxk_header_t));
+ memcpy(RTE_PTR_ADD(buffer, len), &hdr, sizeof(cnxk_header_t));
len += sizeof(cnxk_header_t);
*length = len;
diff --git a/drivers/net/cnxk/cnxk_rep_ops.c b/drivers/net/cnxk/cnxk_rep_ops.c
index 8bcb689468..cd9ae52f99 100644
--- a/drivers/net/cnxk/cnxk_rep_ops.c
+++ b/drivers/net/cnxk/cnxk_rep_ops.c
@@ -677,7 +677,7 @@ cnxk_rep_mac_addr_set(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr)
cnxk_rep_msg_populate_header(buffer, &len);
msg_sm_meta.portid = rep_dev->rep_id;
- rte_memcpy(&msg_sm_meta.addr_bytes, addr->addr_bytes, RTE_ETHER_ADDR_LEN);
+ memcpy(&msg_sm_meta.addr_bytes, addr->addr_bytes, RTE_ETHER_ADDR_LEN);
cnxk_rep_msg_populate_command_meta(buffer, &len, &msg_sm_meta,
sizeof(cnxk_rep_msg_eth_set_mac_meta_t),
CNXK_REP_MSG_ETH_SET_MAC);
diff --git a/drivers/net/cnxk/cnxk_tm.c b/drivers/net/cnxk/cnxk_tm.c
index c799193cb8..5c8b0997ca 100644
--- a/drivers/net/cnxk/cnxk_tm.c
+++ b/drivers/net/cnxk/cnxk_tm.c
@@ -300,8 +300,7 @@ cnxk_nix_tm_shaper_profile_add(struct rte_eth_dev *eth_dev, uint32_t id,
profile->profile.pkt_len_adj = params->pkt_length_adjust;
profile->profile.pkt_mode = params->packet_mode;
profile->profile.free_fn = rte_free;
- rte_memcpy(&profile->params, params,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&profile->params, params, sizeof(struct rte_tm_shaper_params));
rc = roc_nix_tm_shaper_profile_add(nix, &profile->profile);
@@ -373,7 +372,7 @@ cnxk_nix_tm_node_add(struct rte_eth_dev *eth_dev, uint32_t node_id,
if (!node)
return -ENOMEM;
- rte_memcpy(&node->params, params, sizeof(struct rte_tm_node_params));
+ memcpy(&node->params, params, sizeof(struct rte_tm_node_params));
node->nix_node.id = node_id;
node->nix_node.parent_id = parent_node_id;
diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c
index ef19aa1b6a..1037aec68d 100644
--- a/drivers/net/cpfl/cpfl_ethdev.c
+++ b/drivers/net/cpfl/cpfl_ethdev.c
@@ -2292,7 +2292,8 @@ cpfl_adapter_ext_init(struct rte_pci_device *pci_dev, struct cpfl_adapter_ext *a
strncpy(adapter->name, pci_dev->device.name, PCI_PRI_STR_SIZE);
- rte_memcpy(&base->caps, &req_caps, sizeof(struct virtchnl2_get_capabilities));
+ memcpy(&base->caps, &req_caps,
+ sizeof(struct virtchnl2_get_capabilities));
ret = idpf_adapter_init(base);
if (ret != 0) {
diff --git a/drivers/net/cpfl/cpfl_vchnl.c b/drivers/net/cpfl/cpfl_vchnl.c
index 7d277a0e8e..e914014d8a 100644
--- a/drivers/net/cpfl/cpfl_vchnl.c
+++ b/drivers/net/cpfl/cpfl_vchnl.c
@@ -32,7 +32,7 @@ cpfl_cc_vport_list_get(struct cpfl_adapter_ext *adapter,
return err;
}
- rte_memcpy(response, args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
+ memcpy(response, args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
return 0;
}
@@ -66,7 +66,7 @@ cpfl_cc_vport_info_get(struct cpfl_adapter_ext *adapter,
return err;
}
- rte_memcpy(response, args.out_buffer, sizeof(*response));
+ memcpy(response, args.out_buffer, sizeof(*response));
return 0;
}
diff --git a/drivers/net/cxgbe/clip_tbl.c b/drivers/net/cxgbe/clip_tbl.c
index b709e26f6a..d30fa6425f 100644
--- a/drivers/net/cxgbe/clip_tbl.c
+++ b/drivers/net/cxgbe/clip_tbl.c
@@ -115,7 +115,7 @@ static struct clip_entry *t4_clip_alloc(struct rte_eth_dev *dev,
if (ce) {
t4_os_lock(&ce->lock);
if (__atomic_load_n(&ce->refcnt, __ATOMIC_RELAXED) == 0) {
- rte_memcpy(ce->addr, lip, sizeof(ce->addr));
+ memcpy(ce->addr, lip, sizeof(ce->addr));
if (v6) {
ce->type = FILTER_TYPE_IPV6;
__atomic_store_n(&ce->refcnt, 1,
diff --git a/drivers/net/cxgbe/cxgbe_filter.c b/drivers/net/cxgbe/cxgbe_filter.c
index 5a7efe7a73..3d1d087ec2 100644
--- a/drivers/net/cxgbe/cxgbe_filter.c
+++ b/drivers/net/cxgbe/cxgbe_filter.c
@@ -851,10 +851,10 @@ static int set_filter_wr(struct rte_eth_dev *dev, unsigned int fidx)
fwr->ivlanm = cpu_to_be16(f->fs.mask.ivlan);
fwr->ovlan = cpu_to_be16(f->fs.val.ovlan);
fwr->ovlanm = cpu_to_be16(f->fs.mask.ovlan);
- rte_memcpy(fwr->lip, f->fs.val.lip, sizeof(fwr->lip));
- rte_memcpy(fwr->lipm, f->fs.mask.lip, sizeof(fwr->lipm));
- rte_memcpy(fwr->fip, f->fs.val.fip, sizeof(fwr->fip));
- rte_memcpy(fwr->fipm, f->fs.mask.fip, sizeof(fwr->fipm));
+ memcpy(fwr->lip, f->fs.val.lip, sizeof(fwr->lip));
+ memcpy(fwr->lipm, f->fs.mask.lip, sizeof(fwr->lipm));
+ memcpy(fwr->fip, f->fs.val.fip, sizeof(fwr->fip));
+ memcpy(fwr->fipm, f->fs.mask.fip, sizeof(fwr->fipm));
fwr->lp = cpu_to_be16(f->fs.val.lport);
fwr->lpm = cpu_to_be16(f->fs.mask.lport);
fwr->fp = cpu_to_be16(f->fs.val.fport);
diff --git a/drivers/net/cxgbe/l2t.c b/drivers/net/cxgbe/l2t.c
index 21f4019ae6..7721c7953e 100644
--- a/drivers/net/cxgbe/l2t.c
+++ b/drivers/net/cxgbe/l2t.c
@@ -82,7 +82,7 @@ static int write_l2e(struct rte_eth_dev *dev, struct l2t_entry *e, int sync,
V_L2T_W_NOREPLY(!sync));
req->l2t_idx = cpu_to_be16(l2t_idx);
req->vlan = cpu_to_be16(e->vlan);
- rte_memcpy(req->dst_mac, e->dmac, RTE_ETHER_ADDR_LEN);
+ memcpy(req->dst_mac, e->dmac, RTE_ETHER_ADDR_LEN);
if (loopback)
memset(req->dst_mac, 0, RTE_ETHER_ADDR_LEN);
@@ -155,7 +155,7 @@ static struct l2t_entry *t4_l2t_alloc_switching(struct rte_eth_dev *dev,
e->state = L2T_STATE_SWITCHING;
e->vlan = vlan;
e->lport = port;
- rte_memcpy(e->dmac, eth_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(e->dmac, eth_addr, RTE_ETHER_ADDR_LEN);
__atomic_store_n(&e->refcnt, 1, __ATOMIC_RELAXED);
ret = write_l2e(dev, e, 0, !L2T_LPBK, !L2T_ARPMISS);
if (ret < 0)
diff --git a/drivers/net/cxgbe/smt.c b/drivers/net/cxgbe/smt.c
index 4e14a73753..a74b2e0794 100644
--- a/drivers/net/cxgbe/smt.c
+++ b/drivers/net/cxgbe/smt.c
@@ -55,26 +55,24 @@ static int write_smt_entry(struct rte_eth_dev *dev, struct smt_entry *e)
*/
if (e->idx & 1) {
req->pfvf1 = 0x0;
- rte_memcpy(req->src_mac1, e->src_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(req->src_mac1, e->src_mac, RTE_ETHER_ADDR_LEN);
/* fill pfvf0/src_mac0 with entry
* at prev index from smt-tab.
*/
req->pfvf0 = 0x0;
- rte_memcpy(req->src_mac0, s->smtab[e->idx - 1].src_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(req->src_mac0, s->smtab[e->idx - 1].src_mac,
+ RTE_ETHER_ADDR_LEN);
} else {
req->pfvf0 = 0x0;
- rte_memcpy(req->src_mac0, e->src_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(req->src_mac0, e->src_mac, RTE_ETHER_ADDR_LEN);
/* fill pfvf1/src_mac1 with entry
* at next index from smt-tab
*/
req->pfvf1 = 0x0;
- rte_memcpy(req->src_mac1, s->smtab[e->idx + 1].src_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(req->src_mac1, s->smtab[e->idx + 1].src_mac,
+ RTE_ETHER_ADDR_LEN);
}
row = (e->hw_idx >> 1);
} else {
@@ -87,8 +85,8 @@ static int write_smt_entry(struct rte_eth_dev *dev, struct smt_entry *e)
/* fill pfvf0/src_mac0 from smt-tab */
t6req->pfvf0 = 0x0;
- rte_memcpy(t6req->src_mac0, s->smtab[e->idx].src_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(t6req->src_mac0, s->smtab[e->idx].src_mac,
+ RTE_ETHER_ADDR_LEN);
row = e->hw_idx;
req = (struct cpl_smt_write_req *)t6req;
}
@@ -158,7 +156,7 @@ static struct smt_entry *t4_smt_alloc_switching(struct rte_eth_dev *dev,
t4_os_lock(&e->lock);
if (__atomic_load_n(&e->refcnt, __ATOMIC_RELAXED) == 0) {
e->pfvf = pfvf;
- rte_memcpy(e->src_mac, smac, RTE_ETHER_ADDR_LEN);
+ memcpy(e->src_mac, smac, RTE_ETHER_ADDR_LEN);
ret = write_smt_entry(dev, e);
if (ret) {
e->pfvf = 0;
diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
index 4d33b51fea..747fa40532 100644
--- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
+++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
@@ -11,7 +11,6 @@
#include <rte_mbuf.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <rte_cycles.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 97edc00420..5799770fde 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -11,7 +11,6 @@
#include <rte_mbuf.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <rte_cycles.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/dpaa2/dpaa2_recycle.c b/drivers/net/dpaa2/dpaa2_recycle.c
index fbfdf360d1..cda08a6cee 100644
--- a/drivers/net/dpaa2/dpaa2_recycle.c
+++ b/drivers/net/dpaa2/dpaa2_recycle.c
@@ -10,7 +10,6 @@
#include <rte_mbuf.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <rte_cycles.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c
index 23f7c4132d..b83015a94c 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -11,7 +11,6 @@
#include <rte_mbuf.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <dev_driver.h>
#include <rte_hexdump.h>
diff --git a/drivers/net/dpaa2/dpaa2_sparser.c b/drivers/net/dpaa2/dpaa2_sparser.c
index 36a14526a5..e2976282bf 100644
--- a/drivers/net/dpaa2/dpaa2_sparser.c
+++ b/drivers/net/dpaa2/dpaa2_sparser.c
@@ -5,7 +5,6 @@
#include <rte_mbuf.h>
#include <rte_ethdev.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <dev_driver.h>
diff --git a/drivers/net/dpaa2/dpaa2_tm.c b/drivers/net/dpaa2/dpaa2_tm.c
index 8fe5bfa013..1749b1be22 100644
--- a/drivers/net/dpaa2/dpaa2_tm.c
+++ b/drivers/net/dpaa2/dpaa2_tm.c
@@ -324,7 +324,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,
NULL, NULL);
profile->id = shaper_profile_id;
- rte_memcpy(&profile->params, params, sizeof(profile->params));
+ memcpy(&profile->params, params, sizeof(profile->params));
LIST_INSERT_HEAD(&priv->shaper_profiles, profile, next);
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index df5fbb7823..3a069ce33e 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -20,7 +20,6 @@
#include <rte_pci.h>
#include <bus_pci_driver.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_eal.h>
diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c
index ea9b290e1c..8bca484960 100644
--- a/drivers/net/e1000/igb_flow.c
+++ b/drivers/net/e1000/igb_flow.c
@@ -1484,9 +1484,9 @@ igb_flow_create(struct rte_eth_dev *dev,
goto out;
}
- rte_memcpy(&ntuple_filter_ptr->filter_info,
- &ntuple_filter,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter_ptr->filter_info,
+ &ntuple_filter,
+ sizeof(struct rte_eth_ntuple_filter));
TAILQ_INSERT_TAIL(&igb_filter_ntuple_list,
ntuple_filter_ptr, entries);
flow->rule = ntuple_filter_ptr;
@@ -1511,9 +1511,9 @@ igb_flow_create(struct rte_eth_dev *dev,
goto out;
}
- rte_memcpy(ðertype_filter_ptr->filter_info,
- ðertype_filter,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter_ptr->filter_info,
+ ðertype_filter,
+ sizeof(struct rte_eth_ethertype_filter));
TAILQ_INSERT_TAIL(&igb_filter_ethertype_list,
ethertype_filter_ptr, entries);
flow->rule = ethertype_filter_ptr;
@@ -1536,9 +1536,8 @@ igb_flow_create(struct rte_eth_dev *dev,
goto out;
}
- rte_memcpy(&syn_filter_ptr->filter_info,
- &syn_filter,
- sizeof(struct rte_eth_syn_filter));
+ memcpy(&syn_filter_ptr->filter_info, &syn_filter,
+ sizeof(struct rte_eth_syn_filter));
TAILQ_INSERT_TAIL(&igb_filter_syn_list,
syn_filter_ptr,
entries);
@@ -1562,9 +1561,8 @@ igb_flow_create(struct rte_eth_dev *dev,
goto out;
}
- rte_memcpy(&flex_filter_ptr->filter_info,
- &flex_filter,
- sizeof(struct igb_flex_filter));
+ memcpy(&flex_filter_ptr->filter_info, &flex_filter,
+ sizeof(struct igb_flex_filter));
TAILQ_INSERT_TAIL(&igb_filter_flex_list,
flex_filter_ptr, entries);
flow->rule = flex_filter_ptr;
diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c
index c7588ea57e..efb806af56 100644
--- a/drivers/net/e1000/igb_pf.c
+++ b/drivers/net/e1000/igb_pf.c
@@ -17,7 +17,6 @@
#include <rte_eal.h>
#include <rte_ether.h>
#include <ethdev_driver.h>
-#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
@@ -290,7 +289,7 @@ igb_vf_reset(struct rte_eth_dev *dev, uint16_t vf, uint32_t *msgbuf)
/* reply to reset with ack and vf mac address */
msgbuf[0] = E1000_VF_RESET | E1000_VT_MSGTYPE_ACK;
- rte_memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
+ memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
e1000_write_mbx(hw, msgbuf, 3, vf);
return 0;
@@ -308,8 +307,8 @@ igb_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
if (rte_is_unicast_ether_addr((struct rte_ether_addr *)new_mac)) {
if (!rte_is_zero_ether_addr((struct rte_ether_addr *)new_mac))
- rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac,
- sizeof(vfinfo[vf].vf_mac_addresses));
+ memcpy(vfinfo[vf].vf_mac_addresses, new_mac,
+ sizeof(vfinfo[vf].vf_mac_addresses));
hw->mac.ops.rar_set(hw, new_mac, rar_entry);
rah = E1000_READ_REG(hw, E1000_RAH(rar_entry));
rah |= (0x1 << (E1000_RAH_POOLSEL_SHIFT + vf));
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 5cafd6f1ce..4a41a3cea5 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -19,7 +19,6 @@
#include <rte_debug.h>
#include <rte_pci.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_eal.h>
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 2f681315b6..9e3e026856 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1221,8 +1221,8 @@ static int enic_set_rsskey(struct enic *enic, uint8_t *user_key)
/* Save for later queries */
if (!err) {
- rte_memcpy(&enic->rss_key, rss_key_buf_va,
- sizeof(union vnic_rss_key));
+ memcpy(&enic->rss_key, rss_key_buf_va,
+ sizeof(union vnic_rss_key));
}
enic_free_consistent(enic, sizeof(union vnic_rss_key),
rss_key_buf_va, rss_key_buf_pa);
@@ -1243,7 +1243,7 @@ int enic_set_rss_reta(struct enic *enic, union vnic_rss_cpu *rss_cpu)
if (!rss_cpu_buf_va)
return -ENOMEM;
- rte_memcpy(rss_cpu_buf_va, rss_cpu, sizeof(union vnic_rss_cpu));
+ memcpy(rss_cpu_buf_va, rss_cpu, sizeof(union vnic_rss_cpu));
err = enic_set_rss_cpu(enic,
rss_cpu_buf_pa,
@@ -1254,7 +1254,7 @@ int enic_set_rss_reta(struct enic *enic, union vnic_rss_cpu *rss_cpu)
/* Save for later queries */
if (!err)
- rte_memcpy(&enic->rss_cpu, rss_cpu, sizeof(union vnic_rss_cpu));
+ memcpy(&enic->rss_cpu, rss_cpu, sizeof(union vnic_rss_cpu));
return err;
}
diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index 9c013e0419..47d453ef80 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -902,16 +902,16 @@ fs_stats_get(struct rte_eth_dev *dev,
ret = fs_lock(dev, 0);
if (ret != 0)
return ret;
- rte_memcpy(stats, &PRIV(dev)->stats_accumulator, sizeof(*stats));
+ memcpy(stats, &PRIV(dev)->stats_accumulator, sizeof(*stats));
FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {
struct rte_eth_stats *snapshot = &sdev->stats_snapshot.stats;
uint64_t *timestamp = &sdev->stats_snapshot.timestamp;
- rte_memcpy(&backup, snapshot, sizeof(backup));
+ memcpy(&backup, snapshot, sizeof(backup));
ret = rte_eth_stats_get(PORT_ID(sdev), snapshot);
if (ret) {
if (!fs_err(sdev, ret)) {
- rte_memcpy(snapshot, &backup, sizeof(backup));
+ memcpy(snapshot, &backup, sizeof(backup));
goto inc;
}
ERROR("Operation rte_eth_stats_get failed for sub_device %d with error %d",
diff --git a/drivers/net/gve/base/gve_adminq.c b/drivers/net/gve/base/gve_adminq.c
index 629d15cfbe..24b00a1fbf 100644
--- a/drivers/net/gve/base/gve_adminq.c
+++ b/drivers/net/gve/base/gve_adminq.c
@@ -785,7 +785,7 @@ int gve_adminq_describe_device(struct gve_priv *priv)
}
priv->max_mtu = mtu;
priv->num_event_counters = be16_to_cpu(descriptor->counters);
- rte_memcpy(priv->dev_addr.addr_bytes, descriptor->mac, ETH_ALEN);
+ memcpy(priv->dev_addr.addr_bytes, descriptor->mac, ETH_ALEN);
PMD_DRV_LOG(INFO, "MAC addr: " RTE_ETHER_ADDR_PRT_FMT,
RTE_ETHER_ADDR_BYTES(&priv->dev_addr));
priv->tx_pages_per_qpl = be16_to_cpu(descriptor->tx_pages_per_qpl);
diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c
index d4978e0649..65ae92b1ff 100644
--- a/drivers/net/hinic/hinic_pmd_ethdev.c
+++ b/drivers/net/hinic/hinic_pmd_ethdev.c
@@ -7,7 +7,6 @@
#include <ethdev_pci.h>
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_mempool.h>
#include <rte_errno.h>
#include <rte_ether.h>
diff --git a/drivers/net/hinic/hinic_pmd_flow.c b/drivers/net/hinic/hinic_pmd_flow.c
index d1a564a163..cb61c989fd 100644
--- a/drivers/net/hinic/hinic_pmd_flow.c
+++ b/drivers/net/hinic/hinic_pmd_flow.c
@@ -983,8 +983,7 @@ static int hinic_normal_item_check_ip(const struct rte_flow_item **in_out_item,
}
ipv6_spec = (const struct rte_flow_item_ipv6 *)item->spec;
- rte_memcpy(rule->hinic_fdir.dst_ipv6,
- ipv6_spec->hdr.dst_addr, 16);
+ memcpy(rule->hinic_fdir.dst_ipv6, ipv6_spec->hdr.dst_addr, 16);
/*
* Check if the next not void item is TCP or UDP or ICMP.
@@ -2193,8 +2192,8 @@ static int hinic_add_del_ntuple_filter(struct rte_eth_dev *dev,
sizeof(struct hinic_5tuple_filter), 0);
if (filter == NULL)
return -ENOMEM;
- rte_memcpy(&filter->filter_info, &filter_5tuple,
- sizeof(struct hinic_5tuple_filter_info));
+ memcpy(&filter->filter_info, &filter_5tuple,
+ sizeof(struct hinic_5tuple_filter_info));
filter->queue = ntuple_filter->queue;
filter_info->qid = ntuple_filter->queue;
@@ -2912,8 +2911,7 @@ static int hinic_add_del_tcam_fdir_filter(struct rte_eth_dev *dev,
sizeof(struct hinic_tcam_filter), 0);
if (tcam_filter == NULL)
return -ENOMEM;
- (void)rte_memcpy(&tcam_filter->tcam_key,
- &tcam_key, sizeof(struct tag_tcam_key));
+ memcpy(&tcam_filter->tcam_key, &tcam_key, sizeof(struct tag_tcam_key));
tcam_filter->queue = fdir_tcam_rule.data.qid;
ret = hinic_add_tcam_filter(dev, tcam_filter, &fdir_tcam_rule);
@@ -2990,9 +2988,9 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
&ntuple_filter, FALSE);
goto out;
}
- rte_memcpy(&ntuple_filter_ptr->filter_info,
- &ntuple_filter,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter_ptr->filter_info,
+ &ntuple_filter,
+ sizeof(struct rte_eth_ntuple_filter));
TAILQ_INSERT_TAIL(&nic_dev->filter_ntuple_list,
ntuple_filter_ptr, entries);
flow->rule = ntuple_filter_ptr;
@@ -3022,9 +3020,9 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
ðertype_filter, FALSE);
goto out;
}
- rte_memcpy(ðertype_filter_ptr->filter_info,
- ðertype_filter,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter_ptr->filter_info,
+ ðertype_filter,
+ sizeof(struct rte_eth_ethertype_filter));
TAILQ_INSERT_TAIL(&nic_dev->filter_ethertype_list,
ethertype_filter_ptr, entries);
flow->rule = ethertype_filter_ptr;
@@ -3065,8 +3063,8 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev,
goto out;
}
- rte_memcpy(&fdir_rule_ptr->filter_info, &fdir_rule,
- sizeof(struct hinic_fdir_rule));
+ memcpy(&fdir_rule_ptr->filter_info, &fdir_rule,
+ sizeof(struct hinic_fdir_rule));
TAILQ_INSERT_TAIL(&nic_dev->filter_fdir_rule_list,
fdir_rule_ptr, entries);
flow->rule = fdir_rule_ptr;
@@ -3109,8 +3107,8 @@ static int hinic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
case RTE_ETH_FILTER_NTUPLE:
ntuple_filter_ptr = (struct hinic_ntuple_filter_ele *)
pmd_flow->rule;
- rte_memcpy(&ntuple_filter, &ntuple_filter_ptr->filter_info,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter, &ntuple_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ntuple_filter));
ret = hinic_add_del_ntuple_filter(dev, &ntuple_filter, FALSE);
if (!ret) {
TAILQ_REMOVE(&nic_dev->filter_ntuple_list,
@@ -3121,9 +3119,8 @@ static int hinic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
case RTE_ETH_FILTER_ETHERTYPE:
ethertype_filter_ptr = (struct hinic_ethertype_filter_ele *)
pmd_flow->rule;
- rte_memcpy(ðertype_filter,
- ðertype_filter_ptr->filter_info,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter, ðertype_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ethertype_filter));
ret = hinic_add_del_ethertype_filter(dev,
ðertype_filter, FALSE);
if (!ret) {
@@ -3134,9 +3131,8 @@ static int hinic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
break;
case RTE_ETH_FILTER_FDIR:
fdir_rule_ptr = (struct hinic_fdir_rule_ele *)pmd_flow->rule;
- rte_memcpy(&fdir_rule,
- &fdir_rule_ptr->filter_info,
- sizeof(struct hinic_fdir_rule));
+ memcpy(&fdir_rule, &fdir_rule_ptr->filter_info,
+ sizeof(struct hinic_fdir_rule));
if (fdir_rule.mode == HINIC_FDIR_MODE_NORMAL) {
ret = hinic_add_del_fdir_filter(dev, &fdir_rule, FALSE);
} else if (fdir_rule.mode == HINIC_FDIR_MODE_TCAM) {
diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
index d100e58d10..332cbb847b 100644
--- a/drivers/net/hns3/hns3_fdir.c
+++ b/drivers/net/hns3/hns3_fdir.c
@@ -996,7 +996,7 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns,
return -ENOMEM;
}
- rte_memcpy(&node->fdir_conf, rule, sizeof(struct hns3_fdir_rule));
+ memcpy(&node->fdir_conf, rule, sizeof(struct hns3_fdir_rule));
ret = hns3_insert_fdir_filter(hw, fdir_info, node);
if (ret < 0) {
rte_free(node);
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 7fbe65313c..96b91bed6b 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -2416,8 +2416,8 @@ hns3_flow_query(struct rte_eth_dev *dev, struct rte_flow *flow,
}
rss_conf = (struct rte_flow_action_rss *)data;
rss_rule = (struct hns3_rss_conf_ele *)flow->rule;
- rte_memcpy(rss_conf, &rss_rule->filter_info.conf,
- sizeof(struct rte_flow_action_rss));
+ memcpy(rss_conf, &rss_rule->filter_info.conf,
+ sizeof(struct rte_flow_action_rss));
break;
default:
return rte_flow_error_set(error, ENOTSUP,
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 380ce1a720..bf128074b7 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -22,7 +22,6 @@
#include <ethdev_pci.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_alarm.h>
#include <dev_driver.h>
#include <rte_tailq.h>
@@ -4448,7 +4447,7 @@ i40e_macaddr_add(struct rte_eth_dev *dev,
return -EINVAL;
}
- rte_memcpy(&mac_filter.mac_addr, mac_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(&mac_filter.mac_addr, mac_addr, RTE_ETHER_ADDR_LEN);
if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_VLAN_FILTER)
mac_filter.filter_type = I40E_MACVLAN_PERFECT_MATCH;
else
@@ -5333,7 +5332,7 @@ i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi,
vsi->info.valid_sections =
rte_cpu_to_le_16(I40E_AQ_VSI_PROP_VLAN_VALID);
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
hw = I40E_VSI_TO_HW(vsi);
@@ -5372,8 +5371,8 @@ i40e_vsi_update_tc_bandwidth(struct i40e_vsi *vsi, uint8_t enabled_tcmap)
return ret;
}
- rte_memcpy(vsi->info.qs_handle, tc_bw_data.qs_handles,
- sizeof(vsi->info.qs_handle));
+ memcpy(vsi->info.qs_handle, tc_bw_data.qs_handles,
+ sizeof(vsi->info.qs_handle));
return I40E_SUCCESS;
}
@@ -5630,8 +5629,7 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi)
if (vsi->type != I40E_VSI_MAIN)
return I40E_ERR_CONFIG;
memset(&def_filter, 0, sizeof(def_filter));
- rte_memcpy(def_filter.mac_addr, hw->mac.perm_addr,
- ETH_ADDR_LEN);
+ memcpy(def_filter.mac_addr, hw->mac.perm_addr, ETH_ADDR_LEN);
def_filter.vlan_tag = 0;
def_filter.flags = I40E_AQC_MACVLAN_DEL_PERFECT_MATCH |
I40E_AQC_MACVLAN_DEL_IGNORE_VLAN;
@@ -5649,16 +5647,15 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi)
return I40E_ERR_NO_MEMORY;
}
mac = &f->mac_info.mac_addr;
- rte_memcpy(&mac->addr_bytes, hw->mac.perm_addr,
- ETH_ADDR_LEN);
+ memcpy(&mac->addr_bytes, hw->mac.perm_addr, ETH_ADDR_LEN);
f->mac_info.filter_type = I40E_MACVLAN_PERFECT_MATCH;
TAILQ_INSERT_TAIL(&vsi->mac_list, f, next);
vsi->mac_num++;
return ret;
}
- rte_memcpy(&filter.mac_addr,
- (struct rte_ether_addr *)(hw->mac.perm_addr), ETH_ADDR_LEN);
+ memcpy(&filter.mac_addr, (struct rte_ether_addr *)(hw->mac.perm_addr),
+ ETH_ADDR_LEN);
filter.filter_type = I40E_MACVLAN_PERFECT_MATCH;
return i40e_vsi_add_mac(vsi, &filter);
}
@@ -5977,8 +5974,8 @@ i40e_vsi_setup(struct i40e_pf *pf,
PMD_DRV_LOG(ERR, "Failed to get VSI params");
goto fail_msix_alloc;
}
- rte_memcpy(&vsi->info, &ctxt.info,
- sizeof(struct i40e_aqc_vsi_properties_data));
+ memcpy(&vsi->info, &ctxt.info,
+ sizeof(struct i40e_aqc_vsi_properties_data));
vsi->vsi_id = ctxt.vsi_number;
vsi->info.valid_sections = 0;
@@ -5995,8 +5992,8 @@ i40e_vsi_setup(struct i40e_pf *pf,
rte_cpu_to_le_16(I40E_AQ_VSI_PROP_VLAN_VALID);
vsi->info.port_vlan_flags = I40E_AQ_VSI_PVLAN_MODE_ALL |
I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH;
- rte_memcpy(&ctxt.info, &vsi->info,
- sizeof(struct i40e_aqc_vsi_properties_data));
+ memcpy(&ctxt.info, &vsi->info,
+ sizeof(struct i40e_aqc_vsi_properties_data));
ret = i40e_vsi_config_tc_queue_mapping(vsi, &ctxt.info,
I40E_DEFAULT_TCMAP);
if (ret != I40E_SUCCESS) {
@@ -6016,16 +6013,15 @@ i40e_vsi_setup(struct i40e_pf *pf,
goto fail_msix_alloc;
}
- rte_memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
- sizeof(vsi->info.tc_mapping));
- rte_memcpy(&vsi->info.queue_mapping,
- &ctxt.info.queue_mapping,
- sizeof(vsi->info.queue_mapping));
+ memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
+ sizeof(vsi->info.tc_mapping));
+ memcpy(&vsi->info.queue_mapping, &ctxt.info.queue_mapping,
+ sizeof(vsi->info.queue_mapping));
vsi->info.mapping_flags = ctxt.info.mapping_flags;
vsi->info.valid_sections = 0;
- rte_memcpy(pf->dev_addr.addr_bytes, hw->mac.perm_addr,
- ETH_ADDR_LEN);
+ memcpy(pf->dev_addr.addr_bytes, hw->mac.perm_addr,
+ ETH_ADDR_LEN);
/**
* Updating default filter settings are necessary to prevent
@@ -6168,7 +6164,7 @@ i40e_vsi_setup(struct i40e_pf *pf,
if (vsi->type != I40E_VSI_FDIR) {
/* MAC/VLAN configuration for non-FDIR VSI*/
- rte_memcpy(&filter.mac_addr, &broadcast, RTE_ETHER_ADDR_LEN);
+ memcpy(&filter.mac_addr, &broadcast, RTE_ETHER_ADDR_LEN);
filter.filter_type = I40E_MACVLAN_PERFECT_MATCH;
ret = i40e_vsi_add_mac(vsi, &filter);
@@ -6281,7 +6277,7 @@ i40e_vsi_config_vlan_stripping(struct i40e_vsi *vsi, bool on)
vsi->info.port_vlan_flags &= ~(I40E_AQ_VSI_PVLAN_EMOD_MASK);
vsi->info.port_vlan_flags |= vlan_flags;
ctxt.seid = vsi->seid;
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL);
if (ret)
PMD_DRV_LOG(INFO, "Update VSI failed to %s vlan stripping",
@@ -7148,8 +7144,8 @@ i40e_add_macvlan_filters(struct i40e_vsi *vsi,
memset(req_list, 0, ele_buff_size);
for (i = 0; i < actual_num; i++) {
- rte_memcpy(req_list[i].mac_addr,
- &filter[num + i].macaddr, ETH_ADDR_LEN);
+ memcpy(req_list[i].mac_addr, &filter[num + i].macaddr,
+ ETH_ADDR_LEN);
req_list[i].vlan_tag =
rte_cpu_to_le_16(filter[num + i].vlan_id);
@@ -7224,8 +7220,8 @@ i40e_remove_macvlan_filters(struct i40e_vsi *vsi,
memset(req_list, 0, ele_buff_size);
for (i = 0; i < actual_num; i++) {
- rte_memcpy(req_list[i].mac_addr,
- &filter[num + i].macaddr, ETH_ADDR_LEN);
+ memcpy(req_list[i].mac_addr, &filter[num + i].macaddr,
+ ETH_ADDR_LEN);
req_list[i].vlan_tag =
rte_cpu_to_le_16(filter[num + i].vlan_id);
@@ -7381,8 +7377,8 @@ i40e_find_all_vlan_for_mac(struct i40e_vsi *vsi,
"vlan number doesn't match");
return I40E_ERR_PARAM;
}
- rte_memcpy(&mv_f[i].macaddr,
- addr, ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, addr,
+ ETH_ADDR_LEN);
mv_f[i].vlan_id =
j * I40E_UINT32_BIT_SIZE + k;
i++;
@@ -7410,8 +7406,7 @@ i40e_find_all_mac_for_vlan(struct i40e_vsi *vsi,
PMD_DRV_LOG(ERR, "buffer number not match");
return I40E_ERR_PARAM;
}
- rte_memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr, ETH_ADDR_LEN);
mv_f[i].vlan_id = vlan;
mv_f[i].filter_type = f->mac_info.filter_type;
i++;
@@ -7446,8 +7441,8 @@ i40e_vsi_remove_all_macvlan_filter(struct i40e_vsi *vsi)
i = 0;
if (vsi->vlan_num == 0) {
TAILQ_FOREACH(f, &vsi->mac_list, next) {
- rte_memcpy(&mv_f[i].macaddr,
- &f->mac_info.mac_addr, ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr,
+ ETH_ADDR_LEN);
mv_f[i].filter_type = f->mac_info.filter_type;
mv_f[i].vlan_id = 0;
i++;
@@ -7616,8 +7611,7 @@ i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter)
for (i = 0; i < vlan_num; i++) {
mv_f[i].filter_type = mac_filter->filter_type;
- rte_memcpy(&mv_f[i].macaddr, &mac_filter->mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &mac_filter->mac_addr, ETH_ADDR_LEN);
}
if (mac_filter->filter_type == I40E_MACVLAN_PERFECT_MATCH ||
@@ -7639,8 +7633,7 @@ i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter)
ret = I40E_ERR_NO_MEMORY;
goto DONE;
}
- rte_memcpy(&f->mac_info.mac_addr, &mac_filter->mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&f->mac_info.mac_addr, &mac_filter->mac_addr, ETH_ADDR_LEN);
f->mac_info.filter_type = mac_filter->filter_type;
TAILQ_INSERT_TAIL(&vsi->mac_list, f, next);
vsi->mac_num++;
@@ -7686,8 +7679,7 @@ i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct rte_ether_addr *addr)
for (i = 0; i < vlan_num; i++) {
mv_f[i].filter_type = filter_type;
- rte_memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr, ETH_ADDR_LEN);
}
if (filter_type == I40E_MACVLAN_PERFECT_MATCH ||
filter_type == I40E_MACVLAN_HASH_MATCH) {
@@ -7973,9 +7965,8 @@ i40e_tunnel_filter_convert(
tunnel_filter->input.flags = cld_filter->element.flags;
tunnel_filter->input.tenant_id = cld_filter->element.tenant_id;
tunnel_filter->queue = cld_filter->element.queue_number;
- rte_memcpy(tunnel_filter->input.general_fields,
- cld_filter->general_fields,
- sizeof(cld_filter->general_fields));
+ memcpy(tunnel_filter->input.general_fields,
+ cld_filter->general_fields, sizeof(cld_filter->general_fields));
return 0;
}
@@ -8522,9 +8513,8 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf,
ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV4;
ipv4_addr = rte_be_to_cpu_32(tunnel_filter->ip_addr.ipv4_addr);
ipv4_addr_le = rte_cpu_to_le_32(ipv4_addr);
- rte_memcpy(&pfilter->element.ipaddr.v4.data,
- &ipv4_addr_le,
- sizeof(pfilter->element.ipaddr.v4.data));
+ memcpy(&pfilter->element.ipaddr.v4.data, &ipv4_addr_le,
+ sizeof(pfilter->element.ipaddr.v4.data));
} else {
ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV6;
for (i = 0; i < 4; i++) {
@@ -8532,9 +8522,8 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf,
rte_cpu_to_le_32(rte_be_to_cpu_32(
tunnel_filter->ip_addr.ipv6_addr[i]));
}
- rte_memcpy(&pfilter->element.ipaddr.v6.data,
- &convert_ipv6,
- sizeof(pfilter->element.ipaddr.v6.data));
+ memcpy(&pfilter->element.ipaddr.v6.data, &convert_ipv6,
+ sizeof(pfilter->element.ipaddr.v6.data));
}
/* check tunneled type */
@@ -8779,7 +8768,7 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf,
return -ENOMEM;
}
- rte_memcpy(tunnel, &check_filter, sizeof(check_filter));
+ memcpy(tunnel, &check_filter, sizeof(check_filter));
ret = i40e_sw_tunnel_filter_insert(pf, tunnel);
if (ret < 0)
rte_free(tunnel);
@@ -9904,8 +9893,7 @@ static int
i40e_ethertype_filter_convert(const struct rte_eth_ethertype_filter *input,
struct i40e_ethertype_filter *filter)
{
- rte_memcpy(&filter->input.mac_addr, &input->mac_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&filter->input.mac_addr, &input->mac_addr, RTE_ETHER_ADDR_LEN);
filter->input.ether_type = input->ether_type;
filter->flags = input->flags;
filter->queue = input->queue;
@@ -10052,8 +10040,7 @@ i40e_ethertype_filter_set(struct i40e_pf *pf,
return -ENOMEM;
}
- rte_memcpy(ethertype_filter, &check_filter,
- sizeof(check_filter));
+ memcpy(ethertype_filter, &check_filter, sizeof(check_filter));
ret = i40e_sw_ethertype_filter_insert(pf, ethertype_filter);
if (ret < 0)
rte_free(ethertype_filter);
@@ -10933,11 +10920,10 @@ i40e_vsi_config_tc(struct i40e_vsi *vsi, uint8_t tc_map)
goto out;
}
/* update the local VSI info with updated queue map */
- rte_memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
- sizeof(vsi->info.tc_mapping));
- rte_memcpy(&vsi->info.queue_mapping,
- &ctxt.info.queue_mapping,
- sizeof(vsi->info.queue_mapping));
+ memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
+ sizeof(vsi->info.tc_mapping));
+ memcpy(&vsi->info.queue_mapping, &ctxt.info.queue_mapping,
+ sizeof(vsi->info.queue_mapping));
vsi->info.mapping_flags = ctxt.info.mapping_flags;
vsi->info.valid_sections = 0;
@@ -11689,9 +11675,8 @@ i40e_tunnel_filter_restore(struct i40e_pf *pf)
cld_filter.element.flags = f->input.flags;
cld_filter.element.tenant_id = f->input.tenant_id;
cld_filter.element.queue_number = f->queue;
- rte_memcpy(cld_filter.general_fields,
- f->input.general_fields,
- sizeof(f->input.general_fields));
+ memcpy(cld_filter.general_fields, f->input.general_fields,
+ sizeof(f->input.general_fields));
if (((f->input.flags &
I40E_AQC_ADD_CLOUD_FILTER_0X11) ==
diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 47f79ecf11..554b763e9f 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -464,10 +464,10 @@ fill_ip6_head(const struct i40e_fdir_input *fdir_input, unsigned char *raw_pkt,
* need to be presented in a reversed order with respect
* to the expected received packets.
*/
- rte_memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip,
- IPV6_ADDR_LEN);
- rte_memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,
- IPV6_ADDR_LEN);
+ memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip,
+ IPV6_ADDR_LEN);
+ memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,
+ IPV6_ADDR_LEN);
len += sizeof(struct rte_ipv6_hdr);
return len;
@@ -528,18 +528,16 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
[I40E_FILTER_PCTYPE_NONF_IPV6_OTHER] = IPPROTO_NONE,
};
- rte_memcpy(raw_pkt, &fdir_input->flow.l2_flow.dst,
- sizeof(struct rte_ether_addr));
- rte_memcpy(raw_pkt + sizeof(struct rte_ether_addr),
- &fdir_input->flow.l2_flow.src,
- sizeof(struct rte_ether_addr));
+ memcpy(raw_pkt, &fdir_input->flow.l2_flow.dst,
+ sizeof(struct rte_ether_addr));
+ memcpy(raw_pkt + sizeof(struct rte_ether_addr),
+ &fdir_input->flow.l2_flow.src, sizeof(struct rte_ether_addr));
raw_pkt += 2 * sizeof(struct rte_ether_addr);
if (vlan && fdir_input->flow_ext.vlan_tci) {
- rte_memcpy(raw_pkt, vlan_frame, sizeof(vlan_frame));
- rte_memcpy(raw_pkt + sizeof(uint16_t),
- &fdir_input->flow_ext.vlan_tci,
- sizeof(uint16_t));
+ memcpy(raw_pkt, vlan_frame, sizeof(vlan_frame));
+ memcpy(raw_pkt + sizeof(uint16_t),
+ &fdir_input->flow_ext.vlan_tci, sizeof(uint16_t));
raw_pkt += sizeof(vlan_frame);
len += sizeof(vlan_frame);
}
@@ -1003,7 +1001,7 @@ static int
i40e_fdir_filter_convert(const struct i40e_fdir_filter_conf *input,
struct i40e_fdir_filter *filter)
{
- rte_memcpy(&filter->fdir, input, sizeof(struct i40e_fdir_filter_conf));
+ memcpy(&filter->fdir, input, sizeof(struct i40e_fdir_filter_conf));
if (input->input.flow_ext.pkt_template) {
filter->fdir.input.flow.raw_flow.packet = NULL;
filter->fdir.input.flow.raw_flow.length =
@@ -1060,7 +1058,7 @@ i40e_sw_fdir_filter_insert(struct i40e_pf *pf, struct i40e_fdir_filter *filter)
return -1;
hash_filter = &fdir_info->fdir_filter_array[ret];
- rte_memcpy(hash_filter, filter, sizeof(*filter));
+ memcpy(hash_filter, filter, sizeof(*filter));
fdir_info->hash_map[ret] = hash_filter;
TAILQ_INSERT_TAIL(&fdir_info->fdir_list, hash_filter, rules);
diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 92165c8422..9afb7a540d 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -1175,7 +1175,7 @@ i40e_pattern_skip_void_item(struct rte_flow_item *items,
pb = pe + 1;
}
/* Copy the END item. */
- rte_memcpy(items, pe, sizeof(struct rte_flow_item));
+ memcpy(items, pe, sizeof(struct rte_flow_item));
}
/* Check if the pattern matches a supported item type array */
@@ -1986,10 +1986,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
filter->input.flow_ext.oip_type =
I40E_FDIR_IPTYPE_IPV6;
- rte_memcpy(filter->input.flow.ipv6_flow.src_ip,
- ipv6_spec->hdr.src_addr, 16);
- rte_memcpy(filter->input.flow.ipv6_flow.dst_ip,
- ipv6_spec->hdr.dst_addr, 16);
+ memcpy(filter->input.flow.ipv6_flow.src_ip,
+ ipv6_spec->hdr.src_addr, 16);
+ memcpy(filter->input.flow.ipv6_flow.dst_ip,
+ ipv6_spec->hdr.dst_addr, 16);
/* Check if it is fragment. */
if (ipv6_spec->hdr.proto ==
@@ -2926,14 +2926,14 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev,
}
if (!vxlan_flag) {
- rte_memcpy(&filter->outer_mac,
- ð_spec->hdr.dst_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&filter->outer_mac,
+ ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
filter_type |= RTE_ETH_TUNNEL_FILTER_OMAC;
} else {
- rte_memcpy(&filter->inner_mac,
- ð_spec->hdr.dst_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&filter->inner_mac,
+ ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
filter_type |= RTE_ETH_TUNNEL_FILTER_IMAC;
}
}
@@ -3026,8 +3026,8 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev,
return -rte_errno;
}
- rte_memcpy(((uint8_t *)&tenant_id_be + 1),
- vxlan_spec->hdr.vni, 3);
+ memcpy(((uint8_t *)&tenant_id_be + 1),
+ vxlan_spec->hdr.vni, 3);
filter->tenant_id =
rte_be_to_cpu_32(tenant_id_be);
filter_type |= RTE_ETH_TUNNEL_FILTER_TENID;
@@ -3156,14 +3156,14 @@ i40e_flow_parse_nvgre_pattern(__rte_unused struct rte_eth_dev *dev,
}
if (!nvgre_flag) {
- rte_memcpy(&filter->outer_mac,
- ð_spec->hdr.dst_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&filter->outer_mac,
+ ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
filter_type |= RTE_ETH_TUNNEL_FILTER_OMAC;
} else {
- rte_memcpy(&filter->inner_mac,
- ð_spec->hdr.dst_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&filter->inner_mac,
+ ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
filter_type |= RTE_ETH_TUNNEL_FILTER_IMAC;
}
}
@@ -3278,8 +3278,8 @@ i40e_flow_parse_nvgre_pattern(__rte_unused struct rte_eth_dev *dev,
"Invalid NVGRE item");
return -rte_errno;
}
- rte_memcpy(((uint8_t *)&tenant_id_be + 1),
- nvgre_spec->tni, 3);
+ memcpy(((uint8_t *)&tenant_id_be + 1),
+ nvgre_spec->tni, 3);
filter->tenant_id =
rte_be_to_cpu_32(tenant_id_be);
filter_type |= RTE_ETH_TUNNEL_FILTER_TENID;
@@ -3447,8 +3447,8 @@ i40e_flow_parse_mpls_pattern(__rte_unused struct rte_eth_dev *dev,
"Invalid MPLS label mask");
return -rte_errno;
}
- rte_memcpy(((uint8_t *)&label_be + 1),
- mpls_spec->label_tc_s, 3);
+ memcpy(((uint8_t *)&label_be + 1),
+ mpls_spec->label_tc_s, 3);
filter->tenant_id = rte_be_to_cpu_32(label_be) >> 4;
break;
default:
@@ -4051,9 +4051,8 @@ i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
cld_filter.element.flags = filter->input.flags;
cld_filter.element.tenant_id = filter->input.tenant_id;
cld_filter.element.queue_number = filter->queue;
- rte_memcpy(cld_filter.general_fields,
- filter->input.general_fields,
- sizeof(cld_filter.general_fields));
+ memcpy(cld_filter.general_fields, filter->input.general_fields,
+ sizeof(cld_filter.general_fields));
if (!filter->is_to_vf)
vsi = pf->main_vsi;
@@ -4271,9 +4270,8 @@ i40e_flow_query(struct rte_eth_dev *dev __rte_unused,
"action not supported");
return -rte_errno;
}
- rte_memcpy(rss_conf,
- &rss_rule->rss_filter_info.conf,
- sizeof(struct rte_flow_action_rss));
+ memcpy(rss_conf, &rss_rule->rss_filter_info.conf,
+ sizeof(struct rte_flow_action_rss));
break;
default:
return rte_flow_error_set(error, ENOTSUP,
diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c
index 15d9ff868f..f8073ef9cb 100644
--- a/drivers/net/i40e/i40e_pf.c
+++ b/drivers/net/i40e/i40e_pf.c
@@ -16,7 +16,6 @@
#include <rte_ether.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include "i40e_logs.h"
#include "base/i40e_prototype.h"
@@ -869,7 +868,7 @@ i40e_pf_host_process_cmd_add_ether_address(struct i40e_pf_vf *vf,
for (i = 0; i < addr_list->num_elements; i++) {
mac = (struct rte_ether_addr *)(addr_list->list[i].addr);
- rte_memcpy(&filter.mac_addr, mac, RTE_ETHER_ADDR_LEN);
+ memcpy(&filter.mac_addr, mac, RTE_ETHER_ADDR_LEN);
filter.filter_type = I40E_MACVLAN_PERFECT_MATCH;
if (rte_is_zero_ether_addr(mac) ||
i40e_vsi_add_mac(vf->vsi, &filter)) {
diff --git a/drivers/net/i40e/i40e_tm.c b/drivers/net/i40e/i40e_tm.c
index cab296e1a4..3f77a7b3a0 100644
--- a/drivers/net/i40e/i40e_tm.c
+++ b/drivers/net/i40e/i40e_tm.c
@@ -279,8 +279,8 @@ i40e_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&pf->tm_conf.shaper_profile_list,
shaper_profile, node);
@@ -526,8 +526,8 @@ i40e_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->reference_count = 0;
tm_node->parent = NULL;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
pf->tm_conf.root = tm_node;
/* increase the reference counter of the shaper profile */
@@ -600,8 +600,7 @@ i40e_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->reference_count = 0;
tm_node->parent = parent_node;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
if (parent_node_type == I40E_TM_NODE_TYPE_PORT) {
TAILQ_INSERT_TAIL(&pf->tm_conf.tc_list,
tm_node, node);
diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index 9d39984ea1..03d0b61902 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -90,7 +90,7 @@ rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on)
vsi->info.sec_flags &= ~I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK;
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
hw = I40E_VSI_TO_HW(vsi);
@@ -192,7 +192,7 @@ rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on)
vsi->info.sec_flags &= ~I40E_AQ_VSI_SEC_FLAG_ENABLE_VLAN_CHK;
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
hw = I40E_VSI_TO_HW(vsi);
@@ -237,9 +237,8 @@ i40e_vsi_rm_mac_filter(struct i40e_vsi *vsi)
for (i = 0; i < vlan_num; i++) {
mv_f[i].filter_type = filter_type;
- rte_memcpy(&mv_f[i].macaddr,
- &f->mac_info.mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr,
+ ETH_ADDR_LEN);
}
if (filter_type == I40E_MACVLAN_PERFECT_MATCH ||
filter_type == I40E_MACVLAN_HASH_MATCH) {
@@ -298,9 +297,8 @@ i40e_vsi_restore_mac_filter(struct i40e_vsi *vsi)
for (i = 0; i < vlan_num; i++) {
mv_f[i].filter_type = f->mac_info.filter_type;
- rte_memcpy(&mv_f[i].macaddr,
- &f->mac_info.mac_addr,
- ETH_ADDR_LEN);
+ memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr,
+ ETH_ADDR_LEN);
}
if (f->mac_info.filter_type == I40E_MACVLAN_PERFECT_MATCH ||
@@ -380,7 +378,7 @@ i40e_vsi_set_tx_loopback(struct i40e_vsi *vsi, uint8_t on)
vsi->info.switch_id &= ~I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB;
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL);
@@ -705,7 +703,7 @@ int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id,
vsi->info.port_vlan_flags &= ~I40E_AQ_VSI_PVLAN_INSERT_PVID;
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
hw = I40E_VSI_TO_HW(vsi);
@@ -767,7 +765,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id,
}
if (on) {
- rte_memcpy(&filter.mac_addr, &broadcast, RTE_ETHER_ADDR_LEN);
+ memcpy(&filter.mac_addr, &broadcast, RTE_ETHER_ADDR_LEN);
filter.filter_type = I40E_MACVLAN_PERFECT_MATCH;
ret = i40e_vsi_add_mac(vsi, &filter);
} else {
@@ -839,7 +837,7 @@ int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on)
}
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.seid = vsi->seid;
hw = I40E_VSI_TO_HW(vsi);
@@ -2586,11 +2584,10 @@ i40e_vsi_update_queue_region_mapping(struct i40e_hw *hw,
return ret;
}
/* update the local VSI info with updated queue map */
- rte_memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
- sizeof(vsi->info.tc_mapping));
- rte_memcpy(&vsi->info.queue_mapping,
- &ctxt.info.queue_mapping,
- sizeof(vsi->info.queue_mapping));
+ memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping,
+ sizeof(vsi->info.tc_mapping));
+ memcpy(&vsi->info.queue_mapping, &ctxt.info.queue_mapping,
+ sizeof(vsi->info.queue_mapping));
vsi->info.mapping_flags = ctxt.info.mapping_flags;
vsi->info.valid_sections = 0;
@@ -2961,8 +2958,7 @@ i40e_queue_region_get_all_info(struct i40e_pf *pf,
{
struct i40e_queue_regions *info = &pf->queue_region;
- rte_memcpy(regions_ptr, info,
- sizeof(struct i40e_queue_regions));
+ memcpy(regions_ptr, info, sizeof(struct i40e_queue_regions));
return 0;
}
diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c
index 811a10287b..35257c43f1 100644
--- a/drivers/net/iavf/iavf_fdir.c
+++ b/drivers/net/iavf/iavf_fdir.c
@@ -374,7 +374,7 @@ iavf_fdir_create(struct iavf_adapter *ad,
if (filter->mark_flag == 1)
iavf_fdir_rx_proc_enable(ad, 1);
- rte_memcpy(rule, filter, sizeof(*rule));
+ memcpy(rule, filter, sizeof(*rule));
flow->rule = rule;
return 0;
@@ -672,15 +672,13 @@ iavf_fdir_refine_input_set(const uint64_t input_set,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV4, PROT);
memset(&ipv4_spec, 0, sizeof(ipv4_spec));
ipv4_spec.hdr.next_proto_id = proto_id;
- rte_memcpy(hdr->buffer, &ipv4_spec.hdr,
- sizeof(ipv4_spec.hdr));
+ memcpy(hdr->buffer, &ipv4_spec.hdr, sizeof(ipv4_spec.hdr));
return true;
case VIRTCHNL_PROTO_HDR_IPV6:
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV6, PROT);
memset(&ipv6_spec, 0, sizeof(ipv6_spec));
ipv6_spec.hdr.proto = proto_id;
- rte_memcpy(hdr->buffer, &ipv6_spec.hdr,
- sizeof(ipv6_spec.hdr));
+ memcpy(hdr->buffer, &ipv6_spec.hdr, sizeof(ipv6_spec.hdr));
return true;
default:
return false;
@@ -885,8 +883,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
ETHERTYPE);
}
- rte_memcpy(hdr1->buffer, eth_spec,
- sizeof(struct rte_ether_hdr));
+ memcpy(hdr1->buffer, eth_spec,
+ sizeof(struct rte_ether_hdr));
}
hdrs->count = ++layer;
@@ -976,8 +974,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
input_set |= IAVF_PROT_IPV4_INNER;
}
- rte_memcpy(hdr->buffer, &ipv4_spec->hdr,
- sizeof(ipv4_spec->hdr));
+ memcpy(hdr->buffer, &ipv4_spec->hdr,
+ sizeof(ipv4_spec->hdr));
hdrs->count = ++layer;
@@ -1066,8 +1064,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
input_set |= IAVF_PROT_IPV6_INNER;
}
- rte_memcpy(hdr->buffer, &ipv6_spec->hdr,
- sizeof(ipv6_spec->hdr));
+ memcpy(hdr->buffer, &ipv6_spec->hdr,
+ sizeof(ipv6_spec->hdr));
hdrs->count = ++layer;
break;
@@ -1101,8 +1099,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr1, ETH,
ETHERTYPE);
- rte_memcpy(hdr->buffer, &ipv6_frag_spec->hdr,
- sizeof(ipv6_frag_spec->hdr));
+ memcpy(hdr->buffer, &ipv6_frag_spec->hdr,
+ sizeof(ipv6_frag_spec->hdr));
} else if (ipv6_frag_mask->hdr.id == UINT32_MAX) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
@@ -1153,13 +1151,11 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
}
if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
- rte_memcpy(hdr->buffer,
- &udp_spec->hdr,
- sizeof(udp_spec->hdr));
+ memcpy(hdr->buffer, &udp_spec->hdr,
+ sizeof(udp_spec->hdr));
else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
- rte_memcpy(hdr->buffer,
- &udp_spec->hdr,
- sizeof(udp_spec->hdr));
+ memcpy(hdr->buffer, &udp_spec->hdr,
+ sizeof(udp_spec->hdr));
}
hdrs->count = ++layer;
@@ -1210,13 +1206,11 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
}
if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
- rte_memcpy(hdr->buffer,
- &tcp_spec->hdr,
- sizeof(tcp_spec->hdr));
+ memcpy(hdr->buffer, &tcp_spec->hdr,
+ sizeof(tcp_spec->hdr));
else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
- rte_memcpy(hdr->buffer,
- &tcp_spec->hdr,
- sizeof(tcp_spec->hdr));
+ memcpy(hdr->buffer, &tcp_spec->hdr,
+ sizeof(tcp_spec->hdr));
}
hdrs->count = ++layer;
@@ -1256,13 +1250,11 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
}
if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
- rte_memcpy(hdr->buffer,
- &sctp_spec->hdr,
- sizeof(sctp_spec->hdr));
+ memcpy(hdr->buffer, &sctp_spec->hdr,
+ sizeof(sctp_spec->hdr));
else if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
- rte_memcpy(hdr->buffer,
- &sctp_spec->hdr,
- sizeof(sctp_spec->hdr));
+ memcpy(hdr->buffer, &sctp_spec->hdr,
+ sizeof(sctp_spec->hdr));
}
hdrs->count = ++layer;
@@ -1291,8 +1283,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, GTPU_IP, TEID);
}
- rte_memcpy(hdr->buffer,
- gtp_spec, sizeof(*gtp_spec));
+ memcpy(hdr->buffer, gtp_spec,
+ sizeof(*gtp_spec));
}
tun_inner = 1;
@@ -1346,8 +1338,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
psc.qfi = gtp_psc_spec->hdr.qfi;
psc.type = gtp_psc_spec->hdr.type;
psc.next = 0;
- rte_memcpy(hdr->buffer, &psc,
- sizeof(struct iavf_gtp_psc_spec_hdr));
+ memcpy(hdr->buffer, &psc,
+ sizeof(struct iavf_gtp_psc_spec_hdr));
}
hdrs->count = ++layer;
@@ -1367,8 +1359,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, L2TPV3, SESS_ID);
}
- rte_memcpy(hdr->buffer, l2tpv3oip_spec,
- sizeof(*l2tpv3oip_spec));
+ memcpy(hdr->buffer, l2tpv3oip_spec,
+ sizeof(*l2tpv3oip_spec));
}
hdrs->count = ++layer;
@@ -1388,8 +1380,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, ESP, SPI);
}
- rte_memcpy(hdr->buffer, &esp_spec->hdr,
- sizeof(esp_spec->hdr));
+ memcpy(hdr->buffer, &esp_spec->hdr,
+ sizeof(esp_spec->hdr));
}
hdrs->count = ++layer;
@@ -1409,8 +1401,7 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, AH, SPI);
}
- rte_memcpy(hdr->buffer, ah_spec,
- sizeof(*ah_spec));
+ memcpy(hdr->buffer, ah_spec, sizeof(*ah_spec));
}
hdrs->count = ++layer;
@@ -1430,8 +1421,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, PFCP, S_FIELD);
}
- rte_memcpy(hdr->buffer, pfcp_spec,
- sizeof(*pfcp_spec));
+ memcpy(hdr->buffer, pfcp_spec,
+ sizeof(*pfcp_spec));
}
hdrs->count = ++layer;
@@ -1455,8 +1446,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
PC_RTC_ID);
}
- rte_memcpy(hdr->buffer, ecpri_spec,
- sizeof(*ecpri_spec));
+ memcpy(hdr->buffer, ecpri_spec,
+ sizeof(*ecpri_spec));
}
hdrs->count = ++layer;
@@ -1471,8 +1462,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, GRE);
if (gre_spec && gre_mask) {
- rte_memcpy(hdr->buffer, gre_spec,
- sizeof(*gre_spec));
+ memcpy(hdr->buffer, gre_spec,
+ sizeof(*gre_spec));
}
tun_inner = 1;
@@ -1520,8 +1511,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
SESS_ID);
}
- rte_memcpy(hdr->buffer, l2tpv2_spec,
- sizeof(*l2tpv2_spec));
+ memcpy(hdr->buffer, l2tpv2_spec,
+ sizeof(*l2tpv2_spec));
}
tun_inner = 1;
@@ -1538,8 +1529,8 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad,
VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, PPP);
if (ppp_spec && ppp_mask) {
- rte_memcpy(hdr->buffer, ppp_spec,
- sizeof(*ppp_spec));
+ memcpy(hdr->buffer, ppp_spec,
+ sizeof(*ppp_spec));
}
hdrs->count = ++layer;
diff --git a/drivers/net/iavf/iavf_fsub.c b/drivers/net/iavf/iavf_fsub.c
index 74e1e7099b..d98cde0fa5 100644
--- a/drivers/net/iavf/iavf_fsub.c
+++ b/drivers/net/iavf/iavf_fsub.c
@@ -92,7 +92,7 @@ iavf_fsub_create(struct iavf_adapter *ad, struct rte_flow *flow,
goto free_entry;
}
- rte_memcpy(rule, filter, sizeof(*rule));
+ memcpy(rule, filter, sizeof(*rule));
flow->rule = rule;
rte_free(meta);
@@ -272,10 +272,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
input_set_byte += 2;
}
- rte_memcpy(hdr1->buffer_spec, eth_spec,
- sizeof(struct rte_ether_hdr));
- rte_memcpy(hdr1->buffer_mask, eth_mask,
- sizeof(struct rte_ether_hdr));
+ memcpy(hdr1->buffer_spec, eth_spec,
+ sizeof(struct rte_ether_hdr));
+ memcpy(hdr1->buffer_mask, eth_mask,
+ sizeof(struct rte_ether_hdr));
} else {
/* flow subscribe filter will add dst mac in kernel */
input_set_byte += 6;
@@ -325,10 +325,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
input_set_byte++;
}
- rte_memcpy(hdr->buffer_spec, &ipv4_spec->hdr,
- sizeof(ipv4_spec->hdr));
- rte_memcpy(hdr->buffer_mask, &ipv4_mask->hdr,
- sizeof(ipv4_spec->hdr));
+ memcpy(hdr->buffer_spec, &ipv4_spec->hdr,
+ sizeof(ipv4_spec->hdr));
+ memcpy(hdr->buffer_mask, &ipv4_mask->hdr,
+ sizeof(ipv4_spec->hdr));
}
hdrs->count = ++layer;
@@ -388,10 +388,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
input_set_byte += 4;
}
- rte_memcpy(hdr->buffer_spec, &ipv6_spec->hdr,
- sizeof(ipv6_spec->hdr));
- rte_memcpy(hdr->buffer_mask, &ipv6_mask->hdr,
- sizeof(ipv6_spec->hdr));
+ memcpy(hdr->buffer_spec, &ipv6_spec->hdr,
+ sizeof(ipv6_spec->hdr));
+ memcpy(hdr->buffer_mask, &ipv6_mask->hdr,
+ sizeof(ipv6_spec->hdr));
}
hdrs->count = ++layer;
@@ -425,10 +425,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
input_set_byte += 2;
}
- rte_memcpy(hdr->buffer_spec, &udp_spec->hdr,
- sizeof(udp_spec->hdr));
- rte_memcpy(hdr->buffer_mask, &udp_mask->hdr,
- sizeof(udp_mask->hdr));
+ memcpy(hdr->buffer_spec, &udp_spec->hdr,
+ sizeof(udp_spec->hdr));
+ memcpy(hdr->buffer_mask, &udp_mask->hdr,
+ sizeof(udp_mask->hdr));
}
hdrs->count = ++layer;
@@ -466,10 +466,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
input_set_byte += 2;
}
- rte_memcpy(hdr->buffer_spec, &tcp_spec->hdr,
- sizeof(tcp_spec->hdr));
- rte_memcpy(hdr->buffer_mask, &tcp_mask->hdr,
- sizeof(tcp_mask->hdr));
+ memcpy(hdr->buffer_spec, &tcp_spec->hdr,
+ sizeof(tcp_spec->hdr));
+ memcpy(hdr->buffer_mask, &tcp_mask->hdr,
+ sizeof(tcp_mask->hdr));
}
hdrs->count = ++layer;
@@ -498,10 +498,10 @@ iavf_fsub_parse_pattern(const struct rte_flow_item pattern[],
return -rte_errno;
}
- rte_memcpy(hdr->buffer_spec, &vlan_spec->hdr,
- sizeof(vlan_spec->hdr));
- rte_memcpy(hdr->buffer_mask, &vlan_mask->hdr,
- sizeof(vlan_mask->hdr));
+ memcpy(hdr->buffer_spec, &vlan_spec->hdr,
+ sizeof(vlan_spec->hdr));
+ memcpy(hdr->buffer_mask, &vlan_mask->hdr,
+ sizeof(vlan_mask->hdr));
}
hdrs->count = ++layer;
diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c
index 6f6e95fc45..0bcfb5bf24 100644
--- a/drivers/net/iavf/iavf_generic_flow.c
+++ b/drivers/net/iavf/iavf_generic_flow.c
@@ -2019,7 +2019,7 @@ iavf_pattern_skip_void_item(struct rte_flow_item *items,
pb = pe + 1;
}
/* Copy the END item. */
- rte_memcpy(items, pe, sizeof(struct rte_flow_item));
+ memcpy(items, pe, sizeof(struct rte_flow_item));
}
/* Check if the pattern matches a supported item type array */
diff --git a/drivers/net/iavf/iavf_tm.c b/drivers/net/iavf/iavf_tm.c
index 32bb3be45e..a6ad6bb0a2 100644
--- a/drivers/net/iavf/iavf_tm.c
+++ b/drivers/net/iavf/iavf_tm.c
@@ -342,8 +342,8 @@ iavf_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->id = node_id;
tm_node->parent = NULL;
tm_node->reference_count = 0;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
vf->tm_conf.root = tm_node;
return 0;
}
@@ -403,8 +403,7 @@ iavf_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->reference_count = 0;
tm_node->parent = parent_node;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
if (parent_node_type == IAVF_TM_NODE_TYPE_PORT) {
TAILQ_INSERT_TAIL(&vf->tm_conf.tc_list,
tm_node, node);
@@ -543,8 +542,8 @@ iavf_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&vf->tm_conf.shaper_profile_list,
shaper_profile, node);
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 1111d30f57..711186c1b5 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -920,7 +920,7 @@ iavf_get_vlan_offload_caps_v2(struct iavf_adapter *adapter)
return ret;
}
- rte_memcpy(&vf->vlan_v2_caps, vf->aq_resp, sizeof(vf->vlan_v2_caps));
+ memcpy(&vf->vlan_v2_caps, vf->aq_resp, sizeof(vf->vlan_v2_caps));
return 0;
}
@@ -1427,8 +1427,8 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add)
addr = &adapter->dev_data->mac_addrs[i];
if (rte_is_zero_ether_addr(addr))
continue;
- rte_memcpy(list->list[j].addr, addr->addr_bytes,
- sizeof(addr->addr_bytes));
+ memcpy(list->list[j].addr, addr->addr_bytes,
+ sizeof(addr->addr_bytes));
list->list[j].type = (j == 0 ?
VIRTCHNL_ETHER_ADDR_PRIMARY :
VIRTCHNL_ETHER_ADDR_EXTRA);
@@ -1547,8 +1547,7 @@ iavf_add_del_eth_addr(struct iavf_adapter *adapter, struct rte_ether_addr *addr,
list->vsi_id = vf->vsi_res->vsi_id;
list->num_elements = 1;
list->list[0].type = type;
- rte_memcpy(list->list[0].addr, addr->addr_bytes,
- sizeof(addr->addr_bytes));
+ memcpy(list->list[0].addr, addr->addr_bytes, sizeof(addr->addr_bytes));
args.ops = add ? VIRTCHNL_OP_ADD_ETH_ADDR : VIRTCHNL_OP_DEL_ETH_ADDR;
args.in_args = cmd_buffer;
diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c
index 7f8f5163ac..42e5b30b2b 100644
--- a/drivers/net/ice/ice_dcf.c
+++ b/drivers/net/ice/ice_dcf.c
@@ -731,7 +731,7 @@ dcf_get_vlan_offload_caps_v2(struct ice_dcf_hw *hw)
return ret;
}
- rte_memcpy(&hw->vlan_v2_caps, &vlan_v2_caps, sizeof(vlan_v2_caps));
+ memcpy(&hw->vlan_v2_caps, &vlan_v2_caps, sizeof(vlan_v2_caps));
return 0;
}
@@ -1407,8 +1407,7 @@ ice_dcf_add_del_all_mac_addr(struct ice_dcf_hw *hw,
return -ENOMEM;
}
- rte_memcpy(list->list[0].addr, addr->addr_bytes,
- sizeof(addr->addr_bytes));
+ memcpy(list->list[0].addr, addr->addr_bytes, sizeof(addr->addr_bytes));
PMD_DRV_LOG(DEBUG, "add/rm mac:" RTE_ETHER_ADDR_PRT_FMT,
RTE_ETHER_ADDR_BYTES(addr));
diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c
index 6e845f458a..0c53755c9d 100644
--- a/drivers/net/ice/ice_dcf_parent.c
+++ b/drivers/net/ice/ice_dcf_parent.c
@@ -407,7 +407,7 @@ ice_dcf_load_pkg(struct ice_adapter *adapter)
use_dsn = ice_dcf_execute_virtchnl_cmd(&dcf_adapter->real_hw, &vc_cmd) == 0;
if (use_dsn)
- rte_memcpy(&dsn, pkg_info.dsn, sizeof(dsn));
+ memcpy(&dsn, pkg_info.dsn, sizeof(dsn));
return ice_load_pkg(adapter, use_dsn, dsn);
}
diff --git a/drivers/net/ice/ice_dcf_sched.c b/drivers/net/ice/ice_dcf_sched.c
index b08bc5f1de..465ae75d5c 100644
--- a/drivers/net/ice/ice_dcf_sched.c
+++ b/drivers/net/ice/ice_dcf_sched.c
@@ -308,8 +308,8 @@ ice_dcf_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->id = node_id;
tm_node->parent = NULL;
tm_node->reference_count = 0;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
hw->tm_conf.root = tm_node;
return 0;
@@ -373,8 +373,7 @@ ice_dcf_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->shaper_profile = shaper_profile;
tm_node->reference_count = 0;
tm_node->parent = parent_node;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
if (parent_node_type == ICE_DCF_TM_NODE_TYPE_PORT) {
TAILQ_INSERT_TAIL(&hw->tm_conf.tc_list,
tm_node, node);
@@ -520,8 +519,8 @@ ice_dcf_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&hw->tm_conf.shaper_profile_list,
shaper_profile, node);
diff --git a/drivers/net/ice/ice_diagnose.c b/drivers/net/ice/ice_diagnose.c
index 3be819d7f8..c22f71e48e 100644
--- a/drivers/net/ice/ice_diagnose.c
+++ b/drivers/net/ice/ice_diagnose.c
@@ -362,13 +362,13 @@ ice_dump_pkg(struct rte_eth_dev *dev, uint8_t **buff, uint32_t *size)
count = *size / ICE_PKG_BUF_SIZE;
for (i = 0; i < count; i++) {
next_buff = (uint8_t *)(*buff) + i * ICE_PKG_BUF_SIZE;
- rte_memcpy(pkg_buff.buf, next_buff, ICE_PKG_BUF_SIZE);
+ memcpy(pkg_buff.buf, next_buff, ICE_PKG_BUF_SIZE);
if (ice_aq_upload_section(hw,
(struct ice_buf_hdr *)&pkg_buff.buf[0],
ICE_PKG_BUF_SIZE,
NULL))
return -EINVAL;
- rte_memcpy(next_buff, pkg_buff.buf, ICE_PKG_BUF_SIZE);
+ memcpy(next_buff, pkg_buff.buf, ICE_PKG_BUF_SIZE);
}
cache_size = sizeof(struct ice_package_header) + *size;
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 87385d2649..126afb763c 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -3453,11 +3453,11 @@ static int ice_init_rss(struct ice_pf *pf)
RTE_MIN(rss_conf->rss_key_len,
vsi->rss_key_size));
- rte_memcpy(key.standard_rss_key, vsi->rss_key,
- ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE);
- rte_memcpy(key.extended_hash_key,
- &vsi->rss_key[ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE],
- ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE);
+ memcpy(key.standard_rss_key, vsi->rss_key,
+ ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE);
+ memcpy(key.extended_hash_key,
+ &vsi->rss_key[ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE],
+ ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE);
ret = ice_aq_set_rss_key(hw, vsi->idx, &key);
if (ret)
goto out;
@@ -4549,7 +4549,7 @@ ice_vsi_config_vlan_filter(struct ice_vsi *vsi, bool on)
vsi->info.sw_flags2 &= ~sw_flags2;
vsi->info.sw_id = hw->port_info->sw_id;
- (void)rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.info.valid_sections =
rte_cpu_to_le_16(ICE_AQ_VSI_PROP_SW_VALID |
ICE_AQ_VSI_PROP_SECURITY_VALID);
@@ -5367,7 +5367,7 @@ ice_vsi_vlan_pvid_set(struct ice_vsi *vsi, struct ice_vsi_vlan_pvid_info *info)
ICE_AQ_VSI_INNER_VLAN_EMODE_M);
vsi->info.inner_vlan_flags |= vlan_flags;
memset(&ctxt, 0, sizeof(ctxt));
- rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
+ memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
ctxt.info.valid_sections =
rte_cpu_to_le_16(ICE_AQ_VSI_PROP_VLAN_VALID);
ctxt.vsi_num = vsi->vsi_id;
diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 0b7920ad44..de7b531aa0 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -1224,13 +1224,13 @@ ice_fdir_extract_fltr_key(struct ice_fdir_fltr_pattern *key,
memset(key, 0, sizeof(*key));
key->flow_type = input->flow_type;
- rte_memcpy(&key->ip, &input->ip, sizeof(key->ip));
- rte_memcpy(&key->mask, &input->mask, sizeof(key->mask));
- rte_memcpy(&key->ext_data, &input->ext_data, sizeof(key->ext_data));
- rte_memcpy(&key->ext_mask, &input->ext_mask, sizeof(key->ext_mask));
+ memcpy(&key->ip, &input->ip, sizeof(key->ip));
+ memcpy(&key->mask, &input->mask, sizeof(key->mask));
+ memcpy(&key->ext_data, &input->ext_data, sizeof(key->ext_data));
+ memcpy(&key->ext_mask, &input->ext_mask, sizeof(key->ext_mask));
- rte_memcpy(&key->gtpu_data, &input->gtpu_data, sizeof(key->gtpu_data));
- rte_memcpy(&key->gtpu_mask, &input->gtpu_mask, sizeof(key->gtpu_mask));
+ memcpy(&key->gtpu_data, &input->gtpu_data, sizeof(key->gtpu_data));
+ memcpy(&key->gtpu_mask, &input->gtpu_mask, sizeof(key->gtpu_mask));
key->tunnel_type = filter->tunnel_type;
}
@@ -1358,7 +1358,7 @@ ice_fdir_create_filter(struct ice_adapter *ad,
if (!entry)
goto error;
- rte_memcpy(entry, filter, sizeof(*filter));
+ memcpy(entry, filter, sizeof(*filter));
flow->rule = entry;
@@ -1419,7 +1419,7 @@ ice_fdir_create_filter(struct ice_adapter *ad,
if (filter->mark_flag == 1)
ice_fdir_rx_parsing_enable(ad, 1);
- rte_memcpy(entry, filter, sizeof(*entry));
+ memcpy(entry, filter, sizeof(*entry));
ret = ice_fdir_entry_insert(pf, entry, &key);
if (ret) {
rte_flow_error_set(error, -ret,
@@ -1720,8 +1720,8 @@ ice_fdir_parse_action(struct ice_adapter *ad,
act_count = actions->conf;
filter->input.cnt_ena = ICE_FXD_FLTR_QW0_STAT_ENA_PKTS;
- rte_memcpy(&filter->act_count, act_count,
- sizeof(filter->act_count));
+ memcpy(&filter->act_count, act_count,
+ sizeof(filter->act_count));
break;
default:
@@ -1978,12 +1978,13 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
p_ext_data = (tunnel_type && is_outer) ?
&filter->input.ext_data_outer :
&filter->input.ext_data;
- rte_memcpy(&p_ext_data->src_mac,
- ð_spec->hdr.src_addr, RTE_ETHER_ADDR_LEN);
- rte_memcpy(&p_ext_data->dst_mac,
- ð_spec->hdr.dst_addr, RTE_ETHER_ADDR_LEN);
- rte_memcpy(&p_ext_data->ether_type,
- ð_spec->hdr.ether_type, sizeof(eth_spec->hdr.ether_type));
+ memcpy(&p_ext_data->src_mac, ð_spec->hdr.src_addr,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(&p_ext_data->dst_mac, ð_spec->hdr.dst_addr,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(&p_ext_data->ether_type,
+ ð_spec->hdr.ether_type,
+ sizeof(eth_spec->hdr.ether_type));
break;
case RTE_FLOW_ITEM_TYPE_IPV4:
flow_type = ICE_FLTR_PTYPE_NONF_IPV4_OTHER;
@@ -2108,8 +2109,8 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
if (ipv6_mask->hdr.hop_limits == UINT8_MAX)
*input_set |= ICE_INSET_IPV6_HOP_LIMIT;
- rte_memcpy(&p_v6->dst_ip, ipv6_spec->hdr.dst_addr, 16);
- rte_memcpy(&p_v6->src_ip, ipv6_spec->hdr.src_addr, 16);
+ memcpy(&p_v6->dst_ip, ipv6_spec->hdr.dst_addr, 16);
+ memcpy(&p_v6->src_ip, ipv6_spec->hdr.src_addr, 16);
vtc_flow_cpu = rte_be_to_cpu_32(ipv6_spec->hdr.vtc_flow);
p_v6->tc = (uint8_t)(vtc_flow_cpu >> ICE_FDIR_IPV6_TC_OFFSET);
p_v6->proto = ipv6_spec->hdr.proto;
diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c
index 50d760004f..9e7de43575 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -1969,7 +1969,7 @@ ice_pattern_skip_void_item(struct rte_flow_item *items,
pb = pe + 1;
}
/* Copy the END item. */
- rte_memcpy(items, pe, sizeof(struct rte_flow_item));
+ memcpy(items, pe, sizeof(struct rte_flow_item));
}
/* Check if the pattern matches a supported item type array */
diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index f923641533..80b44713a9 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -715,7 +715,7 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad,
pkt_len, ICE_BLK_RSS, true, &prof))
return -rte_errno;
- rte_memcpy(&meta->raw.prof, &prof, sizeof(prof));
+ memcpy(&meta->raw.prof, &prof, sizeof(prof));
rte_free(pkt_buf);
rte_free(msk_buf);
diff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c
index 17f0ca0ce0..7515d738cd 100644
--- a/drivers/net/ice/ice_tm.c
+++ b/drivers/net/ice/ice_tm.c
@@ -293,8 +293,8 @@ ice_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&pf->tm_conf.shaper_profile_list,
shaper_profile, node);
@@ -403,8 +403,8 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->shaper_profile = shaper_profile;
tm_node->children =
(void *)((uint8_t *)tm_node + sizeof(struct ice_tm_node));
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
pf->tm_conf.root = tm_node;
return 0;
}
@@ -480,8 +480,7 @@ ice_tm_node_add(struct rte_eth_dev *dev, uint32_t node_id,
PMD_DRV_LOG(WARNING, "weight != 1 not supported in level %d",
level_id);
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
tm_node->parent->reference_count++;
return 0;
diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index 86151c9ec9..9cf33c4b70 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -1088,8 +1088,8 @@ idpf_handle_virtchnl_msg(struct idpf_adapter_ext *adapter_ex)
return;
}
- rte_memcpy(adapter->mbx_resp, ctlq_msg.ctx.indirect.payload->va,
- IDPF_DFLT_MBX_BUF_SIZE);
+ memcpy(adapter->mbx_resp, ctlq_msg.ctx.indirect.payload->va,
+ IDPF_DFLT_MBX_BUF_SIZE);
mbx_op = rte_le_to_cpu_16(ctlq_msg.opcode);
vc_op = rte_le_to_cpu_32(ctlq_msg.cookie.mbx.chnl_opcode);
@@ -1202,7 +1202,8 @@ idpf_adapter_ext_init(struct rte_pci_device *pci_dev, struct idpf_adapter_ext *a
strncpy(adapter->name, pci_dev->device.name, PCI_PRI_STR_SIZE);
- rte_memcpy(&base->caps, &req_caps, sizeof(struct virtchnl2_get_capabilities));
+ memcpy(&base->caps, &req_caps,
+ sizeof(struct virtchnl2_get_capabilities));
ret = idpf_adapter_init(base);
if (ret != 0) {
diff --git a/drivers/net/idpf/idpf_rxtx.c b/drivers/net/idpf/idpf_rxtx.c
index 64f2235580..da659e1653 100644
--- a/drivers/net/idpf/idpf_rxtx.c
+++ b/drivers/net/idpf/idpf_rxtx.c
@@ -76,7 +76,7 @@ idpf_dma_zone_reserve(struct rte_eth_dev *dev, uint16_t queue_idx,
else
ring_size = RTE_ALIGN(len * sizeof(struct idpf_base_tx_desc),
IDPF_DMA_MEM_ALIGN);
- rte_memcpy(ring_name, "idpf Tx ring", sizeof("idpf Tx ring"));
+ memcpy(ring_name, "idpf Tx ring", sizeof("idpf Tx ring"));
break;
case VIRTCHNL2_QUEUE_TYPE_RX:
if (splitq)
@@ -85,17 +85,19 @@ idpf_dma_zone_reserve(struct rte_eth_dev *dev, uint16_t queue_idx,
else
ring_size = RTE_ALIGN(len * sizeof(struct virtchnl2_singleq_rx_buf_desc),
IDPF_DMA_MEM_ALIGN);
- rte_memcpy(ring_name, "idpf Rx ring", sizeof("idpf Rx ring"));
+ memcpy(ring_name, "idpf Rx ring", sizeof("idpf Rx ring"));
break;
case VIRTCHNL2_QUEUE_TYPE_TX_COMPLETION:
ring_size = RTE_ALIGN(len * sizeof(struct idpf_splitq_tx_compl_desc),
IDPF_DMA_MEM_ALIGN);
- rte_memcpy(ring_name, "idpf Tx compl ring", sizeof("idpf Tx compl ring"));
+ memcpy(ring_name, "idpf Tx compl ring",
+ sizeof("idpf Tx compl ring"));
break;
case VIRTCHNL2_QUEUE_TYPE_RX_BUFFER:
ring_size = RTE_ALIGN(len * sizeof(struct virtchnl2_splitq_rx_buf_desc),
IDPF_DMA_MEM_ALIGN);
- rte_memcpy(ring_name, "idpf Rx buf ring", sizeof("idpf Rx buf ring"));
+ memcpy(ring_name, "idpf Rx buf ring",
+ sizeof("idpf Rx buf ring"));
break;
default:
PMD_INIT_LOG(ERR, "Invalid queue type");
diff --git a/drivers/net/ipn3ke/ipn3ke_flow.c b/drivers/net/ipn3ke/ipn3ke_flow.c
index d20a29b9a2..eeb0ec55d9 100644
--- a/drivers/net/ipn3ke/ipn3ke_flow.c
+++ b/drivers/net/ipn3ke/ipn3ke_flow.c
@@ -100,15 +100,14 @@ ipn3ke_pattern_vxlan(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_ETH:
eth = item->spec;
- rte_memcpy(&parser->key[0],
- eth->hdr.src_addr.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&parser->key[0], eth->hdr.src_addr.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
break;
case RTE_FLOW_ITEM_TYPE_VXLAN:
vxlan = item->spec;
- rte_memcpy(&parser->key[6], vxlan->hdr.vni, 3);
+ memcpy(&parser->key[6], vxlan->hdr.vni, 3);
break;
default:
@@ -164,9 +163,8 @@ ipn3ke_pattern_mac(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_ETH:
eth = item->spec;
- rte_memcpy(parser->key,
- eth->hdr.src_addr.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(parser->key, eth->hdr.src_addr.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
break;
default:
@@ -369,13 +367,13 @@ ipn3ke_pattern_ip_tcp(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_IPV4:
ipv4 = item->spec;
- rte_memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
+ memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
break;
case RTE_FLOW_ITEM_TYPE_TCP:
tcp = item->spec;
- rte_memcpy(&parser->key[4], &tcp->hdr.src_port, 2);
+ memcpy(&parser->key[4], &tcp->hdr.src_port, 2);
break;
default:
@@ -434,13 +432,13 @@ ipn3ke_pattern_ip_udp(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_IPV4:
ipv4 = item->spec;
- rte_memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
+ memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
break;
case RTE_FLOW_ITEM_TYPE_UDP:
udp = item->spec;
- rte_memcpy(&parser->key[4], &udp->hdr.src_port, 2);
+ memcpy(&parser->key[4], &udp->hdr.src_port, 2);
break;
default:
@@ -502,19 +500,19 @@ ipn3ke_pattern_ip_nvgre(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_IPV4:
ipv4 = item->spec;
- rte_memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
+ memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4);
break;
case RTE_FLOW_ITEM_TYPE_UDP:
udp = item->spec;
- rte_memcpy(&parser->key[4], &udp->hdr.src_port, 2);
+ memcpy(&parser->key[4], &udp->hdr.src_port, 2);
break;
case RTE_FLOW_ITEM_TYPE_NVGRE:
nvgre = item->spec;
- rte_memcpy(&parser->key[6], nvgre->tni, 3);
+ memcpy(&parser->key[6], nvgre->tni, 3);
break;
default:
@@ -576,19 +574,19 @@ ipn3ke_pattern_vxlan_ip_udp(const struct rte_flow_item patterns[],
case RTE_FLOW_ITEM_TYPE_VXLAN:
vxlan = item->spec;
- rte_memcpy(&parser->key[0], vxlan->hdr.vni, 3);
+ memcpy(&parser->key[0], vxlan->hdr.vni, 3);
break;
case RTE_FLOW_ITEM_TYPE_IPV4:
ipv4 = item->spec;
- rte_memcpy(&parser->key[3], &ipv4->hdr.src_addr, 4);
+ memcpy(&parser->key[3], &ipv4->hdr.src_addr, 4);
break;
case RTE_FLOW_ITEM_TYPE_UDP:
udp = item->spec;
- rte_memcpy(&parser->key[7], &udp->hdr.src_port, 2);
+ memcpy(&parser->key[7], &udp->hdr.src_port, 2);
break;
default:
diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c
index 8145f1bb2a..99527d1879 100644
--- a/drivers/net/ipn3ke/ipn3ke_representor.c
+++ b/drivers/net/ipn3ke/ipn3ke_representor.c
@@ -137,17 +137,17 @@ ipn3ke_rpst_dev_start(struct rte_eth_dev *dev)
if (hw->retimer.mac_type == IFPGA_RAWDEV_RETIMER_MAC_TYPE_10GE_XFI) {
/* Set mac address */
- rte_memcpy(((char *)(&val)),
- (char *)&dev->data->mac_addrs->addr_bytes[0],
- sizeof(uint32_t));
+ memcpy(((char *)(&val)),
+ (char *)&dev->data->mac_addrs->addr_bytes[0],
+ sizeof(uint32_t));
(*hw->f_mac_write)(hw,
val,
IPN3KE_MAC_PRIMARY_MAC_ADDR0,
rpst->port_id,
0);
- rte_memcpy(((char *)(&val)),
- (char *)&dev->data->mac_addrs->addr_bytes[4],
- sizeof(uint16_t));
+ memcpy(((char *)(&val)),
+ (char *)&dev->data->mac_addrs->addr_bytes[4],
+ sizeof(uint16_t));
(*hw->f_mac_write)(hw,
val,
IPN3KE_MAC_PRIMARY_MAC_ADDR1,
@@ -2753,13 +2753,13 @@ ipn3ke_rpst_mac_addr_set(struct rte_eth_dev *ethdev,
rte_ether_addr_copy(&mac_addr[0], &rpst->mac_addr);
/* Set mac address */
- rte_memcpy(((char *)(&val)), &mac_addr[0], sizeof(uint32_t));
+ memcpy(((char *)(&val)), &mac_addr[0], sizeof(uint32_t));
(*hw->f_mac_write)(hw,
val,
IPN3KE_MAC_PRIMARY_MAC_ADDR0,
rpst->port_id,
0);
- rte_memcpy(((char *)(&val)), &mac_addr[4], sizeof(uint16_t));
+ memcpy(((char *)(&val)), &mac_addr[4], sizeof(uint16_t));
(*hw->f_mac_write)(hw,
val,
IPN3KE_MAC_PRIMARY_MAC_ADDR0,
diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c b/drivers/net/ipn3ke/ipn3ke_tm.c
index 0260227900..b7097083d2 100644
--- a/drivers/net/ipn3ke/ipn3ke_tm.c
+++ b/drivers/net/ipn3ke/ipn3ke_tm.c
@@ -814,7 +814,7 @@ ipn3ke_tm_shaper_profile_add(struct rte_eth_dev *dev,
rte_strerror(EINVAL));
} else {
sp->valid = 1;
- rte_memcpy(&sp->params, profile, sizeof(sp->params));
+ memcpy(&sp->params, profile, sizeof(sp->params));
}
tm->h.n_shaper_profiles++;
@@ -960,7 +960,7 @@ ipn3ke_tm_tdrop_profile_add(struct rte_eth_dev *dev,
IPN3KE_TDROP_TH2_MASK);
tp->th1 = th1;
tp->th2 = th2;
- rte_memcpy(&tp->params, profile, sizeof(tp->params));
+ memcpy(&tp->params, profile, sizeof(tp->params));
/* Add to list */
tm->h.n_tdrop_profiles++;
@@ -1308,7 +1308,7 @@ ipn3ke_tm_node_add(struct rte_eth_dev *dev,
n->tdrop_profile = ipn3ke_hw_tm_tdrop_profile_search(hw,
params->leaf.wred.wred_profile_id);
- rte_memcpy(&n->params, params, sizeof(n->params));
+ memcpy(&n->params, params, sizeof(n->params));
return 0;
}
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index c61c52b296..68f46d443a 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -6597,9 +6597,8 @@ ixgbe_add_del_ntuple_filter(struct rte_eth_dev *dev,
sizeof(struct ixgbe_5tuple_filter), 0);
if (filter == NULL)
return -ENOMEM;
- rte_memcpy(&filter->filter_info,
- &filter_5tuple,
- sizeof(struct ixgbe_5tuple_filter_info));
+ memcpy(&filter->filter_info, &filter_5tuple,
+ sizeof(struct ixgbe_5tuple_filter_info));
filter->queue = ntuple_filter->queue;
ret = ixgbe_add_5tuple_filter(dev, filter);
if (ret < 0) {
@@ -7596,9 +7595,7 @@ ixgbe_dev_l2_tunnel_filter_add(struct rte_eth_dev *dev,
if (!node)
return -ENOMEM;
- rte_memcpy(&node->key,
- &key,
- sizeof(struct ixgbe_l2_tn_key));
+ memcpy(&node->key, &key, sizeof(struct ixgbe_l2_tn_key));
node->pool = l2_tunnel->pool;
ret = ixgbe_insert_l2_tn_filter(l2_tn_info, node);
if (ret < 0) {
diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c
index 06d6e2126d..b168ab8278 100644
--- a/drivers/net/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/ixgbe/ixgbe_fdir.c
@@ -74,7 +74,7 @@
else \
ipv6_addr[i] = 0; \
} \
- rte_memcpy((ipaddr), ipv6_addr, sizeof(ipv6_addr));\
+ memcpy((ipaddr), ipv6_addr, sizeof(ipv6_addr));\
} while (0)
#define IXGBE_FDIRIP6M_INNER_MAC_SHIFT 4
@@ -1217,9 +1217,8 @@ ixgbe_fdir_filter_program(struct rte_eth_dev *dev,
0);
if (!node)
return -ENOMEM;
- rte_memcpy(&node->ixgbe_fdir,
- &rule->ixgbe_fdir,
- sizeof(union ixgbe_atr_input));
+ memcpy(&node->ixgbe_fdir, &rule->ixgbe_fdir,
+ sizeof(union ixgbe_atr_input));
node->fdirflags = fdircmd_flags;
node->fdirhash = fdirhash;
node->queue = queue;
diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
index 687341c6b8..8a13f47f2b 100644
--- a/drivers/net/ixgbe/ixgbe_flow.c
+++ b/drivers/net/ixgbe/ixgbe_flow.c
@@ -1944,10 +1944,10 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev,
if (item->spec) {
rule->b_spec = TRUE;
ipv6_spec = item->spec;
- rte_memcpy(rule->ixgbe_fdir.formatted.src_ip,
- ipv6_spec->hdr.src_addr, 16);
- rte_memcpy(rule->ixgbe_fdir.formatted.dst_ip,
- ipv6_spec->hdr.dst_addr, 16);
+ memcpy(rule->ixgbe_fdir.formatted.src_ip,
+ ipv6_spec->hdr.src_addr, 16);
+ memcpy(rule->ixgbe_fdir.formatted.dst_ip,
+ ipv6_spec->hdr.dst_addr, 16);
}
/**
@@ -3070,9 +3070,9 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&ntuple_filter_ptr->filter_info,
- &ntuple_filter,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter_ptr->filter_info,
+ &ntuple_filter,
+ sizeof(struct rte_eth_ntuple_filter));
TAILQ_INSERT_TAIL(&filter_ntuple_list,
ntuple_filter_ptr, entries);
flow->rule = ntuple_filter_ptr;
@@ -3096,9 +3096,9 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(ðertype_filter_ptr->filter_info,
- ðertype_filter,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter_ptr->filter_info,
+ ðertype_filter,
+ sizeof(struct rte_eth_ethertype_filter));
TAILQ_INSERT_TAIL(&filter_ethertype_list,
ethertype_filter_ptr, entries);
flow->rule = ethertype_filter_ptr;
@@ -3120,9 +3120,8 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&syn_filter_ptr->filter_info,
- &syn_filter,
- sizeof(struct rte_eth_syn_filter));
+ memcpy(&syn_filter_ptr->filter_info, &syn_filter,
+ sizeof(struct rte_eth_syn_filter));
TAILQ_INSERT_TAIL(&filter_syn_list,
syn_filter_ptr,
entries);
@@ -3141,9 +3140,8 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
if (fdir_rule.b_mask) {
if (!fdir_info->mask_added) {
/* It's the first time the mask is set. */
- rte_memcpy(&fdir_info->mask,
- &fdir_rule.mask,
- sizeof(struct ixgbe_hw_fdir_mask));
+ memcpy(&fdir_info->mask, &fdir_rule.mask,
+ sizeof(struct ixgbe_hw_fdir_mask));
if (fdir_rule.mask.flex_bytes_mask) {
ret = ixgbe_fdir_set_flexbytes_offset(dev,
@@ -3185,9 +3183,9 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&fdir_rule_ptr->filter_info,
- &fdir_rule,
- sizeof(struct ixgbe_fdir_rule));
+ memcpy(&fdir_rule_ptr->filter_info,
+ &fdir_rule,
+ sizeof(struct ixgbe_fdir_rule));
TAILQ_INSERT_TAIL(&filter_fdir_list,
fdir_rule_ptr, entries);
flow->rule = fdir_rule_ptr;
@@ -3222,9 +3220,8 @@ ixgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&l2_tn_filter_ptr->filter_info,
- &l2_tn_filter,
- sizeof(struct ixgbe_l2_tunnel_conf));
+ memcpy(&l2_tn_filter_ptr->filter_info, &l2_tn_filter,
+ sizeof(struct ixgbe_l2_tunnel_conf));
TAILQ_INSERT_TAIL(&filter_l2_tunnel_list,
l2_tn_filter_ptr, entries);
flow->rule = l2_tn_filter_ptr;
@@ -3351,9 +3348,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_NTUPLE:
ntuple_filter_ptr = (struct ixgbe_ntuple_filter_ele *)
pmd_flow->rule;
- rte_memcpy(&ntuple_filter,
- &ntuple_filter_ptr->filter_info,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter, &ntuple_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ntuple_filter));
ret = ixgbe_add_del_ntuple_filter(dev, &ntuple_filter, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_ntuple_list,
@@ -3364,9 +3360,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_ETHERTYPE:
ethertype_filter_ptr = (struct ixgbe_ethertype_filter_ele *)
pmd_flow->rule;
- rte_memcpy(ðertype_filter,
- ðertype_filter_ptr->filter_info,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter, ðertype_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ethertype_filter));
ret = ixgbe_add_del_ethertype_filter(dev,
ðertype_filter, FALSE);
if (!ret) {
@@ -3378,9 +3373,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_SYN:
syn_filter_ptr = (struct ixgbe_eth_syn_filter_ele *)
pmd_flow->rule;
- rte_memcpy(&syn_filter,
- &syn_filter_ptr->filter_info,
- sizeof(struct rte_eth_syn_filter));
+ memcpy(&syn_filter, &syn_filter_ptr->filter_info,
+ sizeof(struct rte_eth_syn_filter));
ret = ixgbe_syn_filter_set(dev, &syn_filter, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_syn_list,
@@ -3390,9 +3384,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
break;
case RTE_ETH_FILTER_FDIR:
fdir_rule_ptr = (struct ixgbe_fdir_rule_ele *)pmd_flow->rule;
- rte_memcpy(&fdir_rule,
- &fdir_rule_ptr->filter_info,
- sizeof(struct ixgbe_fdir_rule));
+ memcpy(&fdir_rule, &fdir_rule_ptr->filter_info,
+ sizeof(struct ixgbe_fdir_rule));
ret = ixgbe_fdir_filter_program(dev, &fdir_rule, TRUE, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_fdir_list,
@@ -3405,8 +3398,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_L2_TUNNEL:
l2_tn_filter_ptr = (struct ixgbe_eth_l2_tunnel_conf_ele *)
pmd_flow->rule;
- rte_memcpy(&l2_tn_filter, &l2_tn_filter_ptr->filter_info,
- sizeof(struct ixgbe_l2_tunnel_conf));
+ memcpy(&l2_tn_filter, &l2_tn_filter_ptr->filter_info,
+ sizeof(struct ixgbe_l2_tunnel_conf));
ret = ixgbe_dev_l2_tunnel_filter_del(dev, &l2_tn_filter);
if (!ret) {
TAILQ_REMOVE(&filter_l2_tunnel_list,
diff --git a/drivers/net/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c
index d331308556..d8ed095dce 100644
--- a/drivers/net/ixgbe/ixgbe_ipsec.c
+++ b/drivers/net/ixgbe/ixgbe_ipsec.c
@@ -680,10 +680,10 @@ ixgbe_crypto_add_ingress_sa_from_flow(const void *sess,
const struct rte_flow_item_ipv6 *ipv6 = ip_spec;
ic_session->src_ip.type = IPv6;
ic_session->dst_ip.type = IPv6;
- rte_memcpy(ic_session->src_ip.ipv6,
- ipv6->hdr.src_addr, 16);
- rte_memcpy(ic_session->dst_ip.ipv6,
- ipv6->hdr.dst_addr, 16);
+ memcpy(ic_session->src_ip.ipv6, ipv6->hdr.src_addr,
+ 16);
+ memcpy(ic_session->dst_ip.ipv6, ipv6->hdr.dst_addr,
+ 16);
} else {
const struct rte_flow_item_ipv4 *ipv4 = ip_spec;
ic_session->src_ip.type = IPv4;
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index 0a0f639e39..f16bd45dbf 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -16,7 +16,6 @@
#include <rte_eal.h>
#include <rte_ether.h>
#include <ethdev_driver.h>
-#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
@@ -450,7 +449,7 @@ ixgbe_vf_reset(struct rte_eth_dev *dev, uint16_t vf, uint32_t *msgbuf)
/* reply to reset with ack and vf mac address */
msgbuf[0] = IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_ACK;
- rte_memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
+ memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
/*
* Piggyback the multicast filter type so VF can compute the
* correct vectors
@@ -472,7 +471,7 @@ ixgbe_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
if (rte_is_valid_assigned_ether_addr(
(struct rte_ether_addr *)new_mac)) {
- rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
+ memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
return hw->mac.ops.set_rar(hw, rar_entry, new_mac, vf, IXGBE_RAH_AV);
}
return -1;
diff --git a/drivers/net/ixgbe/ixgbe_tm.c b/drivers/net/ixgbe/ixgbe_tm.c
index ac8976062f..00d9de4393 100644
--- a/drivers/net/ixgbe/ixgbe_tm.c
+++ b/drivers/net/ixgbe/ixgbe_tm.c
@@ -289,8 +289,8 @@ ixgbe_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&tm_conf->shaper_profile_list,
shaper_profile, node);
@@ -637,8 +637,8 @@ ixgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->no = 0;
tm_node->parent = NULL;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
tm_conf->root = tm_node;
/* increase the reference counter of the shaper profile */
@@ -718,8 +718,7 @@ ixgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->reference_count = 0;
tm_node->parent = parent_node;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
if (parent_node_type == IXGBE_TM_NODE_TYPE_PORT) {
tm_node->no = parent_node->reference_count;
TAILQ_INSERT_TAIL(&tm_conf->tc_list,
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c
index f76ef63921..ba700fe023 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.c
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c
@@ -37,8 +37,8 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf,
if (rte_is_valid_assigned_ether_addr(
(struct rte_ether_addr *)new_mac)) {
- rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac,
- RTE_ETHER_ADDR_LEN);
+ memcpy(vfinfo[vf].vf_mac_addresses, new_mac,
+ RTE_ETHER_ADDR_LEN);
return hw->mac.ops.set_rar(hw, rar_entry, new_mac, vf,
IXGBE_RAH_AV);
}
diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
index 649f8d0e61..f5a3354c46 100644
--- a/drivers/net/memif/memif_socket.c
+++ b/drivers/net/memif/memif_socket.c
@@ -48,7 +48,7 @@ memif_msg_send(int fd, memif_msg_t *msg, int afd)
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
- rte_memcpy(CMSG_DATA(cmsg), &afd, sizeof(int));
+ memcpy(CMSG_DATA(cmsg), &afd, sizeof(int));
}
return sendmsg(fd, &mh, 0);
@@ -675,7 +675,7 @@ memif_msg_receive(struct memif_control_channel *cc)
if (cmsg->cmsg_type == SCM_CREDENTIALS)
cr = (struct ucred *)CMSG_DATA(cmsg);
else if (cmsg->cmsg_type == SCM_RIGHTS)
- rte_memcpy(&afd, CMSG_DATA(cmsg), sizeof(int));
+ memcpy(&afd, CMSG_DATA(cmsg), sizeof(int));
}
cmsg = CMSG_NXTHDR(&mh, cmsg);
}
diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c
index 9fa400fc48..6380a5c83c 100644
--- a/drivers/net/mlx5/mlx5_devx.c
+++ b/drivers/net/mlx5/mlx5_devx.c
@@ -512,7 +512,7 @@ mlx5_rxq_obj_hairpin_new(struct mlx5_rxq_priv *rxq)
* during queue setup.
*/
MLX5_ASSERT(hca_attr->hairpin_data_buffer_locked);
- rte_memcpy(&locked_attr, &unlocked_attr, sizeof(locked_attr));
+ memcpy(&locked_attr, &unlocked_attr, sizeof(locked_attr));
locked_attr.hairpin_data_buffer_type =
MLX5_RQC_HAIRPIN_DATA_BUFFER_TYPE_LOCKED_INTERNAL_BUFFER;
tmpl->rq = mlx5_devx_cmd_create_rq(priv->sh->cdev->ctx, &locked_attr,
@@ -1289,7 +1289,7 @@ mlx5_txq_obj_hairpin_new(struct rte_eth_dev *dev, uint16_t idx)
*/
MLX5_ASSERT(hca_attr->hairpin_sq_wq_in_host_mem);
MLX5_ASSERT(hca_attr->hairpin_sq_wqe_bb_size > 0);
- rte_memcpy(&host_mem_attr, &dev_mem_attr, sizeof(host_mem_attr));
+ memcpy(&host_mem_attr, &dev_mem_attr, sizeof(host_mem_attr));
umem_size = MLX5_WQE_SIZE *
RTE_BIT32(host_mem_attr.wq_attr.log_hairpin_num_packets);
umem_dbrec = RTE_ALIGN(umem_size, MLX5_DBR_SIZE);
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index f31fdfbf3d..dba8afbb28 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -4516,8 +4516,8 @@ flow_action_handles_translate(struct rte_eth_dev *dev,
(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION_NUM,
NULL, "too many shared actions");
}
- rte_memcpy(&handle[copied_n].action, &actions[n].conf,
- sizeof(actions[n].conf));
+ memcpy(&handle[copied_n].action, &actions[n].conf,
+ sizeof(actions[n].conf));
handle[copied_n].index = n;
copied_n++;
}
@@ -5383,30 +5383,30 @@ flow_hairpin_split(struct rte_eth_dev *dev,
case RTE_FLOW_ACTION_TYPE_NVGRE_ENCAP:
case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN:
case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP:
- rte_memcpy(actions_tx, actions,
+ memcpy(actions_tx, actions,
sizeof(struct rte_flow_action));
actions_tx++;
break;
case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID:
if (push_vlan) {
- rte_memcpy(actions_tx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_tx, actions,
+ sizeof(struct rte_flow_action));
actions_tx++;
} else {
- rte_memcpy(actions_rx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions,
+ sizeof(struct rte_flow_action));
actions_rx++;
}
break;
case RTE_FLOW_ACTION_TYPE_COUNT:
case RTE_FLOW_ACTION_TYPE_AGE:
if (encap) {
- rte_memcpy(actions_tx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_tx, actions,
+ sizeof(struct rte_flow_action));
actions_tx++;
} else {
- rte_memcpy(actions_rx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions,
+ sizeof(struct rte_flow_action));
actions_rx++;
}
break;
@@ -5418,8 +5418,8 @@ flow_hairpin_split(struct rte_eth_dev *dev,
actions_tx++;
encap = 1;
} else {
- rte_memcpy(actions_rx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions,
+ sizeof(struct rte_flow_action));
actions_rx++;
}
break;
@@ -5430,14 +5430,14 @@ flow_hairpin_split(struct rte_eth_dev *dev,
sizeof(struct rte_flow_action));
actions_tx++;
} else {
- rte_memcpy(actions_rx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions,
+ sizeof(struct rte_flow_action));
actions_rx++;
}
break;
default:
- rte_memcpy(actions_rx, actions,
- sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions,
+ sizeof(struct rte_flow_action));
actions_rx++;
break;
}
@@ -5447,7 +5447,7 @@ flow_hairpin_split(struct rte_eth_dev *dev,
tag_action->type = (enum rte_flow_action_type)
MLX5_RTE_FLOW_ACTION_TYPE_TAG;
actions_rx++;
- rte_memcpy(actions_rx, actions, sizeof(struct rte_flow_action));
+ memcpy(actions_rx, actions, sizeof(struct rte_flow_action));
actions_rx++;
set_tag = (void *)actions_rx;
*set_tag = (struct mlx5_rte_flow_action_set_tag) {
@@ -5457,7 +5457,7 @@ flow_hairpin_split(struct rte_eth_dev *dev,
MLX5_ASSERT(set_tag->id > REG_NON);
tag_action->conf = set_tag;
/* Create Tx item list. */
- rte_memcpy(actions_tx, actions, sizeof(struct rte_flow_action));
+ memcpy(actions_tx, actions, sizeof(struct rte_flow_action));
addr = (void *)&pattern_tx[2];
item = pattern_tx;
item->type = (enum rte_flow_item_type)
diff --git a/drivers/net/mlx5/mlx5_flow_aso.c b/drivers/net/mlx5/mlx5_flow_aso.c
index ab9eb21e01..0a44599737 100644
--- a/drivers/net/mlx5/mlx5_flow_aso.c
+++ b/drivers/net/mlx5/mlx5_flow_aso.c
@@ -1377,9 +1377,9 @@ mlx5_aso_ct_status_update(struct mlx5_aso_sq *sq, uint16_t num)
MLX5_ASSERT(ct);
MLX5_ASO_CT_UPDATE_STATE(ct, ASO_CONNTRACK_READY);
if (sq->elts[idx].query_data)
- rte_memcpy(sq->elts[idx].query_data,
- (char *)((uintptr_t)sq->mr.addr + idx * 64),
- 64);
+ memcpy(sq->elts[idx].query_data,
+ (char *)((uintptr_t)sq->mr.addr + idx * 64),
+ 64);
}
}
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 9ebbe664d1..9f0f8d0907 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -2072,7 +2072,7 @@ mlx5_tbl_translate_modify_header(struct rte_eth_dev *dev,
return rte_flow_error_set(error, ENOMEM,
RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
NULL, "translate modify_header: no memory for modify header context");
- rte_memcpy(acts->mhdr, mhdr, sizeof(*mhdr));
+ memcpy(acts->mhdr, mhdr, sizeof(*mhdr));
pattern.data = (__be64 *)acts->mhdr->mhdr_cmds;
if (mhdr->shared) {
uint32_t flags = mlx5_hw_act_flag[!!attr->group][tbl_type] |
@@ -2669,8 +2669,8 @@ flow_hw_populate_rule_acts_caches(struct rte_eth_dev *dev,
struct mlx5dr_rule_action *rule_acts =
flow_hw_get_dr_action_buffer(priv, table, at_idx, q);
- rte_memcpy(rule_acts, table->ats[at_idx].acts.rule_acts,
- sizeof(table->ats[at_idx].acts.rule_acts));
+ memcpy(rule_acts, table->ats[at_idx].acts.rule_acts,
+ sizeof(table->ats[at_idx].acts.rule_acts));
}
}
@@ -2972,9 +2972,9 @@ flow_hw_modify_field_construct(struct mlx5_modification_cmd *mhdr_cmd,
mhdr_action->src.field != RTE_FLOW_FIELD_POINTER)
return 0;
if (mhdr_action->src.field == RTE_FLOW_FIELD_VALUE)
- rte_memcpy(values, &mhdr_action->src.value, sizeof(values));
+ memcpy(values, &mhdr_action->src.value, sizeof(values));
else
- rte_memcpy(values, mhdr_action->src.pvalue, sizeof(values));
+ memcpy(values, mhdr_action->src.pvalue, sizeof(values));
if (mhdr_action->dst.field == RTE_FLOW_FIELD_META ||
mhdr_action->dst.field == RTE_FLOW_FIELD_TAG ||
mhdr_action->dst.field == RTE_FLOW_FIELD_METER_COLOR ||
@@ -4825,7 +4825,7 @@ flow_hw_table_create(struct rte_eth_dev *dev,
rte_flow_error_set(error, err, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
"Failed to create template table");
else
- rte_memcpy(error, &sub_error, sizeof(sub_error));
+ memcpy(error, &sub_error, sizeof(sub_error));
}
return NULL;
}
@@ -6917,8 +6917,9 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
if (masked) {
uint32_t mask_val = 0xffffffff;
- rte_memcpy(spec->src.value, &conf->vlan_vid, sizeof(conf->vlan_vid));
- rte_memcpy(mask->src.value, &mask_val, sizeof(mask_val));
+ memcpy(spec->src.value, &conf->vlan_vid,
+ sizeof(conf->vlan_vid));
+ memcpy(mask->src.value, &mask_val, sizeof(mask_val));
}
ra[set_vlan_vid_ix].type = RTE_FLOW_ACTION_TYPE_MODIFY_FIELD;
ra[set_vlan_vid_ix].conf = spec;
@@ -6954,7 +6955,7 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
.conf = &conf
};
- rte_memcpy(conf.src.value, &vid, sizeof(vid));
+ memcpy(conf.src.value, &vid, sizeof(vid));
return flow_hw_modify_field_construct(mhdr_cmd, act_data, hw_acts, &modify_action);
}
@@ -8577,8 +8578,8 @@ flow_hw_create_tx_repr_tag_jump_acts_tmpl(struct rte_eth_dev *dev,
struct rte_flow_action actions_m[4] = { { 0 } };
unsigned int idx = 0;
- rte_memcpy(set_tag_v.src.value, &tag_value, sizeof(tag_value));
- rte_memcpy(set_tag_m.src.value, &tag_mask, sizeof(tag_mask));
+ memcpy(set_tag_v.src.value, &tag_value, sizeof(tag_value));
+ memcpy(set_tag_m.src.value, &tag_mask, sizeof(tag_mask));
flow_hw_update_action_mask(&actions_v[idx], &actions_m[idx],
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD,
&set_tag_v, &set_tag_m);
@@ -8985,8 +8986,8 @@ flow_hw_create_ctrl_regc_jump_actions_template(struct rte_eth_dev *dev,
};
set_reg_v.dst.offset = rte_bsf32(marker_mask);
- rte_memcpy(set_reg_v.src.value, &marker_bits, sizeof(marker_bits));
- rte_memcpy(set_reg_m.src.value, &marker_mask, sizeof(marker_mask));
+ memcpy(set_reg_v.src.value, &marker_bits, sizeof(marker_bits));
+ memcpy(set_reg_m.src.value, &marker_mask, sizeof(marker_mask));
return flow_hw_actions_template_create(dev, &attr, actions_v, actions_m, error);
}
diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c
index cc087348a4..afd3194553 100644
--- a/drivers/net/mlx5/mlx5_rx.c
+++ b/drivers/net/mlx5/mlx5_rx.c
@@ -767,9 +767,9 @@ mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
ret = check_cqe_iteration(next, rxq->cqe_n, rxq->cq_ci);
if (ret != MLX5_CQE_STATUS_SW_OWN ||
MLX5_CQE_FORMAT(next->op_own) == MLX5_COMPRESSED)
- rte_memcpy(&rxq->title_cqe,
- (const void *)(uintptr_t)cqe,
- sizeof(struct mlx5_cqe));
+ memcpy(&rxq->title_cqe,
+ (const void *)(uintptr_t)cqe,
+ sizeof(struct mlx5_cqe));
}
}
}
diff --git a/drivers/net/mlx5/mlx5_rxtx_vec.c b/drivers/net/mlx5/mlx5_rxtx_vec.c
index 2363d7ed27..c3bcd3ef16 100644
--- a/drivers/net/mlx5/mlx5_rxtx_vec.c
+++ b/drivers/net/mlx5/mlx5_rxtx_vec.c
@@ -349,8 +349,8 @@ rxq_burst_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
ret = check_cqe_iteration(next, rxq->cqe_n, rxq->cq_ci);
if (ret != MLX5_CQE_STATUS_SW_OWN ||
MLX5_CQE_FORMAT(next->op_own) == MLX5_COMPRESSED)
- rte_memcpy(&rxq->title_pkt, elts[nocmp_n - 1],
- sizeof(struct rte_mbuf));
+ memcpy(&rxq->title_pkt, elts[nocmp_n - 1],
+ sizeof(struct rte_mbuf));
}
/* Decompress the last CQE if compressed. */
if (comp_idx < MLX5_VPMD_DESCS_PER_LOOP) {
@@ -499,8 +499,8 @@ rxq_burst_mprq_v(struct mlx5_rxq_data *rxq, struct rte_mbuf **pkts,
ret = check_cqe_iteration(next, rxq->cqe_n, rxq->cq_ci);
if (ret != MLX5_CQE_STATUS_SW_OWN ||
MLX5_CQE_FORMAT(next->op_own) == MLX5_COMPRESSED)
- rte_memcpy(&rxq->title_pkt, elts[nocmp_n - 1],
- sizeof(struct rte_mbuf));
+ memcpy(&rxq->title_pkt, elts[nocmp_n - 1],
+ sizeof(struct rte_mbuf));
}
/* Decompress the last CQE if compressed. */
if (comp_idx < MLX5_VPMD_DESCS_PER_LOOP) {
diff --git a/drivers/net/mvpp2/mrvl_tm.c b/drivers/net/mvpp2/mrvl_tm.c
index 9fac80b867..a5cdae6d1d 100644
--- a/drivers/net/mvpp2/mrvl_tm.c
+++ b/drivers/net/mvpp2/mrvl_tm.c
@@ -437,7 +437,7 @@ mrvl_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,
NULL, NULL);
profile->id = shaper_profile_id;
- rte_memcpy(&profile->params, params, sizeof(profile->params));
+ memcpy(&profile->params, params, sizeof(profile->params));
LIST_INSERT_HEAD(&priv->shaper_profiles, profile, next);
diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index b8a32832d7..b1be12c2d5 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -16,7 +16,6 @@
#include <sys/ioctl.h>
#include <rte_ethdev.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <rte_memzone.h>
#include <rte_devargs.h>
diff --git a/drivers/net/nfp/flower/nfp_conntrack.c b/drivers/net/nfp/flower/nfp_conntrack.c
index f89003be8b..279bf17eb3 100644
--- a/drivers/net/nfp/flower/nfp_conntrack.c
+++ b/drivers/net/nfp/flower/nfp_conntrack.c
@@ -1470,7 +1470,7 @@ nfp_ct_do_flow_merge(struct nfp_ct_zone_entry *ze,
merge_entry->ze = ze;
merge_entry->pre_ct_parent = pre_ct_entry;
merge_entry->post_ct_parent = post_ct_entry;
- rte_memcpy(merge_entry->cookie, new_cookie, sizeof(new_cookie));
+ memcpy(merge_entry->cookie, new_cookie, sizeof(new_cookie));
merge_entry->rule.items_cnt = pre_ct_entry->rule.items_cnt +
post_ct_entry->rule.items_cnt - cnt_same_item - 1;
merge_entry->rule.actions_cnt = pre_ct_entry->rule.actions_cnt +
diff --git a/drivers/net/nfp/flower/nfp_flower_flow.c b/drivers/net/nfp/flower/nfp_flower_flow.c
index 086cc8079a..4a6c587b6b 100644
--- a/drivers/net/nfp/flower/nfp_flower_flow.c
+++ b/drivers/net/nfp/flower/nfp_flower_flow.c
@@ -179,10 +179,10 @@ nfp_mask_id_alloc(struct nfp_flow_priv *priv,
return -ENOENT;
}
- rte_memcpy(&temp_id, &ring->buf[ring->tail], NFP_FLOWER_MASK_ELEMENT_RS);
+ memcpy(&temp_id, &ring->buf[ring->tail], NFP_FLOWER_MASK_ELEMENT_RS);
*mask_id = temp_id;
- rte_memcpy(&ring->buf[ring->tail], &freed_id, NFP_FLOWER_MASK_ELEMENT_RS);
+ memcpy(&ring->buf[ring->tail], &freed_id, NFP_FLOWER_MASK_ELEMENT_RS);
ring->tail = (ring->tail + NFP_FLOWER_MASK_ELEMENT_RS) %
(NFP_FLOWER_MASK_ENTRY_RS * NFP_FLOWER_MASK_ELEMENT_RS);
@@ -201,7 +201,7 @@ nfp_mask_id_free(struct nfp_flow_priv *priv,
if (CIRC_SPACE(ring->head, ring->tail, NFP_FLOWER_MASK_ENTRY_RS) == 0)
return -ENOBUFS;
- rte_memcpy(&ring->buf[ring->head], &mask_id, NFP_FLOWER_MASK_ELEMENT_RS);
+ memcpy(&ring->buf[ring->head], &mask_id, NFP_FLOWER_MASK_ELEMENT_RS);
ring->head = (ring->head + NFP_FLOWER_MASK_ELEMENT_RS) %
(NFP_FLOWER_MASK_ENTRY_RS * NFP_FLOWER_MASK_ELEMENT_RS);
@@ -2255,13 +2255,13 @@ nfp_flow_action_set_mac(char *act_data,
set_mac = action->conf;
if (mac_src_flag) {
- rte_memcpy(&set_eth->eth_addr[RTE_ETHER_ADDR_LEN],
- set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(&set_eth->eth_addr[RTE_ETHER_ADDR_LEN],
+ set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
set_eth->eth_addr_mask[RTE_ETHER_ADDR_LEN + i] = 0xff;
} else {
- rte_memcpy(&set_eth->eth_addr[0],
- set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(&set_eth->eth_addr[0], set_mac->mac_addr,
+ RTE_ETHER_ADDR_LEN);
for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
set_eth->eth_addr_mask[i] = 0xff;
}
@@ -2337,7 +2337,7 @@ nfp_flow_action_set_ipv6(char *act_data,
set_ip->reserved = 0;
for (i = 0; i < 4; i++) {
- rte_memcpy(&tmp, &set_ipv6->ipv6_addr[i * 4], 4);
+ memcpy(&tmp, &set_ipv6->ipv6_addr[i * 4], 4);
set_ip->ipv6[i].exact = tmp;
set_ip->ipv6[i].mask = RTE_BE32(0xffffffff);
}
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index b2c55879ca..007e202e26 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -194,7 +194,7 @@ nfp_flower_repr_stats_get(struct rte_eth_dev *ethdev,
struct nfp_flower_representor *repr;
repr = ethdev->data->dev_private;
- rte_memcpy(stats, &repr->repr_stats, sizeof(struct rte_eth_stats));
+ memcpy(stats, &repr->repr_stats, sizeof(struct rte_eth_stats));
return 0;
}
diff --git a/drivers/net/nfp/nfp_mtr.c b/drivers/net/nfp/nfp_mtr.c
index 6abc6dc9bc..d69139d861 100644
--- a/drivers/net/nfp/nfp_mtr.c
+++ b/drivers/net/nfp/nfp_mtr.c
@@ -243,7 +243,7 @@ nfp_mtr_profile_mod(struct nfp_app_fw_flower *app_fw_flower,
struct nfp_profile_conf old_conf;
/* Get the old profile config */
- rte_memcpy(&old_conf, &mtr_profile->conf, sizeof(old_conf));
+ memcpy(&old_conf, &mtr_profile->conf, sizeof(old_conf));
memset(&mtr_profile->conf, 0, sizeof(struct nfp_profile_conf));
@@ -267,7 +267,7 @@ nfp_mtr_profile_mod(struct nfp_app_fw_flower *app_fw_flower,
return 0;
rollback:
- rte_memcpy(&mtr_profile->conf, &old_conf, sizeof(old_conf));
+ memcpy(&mtr_profile->conf, &old_conf, sizeof(old_conf));
return ret;
}
@@ -492,8 +492,8 @@ nfp_mtr_policy_add(struct rte_eth_dev *dev,
}
mtr_policy->policy_id = mtr_policy_id;
- rte_memcpy(&mtr_policy->policy, policy,
- sizeof(struct rte_mtr_meter_policy_params));
+ memcpy(&mtr_policy->policy, policy,
+ sizeof(struct rte_mtr_meter_policy_params));
/* Insert policy into policy list */
LIST_INSERT_HEAD(&priv->policies, mtr_policy, next);
@@ -1028,7 +1028,7 @@ nfp_mtr_stats_read(struct rte_eth_dev *dev,
*stats_mask = mtr->stats_mask;
rte_spinlock_lock(&priv->mtr_stats_lock);
- rte_memcpy(&curr, &mtr->mtr_stats.curr, sizeof(curr));
+ memcpy(&curr, &mtr->mtr_stats.curr, sizeof(curr));
rte_spinlock_unlock(&priv->mtr_stats_lock);
prev = &mtr->mtr_stats.prev;
diff --git a/drivers/net/ngbe/ngbe_pf.c b/drivers/net/ngbe/ngbe_pf.c
index 947ae7fe94..48f578b066 100644
--- a/drivers/net/ngbe/ngbe_pf.c
+++ b/drivers/net/ngbe/ngbe_pf.c
@@ -347,7 +347,7 @@ ngbe_vf_reset(struct rte_eth_dev *eth_dev, uint16_t vf, uint32_t *msgbuf)
/* reply to reset with ack and vf mac address */
msgbuf[0] = NGBE_VF_RESET | NGBE_VT_MSGTYPE_ACK;
- rte_memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
+ memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
/*
* Piggyback the multicast filter type so VF can compute the
* correct vectors
@@ -369,7 +369,7 @@ ngbe_vf_set_mac_addr(struct rte_eth_dev *eth_dev,
struct rte_ether_addr *ea = (struct rte_ether_addr *)new_mac;
if (rte_is_valid_assigned_ether_addr(ea)) {
- rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
+ memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
return hw->mac.set_rar(hw, rar_entry, new_mac, vf, true);
}
return -1;
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 7c46004f1e..fd8b01b2b1 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -465,7 +465,7 @@ eth_rss_hash_update(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf)
rss_conf->rss_hf & internal->flow_type_rss_offloads;
if (rss_conf->rss_key)
- rte_memcpy(internal->rss_key, rss_conf->rss_key, 40);
+ memcpy(internal->rss_key, rss_conf->rss_key, 40);
rte_spinlock_unlock(&internal->rss_lock);
@@ -482,7 +482,7 @@ eth_rss_hash_conf_get(struct rte_eth_dev *dev,
rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf;
if (rss_conf->rss_key)
- rte_memcpy(rss_conf->rss_key, internal->rss_key, 40);
+ memcpy(rss_conf->rss_key, internal->rss_key, 40);
rte_spinlock_unlock(&internal->rss_lock);
@@ -577,7 +577,7 @@ eth_dev_null_create(struct rte_vdev_device *dev, struct pmd_options *args)
internals->flow_type_rss_offloads = RTE_ETH_RSS_PROTO_MASK;
internals->reta_size = RTE_DIM(internals->reta_conf) * RTE_ETH_RETA_GROUP_SIZE;
- rte_memcpy(internals->rss_key, default_rss_key, 40);
+ memcpy(internals->rss_key, default_rss_key, 40);
data = eth_dev->data;
data->nb_rx_queues = (uint16_t)nb_rx_queues;
diff --git a/drivers/net/pcap/pcap_ethdev.c b/drivers/net/pcap/pcap_ethdev.c
index bfec085045..54f0dfffbd 100644
--- a/drivers/net/pcap/pcap_ethdev.c
+++ b/drivers/net/pcap/pcap_ethdev.c
@@ -1270,7 +1270,7 @@ eth_pcap_update_mac(const char *if_name, struct rte_eth_dev *eth_dev,
return -1;
PMD_LOG(INFO, "Setting phy MAC for %s", if_name);
- rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
+ memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
eth_dev->data->mac_addrs = mac_addrs;
return 0;
}
diff --git a/drivers/net/pcap/pcap_osdep_freebsd.c b/drivers/net/pcap/pcap_osdep_freebsd.c
index 20556b3e92..8811485aef 100644
--- a/drivers/net/pcap/pcap_osdep_freebsd.c
+++ b/drivers/net/pcap/pcap_osdep_freebsd.c
@@ -9,7 +9,6 @@
#include <sys/sysctl.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include "pcap_osdep.h"
@@ -52,7 +51,7 @@ osdep_iface_mac_get(const char *if_name, struct rte_ether_addr *mac)
ifm = (struct if_msghdr *)buf;
sdl = (struct sockaddr_dl *)(ifm + 1);
- rte_memcpy(mac->addr_bytes, LLADDR(sdl), RTE_ETHER_ADDR_LEN);
+ memcpy(mac->addr_bytes, LLADDR(sdl), RTE_ETHER_ADDR_LEN);
rte_free(buf);
return 0;
diff --git a/drivers/net/pcap/pcap_osdep_linux.c b/drivers/net/pcap/pcap_osdep_linux.c
index 97033f57c5..943e947296 100644
--- a/drivers/net/pcap/pcap_osdep_linux.c
+++ b/drivers/net/pcap/pcap_osdep_linux.c
@@ -9,7 +9,6 @@
#include <sys/socket.h>
#include <unistd.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include "pcap_osdep.h"
@@ -35,7 +34,7 @@ osdep_iface_mac_get(const char *if_name, struct rte_ether_addr *mac)
return -1;
}
- rte_memcpy(mac->addr_bytes, ifr.ifr_hwaddr.sa_data, RTE_ETHER_ADDR_LEN);
+ memcpy(mac->addr_bytes, ifr.ifr_hwaddr.sa_data, RTE_ETHER_ADDR_LEN);
close(if_fd);
return 0;
diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index fd63262f3a..32fa2016d2 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -180,7 +180,7 @@ static void qed_handle_bulletin_change(struct ecore_hwfn *hwfn)
is_mac_exist = ecore_vf_bulletin_get_forced_mac(hwfn, mac,
&is_mac_forced);
if (is_mac_exist && is_mac_forced)
- rte_memcpy(hwfn->hw_info.hw_mac_addr, mac, ETH_ALEN);
+ memcpy(hwfn->hw_info.hw_mac_addr, mac, ETH_ALEN);
/* Always update link configuration according to bulletin */
qed_link_update(hwfn);
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 48953dd7a0..8d53983965 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -8,7 +8,6 @@
#include <rte_mbuf.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_os_shim.h>
#include <rte_string_fns.h>
#include <bus_vdev_driver.h>
diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c
index 2cfff20f47..2fd160e99e 100644
--- a/drivers/net/sfc/sfc.c
+++ b/drivers/net/sfc/sfc.c
@@ -850,7 +850,7 @@ sfc_rss_attach(struct sfc_adapter *sa)
efx_ev_fini(sa->nic);
efx_intr_fini(sa->nic);
- rte_memcpy(rss->key, default_rss_key, sizeof(rss->key));
+ memcpy(rss->key, default_rss_key, sizeof(rss->key));
memset(&rss->dummy_ctx, 0, sizeof(rss->dummy_ctx));
rss->dummy_ctx.conf.qid_span = 1;
rss->dummy_ctx.dummy = true;
diff --git a/drivers/net/sfc/sfc_ef10_tx.c b/drivers/net/sfc/sfc_ef10_tx.c
index 116229382b..0b78a9eacc 100644
--- a/drivers/net/sfc/sfc_ef10_tx.c
+++ b/drivers/net/sfc/sfc_ef10_tx.c
@@ -514,7 +514,7 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg,
first_m_seg->outer_l2_len);
th = (const struct rte_tcp_hdr *)(hdr_addr + tcph_off);
- rte_memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t));
+ memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t));
sent_seq = rte_be_to_cpu_32(sent_seq);
sfc_ef10_tx_qdesc_tso2_create(txq, *added, packet_id, outer_packet_id,
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 92ca5e7a60..a6f0743f10 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -1287,8 +1287,7 @@ sfc_set_mc_addr_list(struct rte_eth_dev *dev,
}
for (i = 0; i < nb_mc_addr; ++i) {
- rte_memcpy(mc_addrs, mc_addr_set[i].addr_bytes,
- EFX_MAC_ADDR_LEN);
+ memcpy(mc_addrs, mc_addr_set[i].addr_bytes, EFX_MAC_ADDR_LEN);
mc_addrs += EFX_MAC_ADDR_LEN;
}
@@ -1672,7 +1671,7 @@ sfc_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
rss_conf->rss_hf = sfc_rx_hf_efx_to_rte(rss, rss->hash_types);
rss_conf->rss_key_len = EFX_RSS_KEY_SIZE;
if (rss_conf->rss_key != NULL)
- rte_memcpy(rss_conf->rss_key, rss->key, EFX_RSS_KEY_SIZE);
+ memcpy(rss_conf->rss_key, rss->key, EFX_RSS_KEY_SIZE);
return 0;
}
@@ -1741,7 +1740,7 @@ sfc_dev_rss_hash_update(struct rte_eth_dev *dev,
}
}
- rte_memcpy(rss->key, rss_conf->rss_key, sizeof(rss->key));
+ memcpy(rss->key, rss_conf->rss_key, sizeof(rss->key));
}
rss->hash_types = efx_hash_types;
@@ -1840,7 +1839,7 @@ sfc_dev_rss_reta_update(struct rte_eth_dev *dev,
sfc_adapter_lock(sa);
- rte_memcpy(rss_tbl_new, rss->tbl, sizeof(rss->tbl));
+ memcpy(rss_tbl_new, rss->tbl, sizeof(rss->tbl));
for (entry = 0; entry < reta_size; entry++) {
int grp_idx = entry % RTE_ETH_RETA_GROUP_SIZE;
@@ -1864,7 +1863,7 @@ sfc_dev_rss_reta_update(struct rte_eth_dev *dev,
goto fail_scale_tbl_set;
}
- rte_memcpy(rss->tbl, rss_tbl_new, sizeof(rss->tbl));
+ memcpy(rss->tbl, rss_tbl_new, sizeof(rss->tbl));
fail_scale_tbl_set:
bad_reta_entry:
diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index 1b50aefe5c..2bb98a4433 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -325,8 +325,8 @@ sfc_flow_parse_eth(const struct rte_flow_item *item,
efx_spec->efs_match_flags |= is_ifrm ?
EFX_FILTER_MATCH_IFRM_LOC_MAC :
EFX_FILTER_MATCH_LOC_MAC;
- rte_memcpy(loc_mac, spec->hdr.dst_addr.addr_bytes,
- EFX_MAC_ADDR_LEN);
+ memcpy(loc_mac, spec->hdr.dst_addr.addr_bytes,
+ EFX_MAC_ADDR_LEN);
} else if (memcmp(mask->hdr.dst_addr.addr_bytes, ig_mask,
EFX_MAC_ADDR_LEN) == 0) {
if (rte_is_unicast_ether_addr(&spec->hdr.dst_addr))
@@ -348,8 +348,8 @@ sfc_flow_parse_eth(const struct rte_flow_item *item,
*/
if (rte_is_same_ether_addr(&mask->hdr.src_addr, &supp_mask.hdr.src_addr)) {
efx_spec->efs_match_flags |= EFX_FILTER_MATCH_REM_MAC;
- rte_memcpy(efx_spec->efs_rem_mac, spec->hdr.src_addr.addr_bytes,
- EFX_MAC_ADDR_LEN);
+ memcpy(efx_spec->efs_rem_mac, spec->hdr.src_addr.addr_bytes,
+ EFX_MAC_ADDR_LEN);
} else if (!rte_is_zero_ether_addr(&mask->hdr.src_addr)) {
goto fail_bad_mask;
}
@@ -624,8 +624,8 @@ sfc_flow_parse_ipv6(const struct rte_flow_item *item,
RTE_BUILD_BUG_ON(sizeof(efx_spec->efs_rem_host) !=
sizeof(spec->hdr.src_addr));
- rte_memcpy(&efx_spec->efs_rem_host, spec->hdr.src_addr,
- sizeof(efx_spec->efs_rem_host));
+ memcpy(&efx_spec->efs_rem_host, spec->hdr.src_addr,
+ sizeof(efx_spec->efs_rem_host));
} else if (!sfc_flow_is_zero(mask->hdr.src_addr,
sizeof(mask->hdr.src_addr))) {
goto fail_bad_mask;
@@ -637,8 +637,8 @@ sfc_flow_parse_ipv6(const struct rte_flow_item *item,
RTE_BUILD_BUG_ON(sizeof(efx_spec->efs_loc_host) !=
sizeof(spec->hdr.dst_addr));
- rte_memcpy(&efx_spec->efs_loc_host, spec->hdr.dst_addr,
- sizeof(efx_spec->efs_loc_host));
+ memcpy(&efx_spec->efs_loc_host, spec->hdr.dst_addr,
+ sizeof(efx_spec->efs_loc_host));
} else if (!sfc_flow_is_zero(mask->hdr.dst_addr,
sizeof(mask->hdr.dst_addr))) {
goto fail_bad_mask;
@@ -889,8 +889,8 @@ sfc_flow_set_efx_spec_vni_or_vsid(efx_filter_spec_t *efx_spec,
if (memcmp(vni_or_vsid_mask, vni_or_vsid_full_mask,
EFX_VNI_OR_VSID_LEN) == 0) {
efx_spec->efs_match_flags |= EFX_FILTER_MATCH_VNI_OR_VSID;
- rte_memcpy(efx_spec->efs_vni_or_vsid, vni_or_vsid_val,
- EFX_VNI_OR_VSID_LEN);
+ memcpy(efx_spec->efs_vni_or_vsid, vni_or_vsid_val,
+ EFX_VNI_OR_VSID_LEN);
} else if (!sfc_flow_is_zero(vni_or_vsid_mask, EFX_VNI_OR_VSID_LEN)) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM, item,
--git a/drivers/net/sfc/sfc_flow_rss.c b/drivers/net/sfc/sfc_flow_rss.c
index e28c943335..a46ce1fa87 100644
--- a/drivers/net/sfc/sfc_flow_rss.c
+++ b/drivers/net/sfc/sfc_flow_rss.c
@@ -119,7 +119,7 @@ sfc_flow_rss_parse_conf(struct sfc_adapter *sa,
key = ethdev_rss->key;
}
- rte_memcpy(out->key, key, sizeof(out->key));
+ memcpy(out->key, key, sizeof(out->key));
switch (in->func) {
case RTE_ETH_HASH_FUNCTION_DEFAULT:
diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index 60ff6d2181..1f243e798e 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -547,7 +547,7 @@ sfc_mae_mac_addr_add(struct sfc_adapter *sa,
if (mac_addr == NULL)
return ENOMEM;
- rte_memcpy(mac_addr->addr_bytes, addr_bytes, EFX_MAC_ADDR_LEN);
+ memcpy(mac_addr->addr_bytes, addr_bytes, EFX_MAC_ADDR_LEN);
mac_addr->refcnt = 1;
mac_addr->fw_rsrc.mac_id.id = EFX_MAE_RSRC_ID_INVALID;
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index a193229265..55aae9ef04 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -1526,7 +1526,7 @@ sfc_rx_process_adv_conf_rss(struct sfc_adapter *sa,
sizeof(rss->key));
return EINVAL;
}
- rte_memcpy(rss->key, conf->rss_key, sizeof(rss->key));
+ memcpy(rss->key, conf->rss_key, sizeof(rss->key));
}
rss->hash_types = efx_hash_types;
diff --git a/drivers/net/sfc/sfc_tso.c b/drivers/net/sfc/sfc_tso.c
index a0827d1c0d..5da2de3c3d 100644
--- a/drivers/net/sfc/sfc_tso.c
+++ b/drivers/net/sfc/sfc_tso.c
@@ -159,7 +159,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,
/* Handle TCP header */
th = (const struct rte_tcp_hdr *)(tsoh + tcph_off);
- rte_memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t));
+ memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t));
sent_seq = rte_be_to_cpu_32(sent_seq);
efx_tx_qdesc_tso2_create(txq->common, packet_id, 0, sent_seq,
diff --git a/drivers/net/sfc/sfc_tso.h b/drivers/net/sfc/sfc_tso.h
index 9029ad1590..e914eae77e 100644
--- a/drivers/net/sfc/sfc_tso.h
+++ b/drivers/net/sfc/sfc_tso.h
@@ -35,7 +35,7 @@ sfc_tso_ip4_get_ipid(const uint8_t *pkt_hdrp, size_t ip_hdr_off)
uint16_t ipid;
ip_hdrp = (const struct rte_ipv4_hdr *)(pkt_hdrp + ip_hdr_off);
- rte_memcpy(&ipid, &ip_hdrp->packet_id, sizeof(ipid));
+ memcpy(&ipid, &ip_hdrp->packet_id, sizeof(ipid));
return rte_be_to_cpu_16(ipid);
}
@@ -46,9 +46,8 @@ sfc_tso_outer_udp_fix_len(const struct rte_mbuf *m, uint8_t *tsoh)
rte_be16_t len = rte_cpu_to_be_16(m->l2_len + m->l3_len + m->l4_len +
m->tso_segsz);
- rte_memcpy(tsoh + m->outer_l2_len + m->outer_l3_len +
- offsetof(struct rte_udp_hdr, dgram_len),
- &len, sizeof(len));
+ memcpy(tsoh + m->outer_l2_len + m->outer_l3_len + offsetof(struct rte_udp_hdr, dgram_len),
+ &len, sizeof(len));
}
static inline void
@@ -67,7 +66,7 @@ sfc_tso_innermost_ip_fix_len(const struct rte_mbuf *m, uint8_t *tsoh,
len = rte_cpu_to_be_16(ip_payload_len);
}
- rte_memcpy(tsoh + iph_ofst + field_ofst, &len, sizeof(len));
+ memcpy(tsoh + iph_ofst + field_ofst, &len, sizeof(len));
}
unsigned int sfc_tso_prepare_header(uint8_t *tsoh, size_t header_len,
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 69d9da695b..518619c53b 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -1404,11 +1404,11 @@ tap_mac_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)
mac_addr))
mode = LOCAL_AND_REMOTE;
ifr.ifr_hwaddr.sa_family = AF_LOCAL;
- rte_memcpy(ifr.ifr_hwaddr.sa_data, mac_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(ifr.ifr_hwaddr.sa_data, mac_addr, RTE_ETHER_ADDR_LEN);
ret = tap_ioctl(pmd, SIOCSIFHWADDR, &ifr, 1, mode);
if (ret < 0)
return ret;
- rte_memcpy(&pmd->eth_addr, mac_addr, RTE_ETHER_ADDR_LEN);
+ memcpy(&pmd->eth_addr, mac_addr, RTE_ETHER_ADDR_LEN);
if (pmd->remote_if_index && !pmd->flow_isolate) {
/* Replace MAC redirection rule after a MAC change */
ret = tap_flow_implicit_destroy(pmd, TAP_REMOTE_LOCAL_MAC);
@@ -2010,7 +2010,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
if (rte_is_zero_ether_addr(mac_addr))
rte_eth_random_addr((uint8_t *)&pmd->eth_addr);
else
- rte_memcpy(&pmd->eth_addr, mac_addr, sizeof(*mac_addr));
+ memcpy(&pmd->eth_addr, mac_addr, sizeof(*mac_addr));
}
/*
@@ -2033,8 +2033,8 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
if (pmd->type == ETH_TUNTAP_TYPE_TAP) {
memset(&ifr, 0, sizeof(struct ifreq));
ifr.ifr_hwaddr.sa_family = AF_LOCAL;
- rte_memcpy(ifr.ifr_hwaddr.sa_data, &pmd->eth_addr,
- RTE_ETHER_ADDR_LEN);
+ memcpy(ifr.ifr_hwaddr.sa_data, &pmd->eth_addr,
+ RTE_ETHER_ADDR_LEN);
if (tap_ioctl(pmd, SIOCSIFHWADDR, &ifr, 0, LOCAL_ONLY) < 0)
goto error_exit;
}
@@ -2091,8 +2091,8 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
pmd->name, pmd->remote_iface);
goto error_remote;
}
- rte_memcpy(&pmd->eth_addr, ifr.ifr_hwaddr.sa_data,
- RTE_ETHER_ADDR_LEN);
+ memcpy(&pmd->eth_addr, ifr.ifr_hwaddr.sa_data,
+ RTE_ETHER_ADDR_LEN);
/* The desired MAC is already in ifreq after SIOCGIFHWADDR. */
if (tap_ioctl(pmd, SIOCSIFHWADDR, &ifr, 0, LOCAL_ONLY) < 0) {
TAP_LOG(ERR, "%s: failed to get %s MAC address.",
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index b75e8898e2..1c42fd74b4 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -4304,9 +4304,8 @@ txgbe_add_del_ntuple_filter(struct rte_eth_dev *dev,
sizeof(struct txgbe_5tuple_filter), 0);
if (filter == NULL)
return -ENOMEM;
- rte_memcpy(&filter->filter_info,
- &filter_5tuple,
- sizeof(struct txgbe_5tuple_filter_info));
+ memcpy(&filter->filter_info, &filter_5tuple,
+ sizeof(struct txgbe_5tuple_filter_info));
filter->queue = ntuple_filter->queue;
ret = txgbe_add_5tuple_filter(dev, filter);
if (ret < 0) {
@@ -5109,9 +5108,7 @@ txgbe_dev_l2_tunnel_filter_add(struct rte_eth_dev *dev,
if (!node)
return -ENOMEM;
- rte_memcpy(&node->key,
- &key,
- sizeof(struct txgbe_l2_tn_key));
+ memcpy(&node->key, &key, sizeof(struct txgbe_l2_tn_key));
node->pool = l2_tunnel->pool;
ret = txgbe_insert_l2_tn_filter(l2_tn_info, node);
if (ret < 0) {
diff --git a/drivers/net/txgbe/txgbe_fdir.c b/drivers/net/txgbe/txgbe_fdir.c
index a198b6781b..00366ed873 100644
--- a/drivers/net/txgbe/txgbe_fdir.c
+++ b/drivers/net/txgbe/txgbe_fdir.c
@@ -42,7 +42,7 @@
else \
ipv6_addr[i] = 0; \
} \
- rte_memcpy((ipaddr), ipv6_addr, sizeof(ipv6_addr));\
+ memcpy((ipaddr), ipv6_addr, sizeof(ipv6_addr));\
} while (0)
/**
@@ -858,8 +858,8 @@ txgbe_fdir_filter_program(struct rte_eth_dev *dev,
sizeof(struct txgbe_fdir_filter), 0);
if (!node)
return -ENOMEM;
- rte_memcpy(&node->input, &rule->input,
- sizeof(struct txgbe_atr_input));
+ memcpy(&node->input, &rule->input,
+ sizeof(struct txgbe_atr_input));
node->fdirflags = rule->fdirflags;
node->fdirhash = fdirhash;
node->queue = queue;
diff --git a/drivers/net/txgbe/txgbe_flow.c b/drivers/net/txgbe/txgbe_flow.c
index 7ef52d0b0f..c76fc0eed0 100644
--- a/drivers/net/txgbe/txgbe_flow.c
+++ b/drivers/net/txgbe/txgbe_flow.c
@@ -1834,10 +1834,10 @@ txgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev __rte_unused,
if (item->spec) {
rule->b_spec = TRUE;
ipv6_spec = item->spec;
- rte_memcpy(rule->input.src_ip,
- ipv6_spec->hdr.src_addr, 16);
- rte_memcpy(rule->input.dst_ip,
- ipv6_spec->hdr.dst_addr, 16);
+ memcpy(rule->input.src_ip, ipv6_spec->hdr.src_addr,
+ 16);
+ memcpy(rule->input.dst_ip, ipv6_spec->hdr.dst_addr,
+ 16);
}
/**
@@ -2756,9 +2756,9 @@ txgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&ntuple_filter_ptr->filter_info,
- &ntuple_filter,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter_ptr->filter_info,
+ &ntuple_filter,
+ sizeof(struct rte_eth_ntuple_filter));
TAILQ_INSERT_TAIL(&filter_ntuple_list,
ntuple_filter_ptr, entries);
flow->rule = ntuple_filter_ptr;
@@ -2782,9 +2782,9 @@ txgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(ðertype_filter_ptr->filter_info,
- ðertype_filter,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter_ptr->filter_info,
+ ðertype_filter,
+ sizeof(struct rte_eth_ethertype_filter));
TAILQ_INSERT_TAIL(&filter_ethertype_list,
ethertype_filter_ptr, entries);
flow->rule = ethertype_filter_ptr;
@@ -2806,9 +2806,8 @@ txgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&syn_filter_ptr->filter_info,
- &syn_filter,
- sizeof(struct rte_eth_syn_filter));
+ memcpy(&syn_filter_ptr->filter_info, &syn_filter,
+ sizeof(struct rte_eth_syn_filter));
TAILQ_INSERT_TAIL(&filter_syn_list,
syn_filter_ptr,
entries);
@@ -2827,9 +2826,8 @@ txgbe_flow_create(struct rte_eth_dev *dev,
if (fdir_rule.b_mask) {
if (!fdir_info->mask_added) {
/* It's the first time the mask is set. */
- rte_memcpy(&fdir_info->mask,
- &fdir_rule.mask,
- sizeof(struct txgbe_hw_fdir_mask));
+ memcpy(&fdir_info->mask, &fdir_rule.mask,
+ sizeof(struct txgbe_hw_fdir_mask));
fdir_info->flex_bytes_offset =
fdir_rule.flex_bytes_offset;
@@ -2873,9 +2871,9 @@ txgbe_flow_create(struct rte_eth_dev *dev,
"failed to allocate memory");
goto out;
}
- rte_memcpy(&fdir_rule_ptr->filter_info,
- &fdir_rule,
- sizeof(struct txgbe_fdir_rule));
+ memcpy(&fdir_rule_ptr->filter_info,
+ &fdir_rule,
+ sizeof(struct txgbe_fdir_rule));
TAILQ_INSERT_TAIL(&filter_fdir_list,
fdir_rule_ptr, entries);
flow->rule = fdir_rule_ptr;
@@ -2910,9 +2908,8 @@ txgbe_flow_create(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "failed to allocate memory");
goto out;
}
- rte_memcpy(&l2_tn_filter_ptr->filter_info,
- &l2_tn_filter,
- sizeof(struct txgbe_l2_tunnel_conf));
+ memcpy(&l2_tn_filter_ptr->filter_info, &l2_tn_filter,
+ sizeof(struct txgbe_l2_tunnel_conf));
TAILQ_INSERT_TAIL(&filter_l2_tunnel_list,
l2_tn_filter_ptr, entries);
flow->rule = l2_tn_filter_ptr;
@@ -3038,9 +3035,8 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_NTUPLE:
ntuple_filter_ptr = (struct txgbe_ntuple_filter_ele *)
pmd_flow->rule;
- rte_memcpy(&ntuple_filter,
- &ntuple_filter_ptr->filter_info,
- sizeof(struct rte_eth_ntuple_filter));
+ memcpy(&ntuple_filter, &ntuple_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ntuple_filter));
ret = txgbe_add_del_ntuple_filter(dev, &ntuple_filter, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_ntuple_list,
@@ -3051,9 +3047,8 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_ETHERTYPE:
ethertype_filter_ptr = (struct txgbe_ethertype_filter_ele *)
pmd_flow->rule;
- rte_memcpy(ðertype_filter,
- ðertype_filter_ptr->filter_info,
- sizeof(struct rte_eth_ethertype_filter));
+ memcpy(ðertype_filter, ðertype_filter_ptr->filter_info,
+ sizeof(struct rte_eth_ethertype_filter));
ret = txgbe_add_del_ethertype_filter(dev,
ðertype_filter, FALSE);
if (!ret) {
@@ -3065,9 +3060,8 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_SYN:
syn_filter_ptr = (struct txgbe_eth_syn_filter_ele *)
pmd_flow->rule;
- rte_memcpy(&syn_filter,
- &syn_filter_ptr->filter_info,
- sizeof(struct rte_eth_syn_filter));
+ memcpy(&syn_filter, &syn_filter_ptr->filter_info,
+ sizeof(struct rte_eth_syn_filter));
ret = txgbe_syn_filter_set(dev, &syn_filter, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_syn_list,
@@ -3077,9 +3071,8 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
break;
case RTE_ETH_FILTER_FDIR:
fdir_rule_ptr = (struct txgbe_fdir_rule_ele *)pmd_flow->rule;
- rte_memcpy(&fdir_rule,
- &fdir_rule_ptr->filter_info,
- sizeof(struct txgbe_fdir_rule));
+ memcpy(&fdir_rule, &fdir_rule_ptr->filter_info,
+ sizeof(struct txgbe_fdir_rule));
ret = txgbe_fdir_filter_program(dev, &fdir_rule, TRUE, FALSE);
if (!ret) {
TAILQ_REMOVE(&filter_fdir_list,
@@ -3092,8 +3085,8 @@ txgbe_flow_destroy(struct rte_eth_dev *dev,
case RTE_ETH_FILTER_L2_TUNNEL:
l2_tn_filter_ptr = (struct txgbe_eth_l2_tunnel_conf_ele *)
pmd_flow->rule;
- rte_memcpy(&l2_tn_filter, &l2_tn_filter_ptr->filter_info,
- sizeof(struct txgbe_l2_tunnel_conf));
+ memcpy(&l2_tn_filter, &l2_tn_filter_ptr->filter_info,
+ sizeof(struct txgbe_l2_tunnel_conf));
ret = txgbe_dev_l2_tunnel_filter_del(dev, &l2_tn_filter);
if (!ret) {
TAILQ_REMOVE(&filter_l2_tunnel_list,
diff --git a/drivers/net/txgbe/txgbe_ipsec.c b/drivers/net/txgbe/txgbe_ipsec.c
index f9f8108fb8..000dd5ec6d 100644
--- a/drivers/net/txgbe/txgbe_ipsec.c
+++ b/drivers/net/txgbe/txgbe_ipsec.c
@@ -658,10 +658,10 @@ txgbe_crypto_add_ingress_sa_from_flow(const void *sess,
const struct rte_flow_item_ipv6 *ipv6 = ip_spec;
ic_session->src_ip.type = IPv6;
ic_session->dst_ip.type = IPv6;
- rte_memcpy(ic_session->src_ip.ipv6,
- ipv6->hdr.src_addr, 16);
- rte_memcpy(ic_session->dst_ip.ipv6,
- ipv6->hdr.dst_addr, 16);
+ memcpy(ic_session->src_ip.ipv6, ipv6->hdr.src_addr,
+ 16);
+ memcpy(ic_session->dst_ip.ipv6, ipv6->hdr.dst_addr,
+ 16);
} else {
const struct rte_flow_item_ipv4 *ipv4 = ip_spec;
ic_session->src_ip.type = IPv4;
diff --git a/drivers/net/txgbe/txgbe_pf.c b/drivers/net/txgbe/txgbe_pf.c
index 176f79005c..1e8668cbc9 100644
--- a/drivers/net/txgbe/txgbe_pf.c
+++ b/drivers/net/txgbe/txgbe_pf.c
@@ -17,7 +17,6 @@
#include <rte_eal.h>
#include <rte_ether.h>
#include <ethdev_driver.h>
-#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_random.h>
#include <bus_pci_driver.h>
@@ -435,7 +434,7 @@ txgbe_vf_reset(struct rte_eth_dev *eth_dev, uint16_t vf, uint32_t *msgbuf)
/* reply to reset with ack and vf mac address */
msgbuf[0] = TXGBE_VF_RESET | TXGBE_VT_MSGTYPE_ACK;
- rte_memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
+ memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN);
/*
* Piggyback the multicast filter type so VF can compute the
* correct vectors
@@ -457,7 +456,7 @@ txgbe_vf_set_mac_addr(struct rte_eth_dev *eth_dev,
struct rte_ether_addr *ea = (struct rte_ether_addr *)new_mac;
if (rte_is_valid_assigned_ether_addr(ea)) {
- rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
+ memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
return hw->mac.set_rar(hw, rar_entry, new_mac, vf, true);
}
return -1;
diff --git a/drivers/net/txgbe/txgbe_tm.c b/drivers/net/txgbe/txgbe_tm.c
index 3171be73d0..7d77b01dfe 100644
--- a/drivers/net/txgbe/txgbe_tm.c
+++ b/drivers/net/txgbe/txgbe_tm.c
@@ -280,8 +280,8 @@ txgbe_shaper_profile_add(struct rte_eth_dev *dev,
if (!shaper_profile)
return -ENOMEM;
shaper_profile->shaper_profile_id = shaper_profile_id;
- rte_memcpy(&shaper_profile->profile, profile,
- sizeof(struct rte_tm_shaper_params));
+ memcpy(&shaper_profile->profile, profile,
+ sizeof(struct rte_tm_shaper_params));
TAILQ_INSERT_TAIL(&tm_conf->shaper_profile_list,
shaper_profile, node);
@@ -625,8 +625,8 @@ txgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->no = 0;
tm_node->parent = NULL;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params,
+ sizeof(struct rte_tm_node_params));
tm_conf->root = tm_node;
/* increase the reference counter of the shaper profile */
@@ -706,8 +706,7 @@ txgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id,
tm_node->reference_count = 0;
tm_node->parent = parent_node;
tm_node->shaper_profile = shaper_profile;
- rte_memcpy(&tm_node->params, params,
- sizeof(struct rte_tm_node_params));
+ memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params));
if (parent_node_type == TXGBE_TM_NODE_TYPE_PORT) {
tm_node->no = parent_node->reference_count;
TAILQ_INSERT_TAIL(&tm_conf->tc_list,
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 21bbb008e0..a88a3a18a0 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -12,7 +12,6 @@
#include <ethdev_driver.h>
#include <ethdev_vdev.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_net.h>
#include <bus_vdev_driver.h>
#include <rte_kvargs.h>
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 517585740e..5c727cc4c0 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -10,7 +10,6 @@
#include <unistd.h>
#include <ethdev_driver.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 16/30] raw: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (14 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 15/30] net: replace use of fixed size rte_memcpy Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 17/30] baseband: " Stephen Hemminger
` (15 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Rosen Xu, Sachin Saxena, Hemant Agrawal
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +--
drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +--
drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +--
drivers/raw/ifpga/afu_pmd_n3000.c | 8 ++++----
drivers/raw/ifpga/ifpga_rawdev.c | 11 +++++------
drivers/raw/skeleton/skeleton_rawdev.c | 8 +++-----
drivers/raw/skeleton/skeleton_rawdev_test.c | 1 -
7 files changed, 15 insertions(+), 22 deletions(-)
diff --git a/drivers/raw/ifpga/afu_pmd_he_hssi.c b/drivers/raw/ifpga/afu_pmd_he_hssi.c
index 859f28dcc1..c2aaed9203 100644
--- a/drivers/raw/ifpga/afu_pmd_he_hssi.c
+++ b/drivers/raw/ifpga/afu_pmd_he_hssi.c
@@ -15,7 +15,6 @@
#include <rte_eal.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_io.h>
#include <rte_vfio.h>
#include <bus_pci_driver.h>
@@ -314,7 +313,7 @@ static int he_hssi_config(struct afu_rawdev *dev, void *config,
if (cfg->port >= NUM_HE_HSSI_PORTS)
return -EINVAL;
- rte_memcpy(&priv->he_hssi_cfg, cfg, sizeof(priv->he_hssi_cfg));
+ memcpy(&priv->he_hssi_cfg, cfg, sizeof(priv->he_hssi_cfg));
return 0;
}
diff --git a/drivers/raw/ifpga/afu_pmd_he_lpbk.c b/drivers/raw/ifpga/afu_pmd_he_lpbk.c
index c7c5cda48c..ffb7075c84 100644
--- a/drivers/raw/ifpga/afu_pmd_he_lpbk.c
+++ b/drivers/raw/ifpga/afu_pmd_he_lpbk.c
@@ -15,7 +15,6 @@
#include <rte_eal.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_io.h>
#include <rte_vfio.h>
#include <bus_pci_driver.h>
@@ -363,7 +362,7 @@ static int he_lpbk_config(struct afu_rawdev *dev, void *config,
if ((cfg->end < cfg->begin) || (cfg->end > MAX_CACHE_LINES))
return -EINVAL;
- rte_memcpy(&priv->he_lpbk_cfg, cfg, sizeof(priv->he_lpbk_cfg));
+ memcpy(&priv->he_lpbk_cfg, cfg, sizeof(priv->he_lpbk_cfg));
return 0;
}
diff --git a/drivers/raw/ifpga/afu_pmd_he_mem.c b/drivers/raw/ifpga/afu_pmd_he_mem.c
index a1db533eeb..b799e40d2d 100644
--- a/drivers/raw/ifpga/afu_pmd_he_mem.c
+++ b/drivers/raw/ifpga/afu_pmd_he_mem.c
@@ -14,7 +14,6 @@
#include <rte_eal.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_io.h>
#include <rte_vfio.h>
#include <bus_pci_driver.h>
@@ -126,7 +125,7 @@ static int he_mem_tg_config(struct afu_rawdev *dev, void *config,
if (config_size != sizeof(struct rte_pmd_afu_he_mem_tg_cfg))
return -EINVAL;
- rte_memcpy(&priv->he_mem_tg_cfg, config, sizeof(priv->he_mem_tg_cfg));
+ memcpy(&priv->he_mem_tg_cfg, config, sizeof(priv->he_mem_tg_cfg));
return 0;
}
diff --git a/drivers/raw/ifpga/afu_pmd_n3000.c b/drivers/raw/ifpga/afu_pmd_n3000.c
index 67b3941265..9236c0b153 100644
--- a/drivers/raw/ifpga/afu_pmd_n3000.c
+++ b/drivers/raw/ifpga/afu_pmd_n3000.c
@@ -1867,8 +1867,8 @@ static int n3000_afu_config(struct afu_rawdev *dev, void *config,
if ((cfg->nlb_cfg.end < cfg->nlb_cfg.begin) ||
(cfg->nlb_cfg.end > MAX_CACHE_LINES))
return -EINVAL;
- rte_memcpy(&priv->nlb_cfg, &cfg->nlb_cfg,
- sizeof(struct rte_pmd_afu_nlb_cfg));
+ memcpy(&priv->nlb_cfg, &cfg->nlb_cfg,
+ sizeof(struct rte_pmd_afu_nlb_cfg));
} else if (cfg->type == RTE_PMD_AFU_N3000_DMA) {
if (cfg->dma_cfg.index >= NUM_N3000_DMA)
return -EINVAL;
@@ -1887,8 +1887,8 @@ static int n3000_afu_config(struct afu_rawdev *dev, void *config,
cfg->dma_cfg.length);
}
}
- rte_memcpy(&priv->dma_cfg, &cfg->dma_cfg,
- sizeof(struct rte_pmd_afu_dma_cfg));
+ memcpy(&priv->dma_cfg, &cfg->dma_cfg,
+ sizeof(struct rte_pmd_afu_dma_cfg));
} else {
IFPGA_RAWDEV_PMD_ERR("Invalid type of N3000 AFU");
return -EINVAL;
diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index f89bd3f9e2..d5d47e14dd 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -14,7 +14,6 @@
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_devargs.h>
-#include <rte_memcpy.h>
#include <rte_pci.h>
#include <bus_pci_driver.h>
#include <rte_kvargs.h>
@@ -258,7 +257,7 @@ static int ifpga_rawdev_fill_info(struct ifpga_rawdev *ifpga_dev)
if (point < 12)
return -1;
point -= 12;
- rte_memcpy(ifpga_dev->parent_bdf, &link[point], 12);
+ memcpy(ifpga_dev->parent_bdf, &link[point], 12);
point = strlen(link1);
if (point < 26)
@@ -948,10 +947,10 @@ ifpga_rawdev_pr(struct rte_rawdev *dev,
if (ret)
return ret;
- rte_memcpy(&afu_pr_conf->afu_id.uuid.uuid_low, uuid.b,
- sizeof(u64));
- rte_memcpy(&afu_pr_conf->afu_id.uuid.uuid_high, uuid.b + 8,
- sizeof(u64));
+ memcpy(&afu_pr_conf->afu_id.uuid.uuid_low, uuid.b,
+ sizeof(u64));
+ memcpy(&afu_pr_conf->afu_id.uuid.uuid_high, uuid.b + 8,
+ sizeof(u64));
IFPGA_RAWDEV_PMD_INFO("%s: uuid_l=0x%lx, uuid_h=0x%lx\n",
__func__,
diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c
index 6e99d35536..256f45cb5d 100644
--- a/drivers/raw/skeleton/skeleton_rawdev.c
+++ b/drivers/raw/skeleton/skeleton_rawdev.c
@@ -20,7 +20,6 @@
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_lcore.h>
#include <bus_vdev_driver.h>
@@ -245,8 +244,8 @@ static int skeleton_rawdev_queue_def_conf(struct rte_rawdev *dev,
skelq = &skeldev->queues[queue_id];
if (queue_id < SKELETON_MAX_QUEUES)
- rte_memcpy(queue_conf, skelq,
- sizeof(struct skeleton_rawdev_queue));
+ memcpy(queue_conf, skelq,
+ sizeof(struct skeleton_rawdev_queue));
return 0;
}
@@ -281,8 +280,7 @@ static int skeleton_rawdev_queue_setup(struct rte_rawdev *dev,
if (skeldev->num_queues > queue_id &&
q->depth < SKELETON_QUEUE_MAX_DEPTH) {
- rte_memcpy(q, queue_conf,
- sizeof(struct skeleton_rawdev_queue));
+ memcpy(q, queue_conf, sizeof(struct skeleton_rawdev_queue));
clear_queue_bufs(queue_id);
} else {
SKELETON_PMD_ERR("Invalid queue configuration");
diff --git a/drivers/raw/skeleton/skeleton_rawdev_test.c b/drivers/raw/skeleton/skeleton_rawdev_test.c
index b7a7f623aa..dc32c4e29b 100644
--- a/drivers/raw/skeleton/skeleton_rawdev_test.c
+++ b/drivers/raw/skeleton/skeleton_rawdev_test.c
@@ -7,7 +7,6 @@
#include <rte_common.h>
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <dev_driver.h>
#include <rte_rawdev.h>
#include <bus_vdev_driver.h>
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 17/30] baseband: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (15 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 16/30] raw: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-05 1:22 ` Chautru, Nicolas
2024-04-02 21:50 ` [PATCH v3 18/30] common: " Stephen Hemminger
` (14 subsequent siblings)
31 siblings, 1 reply; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Nicolas Chautru, Gagandeep Singh, Hemant Agrawal
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/baseband/acc/rte_acc100_pmd.c | 17 ++++++++---------
drivers/baseband/acc/rte_vrb_pmd.c | 21 ++++++++++-----------
drivers/baseband/la12xx/bbdev_la12xx.c | 4 ++--
3 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c
index 4f666e514b..6a6212f3de 100644
--- a/drivers/baseband/acc/rte_acc100_pmd.c
+++ b/drivers/baseband/acc/rte_acc100_pmd.c
@@ -2975,15 +2975,13 @@ enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
uint8_t *prev_ptr = (uint8_t *) prev_desc;
uint8_t *new_ptr = (uint8_t *) desc;
/* Copy first 4 words and BDESCs */
- rte_memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
- rte_memcpy(new_ptr + ACC_5GUL_OFFSET_0,
- prev_ptr + ACC_5GUL_OFFSET_0,
- ACC_5GUL_SIZE_1);
+ memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
+ memcpy(new_ptr + ACC_5GUL_OFFSET_0,
+ prev_ptr + ACC_5GUL_OFFSET_0, ACC_5GUL_SIZE_1);
desc->req.op_addr = prev_desc->req.op_addr;
/* Copy FCW */
- rte_memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
- prev_ptr + ACC_DESC_FCW_OFFSET,
- ACC_FCW_LD_BLEN);
+ memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
+ prev_ptr + ACC_DESC_FCW_OFFSET, ACC_FCW_LD_BLEN);
acc100_dma_desc_ld_update(op, &desc->req, input, h_output,
&in_offset, &h_out_offset,
&h_out_length, harq_layout);
@@ -3130,7 +3128,8 @@ enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
desc = acc_desc(q, total_enqueued_cbs);
desc->req.data_ptrs[0].address = q->ring_addr_iova + fcw_offset;
desc->req.data_ptrs[0].blen = ACC_FCW_LD_BLEN;
- rte_memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld, ACC_FCW_LD_BLEN);
+ memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
+ ACC_FCW_LD_BLEN);
ret = acc100_dma_desc_ld_fill(op, &desc->req, &input,
h_output, &in_offset, &h_out_offset,
&h_out_length,
@@ -4430,7 +4429,7 @@ acc100_configure(const char *dev_name, struct rte_acc_conf *conf)
struct acc_device *d = bbdev->data->dev_private;
/* Store configuration */
- rte_memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
+ memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
value = acc_reg_read(d, HwPfPcieGpexBridgeControl);
bool firstCfg = (value != ACC100_CFG_PCI_BRIDGE);
diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c
index 88b1104fab..3e5376a12e 100644
--- a/drivers/baseband/acc/rte_vrb_pmd.c
+++ b/drivers/baseband/acc/rte_vrb_pmd.c
@@ -2450,15 +2450,13 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
uint8_t *prev_ptr = (uint8_t *) prev_desc;
uint8_t *new_ptr = (uint8_t *) desc;
/* Copy first 4 words and BDESCs. */
- rte_memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
- rte_memcpy(new_ptr + ACC_5GUL_OFFSET_0,
- prev_ptr + ACC_5GUL_OFFSET_0,
- ACC_5GUL_SIZE_1);
+ memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
+ memcpy(new_ptr + ACC_5GUL_OFFSET_0,
+ prev_ptr + ACC_5GUL_OFFSET_0, ACC_5GUL_SIZE_1);
desc->req.op_addr = prev_desc->req.op_addr;
/* Copy FCW. */
- rte_memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
- prev_ptr + ACC_DESC_FCW_OFFSET,
- ACC_FCW_LD_BLEN);
+ memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
+ prev_ptr + ACC_DESC_FCW_OFFSET, ACC_FCW_LD_BLEN);
vrb_dma_desc_ld_update(op, &desc->req, input, h_output,
&in_offset, &h_out_offset,
&h_out_length, harq_layout);
@@ -2566,7 +2564,8 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct acc_queue *q, struct rte_bbdev_dec_op *op,
fcw_offset = (desc_idx << 8) + ACC_DESC_FCW_OFFSET;
desc->req.data_ptrs[0].address = q->ring_addr_iova + fcw_offset;
desc->req.data_ptrs[0].blen = ACC_FCW_LD_BLEN;
- rte_memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld, ACC_FCW_LD_BLEN);
+ memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
+ ACC_FCW_LD_BLEN);
desc->req.fcw_ld.tb_trailer_size = (c - r - 1) * trail_len;
ret = vrb_dma_desc_ld_fill(op, &desc->req, &input,
h_output, &in_offset, &h_out_offset,
@@ -3991,7 +3990,7 @@ enqueue_mldts_split_op(struct acc_queue *q, struct rte_bbdev_mldts_op *op,
if (symb == 0)
desc->req.cbs_in_tb = num_syms;
else
- rte_memcpy(&desc->req.fcw_mldts, fcw, ACC_FCW_MLDTS_BLEN);
+ memcpy(&desc->req.fcw_mldts, fcw, ACC_FCW_MLDTS_BLEN);
desc->req.data_ptrs[1].address = rte_pktmbuf_iova_offset(input_q, in_offset);
desc->req.data_ptrs[1].blen = q_size;
in_offset += q_size;
@@ -4337,7 +4336,7 @@ vrb1_configure(const char *dev_name, struct rte_acc_conf *conf)
struct acc_device *d = bbdev->data->dev_private;
/* Store configuration. */
- rte_memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
+ memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
/* Check we are already out of PG. */
status = acc_reg_read(d, VRB1_PfHiSectionPowerGatingAck);
@@ -4744,7 +4743,7 @@ vrb2_configure(const char *dev_name, struct rte_acc_conf *conf)
struct acc_device *d = bbdev->data->dev_private;
/* Store configuration. */
- rte_memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
+ memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
/* Explicitly releasing AXI as this may be stopped after PF FLR/BME. */
address = VRB2_PfDmaAxiControl;
diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c
index bb754a5395..23e2fdb811 100644
--- a/drivers/baseband/la12xx/bbdev_la12xx.c
+++ b/drivers/baseband/la12xx/bbdev_la12xx.c
@@ -597,8 +597,8 @@ dequeue_single_op(struct bbdev_la12xx_q_priv *q_priv, void *dst)
op = q_priv->bbdev_op[ci];
- rte_memcpy(dst, q_priv->msg_ch_vaddr[ci],
- sizeof(struct bbdev_ipc_enqueue_op));
+ memcpy(dst, q_priv->msg_ch_vaddr[ci],
+ sizeof(struct bbdev_ipc_enqueue_op));
/* Move Consumer Index forward */
ci++;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 18/30] common: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (16 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 17/30] baseband: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 19/30] crypto: " Stephen Hemminger
` (13 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jingjing Wu, Kai Ji, Fan Zhang, Ashish Gupta
Automatically generated by devtools/cocci/rte_memcpy.cocci
Also, remove unnecessary includes of rte_memcpy.h
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/common/idpf/idpf_common_device.c | 4 ++--
drivers/common/idpf/idpf_common_virtchnl.c | 10 ++++++----
drivers/common/qat/qat_qp.c | 10 ++++------
drivers/compress/qat/qat_comp.c | 8 ++++----
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/common/idpf/idpf_common_device.c b/drivers/common/idpf/idpf_common_device.c
index 8403ed83f9..37c859f830 100644
--- a/drivers/common/idpf/idpf_common_device.c
+++ b/drivers/common/idpf/idpf_common_device.c
@@ -477,8 +477,8 @@ idpf_vport_init(struct idpf_vport *vport,
vport->num_rx_q = vport_info->num_rx_q;
vport->num_rx_bufq = vport_info->num_rx_bufq;
vport->max_mtu = vport_info->max_mtu;
- rte_memcpy(vport->default_mac_addr,
- vport_info->default_mac_addr, ETH_ALEN);
+ memcpy(vport->default_mac_addr, vport_info->default_mac_addr,
+ ETH_ALEN);
vport->rss_algorithm = vport_info->rss_algorithm;
vport->rss_key_size = RTE_MIN(IDPF_RSS_KEY_LEN,
vport_info->rss_key_size);
diff --git a/drivers/common/idpf/idpf_common_virtchnl.c b/drivers/common/idpf/idpf_common_virtchnl.c
index c46ed50eb5..baabfeb216 100644
--- a/drivers/common/idpf/idpf_common_virtchnl.c
+++ b/drivers/common/idpf/idpf_common_virtchnl.c
@@ -290,7 +290,8 @@ idpf_vc_caps_get(struct idpf_adapter *adapter)
return err;
}
- rte_memcpy(&adapter->caps, args.out_buffer, sizeof(struct virtchnl2_get_capabilities));
+ memcpy(&adapter->caps, args.out_buffer,
+ sizeof(struct virtchnl2_get_capabilities));
return 0;
}
@@ -327,7 +328,8 @@ idpf_vc_vport_create(struct idpf_vport *vport,
return err;
}
- rte_memcpy(&(vport->vport_info.info), args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
+ memcpy(&(vport->vport_info.info), args.out_buffer,
+ IDPF_DFLT_MBX_BUF_SIZE);
return 0;
}
@@ -383,7 +385,7 @@ idpf_vc_queue_grps_add(struct idpf_vport *vport,
return err;
}
- rte_memcpy(p2p_queue_grps_out, args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
+ memcpy(p2p_queue_grps_out, args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
return 0;
}
@@ -922,7 +924,7 @@ idpf_vc_ptype_info_query(struct idpf_adapter *adapter,
if (err != 0)
DRV_LOG(ERR, "Failed to execute command of VIRTCHNL2_OP_GET_PTYPE_INFO");
- rte_memcpy(recv_ptype_info, args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
+ memcpy(recv_ptype_info, args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE);
return err;
}
diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c
index f95dd33375..0c30c4d8c1 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",
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 19/30] crypto: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (17 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 18/30] common: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 20/30] " Stephen Hemminger
` (12 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Sunil Uttarwar, Ankur Dwivedi, Anoob Joseph,
Tejasree Kondoj
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
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 {
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 20/30] crypto: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (18 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 19/30] crypto: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 21/30] event: " Stephen Hemminger
` (11 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Hemant Agrawal, Gagandeep Singh, Kai Ji,
Pablo de Lara
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +-
drivers/crypto/qat/qat_sym_session.c | 52 +++++++++----------
.../scheduler/rte_cryptodev_scheduler.c | 6 +--
drivers/crypto/scheduler/scheduler_failover.c | 12 ++---
5 files changed, 37 insertions(+), 39 deletions(-)
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index 44528eaf7f..3e7b78656b 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -676,7 +676,7 @@ dpaa_sec_dump(struct dpaa_sec_op_ctx *ctx, struct dpaa_sec_qp *qp)
}
cdb = &sess->cdb;
- rte_memcpy(&c_cdb, cdb, sizeof(struct sec_cdb));
+ memcpy(&c_cdb, cdb, sizeof(struct sec_cdb));
#ifdef RTE_LIB_SECURITY
printf("\nsession protocol type = %d\n", sess->proto_alg);
#endif
diff --git a/drivers/crypto/ipsec_mb/pmd_snow3g.c b/drivers/crypto/ipsec_mb/pmd_snow3g.c
index a96779f059..f3f519f2d4 100644
--- a/drivers/crypto/ipsec_mb/pmd_snow3g.c
+++ b/drivers/crypto/ipsec_mb/pmd_snow3g.c
@@ -291,8 +291,8 @@ process_snow3g_hash_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops,
/* Copy back digest from src to auth.digest.data */
if (digest_appended)
- rte_memcpy(ops[i]->sym->auth.digest.data,
- dst, SNOW3G_DIGEST_LENGTH);
+ memcpy(ops[i]->sym->auth.digest.data, dst,
+ SNOW3G_DIGEST_LENGTH);
}
processed_ops++;
}
diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index 9e2dba5423..a93625b287 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -1439,7 +1439,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;
}
@@ -1450,7 +1450,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;
}
@@ -1461,7 +1461,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;
}
@@ -1472,7 +1472,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;
}
@@ -1483,7 +1483,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;
}
@@ -1494,7 +1494,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;
}
@@ -1615,8 +1615,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,
@@ -1660,8 +1659,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,
@@ -1924,8 +1923,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 -
@@ -2441,8 +2440,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;
@@ -2453,9 +2452,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 =
@@ -2493,8 +2491,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;
@@ -2520,8 +2518,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;
@@ -2545,8 +2543,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;
@@ -2570,8 +2568,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;
@@ -2595,8 +2593,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;
diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
index 9a21edd32a..ed1833a7c6 100644
--- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
+++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c
@@ -79,7 +79,7 @@ sync_caps(struct rte_cryptodev_capabilities *caps,
/* remove a uncommon cap from the array */
for (j = i; j < sync_nb_caps - 1; j++)
- rte_memcpy(&caps[j], &caps[j+1], sizeof(*cap));
+ memcpy(&caps[j], &caps[j + 1], sizeof(*cap));
memset(&caps[sync_nb_caps - 1], 0, sizeof(*cap));
sync_nb_caps--;
@@ -216,8 +216,8 @@ sync_sec_caps(uint32_t worker_idx,
* caps, from the arrays
*/
for (j = i; j < nb_sec_caps - 1; j++) {
- rte_memcpy(&sec_caps[j], &sec_caps[j+1],
- sizeof(*sec_cap));
+ memcpy(&sec_caps[j], &sec_caps[j + 1],
+ sizeof(*sec_cap));
rte_memcpy(&sec_crypto_caps[j][0],
&sec_crypto_caps[j+1][0],
diff --git a/drivers/crypto/scheduler/scheduler_failover.c b/drivers/crypto/scheduler/scheduler_failover.c
index 52ff2ffbb7..e7c6d19d25 100644
--- a/drivers/crypto/scheduler/scheduler_failover.c
+++ b/drivers/crypto/scheduler/scheduler_failover.c
@@ -171,12 +171,12 @@ scheduler_start(struct rte_cryptodev *dev)
sched_ctx->workers[PRIMARY_WORKER_IDX].qp_id = i;
sched_ctx->workers[SECONDARY_WORKER_IDX].qp_id = i;
- rte_memcpy(&qp_ctx->primary_worker,
- &sched_ctx->workers[PRIMARY_WORKER_IDX],
- sizeof(struct scheduler_worker));
- rte_memcpy(&qp_ctx->secondary_worker,
- &sched_ctx->workers[SECONDARY_WORKER_IDX],
- sizeof(struct scheduler_worker));
+ memcpy(&qp_ctx->primary_worker,
+ &sched_ctx->workers[PRIMARY_WORKER_IDX],
+ sizeof(struct scheduler_worker));
+ memcpy(&qp_ctx->secondary_worker,
+ &sched_ctx->workers[SECONDARY_WORKER_IDX],
+ sizeof(struct scheduler_worker));
}
return 0;
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 21/30] event: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (19 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 20/30] " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 22/30] mempool: " Stephen Hemminger
` (10 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Pavan Nikhilesh, Shijith Thotton,
Abdullah Sevincer, Hemant Agrawal, Sachin Saxena, Jerin Jacob
Automatically generated by devtools/cocci/rte_memcpy.cocci
Also, remove unnecessary includes of rte_memcpy.h
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/event/cnxk/cnxk_eventdev_selftest.c | 1 -
drivers/event/cnxk/cnxk_tim_evdev.c | 4 ++--
drivers/event/dlb2/dlb2.c | 4 ++--
drivers/event/dpaa/dpaa_eventdev.c | 1 -
drivers/event/dpaa2/dpaa2_eventdev.c | 7 +++----
drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 1 -
drivers/event/dpaa2/dpaa2_hw_dpcon.c | 1 -
drivers/event/octeontx/ssovf_evdev_selftest.c | 1 -
drivers/event/octeontx/timvf_evdev.c | 4 ++--
9 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/drivers/event/cnxk/cnxk_eventdev_selftest.c b/drivers/event/cnxk/cnxk_eventdev_selftest.c
index 95c0f1b1f7..620f2a0d67 100644
--- a/drivers/event/cnxk/cnxk_eventdev_selftest.c
+++ b/drivers/event/cnxk/cnxk_eventdev_selftest.c
@@ -13,7 +13,6 @@
#include <rte_lcore.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
-#include <rte_memcpy.h>
#include <rte_per_lcore.h>
#include <rte_random.h>
#include <rte_test.h>
diff --git a/drivers/event/cnxk/cnxk_tim_evdev.c b/drivers/event/cnxk/cnxk_tim_evdev.c
index 6d59fdf909..2027c4644c 100644
--- a/drivers/event/cnxk/cnxk_tim_evdev.c
+++ b/drivers/event/cnxk/cnxk_tim_evdev.c
@@ -115,8 +115,8 @@ cnxk_tim_ring_info_get(const struct rte_event_timer_adapter *adptr,
adptr_info->min_resolution_ns = tim_ring->ena_periodic ?
tim_ring->max_tout :
tim_ring->tck_nsec;
- rte_memcpy(&adptr_info->conf, &adptr->data->conf,
- sizeof(struct rte_event_timer_adapter_conf));
+ memcpy(&adptr_info->conf, &adptr->data->conf,
+ sizeof(struct rte_event_timer_adapter_conf));
}
static int
diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c
index 628ddef649..e38b11f397 100644
--- a/drivers/event/dlb2/dlb2.c
+++ b/drivers/event/dlb2/dlb2.c
@@ -1668,7 +1668,7 @@ dlb2_hw_create_ldb_port(struct dlb2_eventdev *dlb2,
qm_port->issued_releases = 0;
/* Save config message too. */
- rte_memcpy(&qm_port->cfg.ldb, &cfg, sizeof(qm_port->cfg.ldb));
+ memcpy(&qm_port->cfg.ldb, &cfg, sizeof(qm_port->cfg.ldb));
/* update state */
qm_port->state = PORT_STARTED; /* enabled at create time */
@@ -1869,7 +1869,7 @@ dlb2_hw_create_dir_port(struct dlb2_eventdev *dlb2,
qm_port->issued_releases = 0;
/* Save config message too. */
- rte_memcpy(&qm_port->cfg.dir, &cfg, sizeof(qm_port->cfg.dir));
+ memcpy(&qm_port->cfg.dir, &cfg, sizeof(qm_port->cfg.dir));
/* update state */
qm_port->state = PORT_STARTED; /* enabled at create time */
diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c
index 919e922298..0d72fa7864 100644
--- a/drivers/event/dpaa/dpaa_eventdev.c
+++ b/drivers/event/dpaa/dpaa_eventdev.c
@@ -19,7 +19,6 @@
#include <rte_lcore.h>
#include <rte_log.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_memory.h>
#include <rte_memzone.h>
#include <rte_pci.h>
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 1273455673..490598cbc9 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -20,7 +20,6 @@
#include <rte_lcore.h>
#include <rte_log.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_memory.h>
#include <rte_pci.h>
#include <bus_vdev_driver.h>
@@ -159,7 +158,7 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[],
"Unable to allocate event object");
goto send_partial;
}
- rte_memcpy(ev_temp, event, sizeof(struct rte_event));
+ memcpy(ev_temp, event, sizeof(struct rte_event));
DPAA2_SET_FD_ADDR((&fd_arr[loop]), (size_t)ev_temp);
DPAA2_SET_FD_LEN((&fd_arr[loop]),
sizeof(struct rte_event));
@@ -230,7 +229,7 @@ static void dpaa2_eventdev_process_parallel(struct qbman_swp *swp,
RTE_SET_USED(rxq);
- rte_memcpy(ev, ev_temp, sizeof(struct rte_event));
+ memcpy(ev, ev_temp, sizeof(struct rte_event));
rte_free(ev_temp);
qbman_swp_dqrr_consume(swp, dq);
@@ -249,7 +248,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp,
RTE_SET_USED(swp);
RTE_SET_USED(rxq);
- rte_memcpy(ev, ev_temp, sizeof(struct rte_event));
+ memcpy(ev, ev_temp, sizeof(struct rte_event));
rte_free(ev_temp);
*dpaa2_seqn(ev->mbuf) = dqrr_index + 1;
DPAA2_PER_LCORE_DQRR_SIZE++;
diff --git a/drivers/event/dpaa2/dpaa2_eventdev_selftest.c b/drivers/event/dpaa2/dpaa2_eventdev_selftest.c
index 9d4938efe6..8a9a14f628 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev_selftest.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev_selftest.c
@@ -12,7 +12,6 @@
#include <rte_hexdump.h>
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_launch.h>
#include <rte_lcore.h>
#include <rte_per_lcore.h>
diff --git a/drivers/event/dpaa2/dpaa2_hw_dpcon.c b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
index a68d3ac154..e07b473413 100644
--- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c
+++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c
@@ -13,7 +13,6 @@
#include <errno.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <rte_cycles.h>
#include <rte_kvargs.h>
diff --git a/drivers/event/octeontx/ssovf_evdev_selftest.c b/drivers/event/octeontx/ssovf_evdev_selftest.c
index b54ae126d2..c0a0c789de 100644
--- a/drivers/event/octeontx/ssovf_evdev_selftest.c
+++ b/drivers/event/octeontx/ssovf_evdev_selftest.c
@@ -14,7 +14,6 @@
#include <rte_hexdump.h>
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_launch.h>
#include <rte_lcore.h>
#include <rte_per_lcore.h>
diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c
index 090b3ed183..6409d6d161 100644
--- a/drivers/event/octeontx/timvf_evdev.c
+++ b/drivers/event/octeontx/timvf_evdev.c
@@ -42,8 +42,8 @@ timvf_ring_info_get(const struct rte_event_timer_adapter *adptr,
struct timvf_ring *timr = adptr->data->adapter_priv;
adptr_info->max_tmo_ns = timr->max_tout;
adptr_info->min_resolution_ns = timr->tck_nsec;
- rte_memcpy(&adptr_info->conf, &adptr->data->conf,
- sizeof(struct rte_event_timer_adapter_conf));
+ memcpy(&adptr_info->conf, &adptr->data->conf,
+ sizeof(struct rte_event_timer_adapter_conf));
}
static int
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 22/30] mempool: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (20 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 21/30] event: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 23/30] ml/cnxk: " Stephen Hemminger
` (9 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/mempool/dpaa/dpaa_mempool.c | 4 ++--
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 5 ++---
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c
index 0b484b3d9c..f72b51b472 100644
--- a/drivers/mempool/dpaa/dpaa_mempool.c
+++ b/drivers/mempool/dpaa/dpaa_mempool.c
@@ -115,8 +115,8 @@ dpaa_mbuf_create_pool(struct rte_mempool *mp)
return -ENOMEM;
}
- rte_memcpy(bp_info, (void *)&rte_dpaa_bpid_info[bpid],
- sizeof(struct dpaa_bp_info));
+ memcpy(bp_info, (void *)&rte_dpaa_bpid_info[bpid],
+ sizeof(struct dpaa_bp_info));
mp->pool_data = (void *)bp_info;
DPAA_MEMPOOL_INFO("BMAN pool created for bpid =%d", bpid);
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 4c9245cb81..c711de30e8 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -16,7 +16,6 @@
#include <rte_mbuf.h>
#include <ethdev_driver.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_string_fns.h>
#include <rte_cycles.h>
#include <rte_kvargs.h>
@@ -125,8 +124,8 @@ rte_hw_mbuf_create_pool(struct rte_mempool *mp)
rte_dpaa2_bpid_info[bpid].bp_list = bp_list;
rte_dpaa2_bpid_info[bpid].bpid = bpid;
- rte_memcpy(bp_info, (void *)&rte_dpaa2_bpid_info[bpid],
- sizeof(struct dpaa2_bp_info));
+ memcpy(bp_info, (void *)&rte_dpaa2_bpid_info[bpid],
+ sizeof(struct dpaa2_bp_info));
mp->pool_data = (void *)bp_info;
DPAA2_MEMPOOL_DEBUG("BP List created for bpid =%d", dpbp_attr.bpid);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 23/30] ml/cnxk: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (21 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 22/30] mempool: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 24/30] app/test-pmd: " Stephen Hemminger
` (8 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Srikanth Yalavarthi
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/ml/cnxk/cn10k_ml_model.c | 8 +++++---
drivers/ml/cnxk/cn10k_ml_ops.c | 11 +++++++----
drivers/ml/cnxk/cnxk_ml_ops.c | 2 +-
drivers/ml/cnxk/mvtvm_ml_model.c | 8 +++++---
drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +++++---
5 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/drivers/ml/cnxk/cn10k_ml_model.c b/drivers/ml/cnxk/cn10k_ml_model.c
index 0325cd54f1..4e39a584fa 100644
--- a/drivers/ml/cnxk/cn10k_ml_model.c
+++ b/drivers/ml/cnxk/cn10k_ml_model.c
@@ -560,7 +560,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]);
@@ -579,7 +579,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;
@@ -590,7 +591,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 834e55e88e..e53ada7b1c 100644
--- a/drivers/ml/cnxk/cn10k_ml_ops.c
+++ b/drivers/ml/cnxk/cn10k_ml_ops.c
@@ -668,11 +668,13 @@ 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);
/* Set layer name */
- rte_memcpy(layer->name, layer->glow.metadata.model.name, MRVL_ML_MODEL_NAME_LEN);
+ memcpy(layer->name, layer->glow.metadata.model.name,
+ MRVL_ML_MODEL_NAME_LEN);
/* Enable support for batch_size of 256 */
if (layer->glow.metadata.model.batch_size == 0)
@@ -748,11 +750,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/cnxk_ml_ops.c b/drivers/ml/cnxk/cnxk_ml_ops.c
index 971362b242..f9d0f50e1f 100644
--- a/drivers/ml/cnxk/cnxk_ml_ops.c
+++ b/drivers/ml/cnxk/cnxk_ml_ops.c
@@ -1400,7 +1400,7 @@ cnxk_ml_model_info_get(struct rte_ml_dev *dev, uint16_t model_id,
}
info = (struct rte_ml_model_info *)model->info;
- rte_memcpy(model_info, info, sizeof(struct rte_ml_model_info));
+ memcpy(model_info, info, sizeof(struct rte_ml_model_info));
model_info->input_info = info->input_info;
model_info->output_info = info->output_info;
diff --git a/drivers/ml/cnxk/mvtvm_ml_model.c b/drivers/ml/cnxk/mvtvm_ml_model.c
index e3234ae442..99b4774a2e 100644
--- a/drivers/ml/cnxk/mvtvm_ml_model.c
+++ b/drivers/ml/cnxk/mvtvm_ml_model.c
@@ -310,7 +310,7 @@ mvtvm_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo
goto tvm_mrvl_model;
metadata = &model->mvtvm.metadata;
- rte_memcpy(info->name, metadata->model.name, TVMDP_NAME_STRLEN);
+ memcpy(info->name, metadata->model.name, TVMDP_NAME_STRLEN);
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]);
@@ -327,7 +327,8 @@ mvtvm_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, metadata->input[i].name, MRVL_ML_INPUT_NAME_LEN);
+ memcpy(input[i].name, metadata->input[i].name,
+ MRVL_ML_INPUT_NAME_LEN);
input[i].nb_dims = metadata->input[i].ndim;
input[i].shape = &model->mvtvm.info.input[i].shape[0];
input[i].type = model->mvtvm.info.input[i].qtype;
@@ -338,7 +339,8 @@ mvtvm_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, metadata->output[i].name, MRVL_ML_OUTPUT_NAME_LEN);
+ memcpy(output[i].name, metadata->output[i].name,
+ MRVL_ML_OUTPUT_NAME_LEN);
output[i].nb_dims = metadata->output[i].ndim;
output[i].shape = &model->mvtvm.info.output[i].shape[0];
output[i].type = model->mvtvm.info.output[i].qtype;
diff --git a/drivers/ml/cnxk/mvtvm_ml_ops.c b/drivers/ml/cnxk/mvtvm_ml_ops.c
index e825c3fb23..fca7e0c3c0 100644
--- a/drivers/ml/cnxk/mvtvm_ml_ops.c
+++ b/drivers/ml/cnxk/mvtvm_ml_ops.c
@@ -194,7 +194,7 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *
/* Copy mod.so */
model->mvtvm.object.so.addr = mz->addr;
model->mvtvm.object.so.size = object[0].size;
- rte_memcpy(model->mvtvm.object.so.name, object[0].name, TVMDP_NAME_STRLEN);
+ memcpy(model->mvtvm.object.so.name, object[0].name, TVMDP_NAME_STRLEN);
rte_memcpy(model->mvtvm.object.so.addr, object[0].buffer, object[0].size);
rte_free(object[0].buffer);
@@ -203,7 +203,8 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *
RTE_PTR_ADD(model->mvtvm.object.so.addr,
RTE_ALIGN_CEIL(model->mvtvm.object.so.size, RTE_CACHE_LINE_MIN_SIZE));
model->mvtvm.object.json.size = object[1].size;
- rte_memcpy(model->mvtvm.object.json.name, object[1].name, TVMDP_NAME_STRLEN);
+ memcpy(model->mvtvm.object.json.name, object[1].name,
+ TVMDP_NAME_STRLEN);
rte_memcpy(model->mvtvm.object.json.addr, object[1].buffer, object[1].size);
rte_free(object[1].buffer);
@@ -212,7 +213,8 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *
RTE_PTR_ADD(model->mvtvm.object.json.addr,
RTE_ALIGN_CEIL(model->mvtvm.object.json.size, RTE_CACHE_LINE_MIN_SIZE));
model->mvtvm.object.params.size = object[2].size;
- rte_memcpy(model->mvtvm.object.params.name, object[2].name, TVMDP_NAME_STRLEN);
+ memcpy(model->mvtvm.object.params.name, object[2].name,
+ TVMDP_NAME_STRLEN);
rte_memcpy(model->mvtvm.object.params.addr, object[2].buffer, object[2].size);
rte_free(object[2].buffer);
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 24/30] app/test-pmd: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (22 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 23/30] ml/cnxk: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 25/30] app/graph: " Stephen Hemminger
` (7 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Aman Singh, Yuying Zhang, Ori Kam
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-pmd/cmdline.c | 48 ++++++++++++++++++-------------------
app/test-pmd/cmdline_flow.c | 24 +++++++++----------
app/test-pmd/config.c | 8 +++----
app/test-pmd/csumonly.c | 1 -
app/test-pmd/flowgen.c | 1 -
app/test-pmd/iofwd.c | 1 -
app/test-pmd/macfwd.c | 1 -
app/test-pmd/macswap.c | 1 -
app/test-pmd/noisy_vnf.c | 1 -
app/test-pmd/rxonly.c | 1 -
app/test-pmd/testpmd.c | 1 -
11 files changed, 40 insertions(+), 48 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index b7759e38a8..5e0740348a 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -9534,7 +9534,7 @@ static void cmd_set_vxlan_parsed(void *parsed_result,
vxlan_encap_conf.select_ipv4 = 0;
else
return;
- rte_memcpy(vxlan_encap_conf.vni, &id.vni[1], 3);
+ memcpy(vxlan_encap_conf.vni, &id.vni[1], 3);
vxlan_encap_conf.udp_src = rte_cpu_to_be_16(res->udp_src);
vxlan_encap_conf.udp_dst = rte_cpu_to_be_16(res->udp_dst);
vxlan_encap_conf.ip_tos = res->tos;
@@ -9548,10 +9548,10 @@ static void cmd_set_vxlan_parsed(void *parsed_result,
}
if (vxlan_encap_conf.select_vlan)
vxlan_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
- rte_memcpy(vxlan_encap_conf.eth_src, res->eth_src.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- rte_memcpy(vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(vxlan_encap_conf.eth_src, res->eth_src.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
}
static cmdline_parse_inst_t cmd_set_vxlan = {
@@ -9729,7 +9729,7 @@ static void cmd_set_nvgre_parsed(void *parsed_result,
nvgre_encap_conf.select_ipv4 = 0;
else
return;
- rte_memcpy(nvgre_encap_conf.tni, &id.tni[1], 3);
+ memcpy(nvgre_encap_conf.tni, &id.tni[1], 3);
if (nvgre_encap_conf.select_ipv4) {
IPV4_ADDR_TO_UINT(res->ip_src, nvgre_encap_conf.ipv4_src);
IPV4_ADDR_TO_UINT(res->ip_dst, nvgre_encap_conf.ipv4_dst);
@@ -9739,10 +9739,10 @@ static void cmd_set_nvgre_parsed(void *parsed_result,
}
if (nvgre_encap_conf.select_vlan)
nvgre_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
- rte_memcpy(nvgre_encap_conf.eth_src, res->eth_src.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- rte_memcpy(nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(nvgre_encap_conf.eth_src, res->eth_src.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
}
static cmdline_parse_inst_t cmd_set_nvgre = {
@@ -9856,10 +9856,10 @@ static void cmd_set_l2_encap_parsed(void *parsed_result,
return;
if (l2_encap_conf.select_vlan)
l2_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
- rte_memcpy(l2_encap_conf.eth_src, res->eth_src.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- rte_memcpy(l2_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(l2_encap_conf.eth_src, res->eth_src.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(l2_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
}
static cmdline_parse_inst_t cmd_set_l2_encap = {
@@ -10038,7 +10038,7 @@ static void cmd_set_mplsogre_encap_parsed(void *parsed_result,
mplsogre_encap_conf.select_ipv4 = 0;
else
return;
- rte_memcpy(mplsogre_encap_conf.label, &id.label, 3);
+ memcpy(mplsogre_encap_conf.label, &id.label, 3);
if (mplsogre_encap_conf.select_ipv4) {
IPV4_ADDR_TO_UINT(res->ip_src, mplsogre_encap_conf.ipv4_src);
IPV4_ADDR_TO_UINT(res->ip_dst, mplsogre_encap_conf.ipv4_dst);
@@ -10048,10 +10048,10 @@ static void cmd_set_mplsogre_encap_parsed(void *parsed_result,
}
if (mplsogre_encap_conf.select_vlan)
mplsogre_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
- rte_memcpy(mplsogre_encap_conf.eth_src, res->eth_src.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- rte_memcpy(mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(mplsogre_encap_conf.eth_src, res->eth_src.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
}
static cmdline_parse_inst_t cmd_set_mplsogre_encap = {
@@ -10274,7 +10274,7 @@ static void cmd_set_mplsoudp_encap_parsed(void *parsed_result,
mplsoudp_encap_conf.select_ipv4 = 0;
else
return;
- rte_memcpy(mplsoudp_encap_conf.label, &id.label, 3);
+ memcpy(mplsoudp_encap_conf.label, &id.label, 3);
mplsoudp_encap_conf.udp_src = rte_cpu_to_be_16(res->udp_src);
mplsoudp_encap_conf.udp_dst = rte_cpu_to_be_16(res->udp_dst);
if (mplsoudp_encap_conf.select_ipv4) {
@@ -10286,10 +10286,10 @@ static void cmd_set_mplsoudp_encap_parsed(void *parsed_result,
}
if (mplsoudp_encap_conf.select_vlan)
mplsoudp_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
- rte_memcpy(mplsoudp_encap_conf.eth_src, res->eth_src.addr_bytes,
- RTE_ETHER_ADDR_LEN);
- rte_memcpy(mplsoudp_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- RTE_ETHER_ADDR_LEN);
+ memcpy(mplsoudp_encap_conf.eth_src, res->eth_src.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
+ memcpy(mplsoudp_encap_conf.eth_dst, res->eth_dst.addr_bytes,
+ RTE_ETHER_ADDR_LEN);
}
static cmdline_parse_inst_t cmd_set_mplsoudp_encap = {
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 60ee9337cf..95d9133ecb 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -13768,7 +13768,7 @@ cmd_set_raw_parsed_sample(const struct buffer *in)
fprintf(stderr, "Error - Not supported action\n");
return;
}
- rte_memcpy(data, action, sizeof(struct rte_flow_action));
+ memcpy(data, action, sizeof(struct rte_flow_action));
data++;
}
}
@@ -13929,8 +13929,8 @@ cmd_set_raw_parsed(const struct buffer *in)
/* We have to add GTP header extra word. */
*total_size += sizeof(ext_word);
- rte_memcpy(data_tail - (*total_size),
- &ext_word, sizeof(ext_word));
+ memcpy(data_tail - (*total_size), &ext_word,
+ sizeof(ext_word));
}
size = sizeof(struct rte_gtp_hdr);
break;
@@ -13975,21 +13975,21 @@ cmd_set_raw_parsed(const struct buffer *in)
if (opt->checksum_rsvd.checksum) {
*total_size +=
sizeof(opt->checksum_rsvd);
- rte_memcpy(data_tail - (*total_size),
- &opt->checksum_rsvd,
- sizeof(opt->checksum_rsvd));
+ memcpy(data_tail - (*total_size),
+ &opt->checksum_rsvd,
+ sizeof(opt->checksum_rsvd));
}
if (opt->key.key) {
*total_size += sizeof(opt->key.key);
- rte_memcpy(data_tail - (*total_size),
- &opt->key.key,
- sizeof(opt->key.key));
+ memcpy(data_tail - (*total_size),
+ &opt->key.key,
+ sizeof(opt->key.key));
}
if (opt->sequence.sequence) {
*total_size += sizeof(opt->sequence.sequence);
- rte_memcpy(data_tail - (*total_size),
- &opt->sequence.sequence,
- sizeof(opt->sequence.sequence));
+ memcpy(data_tail - (*total_size),
+ &opt->sequence.sequence,
+ sizeof(opt->sequence.sequence));
}
}
proto = 0x2F;
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index ba1007ace6..8b201f2104 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2639,8 +2639,8 @@ port_flow_template_table_create(portid_t port_id, uint32_t id,
}
pt->nb_pattern_templates = nb_pattern_templates;
pt->nb_actions_templates = nb_actions_templates;
- rte_memcpy(&pt->flow_attr, &table_attr->flow_attr,
- sizeof(struct rte_flow_attr));
+ memcpy(&pt->flow_attr, &table_attr->flow_attr,
+ sizeof(struct rte_flow_attr));
printf("Template table #%u created\n", pt->id);
return 0;
}
@@ -3259,8 +3259,8 @@ port_queue_action_handle_update(portid_t port_id,
update = action->conf;
break;
case RTE_FLOW_ACTION_TYPE_METER_MARK:
- rte_memcpy(&mtr_update.meter_mark, action->conf,
- sizeof(struct rte_flow_action_meter_mark));
+ memcpy(&mtr_update.meter_mark, action->conf,
+ sizeof(struct rte_flow_action_meter_mark));
if (mtr_update.meter_mark.profile)
mtr_update.profile_valid = 1;
if (mtr_update.meter_mark.policy)
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 6711dda42e..0db26902a1 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -19,7 +19,6 @@
#include <rte_debug.h>
#include <rte_cycles.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c
index 53b5f24f11..d9454a4d22 100644
--- a/app/test-pmd/flowgen.c
+++ b/app/test-pmd/flowgen.c
@@ -19,7 +19,6 @@
#include <rte_debug.h>
#include <rte_cycles.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
diff --git a/app/test-pmd/iofwd.c b/app/test-pmd/iofwd.c
index ba06fae4a6..c9727d2856 100644
--- a/app/test-pmd/iofwd.c
+++ b/app/test-pmd/iofwd.c
@@ -24,7 +24,6 @@
#include <rte_per_lcore.h>
#include <rte_lcore.h>
#include <rte_branch_prediction.h>
-#include <rte_memcpy.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_interrupts.h>
diff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c
index d19ace7395..ba63aedd79 100644
--- a/app/test-pmd/macfwd.c
+++ b/app/test-pmd/macfwd.c
@@ -19,7 +19,6 @@
#include <rte_debug.h>
#include <rte_cycles.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
diff --git a/app/test-pmd/macswap.c b/app/test-pmd/macswap.c
index 57f77003fe..e1f9be4901 100644
--- a/app/test-pmd/macswap.c
+++ b/app/test-pmd/macswap.c
@@ -19,7 +19,6 @@
#include <rte_debug.h>
#include <rte_cycles.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
diff --git a/app/test-pmd/noisy_vnf.c b/app/test-pmd/noisy_vnf.c
index 81d1187cfe..cf951e9532 100644
--- a/app/test-pmd/noisy_vnf.c
+++ b/app/test-pmd/noisy_vnf.c
@@ -24,7 +24,6 @@
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
-#include <rte_memcpy.h>
#include <rte_mempool.h>
#include <rte_mbuf.h>
#include <rte_ethdev.h>
diff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c
index 315f9286cd..cc73cf4ebf 100644
--- a/app/test-pmd/rxonly.c
+++ b/app/test-pmd/rxonly.c
@@ -19,7 +19,6 @@
#include <rte_debug.h>
#include <rte_cycles.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 70ea257fda..9dd3ffa850 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -30,7 +30,6 @@
#include <rte_debug.h>
#include <rte_cycles.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_launch.h>
#include <rte_bus.h>
#include <rte_eal.h>
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 25/30] app/graph: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (23 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 24/30] app/test-pmd: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 26/30] app/test-eventdev: " Stephen Hemminger
` (6 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Sunil Kumar Kori, Rakesh Kudurumalla
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/graph/neigh.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/graph/neigh.c b/app/graph/neigh.c
index 79fd542c89..77f0766133 100644
--- a/app/graph/neigh.c
+++ b/app/graph/neigh.c
@@ -91,14 +91,14 @@ ip6_rewrite_node_add(struct neigh_ipv6_config *v6_config)
memset(data, 0, len);
/* Copy dst mac */
- rte_memcpy((void *)&data[0], (void *)&v6_config->mac, RTE_ETHER_ADDR_LEN);
+ memcpy((void *)&data[0], (void *)&v6_config->mac, RTE_ETHER_ADDR_LEN);
/* Copy src mac */
rc = rte_eth_macaddr_get(portid, &smac);
if (rc < 0)
return rc;
- rte_memcpy(&data[RTE_ETHER_ADDR_LEN], smac.addr_bytes, RTE_ETHER_ADDR_LEN);
+ memcpy(&data[RTE_ETHER_ADDR_LEN], smac.addr_bytes, RTE_ETHER_ADDR_LEN);
return rte_node_ip6_rewrite_add(portid, data, len, portid);
}
@@ -121,7 +121,7 @@ ip4_rewrite_node_add(struct neigh_ipv4_config *v4_config)
memset(data, 0, len);
/* Copy dst mac */
- rte_memcpy((void *)&data[0], (void *)&v4_config->mac, RTE_ETHER_ADDR_LEN);
+ memcpy((void *)&data[0], (void *)&v4_config->mac, RTE_ETHER_ADDR_LEN);
/* Copy src mac */
rc = rte_eth_macaddr_get(portid, &smac);
@@ -130,7 +130,7 @@ ip4_rewrite_node_add(struct neigh_ipv4_config *v4_config)
return rc;
}
- rte_memcpy(&data[RTE_ETHER_ADDR_LEN], smac.addr_bytes, RTE_ETHER_ADDR_LEN);
+ memcpy(&data[RTE_ETHER_ADDR_LEN], smac.addr_bytes, RTE_ETHER_ADDR_LEN);
return rte_node_ip4_rewrite_add(portid, data, len, portid);
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 26/30] app/test-eventdev: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (24 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 25/30] app/graph: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 27/30] app/test: " Stephen Hemminger
` (5 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Jerin Jacob
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-eventdev/test_pipeline_common.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
index b111690b7c..49bfd0c363 100644
--- a/app/test-eventdev/test_pipeline_common.c
+++ b/app/test-eventdev/test_pipeline_common.c
@@ -177,22 +177,17 @@ pipeline_tx_first(struct test_pipeline *t, struct evt_options *opt)
mbuf->pkt_len = pkt_sz;
/* Copy Ethernet header */
- rte_memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, 0),
- ð_hdr, sizeof(struct rte_ether_hdr));
+ memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, 0),
+ ð_hdr, sizeof(struct rte_ether_hdr));
/* Copy Ipv4 header */
- rte_memcpy(rte_pktmbuf_mtod_offset(
- mbuf, char *,
- sizeof(struct rte_ether_hdr)),
- &ip_hdr, sizeof(struct rte_ipv4_hdr));
+ memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, sizeof(struct rte_ether_hdr)),
+ &ip_hdr, sizeof(struct rte_ipv4_hdr));
/* Copy UDP header */
- rte_memcpy(
- rte_pktmbuf_mtod_offset(
- mbuf, char *,
- sizeof(struct rte_ipv4_hdr) +
- sizeof(struct rte_ether_hdr)),
- &udp_hdr, sizeof(struct rte_udp_hdr));
+ memcpy(rte_pktmbuf_mtod_offset(mbuf, char *, sizeof(struct rte_ipv4_hdr)
+ + sizeof(struct rte_ether_hdr)),
+ &udp_hdr, sizeof(struct rte_udp_hdr));
pkt_udp_hdr = rte_pktmbuf_mtod_offset(
mbuf, struct rte_udp_hdr *,
sizeof(struct rte_ipv4_hdr) +
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 27/30] app/test: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (25 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 26/30] app/test-eventdev: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 28/30] app/test-pipeline: remove unused rte_memcpy.h include Stephen Hemminger
` (4 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Jasvinder Singh, Akhil Goyal, Fan Zhang,
Byron Marohn, Yipeng Wang, Abhinandan Gujjar,
Amit Prakash Shukla, Jerin Jacob, Konstantin Ananyev,
Vladimir Medvedkin, Chas Williams, Min Hu (Connor),
Sameh Gobriel, Sachin Saxena, Hemant Agrawal, Anoob Joseph,
Harry van Haaren
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test/commands.c | 1 -
app/test/packet_burst_generator.c | 4 +--
app/test/test_crc.c | 5 ++--
app/test/test_cryptodev.c | 18 ++++++-------
app/test/test_cryptodev_asym.c | 1 -
app/test/test_cryptodev_security_pdcp.c | 1 -
app/test/test_efd.c | 1 -
app/test/test_efd_perf.c | 1 -
app/test/test_event_crypto_adapter.c | 12 ++++-----
app/test/test_event_dma_adapter.c | 4 +--
app/test/test_eventdev.c | 1 -
app/test/test_ipsec.c | 6 ++---
app/test/test_link_bonding_mode4.c | 8 +++---
app/test/test_mbuf.c | 1 -
app/test/test_member.c | 1 -
app/test/test_member_perf.c | 1 -
app/test/test_rawdev.c | 1 -
app/test/test_security_inline_proto.c | 36 ++++++++++++-------------
app/test/test_service_cores.c | 1 -
app/test/virtual_pmd.c | 3 +--
20 files changed, 46 insertions(+), 61 deletions(-)
diff --git a/app/test/commands.c b/app/test/commands.c
index 497d8e9952..74494a0ef4 100644
--- a/app/test/commands.c
+++ b/app/test/commands.c
@@ -16,7 +16,6 @@
#include <rte_log.h>
#include <rte_debug.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_launch.h>
#include <rte_cycles.h>
diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c
index 867a88da00..fcca2d238e 100644
--- a/app/test/packet_burst_generator.c
+++ b/app/test/packet_burst_generator.c
@@ -148,8 +148,8 @@ initialize_ipv6_header(struct rte_ipv6_hdr *ip_hdr, uint8_t *src_addr,
ip_hdr->proto = IPPROTO_UDP;
ip_hdr->hop_limits = IP_DEFTTL;
- rte_memcpy(ip_hdr->src_addr, src_addr, sizeof(ip_hdr->src_addr));
- rte_memcpy(ip_hdr->dst_addr, dst_addr, sizeof(ip_hdr->dst_addr));
+ memcpy(ip_hdr->src_addr, src_addr, sizeof(ip_hdr->src_addr));
+ memcpy(ip_hdr->dst_addr, dst_addr, sizeof(ip_hdr->dst_addr));
return (uint16_t) (pkt_data_len + sizeof(struct rte_ipv6_hdr));
}
diff --git a/app/test/test_crc.c b/app/test/test_crc.c
index b85fca35fe..30fe004506 100644
--- a/app/test/test_crc.c
+++ b/app/test/test_crc.c
@@ -6,7 +6,6 @@
#include <rte_hexdump.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_net_crc.h>
#define CRC_VEC_LEN 32
@@ -83,7 +82,7 @@ test_crc_calc(void)
return -7;
for (i = 0; i < CRC32_VEC_LEN1; i += 12)
- rte_memcpy(&test_data[i], crc32_vec1, 12);
+ memcpy(&test_data[i], crc32_vec1, 12);
result = crc_calc(test_data, CRC32_VEC_LEN1, type);
if (result != crc32_vec1_res) {
@@ -93,7 +92,7 @@ test_crc_calc(void)
/* 32-bit ethernet CRC: Test 3 */
for (i = 0; i < CRC32_VEC_LEN2; i += 12)
- rte_memcpy(&test_data[i], crc32_vec1, 12);
+ memcpy(&test_data[i], crc32_vec1, 12);
result = crc_calc(test_data, CRC32_VEC_LEN2, type);
if (result != crc32_vec2_res) {
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 1703ebccf1..97651cdb6c 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -2479,8 +2479,8 @@ test_AES_CBC_HMAC_SHA1_encrypt_digest(void)
sym_op->auth.data.length = QUOTE_512_BYTES;
/* Copy IV at the end of the crypto operation */
- rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET),
- aes_cbc_iv, CIPHER_IV_LENGTH_AES_CBC);
+ memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET),
+ aes_cbc_iv, CIPHER_IV_LENGTH_AES_CBC);
/* Set crypto operation cipher parameters */
sym_op->cipher.data.offset = 0;
@@ -2614,9 +2614,7 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(void *sess,
DIGEST_BYTE_LENGTH_SHA512);
TEST_ASSERT_NOT_NULL(ut_params->digest, "no room to append digest");
- rte_memcpy(ut_params->digest,
- digest,
- DIGEST_BYTE_LENGTH_SHA512);
+ memcpy(ut_params->digest, digest, DIGEST_BYTE_LENGTH_SHA512);
/* Generate Crypto op data structure */
ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
@@ -2639,8 +2637,8 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(void *sess,
sym_op->auth.data.length = QUOTE_512_BYTES;
/* Copy IV at the end of the crypto operation */
- rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET),
- iv, CIPHER_IV_LENGTH_AES_CBC);
+ memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET),
+ iv, CIPHER_IV_LENGTH_AES_CBC);
sym_op->cipher.data.offset = 0;
sym_op->cipher.data.length = QUOTE_512_BYTES;
@@ -8997,7 +8995,7 @@ create_aead_operation(enum rte_crypto_aead_operation op,
uint8_t *, IV_OFFSET);
if (tdata->iv.len == 0) {
- rte_memcpy(iv_ptr, tdata->iv.data, AES_GCM_J0_LENGTH);
+ memcpy(iv_ptr, tdata->iv.data, AES_GCM_J0_LENGTH);
debug_hexdump(stdout, "iv:", iv_ptr,
AES_GCM_J0_LENGTH);
} else {
@@ -14337,8 +14335,8 @@ test_multi_session_random_usage(void)
for (i = 0; i < MB_SESSION_NUMBER; i++) {
- rte_memcpy(&ut_paramz[i].ut_params, &unittest_params,
- sizeof(struct crypto_unittest_params));
+ memcpy(&ut_paramz[i].ut_params, &unittest_params,
+ sizeof(struct crypto_unittest_params));
test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
&ut_paramz[i].ut_params,
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 17daf734e8..88561a8f25 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -8,7 +8,6 @@
#include <rte_hexdump.h>
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_pause.h>
#include <rte_cryptodev.h>
diff --git a/app/test/test_cryptodev_security_pdcp.c b/app/test/test_cryptodev_security_pdcp.c
index a7641bab7a..39926cbee3 100644
--- a/app/test/test_cryptodev_security_pdcp.c
+++ b/app/test/test_cryptodev_security_pdcp.c
@@ -10,7 +10,6 @@
#include <rte_hexdump.h>
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_pause.h>
#include <rte_bus_vdev.h>
#include <rte_byteorder.h>
diff --git a/app/test/test_efd.c b/app/test/test_efd.c
index 1c0986b9bc..306f851c52 100644
--- a/app/test/test_efd.c
+++ b/app/test/test_efd.c
@@ -13,7 +13,6 @@ test_efd(void)
#else
-#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_efd.h>
#include <rte_byteorder.h>
diff --git a/app/test/test_efd_perf.c b/app/test/test_efd_perf.c
index b212e96767..7f5a8b9a56 100644
--- a/app/test/test_efd_perf.c
+++ b/app/test/test_efd_perf.c
@@ -22,7 +22,6 @@ test_efd_perf(void)
#include <rte_malloc.h>
#include <rte_random.h>
#include <rte_efd.h>
-#include <rte_memcpy.h>
#include <rte_thash.h>
#define NUM_KEYSIZES 10
diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 0c56744ba0..4992c5bc50 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -454,7 +454,7 @@ test_op_forward_mode(uint8_t session_less)
m_data.request_info.cdev_id = request_info.cdev_id;
m_data.request_info.queue_pair_id = request_info.queue_pair_id;
m_data.response_info.event = response_info.event;
- rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
+ memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
}
sym_op->m_src = m;
@@ -653,8 +653,8 @@ test_asym_op_forward_mode(uint8_t session_less)
m_data.request_info.cdev_id = request_info.cdev_id;
m_data.request_info.queue_pair_id = request_info.queue_pair_id;
m_data.response_info.event = response_info.event;
- rte_memcpy((uint8_t *)op + op->private_data_offset,
- &m_data, sizeof(m_data));
+ memcpy((uint8_t *)op + op->private_data_offset, &m_data,
+ sizeof(m_data));
}
/* Fill in event info and update event_ptr with rte_crypto_op */
memset(&ev, 0, sizeof(ev));
@@ -820,7 +820,7 @@ test_op_new_mode(uint8_t session_less)
op->private_data_offset = len;
/* Fill in private data information */
m_data.response_info.event = response_info.event;
- rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
+ memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
}
sym_op->m_src = m;
@@ -977,8 +977,8 @@ test_asym_op_new_mode(uint8_t session_less)
sizeof(struct rte_crypto_asym_xform));
/* Fill in private data information */
m_data.response_info.event = response_info.event;
- rte_memcpy((uint8_t *)op + op->private_data_offset,
- &m_data, sizeof(m_data));
+ memcpy((uint8_t *)op + op->private_data_offset, &m_data,
+ sizeof(m_data));
}
ret = send_op_recv_ev(op);
diff --git a/app/test/test_event_dma_adapter.c b/app/test/test_event_dma_adapter.c
index 35b417b69f..af2e44a703 100644
--- a/app/test/test_event_dma_adapter.c
+++ b/app/test/test_event_dma_adapter.c
@@ -269,8 +269,8 @@ test_op_forward_mode(void)
op->vchan = TEST_DMA_VCHAN_ID;
response_info.event = dma_response_info.event;
- rte_memcpy((uint8_t *)op + sizeof(struct rte_event_dma_adapter_op), &response_info,
- sizeof(struct rte_event));
+ memcpy((uint8_t *)op + sizeof(struct rte_event_dma_adapter_op),
+ &response_info, sizeof(struct rte_event));
/* Fill in event info and update event_ptr with rte_event_dma_adapter_op */
memset(&ev[i], 0, sizeof(struct rte_event));
diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c
index e4e234dc98..d2ae9b4930 100644
--- a/app/test/test_eventdev.c
+++ b/app/test/test_eventdev.c
@@ -8,7 +8,6 @@
#include <rte_hexdump.h>
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#ifdef RTE_EXEC_ENV_WINDOWS
static int
diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c
index 6cb1bac1e7..25aabdb616 100644
--- a/app/test/test_ipsec.c
+++ b/app/test/test_ipsec.c
@@ -601,10 +601,10 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string,
/* copy outer IP and ESP header */
ipv4_outer.total_length = rte_cpu_to_be_16(t_len);
ipv4_outer.packet_id = rte_cpu_to_be_16(seq);
- rte_memcpy(dst, &ipv4_outer, sizeof(ipv4_outer));
+ memcpy(dst, &ipv4_outer, sizeof(ipv4_outer));
dst += sizeof(ipv4_outer);
m->l3_len = sizeof(ipv4_outer);
- rte_memcpy(dst, &esph, sizeof(esph));
+ memcpy(dst, &esph, sizeof(esph));
dst += sizeof(esph);
if (string != NULL) {
@@ -616,7 +616,7 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string,
sizeof(esp_pad_bytes)));
dst += padlen;
/* copy ESP tail header */
- rte_memcpy(dst, &espt, sizeof(espt));
+ memcpy(dst, &espt, sizeof(espt));
} else
memset(dst, 0, t_len);
diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c
index ff13dbed93..e4827c1e80 100644
--- a/app/test/test_link_bonding_mode4.c
+++ b/app/test/test_link_bonding_mode4.c
@@ -1399,8 +1399,8 @@ test_mode4_ext_ctrl(void)
for (i = 0; i < MEMBER_COUNT; i++) {
lacp_tx_buf[i] = rte_pktmbuf_alloc(test_params.mbuf_pool);
- rte_memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *),
- &lacpdu, sizeof(lacpdu));
+ memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *), &lacpdu,
+ sizeof(lacpdu));
rte_pktmbuf_pkt_len(lacp_tx_buf[i]) = sizeof(lacpdu);
}
@@ -1453,8 +1453,8 @@ test_mode4_ext_lacp(void)
for (i = 0; i < MEMBER_COUNT; i++) {
lacp_tx_buf[i] = rte_pktmbuf_alloc(test_params.mbuf_pool);
- rte_memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *),
- &lacpdu, sizeof(lacpdu));
+ memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *), &lacpdu,
+ sizeof(lacpdu));
rte_pktmbuf_pkt_len(lacp_tx_buf[i]) = sizeof(lacpdu);
}
diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 17be977f31..e1fa5b0f7f 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -19,7 +19,6 @@
#include <rte_debug.h>
#include <rte_log.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_launch.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
diff --git a/app/test/test_member.c b/app/test/test_member.c
index 5a4d2750db..7281a644bd 100644
--- a/app/test/test_member.c
+++ b/app/test/test_member.c
@@ -7,7 +7,6 @@
#include <math.h>
#include "test.h"
-#include <rte_memcpy.h>
#include <rte_malloc.h>
#ifdef RTE_EXEC_ENV_WINDOWS
diff --git a/app/test/test_member_perf.c b/app/test/test_member_perf.c
index db6b8a18ef..f40fdba91e 100644
--- a/app/test/test_member_perf.c
+++ b/app/test/test_member_perf.c
@@ -11,7 +11,6 @@
#include <rte_cycles.h>
#include <rte_malloc.h>
#include <rte_random.h>
-#include <rte_memcpy.h>
#include <rte_thash.h>
#include <math.h>
diff --git a/app/test/test_rawdev.c b/app/test/test_rawdev.c
index d34691dacf..120e61dcc2 100644
--- a/app/test/test_rawdev.c
+++ b/app/test/test_rawdev.c
@@ -7,7 +7,6 @@
#include <rte_common.h>
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_dev.h>
#ifdef RTE_EXEC_ENV_WINDOWS
diff --git a/app/test/test_security_inline_proto.c b/app/test/test_security_inline_proto.c
index 10f7e58caa..03eaf29305 100644
--- a/app/test/test_security_inline_proto.c
+++ b/app/test/test_security_inline_proto.c
@@ -245,8 +245,8 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,
/* Copy cipher session parameters */
if (sa->aead) {
- rte_memcpy(sess_conf->crypto_xform, &sa->xform.aead,
- sizeof(struct rte_crypto_sym_xform));
+ memcpy(sess_conf->crypto_xform, &sa->xform.aead,
+ sizeof(struct rte_crypto_sym_xform));
sess_conf->crypto_xform->aead.key.data = sa->key.data;
/* Verify crypto capabilities */
if (test_sec_crypto_caps_aead_verify(sec_cap, sess_conf->crypto_xform) != 0) {
@@ -256,13 +256,13 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,
}
} else {
if (dir == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) {
- rte_memcpy(&sess_conf->crypto_xform->cipher,
- &sa->xform.chain.cipher.cipher,
- sizeof(struct rte_crypto_cipher_xform));
+ memcpy(&sess_conf->crypto_xform->cipher,
+ &sa->xform.chain.cipher.cipher,
+ sizeof(struct rte_crypto_cipher_xform));
- rte_memcpy(&sess_conf->crypto_xform->next->auth,
- &sa->xform.chain.auth.auth,
- sizeof(struct rte_crypto_auth_xform));
+ memcpy(&sess_conf->crypto_xform->next->auth,
+ &sa->xform.chain.auth.auth,
+ sizeof(struct rte_crypto_auth_xform));
sess_conf->crypto_xform->cipher.key.data =
sa->key.data;
sess_conf->crypto_xform->next->auth.key.data =
@@ -282,12 +282,12 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,
return TEST_SKIPPED;
}
} else {
- rte_memcpy(&sess_conf->crypto_xform->next->cipher,
- &sa->xform.chain.cipher.cipher,
- sizeof(struct rte_crypto_cipher_xform));
- rte_memcpy(&sess_conf->crypto_xform->auth,
- &sa->xform.chain.auth.auth,
- sizeof(struct rte_crypto_auth_xform));
+ memcpy(&sess_conf->crypto_xform->next->cipher,
+ &sa->xform.chain.cipher.cipher,
+ sizeof(struct rte_crypto_cipher_xform));
+ memcpy(&sess_conf->crypto_xform->auth,
+ &sa->xform.chain.auth.auth,
+ sizeof(struct rte_crypto_auth_xform));
sess_conf->crypto_xform->auth.key.data =
sa->auth_key.data;
sess_conf->crypto_xform->next->cipher.key.data =
@@ -463,12 +463,12 @@ init_packet(struct rte_mempool *mp, const uint8_t *data, unsigned int len, bool
return NULL;
if (outer_ipv4) {
- rte_memcpy(rte_pktmbuf_append(pkt, RTE_ETHER_HDR_LEN),
- &dummy_ipv4_eth_hdr, RTE_ETHER_HDR_LEN);
+ memcpy(rte_pktmbuf_append(pkt, RTE_ETHER_HDR_LEN),
+ &dummy_ipv4_eth_hdr, RTE_ETHER_HDR_LEN);
pkt->l3_len = sizeof(struct rte_ipv4_hdr);
} else {
- rte_memcpy(rte_pktmbuf_append(pkt, RTE_ETHER_HDR_LEN),
- &dummy_ipv6_eth_hdr, RTE_ETHER_HDR_LEN);
+ memcpy(rte_pktmbuf_append(pkt, RTE_ETHER_HDR_LEN),
+ &dummy_ipv6_eth_hdr, RTE_ETHER_HDR_LEN);
pkt->l3_len = sizeof(struct rte_ipv6_hdr);
}
pkt->l2_len = RTE_ETHER_HDR_LEN;
diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c
index c12d52d8f1..fb08821b87 100644
--- a/app/test/test_service_cores.c
+++ b/app/test/test_service_cores.c
@@ -6,7 +6,6 @@
#include <rte_hexdump.h>
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_cycles.h>
#include <rte_service.h>
diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
index b7d74a467a..ae48923df7 100644
--- a/app/test/virtual_pmd.c
+++ b/app/test/virtual_pmd.c
@@ -8,7 +8,6 @@
#include <rte_pci.h>
#include <bus_pci_driver.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_memory.h>
#include <rte_ring.h>
@@ -186,7 +185,7 @@ virtual_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
struct virtual_ethdev_private *dev_private = dev->data->dev_private;
if (stats)
- rte_memcpy(stats, &dev_private->eth_stats, sizeof(*stats));
+ memcpy(stats, &dev_private->eth_stats, sizeof(*stats));
return 0;
}
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 28/30] app/test-pipeline: remove unused rte_memcpy.h include
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (26 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 27/30] app/test: " Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 29/30] app/test-bbdev: remove unnecessary include of rte_memcpy.h Stephen Hemminger
` (3 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Cristian Dumitrescu
This included but never used here.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-pipeline/config.c | 1 -
app/test-pipeline/init.c | 1 -
app/test-pipeline/main.c | 1 -
app/test-pipeline/runtime.c | 1 -
4 files changed, 4 deletions(-)
diff --git a/app/test-pipeline/config.c b/app/test-pipeline/config.c
index daf838948b..f4d5d435ad 100644
--- a/app/test-pipeline/config.c
+++ b/app/test-pipeline/config.c
@@ -17,7 +17,6 @@
#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_launch.h>
diff --git a/app/test-pipeline/init.c b/app/test-pipeline/init.c
index 558f0e428d..8028192306 100644
--- a/app/test-pipeline/init.c
+++ b/app/test-pipeline/init.c
@@ -17,7 +17,6 @@
#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_launch.h>
diff --git a/app/test-pipeline/main.c b/app/test-pipeline/main.c
index 4cc098d7ac..ca0bc9d9d1 100644
--- a/app/test-pipeline/main.c
+++ b/app/test-pipeline/main.c
@@ -19,7 +19,6 @@
#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_launch.h>
diff --git a/app/test-pipeline/runtime.c b/app/test-pipeline/runtime.c
index 752f783370..a6457488c0 100644
--- a/app/test-pipeline/runtime.c
+++ b/app/test-pipeline/runtime.c
@@ -17,7 +17,6 @@
#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_launch.h>
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 29/30] app/test-bbdev: remove unnecessary include of rte_memcpy.h
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (27 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 28/30] app/test-pipeline: remove unused rte_memcpy.h include Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 30/30] examples: replace use of fixed size rte_memcpy Stephen Hemminger
` (2 subsequent siblings)
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Nicolas Chautru
Includes rte_memcpy.h but no rte_memcpy used.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-bbdev/test_bbdev.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/app/test-bbdev/test_bbdev.c b/app/test-bbdev/test_bbdev.c
index cf224dca5d..7309d85bc5 100644
--- a/app/test-bbdev/test_bbdev.c
+++ b/app/test-bbdev/test_bbdev.c
@@ -6,7 +6,6 @@
#include <rte_hexdump.h>
#include <rte_mbuf.h>
#include <rte_malloc.h>
-#include <rte_memcpy.h>
#include <rte_cycles.h>
#include <rte_bus_vdev.h>
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* [PATCH v3 30/30] examples: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (28 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 29/30] app/test-bbdev: remove unnecessary include of rte_memcpy.h Stephen Hemminger
@ 2024-04-02 21:50 ` Stephen Hemminger
2024-04-04 7:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Konstantin Ananyev
2024-04-04 15:52 ` Tyler Retzlaff
31 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-02 21:50 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, Nicolas Chautru, Chas Williams,
Min Hu (Connor),
Konstantin Ananyev, Tomasz Kantecki, Akhil Goyal,
Bruce Richardson, Anatoly Burakov, David Hunt,
Sivaprasad Tummala, Kirill Rybalchenko, Cristian Dumitrescu,
Byron Marohn, Yipeng Wang, Maxime Coquelin, Chenbo Xia
Automatically generated by devtools/cocci/rte_memcpy.cocci
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/bbdev_app/main.c | 2 +-
examples/bond/main.c | 1 -
examples/ip_fragmentation/main.c | 1 -
examples/ip_reassembly/main.c | 1 -
examples/ipv4_multicast/main.c | 1 -
examples/l2fwd-cat/cat.c | 4 +---
examples/l2fwd-jobstats/main.c | 1 -
examples/l2fwd-keepalive/main.c | 1 -
examples/l2fwd-macsec/main.c | 1 -
examples/l2fwd/main.c | 1 -
examples/l3fwd-power/main.c | 1 -
examples/l3fwd/main.c | 1 -
examples/link_status_interrupt/main.c | 1 -
.../client_server_mp/mp_server/init.c | 1 -
.../client_server_mp/mp_server/main.c | 1 -
examples/multi_process/symmetric_mp/main.c | 1 -
examples/ptpclient/ptpclient.c | 11 +++++------
examples/qos_sched/app_thread.c | 1 -
examples/qos_sched/main.c | 1 -
examples/server_node_efd/efd_server/init.c | 1 -
examples/server_node_efd/efd_server/main.c | 1 -
examples/vhost/main.c | 6 +++---
examples/vmdq/main.c | 6 ++----
examples/vmdq_dcb/main.c | 15 +++++----------
24 files changed, 17 insertions(+), 45 deletions(-)
diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 16599ae9ce..52c8eabba7 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -359,7 +359,7 @@ add_ether_hdr(struct rte_mbuf *pkt_src, struct rte_mbuf *pkt_dst)
eth_to = rte_pktmbuf_mtod(pkt_dst, struct rte_ether_hdr *);
/* copy header */
- rte_memcpy(eth_to, eth_from, sizeof(struct rte_ether_hdr));
+ memcpy(eth_to, eth_from, sizeof(struct rte_ether_hdr));
}
static inline void
diff --git a/examples/bond/main.c b/examples/bond/main.c
index 8528abf675..a10fc8c92d 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -21,7 +21,6 @@
#include <rte_common.h>
#include <rte_log.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_cycles.h>
diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 744a1aa9b4..d800d314a1 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -18,7 +18,6 @@
#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_cycles.h>
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index bd0b1d31de..b23c2b0942 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -19,7 +19,6 @@
#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_cycles.h>
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 6d0a8501ef..8f135a5a96 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -17,7 +17,6 @@
#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_cycles.h>
diff --git a/examples/l2fwd-cat/cat.c b/examples/l2fwd-cat/cat.c
index 00e4cde48b..d1689fca29 100644
--- a/examples/l2fwd-cat/cat.c
+++ b/examples/l2fwd-cat/cat.c
@@ -12,7 +12,6 @@
#include <stdio.h>
#include <rte_common.h>
-#include <rte_memcpy.h>
#include <pqos.h>
@@ -314,8 +313,7 @@ parse_l3ca(const char *l3ca)
if (cmask != 0 && is_contiguous(cmask) == 0)
goto err;
- rte_memcpy(&m_config[idx].cpumask,
- &cpuset, sizeof(rte_cpuset_t));
+ memcpy(&m_config[idx].cpumask, &cpuset, sizeof(rte_cpuset_t));
if (cmask != 0) {
m_config[idx].cdp = 1;
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 2653db4735..e3e02b751e 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -13,7 +13,6 @@
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_cycles.h>
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 1463cef0fc..52bcc91790 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -21,7 +21,6 @@
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_cycles.h>
diff --git a/examples/l2fwd-macsec/main.c b/examples/l2fwd-macsec/main.c
index a5d7a84828..529489e10d 100644
--- a/examples/l2fwd-macsec/main.c
+++ b/examples/l2fwd-macsec/main.c
@@ -21,7 +21,6 @@
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_cycles.h>
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 96fb33196f..d928c957c3 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -21,7 +21,6 @@
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_cycles.h>
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index f4adcf41b5..9db9de806e 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -21,7 +21,6 @@
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_cycles.h>
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 8d32ae1dd5..d77aa8c62c 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -21,7 +21,6 @@
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_cycles.h>
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index a8423d5d2a..d726d5c3b5 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -19,7 +19,6 @@
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_cycles.h>
diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c
index 65713dbea8..f3b9b49380 100644
--- a/examples/multi_process/client_server_mp/mp_server/init.c
+++ b/examples/multi_process/client_server_mp/mp_server/init.c
@@ -24,7 +24,6 @@
#include <rte_ring.h>
#include <rte_log.h>
#include <rte_mempool.h>
-#include <rte_memcpy.h>
#include <rte_mbuf.h>
#include <rte_interrupts.h>
#include <rte_ether.h>
diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c
index f54bb8b75a..df1bac37d0 100644
--- a/examples/multi_process/client_server_mp/mp_server/main.c
+++ b/examples/multi_process/client_server_mp/mp_server/main.c
@@ -24,7 +24,6 @@
#include <rte_log.h>
#include <rte_debug.h>
#include <rte_mempool.h>
-#include <rte_memcpy.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
#include <rte_interrupts.h>
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 1ff85875df..ebf546db84 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -37,7 +37,6 @@
#include <rte_ether.h>
#include <rte_ethdev.h>
#include <rte_mempool.h>
-#include <rte_memcpy.h>
#include <rte_mbuf.h>
#include <rte_string_fns.h>
#include <rte_cycles.h>
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index afb61bba51..7edf235bfb 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -362,9 +362,9 @@ parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx)
ptp_data->seqID_SYNC = rte_be_to_cpu_16(ptp_hdr->seq_id);
if (ptp_data->ptpset == 0) {
- rte_memcpy(&ptp_data->master_clock_id,
- &ptp_hdr->source_port_id.clock_id,
- sizeof(struct clock_id));
+ memcpy(&ptp_data->master_clock_id,
+ &ptp_hdr->source_port_id.clock_id,
+ sizeof(struct clock_id));
ptp_data->ptpset = 1;
}
@@ -469,9 +469,8 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
client_clkid->id[6] = eth_hdr->src_addr.addr_bytes[4];
client_clkid->id[7] = eth_hdr->src_addr.addr_bytes[5];
- rte_memcpy(&ptp_data->client_clock_id,
- client_clkid,
- sizeof(struct clock_id));
+ memcpy(&ptp_data->client_clock_id, client_clkid,
+ sizeof(struct clock_id));
/* Enable flag for hardware timestamping. */
created_pkt->ol_flags |= RTE_MBUF_F_TX_IEEE1588_TMST;
diff --git a/examples/qos_sched/app_thread.c b/examples/qos_sched/app_thread.c
index 059c470afb..3b8d9d50e8 100644
--- a/examples/qos_sched/app_thread.c
+++ b/examples/qos_sched/app_thread.c
@@ -9,7 +9,6 @@
#include <rte_malloc.h>
#include <rte_cycles.h>
#include <rte_ethdev.h>
-#include <rte_memcpy.h>
#include <rte_byteorder.h>
#include <rte_branch_prediction.h>
#include <rte_sched.h>
diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c
index b3c2c9ef23..e756ce0da2 100644
--- a/examples/qos_sched/main.c
+++ b/examples/qos_sched/main.c
@@ -10,7 +10,6 @@
#include <rte_malloc.h>
#include <rte_cycles.h>
#include <rte_ethdev.h>
-#include <rte_memcpy.h>
#include <rte_byteorder.h>
#include <rte_branch_prediction.h>
diff --git a/examples/server_node_efd/efd_server/init.c b/examples/server_node_efd/efd_server/init.c
index 9c89f6b60d..9a20831a0d 100644
--- a/examples/server_node_efd/efd_server/init.c
+++ b/examples/server_node_efd/efd_server/init.c
@@ -24,7 +24,6 @@
#include <rte_ring.h>
#include <rte_log.h>
#include <rte_mempool.h>
-#include <rte_memcpy.h>
#include <rte_mbuf.h>
#include <rte_interrupts.h>
#include <rte_ether.h>
diff --git a/examples/server_node_efd/efd_server/main.c b/examples/server_node_efd/efd_server/main.c
index fd72882e3a..0cd17a9ca3 100644
--- a/examples/server_node_efd/efd_server/main.c
+++ b/examples/server_node_efd/efd_server/main.c
@@ -26,7 +26,6 @@
#include <rte_log.h>
#include <rte_debug.h>
#include <rte_mempool.h>
-#include <rte_memcpy.h>
#include <rte_mbuf.h>
#include <rte_ether.h>
#include <rte_interrupts.h>
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 3fc1b151d1..41df424565 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -405,9 +405,9 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_devices)
conf.pool_map[i].pools = (1UL << i);
}
- (void)(rte_memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &conf,
- sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
+ memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf));
+ memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &conf,
+ sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf));
return 0;
}
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 4a3ce6884c..d928f4a45c 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -17,7 +17,6 @@
#include <rte_common.h>
#include <rte_log.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_cycles.h>
@@ -151,9 +150,8 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_pools)
conf.pool_map[i].pools = (1UL << (i % num_pools));
}
- (void)(rte_memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &conf,
- sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
+ (void)(memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
+ (void)(memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &conf, sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
if (rss_enable) {
eth_conf->rxmode.mq_mode = RTE_ETH_MQ_RX_VMDQ_RSS;
eth_conf->rx_adv_conf.rss_conf.rss_hf = RTE_ETH_RSS_IP |
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 4ccc2fe4b0..f93eca5936 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -17,7 +17,6 @@
#include <rte_common.h>
#include <rte_log.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_cycles.h>
@@ -161,15 +160,11 @@ get_eth_conf(struct rte_eth_conf *eth_conf)
tx_conf.dcb_tc[i] = i % num_tcs;
}
dcb_conf.nb_tcs = (enum rte_eth_nb_tcs)num_tcs;
- (void)(rte_memcpy(eth_conf, &vmdq_dcb_conf_default, sizeof(*eth_conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_dcb_conf, &conf,
- sizeof(conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.dcb_rx_conf, &dcb_conf,
- sizeof(dcb_conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &vmdq_conf,
- sizeof(vmdq_conf)));
- (void)(rte_memcpy(ð_conf->tx_adv_conf.vmdq_dcb_tx_conf, &tx_conf,
- sizeof(tx_conf)));
+ (void)(memcpy(eth_conf, &vmdq_dcb_conf_default, sizeof(*eth_conf)));
+ (void)(memcpy(ð_conf->rx_adv_conf.vmdq_dcb_conf, &conf, sizeof(conf)));
+ (void)(memcpy(ð_conf->rx_adv_conf.dcb_rx_conf, &dcb_conf, sizeof(dcb_conf)));
+ (void)(memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &vmdq_conf, sizeof(vmdq_conf)));
+ (void)(memcpy(ð_conf->tx_adv_conf.vmdq_dcb_tx_conf, &tx_conf, sizeof(tx_conf)));
if (rss_enable) {
eth_conf->rxmode.mq_mode = RTE_ETH_MQ_RX_VMDQ_DCB_RSS;
eth_conf->rx_adv_conf.rss_conf.rss_hf = RTE_ETH_RSS_IP |
--
2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* RE: [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (29 preceding siblings ...)
2024-04-02 21:50 ` [PATCH v3 30/30] examples: replace use of fixed size rte_memcpy Stephen Hemminger
@ 2024-04-04 7:50 ` Konstantin Ananyev
2024-04-04 15:52 ` Tyler Retzlaff
31 siblings, 0 replies; 205+ messages in thread
From: Konstantin Ananyev @ 2024-04-04 7:50 UTC (permalink / raw)
To: Stephen Hemminger, dev
> The DPDK has a lot of unnecessary usage of rte_memcpy.
> This patch set replaces cases where rte_memcpy is used with a fixed
> size constant size.
>
> Typical example is:
> rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
> which can be replaced with:
> memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
>
> This does not change the resulting binary on almost all architectures
> because x86 version of intrisics and glibc are the same, and
> other architectures were using __builtin_constant_p().
>
> The main benefit is that analysis tools like fortify, Coverity, and ASAN
> analyzers can check these memcpy's.
>
> The first patch is a simple coccinelle script to do the replacement
> and the rest are the results broken out by module. The script can be used
> again to make sure more bad usage doesn't creep in with new drivers.
>
> v3 - rebase and rerun coccinelle script on 24.03
> - consolidate patches by subtree
> - remove inclusion of rte_memcpy.h when no longer used.
>
> Stephen Hemminger (30):
> cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
> eal: replace use of fixed size rte_memcpy
> ethdev: replace use of fixed size rte_memcpy
> eventdev: replace use of fixed size rte_memcpy
> cryptodev: replace use of fixed size rte_memcpy
> ip_frag: replace use of fixed size rte_memcpy
> net: replace use of fixed size rte_memcpy
> lpm: replace use of fixed size rte_memcpy
> node: replace use of fixed size rte_memcpy
> pdcp: replace use of fixed size rte_memcpy
> pipeline: replace use of fixed size rte_memcpy
> rib: replace use of fixed size rte_memcpy
> security: replace use of fixed size rte_memcpy
> bus: remove unneeded rte_memcpy.h include
> net: replace use of fixed size rte_memcpy
> raw: replace use of fixed size rte_memcpy
> baseband: replace use of fixed size rte_memcpy
> common: replace use of fixed size rte_memcpy
> crypto: replace use of fixed size rte_memcpy
> crypto: replace use of fixed size rte_memcpy
> event: replace use of fixed size rte_memcpy
> mempool: replace use of fixed size rte_memcpy
> ml/cnxk: replace use of fixed size rte_memcpy
> app/test-pmd: replace use of fixed size rte_memcpy
> app/graph: replace use of fixed size rte_memcpy
> app/test-eventdev: replace use of fixed size rte_memcpy
> app/test: replace use of fixed size rte_memcpy
> app/test-pipeline: remove unused rte_memcpy.h include
> app/test-bbdev: remove unnecessary include of rte_memcpy.h
> examples: replace use of fixed size rte_memcpy
>
> app/graph/neigh.c | 8 +-
> app/test-bbdev/test_bbdev.c | 1 -
> app/test-eventdev/test_pipeline_common.c | 19 ++-
> app/test-pipeline/config.c | 1 -
> app/test-pipeline/init.c | 1 -
> app/test-pipeline/main.c | 1 -
> app/test-pipeline/runtime.c | 1 -
> app/test-pmd/cmdline.c | 48 ++++----
> app/test-pmd/cmdline_flow.c | 24 ++--
> app/test-pmd/config.c | 8 +-
> app/test-pmd/csumonly.c | 1 -
> app/test-pmd/flowgen.c | 1 -
> app/test-pmd/iofwd.c | 1 -
> app/test-pmd/macfwd.c | 1 -
> app/test-pmd/macswap.c | 1 -
> app/test-pmd/noisy_vnf.c | 1 -
> app/test-pmd/rxonly.c | 1 -
> app/test-pmd/testpmd.c | 1 -
> app/test/commands.c | 1 -
> app/test/packet_burst_generator.c | 4 +-
> app/test/test_crc.c | 5 +-
> app/test/test_cryptodev.c | 18 ++-
> app/test/test_cryptodev_asym.c | 1 -
> app/test/test_cryptodev_security_pdcp.c | 1 -
> app/test/test_efd.c | 1 -
> app/test/test_efd_perf.c | 1 -
> app/test/test_event_crypto_adapter.c | 12 +-
> app/test/test_event_dma_adapter.c | 4 +-
> app/test/test_eventdev.c | 1 -
> app/test/test_ipsec.c | 6 +-
> app/test/test_link_bonding_mode4.c | 8 +-
> app/test/test_mbuf.c | 1 -
> app/test/test_member.c | 1 -
> app/test/test_member_perf.c | 1 -
> app/test/test_rawdev.c | 1 -
> app/test/test_security_inline_proto.c | 36 +++---
> app/test/test_service_cores.c | 1 -
> app/test/virtual_pmd.c | 3 +-
> devtools/cocci/rte_memcpy.cocci | 11 ++
> drivers/baseband/acc/rte_acc100_pmd.c | 17 ++-
> drivers/baseband/acc/rte_vrb_pmd.c | 21 ++--
> drivers/baseband/la12xx/bbdev_la12xx.c | 4 +-
> drivers/bus/auxiliary/linux/auxiliary.c | 1 -
> drivers/bus/fslmc/fslmc_bus.c | 1 -
> drivers/bus/fslmc/fslmc_vfio.c | 1 -
> drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 1 -
> drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 1 -
> drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 1 -
> drivers/bus/pci/linux/pci.c | 1 -
> drivers/common/idpf/idpf_common_device.c | 4 +-
> drivers/common/idpf/idpf_common_virtchnl.c | 10 +-
> drivers/common/qat/qat_qp.c | 10 +-
> drivers/compress/qat/qat_comp.c | 8 +-
> drivers/crypto/ccp/ccp_crypto.c | 14 +--
> drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +-
> drivers/crypto/cnxk/cnxk_se.h | 2 +-
> drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
> drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +-
> drivers/crypto/qat/qat_sym_session.c | 52 ++++-----
> .../scheduler/rte_cryptodev_scheduler.c | 6 +-
> drivers/crypto/scheduler/scheduler_failover.c | 12 +-
> drivers/event/cnxk/cnxk_eventdev_selftest.c | 1 -
> drivers/event/cnxk/cnxk_tim_evdev.c | 4 +-
> drivers/event/dlb2/dlb2.c | 4 +-
> drivers/event/dpaa/dpaa_eventdev.c | 1 -
> drivers/event/dpaa2/dpaa2_eventdev.c | 7 +-
> drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 1 -
> drivers/event/dpaa2/dpaa2_hw_dpcon.c | 1 -
> drivers/event/octeontx/ssovf_evdev_selftest.c | 1 -
> drivers/event/octeontx/timvf_evdev.c | 4 +-
> drivers/mempool/dpaa/dpaa_mempool.c | 4 +-
> drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 5 +-
> drivers/ml/cnxk/cn10k_ml_model.c | 8 +-
> drivers/ml/cnxk/cn10k_ml_ops.c | 11 +-
> drivers/ml/cnxk/cnxk_ml_ops.c | 2 +-
> drivers/ml/cnxk/mvtvm_ml_model.c | 8 +-
> drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +-
> drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
> drivers/net/avp/avp_ethdev.c | 4 +-
> drivers/net/axgbe/axgbe_ethdev.c | 4 +-
> drivers/net/bnx2x/bnx2x.c | 32 +++--
> drivers/net/bnxt/bnxt_flow.c | 34 +++---
> drivers/net/bonding/rte_eth_bond_8023ad.c | 4 +-
> drivers/net/bonding/rte_eth_bond_flow.c | 2 +-
> drivers/net/cnxk/cnxk_eswitch_devargs.c | 3 +-
> drivers/net/cnxk/cnxk_ethdev_ops.c | 2 +-
> drivers/net/cnxk/cnxk_rep.c | 3 +-
> drivers/net/cnxk/cnxk_rep_flow.c | 6 +-
> drivers/net/cnxk/cnxk_rep_msg.c | 8 +-
> drivers/net/cnxk/cnxk_rep_ops.c | 2 +-
> drivers/net/cnxk/cnxk_tm.c | 5 +-
> drivers/net/cpfl/cpfl_ethdev.c | 3 +-
> drivers/net/cpfl/cpfl_vchnl.c | 4 +-
> drivers/net/cxgbe/clip_tbl.c | 2 +-
> drivers/net/cxgbe/cxgbe_filter.c | 8 +-
> drivers/net/cxgbe/l2t.c | 4 +-
> drivers/net/cxgbe/smt.c | 20 ++--
> drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 1 -
> drivers/net/dpaa2/dpaa2_ethdev.c | 1 -
> drivers/net/dpaa2/dpaa2_recycle.c | 1 -
> drivers/net/dpaa2/dpaa2_rxtx.c | 1 -
> drivers/net/dpaa2/dpaa2_sparser.c | 1 -
> drivers/net/dpaa2/dpaa2_tm.c | 2 +-
> drivers/net/e1000/em_rxtx.c | 1 -
> drivers/net/e1000/igb_flow.c | 22 ++--
> drivers/net/e1000/igb_pf.c | 7 +-
> drivers/net/e1000/igb_rxtx.c | 1 -
> drivers/net/enic/enic_main.c | 8 +-
> drivers/net/failsafe/failsafe_ops.c | 6 +-
> drivers/net/gve/base/gve_adminq.c | 2 +-
> drivers/net/hinic/hinic_pmd_ethdev.c | 1 -
> drivers/net/hinic/hinic_pmd_flow.c | 40 +++----
> drivers/net/hns3/hns3_fdir.c | 2 +-
> drivers/net/hns3/hns3_flow.c | 4 +-
> drivers/net/i40e/i40e_ethdev.c | 109 ++++++++----------
> drivers/net/i40e/i40e_fdir.c | 28 +++--
> drivers/net/i40e/i40e_flow.c | 56 +++++----
> drivers/net/i40e/i40e_pf.c | 3 +-
> drivers/net/i40e/i40e_tm.c | 11 +-
> drivers/net/i40e/rte_pmd_i40e.c | 34 +++---
> drivers/net/iavf/iavf_fdir.c | 93 +++++++--------
> drivers/net/iavf/iavf_fsub.c | 50 ++++----
> drivers/net/iavf/iavf_generic_flow.c | 2 +-
> drivers/net/iavf/iavf_tm.c | 11 +-
> drivers/net/iavf/iavf_vchnl.c | 9 +-
> drivers/net/ice/ice_dcf.c | 5 +-
> drivers/net/ice/ice_dcf_parent.c | 2 +-
> drivers/net/ice/ice_dcf_sched.c | 11 +-
> drivers/net/ice/ice_diagnose.c | 4 +-
> drivers/net/ice/ice_ethdev.c | 14 +--
> drivers/net/ice/ice_fdir_filter.c | 37 +++---
> drivers/net/ice/ice_generic_flow.c | 2 +-
> drivers/net/ice/ice_hash.c | 2 +-
> drivers/net/ice/ice_tm.c | 11 +-
> drivers/net/idpf/idpf_ethdev.c | 7 +-
> drivers/net/idpf/idpf_rxtx.c | 10 +-
> drivers/net/ipn3ke/ipn3ke_flow.c | 32 +++--
> drivers/net/ipn3ke/ipn3ke_representor.c | 16 +--
> drivers/net/ipn3ke/ipn3ke_tm.c | 6 +-
> drivers/net/ixgbe/ixgbe_ethdev.c | 9 +-
> drivers/net/ixgbe/ixgbe_fdir.c | 7 +-
> drivers/net/ixgbe/ixgbe_flow.c | 65 +++++------
> drivers/net/ixgbe/ixgbe_ipsec.c | 8 +-
> drivers/net/ixgbe/ixgbe_pf.c | 5 +-
> drivers/net/ixgbe/ixgbe_tm.c | 11 +-
> drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +-
> drivers/net/memif/memif_socket.c | 4 +-
> drivers/net/mlx5/mlx5_devx.c | 4 +-
> drivers/net/mlx5/mlx5_flow.c | 38 +++---
> drivers/net/mlx5/mlx5_flow_aso.c | 6 +-
> drivers/net/mlx5/mlx5_flow_hw.c | 27 ++---
> drivers/net/mlx5/mlx5_rx.c | 6 +-
> drivers/net/mlx5/mlx5_rxtx_vec.c | 8 +-
> drivers/net/mvpp2/mrvl_tm.c | 2 +-
> drivers/net/netvsc/hn_ethdev.c | 1 -
> drivers/net/nfp/flower/nfp_conntrack.c | 2 +-
> drivers/net/nfp/flower/nfp_flower_flow.c | 16 +--
> .../net/nfp/flower/nfp_flower_representor.c | 2 +-
> drivers/net/nfp/nfp_mtr.c | 10 +-
> drivers/net/ngbe/ngbe_pf.c | 4 +-
> drivers/net/null/rte_eth_null.c | 6 +-
> drivers/net/pcap/pcap_ethdev.c | 2 +-
> drivers/net/pcap/pcap_osdep_freebsd.c | 3 +-
> drivers/net/pcap/pcap_osdep_linux.c | 3 +-
> drivers/net/qede/qede_main.c | 2 +-
> drivers/net/ring/rte_eth_ring.c | 1 -
> drivers/net/sfc/sfc.c | 2 +-
> drivers/net/sfc/sfc_ef10_tx.c | 2 +-
> drivers/net/sfc/sfc_ethdev.c | 11 +-
> drivers/net/sfc/sfc_flow.c | 20 ++--
> drivers/net/sfc/sfc_flow_rss.c | 2 +-
> drivers/net/sfc/sfc_mae.c | 2 +-
> drivers/net/sfc/sfc_rx.c | 2 +-
> drivers/net/sfc/sfc_tso.c | 2 +-
> drivers/net/sfc/sfc_tso.h | 9 +-
> drivers/net/tap/rte_eth_tap.c | 14 +--
> drivers/net/txgbe/txgbe_ethdev.c | 9 +-
> drivers/net/txgbe/txgbe_fdir.c | 6 +-
> drivers/net/txgbe/txgbe_flow.c | 65 +++++------
> drivers/net/txgbe/txgbe_ipsec.c | 8 +-
> drivers/net/txgbe/txgbe_pf.c | 5 +-
> drivers/net/txgbe/txgbe_tm.c | 11 +-
> drivers/net/vhost/rte_eth_vhost.c | 1 -
> drivers/net/virtio/virtio_ethdev.c | 1 -
> drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +-
> drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +-
> drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +-
> drivers/raw/ifpga/afu_pmd_n3000.c | 8 +-
> drivers/raw/ifpga/ifpga_rawdev.c | 11 +-
> drivers/raw/skeleton/skeleton_rawdev.c | 8 +-
> drivers/raw/skeleton/skeleton_rawdev_test.c | 1 -
> examples/bbdev_app/main.c | 2 +-
> examples/bond/main.c | 1 -
> examples/ip_fragmentation/main.c | 1 -
> examples/ip_reassembly/main.c | 1 -
> examples/ipv4_multicast/main.c | 1 -
> examples/l2fwd-cat/cat.c | 4 +-
> examples/l2fwd-jobstats/main.c | 1 -
> examples/l2fwd-keepalive/main.c | 1 -
> examples/l2fwd-macsec/main.c | 1 -
> examples/l2fwd/main.c | 1 -
> examples/l3fwd-power/main.c | 1 -
> examples/l3fwd/main.c | 1 -
> examples/link_status_interrupt/main.c | 1 -
> .../client_server_mp/mp_server/init.c | 1 -
> .../client_server_mp/mp_server/main.c | 1 -
> examples/multi_process/symmetric_mp/main.c | 1 -
> examples/ptpclient/ptpclient.c | 11 +-
> examples/qos_sched/app_thread.c | 1 -
> examples/qos_sched/main.c | 1 -
> examples/server_node_efd/efd_server/init.c | 1 -
> examples/server_node_efd/efd_server/main.c | 1 -
> examples/vhost/main.c | 6 +-
> examples/vmdq/main.c | 6 +-
> examples/vmdq_dcb/main.c | 15 +--
> lib/cryptodev/rte_cryptodev.c | 2 +-
> lib/eal/common/eal_common_options.c | 7 +-
> lib/ethdev/rte_ethdev.c | 3 +-
> lib/ethdev/rte_flow.c | 5 +-
> lib/eventdev/rte_event_crypto_adapter.c | 2 +-
> lib/eventdev/rte_event_dma_adapter.c | 4 +-
> lib/eventdev/rte_event_timer_adapter.c | 2 +-
> lib/fib/trie.c | 2 +-
> lib/ip_frag/rte_ipv6_fragmentation.c | 4 +-
> lib/ip_frag/rte_ipv6_reassembly.c | 6 +-
> lib/lpm/rte_lpm6.c | 3 +-
> lib/net/rte_ether.c | 2 +-
> lib/node/ip6_lookup.c | 8 +-
> lib/pdcp/pdcp_process.c | 36 +++---
> lib/pipeline/rte_table_action.c | 8 +-
> lib/rib/rte_rib6.h | 5 +-
> lib/security/rte_security.c | 4 +-
> 232 files changed, 886 insertions(+), 1045 deletions(-)
> create mode 100644 devtools/cocci/rte_memcpy.cocci
>
> --
Series-Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
> 2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* RE: [PATCH v3 15/30] net: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 15/30] net: replace use of fixed size rte_memcpy Stephen Hemminger
@ 2024-04-04 11:07 ` Slava Ovsiienko
0 siblings, 0 replies; 205+ messages in thread
From: Slava Ovsiienko @ 2024-04-04 11:07 UTC (permalink / raw)
To: Stephen Hemminger, dev
Cc: Ciara Loftus, Steven Webster, Matt Peters, Selwin Sebastian,
Julien Aube, Ajit Khaparde, Somnath Kotur, Chas Williams,
Min Hu (Connor),
Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
Harman Kalra, Yuying Zhang, Rahul Lakkireddy, Hemant Agrawal,
Sachin Saxena, John Daley, Hyong Youb Kim, Gaetan Rivet,
Jeroen de Borst, Rushil Gupta, Joshua Washington, Ziyang Xuan,
Xiaoyun Wang, Guoyang Zhou, Jie Hai, Yisen Zhuang, Jingjing Wu,
Rosen Xu, Jakub Grajciar, Dariusz Sosnowski, Ori Kam,
Suanming Mou, Matan Azrad, Liron Himi,
NBU-Contact-longli (EXTERNAL),
Chaoyong He, Jiawen Wu, Tetsuya Mukawa, Devendra Singh Rawat,
Alok Prasad, Bruce Richardson, Andrew Rybchenko, Jian Wang,
Maxime Coquelin, Chenbo Xia
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Wednesday, April 3, 2024 12:51 AM
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Ciara Loftus
> <ciara.loftus@intel.com>; Steven Webster <steven.webster@windriver.com>;
> Matt Peters <matt.peters@windriver.com>; Selwin Sebastian
> <selwin.sebastian@amd.com>; Julien Aube <julien_dpdk@jaube.fr>; Ajit
> Khaparde <ajit.khaparde@broadcom.com>; Somnath Kotur
> <somnath.kotur@broadcom.com>; Chas Williams <chas3@att.com>; Min Hu
> (Connor) <humin29@huawei.com>; Nithin Dabilpuram
> <ndabilpuram@marvell.com>; Kiran Kumar K <kirankumark@marvell.com>;
> Sunil Kumar Kori <skori@marvell.com>; Satha Rao
> <skoteshwar@marvell.com>; Harman Kalra <hkalra@marvell.com>; Yuying
> Zhang <yuying.zhang@intel.com>; Rahul Lakkireddy
> <rahul.lakkireddy@chelsio.com>; Hemant Agrawal
> <hemant.agrawal@nxp.com>; Sachin Saxena <sachin.saxena@nxp.com>; John
> Daley <johndale@cisco.com>; Hyong Youb Kim <hyonkim@cisco.com>; Gaetan
> Rivet <grive@u256.net>; Jeroen de Borst <jeroendb@google.com>; Rushil
> Gupta <rushilg@google.com>; Joshua Washington <joshwash@google.com>;
> Ziyang Xuan <xuanziyang2@huawei.com>; Xiaoyun Wang
> <cloud.wangxiaoyun@huawei.com>; Guoyang Zhou
> <zhouguoyang@huawei.com>; Jie Hai <haijie1@huawei.com>; Yisen Zhuang
> <yisen.zhuang@huawei.com>; Jingjing Wu <jingjing.wu@intel.com>; Rosen Xu
> <rosen.xu@intel.com>; Jakub Grajciar <jgrajcia@cisco.com>; Dariusz
> Sosnowski <dsosnowski@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; Suanming Mou
> <suanmingm@nvidia.com>; Matan Azrad <matan@nvidia.com>; Liron Himi
> <lironh@marvell.com>; NBU-Contact-longli (EXTERNAL)
> <longli@microsoft.com>; Chaoyong He <chaoyong.he@corigine.com>; Jiawen
> Wu <jiawenwu@trustnetic.com>; Tetsuya Mukawa <mtetsuyah@gmail.com>;
> Devendra Singh Rawat <dsinghrawat@marvell.com>; Alok Prasad
> <palok@marvell.com>; Bruce Richardson <bruce.richardson@intel.com>;
> Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; Jian Wang
> <jianwang@trustnetic.com>; Maxime Coquelin
> <maxime.coquelin@redhat.com>; Chenbo Xia <chenbox@nvidia.com>
> Subject: [PATCH v3 15/30] net: replace use of fixed size rte_memcpy
>
> Automatically generated by devtools/cocci/rte_memcpy.cocci
> Also remove unnecessary includes of rte_memcpy.h
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
^ permalink raw reply [flat|nested] 205+ messages in thread
* Re: [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
` (30 preceding siblings ...)
2024-04-04 7:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Konstantin Ananyev
@ 2024-04-04 15:52 ` Tyler Retzlaff
31 siblings, 0 replies; 205+ messages in thread
From: Tyler Retzlaff @ 2024-04-04 15:52 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
On Tue, Apr 02, 2024 at 02:50:16PM -0700, Stephen Hemminger wrote:
> The DPDK has a lot of unnecessary usage of rte_memcpy.
> This patch set replaces cases where rte_memcpy is used with a fixed
> size constant size.
>
> Typical example is:
> rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
> which can be replaced with:
> memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
>
> This does not change the resulting binary on almost all architectures
> because x86 version of intrisics and glibc are the same, and
> other architectures were using __builtin_constant_p().
>
> The main benefit is that analysis tools like fortify, Coverity, and ASAN
> analyzers can check these memcpy's.
>
> The first patch is a simple coccinelle script to do the replacement
> and the rest are the results broken out by module. The script can be used
> again to make sure more bad usage doesn't creep in with new drivers.
>
> v3 - rebase and rerun coccinelle script on 24.03
> - consolidate patches by subtree
> - remove inclusion of rte_memcpy.h when no longer used.
>
> Stephen Hemminger (30):
> cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
> eal: replace use of fixed size rte_memcpy
> ethdev: replace use of fixed size rte_memcpy
> eventdev: replace use of fixed size rte_memcpy
> cryptodev: replace use of fixed size rte_memcpy
> ip_frag: replace use of fixed size rte_memcpy
> net: replace use of fixed size rte_memcpy
> lpm: replace use of fixed size rte_memcpy
> node: replace use of fixed size rte_memcpy
> pdcp: replace use of fixed size rte_memcpy
> pipeline: replace use of fixed size rte_memcpy
> rib: replace use of fixed size rte_memcpy
> security: replace use of fixed size rte_memcpy
> bus: remove unneeded rte_memcpy.h include
> net: replace use of fixed size rte_memcpy
> raw: replace use of fixed size rte_memcpy
> baseband: replace use of fixed size rte_memcpy
> common: replace use of fixed size rte_memcpy
> crypto: replace use of fixed size rte_memcpy
> crypto: replace use of fixed size rte_memcpy
> event: replace use of fixed size rte_memcpy
> mempool: replace use of fixed size rte_memcpy
> ml/cnxk: replace use of fixed size rte_memcpy
> app/test-pmd: replace use of fixed size rte_memcpy
> app/graph: replace use of fixed size rte_memcpy
> app/test-eventdev: replace use of fixed size rte_memcpy
> app/test: replace use of fixed size rte_memcpy
> app/test-pipeline: remove unused rte_memcpy.h include
> app/test-bbdev: remove unnecessary include of rte_memcpy.h
> examples: replace use of fixed size rte_memcpy
>
> app/graph/neigh.c | 8 +-
> app/test-bbdev/test_bbdev.c | 1 -
> app/test-eventdev/test_pipeline_common.c | 19 ++-
> app/test-pipeline/config.c | 1 -
> app/test-pipeline/init.c | 1 -
> app/test-pipeline/main.c | 1 -
> app/test-pipeline/runtime.c | 1 -
> app/test-pmd/cmdline.c | 48 ++++----
> app/test-pmd/cmdline_flow.c | 24 ++--
> app/test-pmd/config.c | 8 +-
> app/test-pmd/csumonly.c | 1 -
> app/test-pmd/flowgen.c | 1 -
> app/test-pmd/iofwd.c | 1 -
> app/test-pmd/macfwd.c | 1 -
> app/test-pmd/macswap.c | 1 -
> app/test-pmd/noisy_vnf.c | 1 -
> app/test-pmd/rxonly.c | 1 -
> app/test-pmd/testpmd.c | 1 -
> app/test/commands.c | 1 -
> app/test/packet_burst_generator.c | 4 +-
> app/test/test_crc.c | 5 +-
> app/test/test_cryptodev.c | 18 ++-
> app/test/test_cryptodev_asym.c | 1 -
> app/test/test_cryptodev_security_pdcp.c | 1 -
> app/test/test_efd.c | 1 -
> app/test/test_efd_perf.c | 1 -
> app/test/test_event_crypto_adapter.c | 12 +-
> app/test/test_event_dma_adapter.c | 4 +-
> app/test/test_eventdev.c | 1 -
> app/test/test_ipsec.c | 6 +-
> app/test/test_link_bonding_mode4.c | 8 +-
> app/test/test_mbuf.c | 1 -
> app/test/test_member.c | 1 -
> app/test/test_member_perf.c | 1 -
> app/test/test_rawdev.c | 1 -
> app/test/test_security_inline_proto.c | 36 +++---
> app/test/test_service_cores.c | 1 -
> app/test/virtual_pmd.c | 3 +-
> devtools/cocci/rte_memcpy.cocci | 11 ++
> drivers/baseband/acc/rte_acc100_pmd.c | 17 ++-
> drivers/baseband/acc/rte_vrb_pmd.c | 21 ++--
> drivers/baseband/la12xx/bbdev_la12xx.c | 4 +-
> drivers/bus/auxiliary/linux/auxiliary.c | 1 -
> drivers/bus/fslmc/fslmc_bus.c | 1 -
> drivers/bus/fslmc/fslmc_vfio.c | 1 -
> drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 1 -
> drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 1 -
> drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 1 -
> drivers/bus/pci/linux/pci.c | 1 -
> drivers/common/idpf/idpf_common_device.c | 4 +-
> drivers/common/idpf/idpf_common_virtchnl.c | 10 +-
> drivers/common/qat/qat_qp.c | 10 +-
> drivers/compress/qat/qat_comp.c | 8 +-
> drivers/crypto/ccp/ccp_crypto.c | 14 +--
> drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +-
> drivers/crypto/cnxk/cnxk_se.h | 2 +-
> drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
> drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +-
> drivers/crypto/qat/qat_sym_session.c | 52 ++++-----
> .../scheduler/rte_cryptodev_scheduler.c | 6 +-
> drivers/crypto/scheduler/scheduler_failover.c | 12 +-
> drivers/event/cnxk/cnxk_eventdev_selftest.c | 1 -
> drivers/event/cnxk/cnxk_tim_evdev.c | 4 +-
> drivers/event/dlb2/dlb2.c | 4 +-
> drivers/event/dpaa/dpaa_eventdev.c | 1 -
> drivers/event/dpaa2/dpaa2_eventdev.c | 7 +-
> drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 1 -
> drivers/event/dpaa2/dpaa2_hw_dpcon.c | 1 -
> drivers/event/octeontx/ssovf_evdev_selftest.c | 1 -
> drivers/event/octeontx/timvf_evdev.c | 4 +-
> drivers/mempool/dpaa/dpaa_mempool.c | 4 +-
> drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 5 +-
> drivers/ml/cnxk/cn10k_ml_model.c | 8 +-
> drivers/ml/cnxk/cn10k_ml_ops.c | 11 +-
> drivers/ml/cnxk/cnxk_ml_ops.c | 2 +-
> drivers/ml/cnxk/mvtvm_ml_model.c | 8 +-
> drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +-
> drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
> drivers/net/avp/avp_ethdev.c | 4 +-
> drivers/net/axgbe/axgbe_ethdev.c | 4 +-
> drivers/net/bnx2x/bnx2x.c | 32 +++--
> drivers/net/bnxt/bnxt_flow.c | 34 +++---
> drivers/net/bonding/rte_eth_bond_8023ad.c | 4 +-
> drivers/net/bonding/rte_eth_bond_flow.c | 2 +-
> drivers/net/cnxk/cnxk_eswitch_devargs.c | 3 +-
> drivers/net/cnxk/cnxk_ethdev_ops.c | 2 +-
> drivers/net/cnxk/cnxk_rep.c | 3 +-
> drivers/net/cnxk/cnxk_rep_flow.c | 6 +-
> drivers/net/cnxk/cnxk_rep_msg.c | 8 +-
> drivers/net/cnxk/cnxk_rep_ops.c | 2 +-
> drivers/net/cnxk/cnxk_tm.c | 5 +-
> drivers/net/cpfl/cpfl_ethdev.c | 3 +-
> drivers/net/cpfl/cpfl_vchnl.c | 4 +-
> drivers/net/cxgbe/clip_tbl.c | 2 +-
> drivers/net/cxgbe/cxgbe_filter.c | 8 +-
> drivers/net/cxgbe/l2t.c | 4 +-
> drivers/net/cxgbe/smt.c | 20 ++--
> drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 1 -
> drivers/net/dpaa2/dpaa2_ethdev.c | 1 -
> drivers/net/dpaa2/dpaa2_recycle.c | 1 -
> drivers/net/dpaa2/dpaa2_rxtx.c | 1 -
> drivers/net/dpaa2/dpaa2_sparser.c | 1 -
> drivers/net/dpaa2/dpaa2_tm.c | 2 +-
> drivers/net/e1000/em_rxtx.c | 1 -
> drivers/net/e1000/igb_flow.c | 22 ++--
> drivers/net/e1000/igb_pf.c | 7 +-
> drivers/net/e1000/igb_rxtx.c | 1 -
> drivers/net/enic/enic_main.c | 8 +-
> drivers/net/failsafe/failsafe_ops.c | 6 +-
> drivers/net/gve/base/gve_adminq.c | 2 +-
> drivers/net/hinic/hinic_pmd_ethdev.c | 1 -
> drivers/net/hinic/hinic_pmd_flow.c | 40 +++----
> drivers/net/hns3/hns3_fdir.c | 2 +-
> drivers/net/hns3/hns3_flow.c | 4 +-
> drivers/net/i40e/i40e_ethdev.c | 109 ++++++++----------
> drivers/net/i40e/i40e_fdir.c | 28 +++--
> drivers/net/i40e/i40e_flow.c | 56 +++++----
> drivers/net/i40e/i40e_pf.c | 3 +-
> drivers/net/i40e/i40e_tm.c | 11 +-
> drivers/net/i40e/rte_pmd_i40e.c | 34 +++---
> drivers/net/iavf/iavf_fdir.c | 93 +++++++--------
> drivers/net/iavf/iavf_fsub.c | 50 ++++----
> drivers/net/iavf/iavf_generic_flow.c | 2 +-
> drivers/net/iavf/iavf_tm.c | 11 +-
> drivers/net/iavf/iavf_vchnl.c | 9 +-
> drivers/net/ice/ice_dcf.c | 5 +-
> drivers/net/ice/ice_dcf_parent.c | 2 +-
> drivers/net/ice/ice_dcf_sched.c | 11 +-
> drivers/net/ice/ice_diagnose.c | 4 +-
> drivers/net/ice/ice_ethdev.c | 14 +--
> drivers/net/ice/ice_fdir_filter.c | 37 +++---
> drivers/net/ice/ice_generic_flow.c | 2 +-
> drivers/net/ice/ice_hash.c | 2 +-
> drivers/net/ice/ice_tm.c | 11 +-
> drivers/net/idpf/idpf_ethdev.c | 7 +-
> drivers/net/idpf/idpf_rxtx.c | 10 +-
> drivers/net/ipn3ke/ipn3ke_flow.c | 32 +++--
> drivers/net/ipn3ke/ipn3ke_representor.c | 16 +--
> drivers/net/ipn3ke/ipn3ke_tm.c | 6 +-
> drivers/net/ixgbe/ixgbe_ethdev.c | 9 +-
> drivers/net/ixgbe/ixgbe_fdir.c | 7 +-
> drivers/net/ixgbe/ixgbe_flow.c | 65 +++++------
> drivers/net/ixgbe/ixgbe_ipsec.c | 8 +-
> drivers/net/ixgbe/ixgbe_pf.c | 5 +-
> drivers/net/ixgbe/ixgbe_tm.c | 11 +-
> drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +-
> drivers/net/memif/memif_socket.c | 4 +-
> drivers/net/mlx5/mlx5_devx.c | 4 +-
> drivers/net/mlx5/mlx5_flow.c | 38 +++---
> drivers/net/mlx5/mlx5_flow_aso.c | 6 +-
> drivers/net/mlx5/mlx5_flow_hw.c | 27 ++---
> drivers/net/mlx5/mlx5_rx.c | 6 +-
> drivers/net/mlx5/mlx5_rxtx_vec.c | 8 +-
> drivers/net/mvpp2/mrvl_tm.c | 2 +-
> drivers/net/netvsc/hn_ethdev.c | 1 -
> drivers/net/nfp/flower/nfp_conntrack.c | 2 +-
> drivers/net/nfp/flower/nfp_flower_flow.c | 16 +--
> .../net/nfp/flower/nfp_flower_representor.c | 2 +-
> drivers/net/nfp/nfp_mtr.c | 10 +-
> drivers/net/ngbe/ngbe_pf.c | 4 +-
> drivers/net/null/rte_eth_null.c | 6 +-
> drivers/net/pcap/pcap_ethdev.c | 2 +-
> drivers/net/pcap/pcap_osdep_freebsd.c | 3 +-
> drivers/net/pcap/pcap_osdep_linux.c | 3 +-
> drivers/net/qede/qede_main.c | 2 +-
> drivers/net/ring/rte_eth_ring.c | 1 -
> drivers/net/sfc/sfc.c | 2 +-
> drivers/net/sfc/sfc_ef10_tx.c | 2 +-
> drivers/net/sfc/sfc_ethdev.c | 11 +-
> drivers/net/sfc/sfc_flow.c | 20 ++--
> drivers/net/sfc/sfc_flow_rss.c | 2 +-
> drivers/net/sfc/sfc_mae.c | 2 +-
> drivers/net/sfc/sfc_rx.c | 2 +-
> drivers/net/sfc/sfc_tso.c | 2 +-
> drivers/net/sfc/sfc_tso.h | 9 +-
> drivers/net/tap/rte_eth_tap.c | 14 +--
> drivers/net/txgbe/txgbe_ethdev.c | 9 +-
> drivers/net/txgbe/txgbe_fdir.c | 6 +-
> drivers/net/txgbe/txgbe_flow.c | 65 +++++------
> drivers/net/txgbe/txgbe_ipsec.c | 8 +-
> drivers/net/txgbe/txgbe_pf.c | 5 +-
> drivers/net/txgbe/txgbe_tm.c | 11 +-
> drivers/net/vhost/rte_eth_vhost.c | 1 -
> drivers/net/virtio/virtio_ethdev.c | 1 -
> drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +-
> drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +-
> drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +-
> drivers/raw/ifpga/afu_pmd_n3000.c | 8 +-
> drivers/raw/ifpga/ifpga_rawdev.c | 11 +-
> drivers/raw/skeleton/skeleton_rawdev.c | 8 +-
> drivers/raw/skeleton/skeleton_rawdev_test.c | 1 -
> examples/bbdev_app/main.c | 2 +-
> examples/bond/main.c | 1 -
> examples/ip_fragmentation/main.c | 1 -
> examples/ip_reassembly/main.c | 1 -
> examples/ipv4_multicast/main.c | 1 -
> examples/l2fwd-cat/cat.c | 4 +-
> examples/l2fwd-jobstats/main.c | 1 -
> examples/l2fwd-keepalive/main.c | 1 -
> examples/l2fwd-macsec/main.c | 1 -
> examples/l2fwd/main.c | 1 -
> examples/l3fwd-power/main.c | 1 -
> examples/l3fwd/main.c | 1 -
> examples/link_status_interrupt/main.c | 1 -
> .../client_server_mp/mp_server/init.c | 1 -
> .../client_server_mp/mp_server/main.c | 1 -
> examples/multi_process/symmetric_mp/main.c | 1 -
> examples/ptpclient/ptpclient.c | 11 +-
> examples/qos_sched/app_thread.c | 1 -
> examples/qos_sched/main.c | 1 -
> examples/server_node_efd/efd_server/init.c | 1 -
> examples/server_node_efd/efd_server/main.c | 1 -
> examples/vhost/main.c | 6 +-
> examples/vmdq/main.c | 6 +-
> examples/vmdq_dcb/main.c | 15 +--
> lib/cryptodev/rte_cryptodev.c | 2 +-
> lib/eal/common/eal_common_options.c | 7 +-
> lib/ethdev/rte_ethdev.c | 3 +-
> lib/ethdev/rte_flow.c | 5 +-
> lib/eventdev/rte_event_crypto_adapter.c | 2 +-
> lib/eventdev/rte_event_dma_adapter.c | 4 +-
> lib/eventdev/rte_event_timer_adapter.c | 2 +-
> lib/fib/trie.c | 2 +-
> lib/ip_frag/rte_ipv6_fragmentation.c | 4 +-
> lib/ip_frag/rte_ipv6_reassembly.c | 6 +-
> lib/lpm/rte_lpm6.c | 3 +-
> lib/net/rte_ether.c | 2 +-
> lib/node/ip6_lookup.c | 8 +-
> lib/pdcp/pdcp_process.c | 36 +++---
> lib/pipeline/rte_table_action.c | 8 +-
> lib/rib/rte_rib6.h | 5 +-
> lib/security/rte_security.c | 4 +-
> 232 files changed, 886 insertions(+), 1045 deletions(-)
> create mode 100644 devtools/cocci/rte_memcpy.cocci
>
> --
Series-Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
^ permalink raw reply [flat|nested] 205+ messages in thread
* RE: [PATCH v3 17/30] baseband: replace use of fixed size rte_memcpy
2024-04-02 21:50 ` [PATCH v3 17/30] baseband: " Stephen Hemminger
@ 2024-04-05 1:22 ` Chautru, Nicolas
2024-04-05 15:02 ` Stephen Hemminger
0 siblings, 1 reply; 205+ messages in thread
From: Chautru, Nicolas @ 2024-04-05 1:22 UTC (permalink / raw)
To: Stephen Hemminger, dev; +Cc: Gagandeep Singh, Hemant Agrawal
Hi Stephen,
Your script is causing some odd line split which are not required I believe. Also doing mix of space and tabs.
- rte_memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld, ACC_FCW_LD_BLEN);
+ memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
+ ACC_FCW_LD_BLEN);
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Tuesday, April 2, 2024 2:51 PM
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Chautru, Nicolas
> <nicolas.chautru@intel.com>; Gagandeep Singh <g.singh@nxp.com>; Hemant
> Agrawal <hemant.agrawal@nxp.com>
> Subject: [PATCH v3 17/30] baseband: replace use of fixed size rte_memcpy
>
> Automatically generated by devtools/cocci/rte_memcpy.cocci
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> drivers/baseband/acc/rte_acc100_pmd.c | 17 ++++++++---------
> drivers/baseband/acc/rte_vrb_pmd.c | 21 ++++++++++-----------
> drivers/baseband/la12xx/bbdev_la12xx.c | 4 ++--
> 3 files changed, 20 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/baseband/acc/rte_acc100_pmd.c
> b/drivers/baseband/acc/rte_acc100_pmd.c
> index 4f666e514b..6a6212f3de 100644
> --- a/drivers/baseband/acc/rte_acc100_pmd.c
> +++ b/drivers/baseband/acc/rte_acc100_pmd.c
> @@ -2975,15 +2975,13 @@ enqueue_ldpc_dec_one_op_cb(struct acc_queue
> *q, struct rte_bbdev_dec_op *op,
> uint8_t *prev_ptr = (uint8_t *) prev_desc;
> uint8_t *new_ptr = (uint8_t *) desc;
> /* Copy first 4 words and BDESCs */
> - rte_memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
> - rte_memcpy(new_ptr + ACC_5GUL_OFFSET_0,
> - prev_ptr + ACC_5GUL_OFFSET_0,
> - ACC_5GUL_SIZE_1);
> + memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
> + memcpy(new_ptr + ACC_5GUL_OFFSET_0,
> + prev_ptr + ACC_5GUL_OFFSET_0, ACC_5GUL_SIZE_1);
> desc->req.op_addr = prev_desc->req.op_addr;
> /* Copy FCW */
> - rte_memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
> - prev_ptr + ACC_DESC_FCW_OFFSET,
> - ACC_FCW_LD_BLEN);
> + memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
> + prev_ptr + ACC_DESC_FCW_OFFSET, ACC_FCW_LD_BLEN);
> acc100_dma_desc_ld_update(op, &desc->req, input,
> h_output,
> &in_offset, &h_out_offset,
> &h_out_length, harq_layout);
> @@ -3130,7 +3128,8 @@ enqueue_ldpc_dec_one_op_tb(struct acc_queue
> *q, struct rte_bbdev_dec_op *op,
> desc = acc_desc(q, total_enqueued_cbs);
> desc->req.data_ptrs[0].address = q->ring_addr_iova +
> fcw_offset;
> desc->req.data_ptrs[0].blen = ACC_FCW_LD_BLEN;
> - rte_memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
> ACC_FCW_LD_BLEN);
> + memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
> + ACC_FCW_LD_BLEN);
> ret = acc100_dma_desc_ld_fill(op, &desc->req, &input,
> h_output, &in_offset, &h_out_offset,
> &h_out_length,
> @@ -4430,7 +4429,7 @@ acc100_configure(const char *dev_name, struct
> rte_acc_conf *conf)
> struct acc_device *d = bbdev->data->dev_private;
>
> /* Store configuration */
> - rte_memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
> + memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
>
> value = acc_reg_read(d, HwPfPcieGpexBridgeControl);
> bool firstCfg = (value != ACC100_CFG_PCI_BRIDGE); diff --git
> a/drivers/baseband/acc/rte_vrb_pmd.c
> b/drivers/baseband/acc/rte_vrb_pmd.c
> index 88b1104fab..3e5376a12e 100644
> --- a/drivers/baseband/acc/rte_vrb_pmd.c
> +++ b/drivers/baseband/acc/rte_vrb_pmd.c
> @@ -2450,15 +2450,13 @@ vrb_enqueue_ldpc_dec_one_op_cb(struct
> acc_queue *q, struct rte_bbdev_dec_op *op,
> uint8_t *prev_ptr = (uint8_t *) prev_desc;
> uint8_t *new_ptr = (uint8_t *) desc;
> /* Copy first 4 words and BDESCs. */
> - rte_memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
> - rte_memcpy(new_ptr + ACC_5GUL_OFFSET_0,
> - prev_ptr + ACC_5GUL_OFFSET_0,
> - ACC_5GUL_SIZE_1);
> + memcpy(new_ptr, prev_ptr, ACC_5GUL_SIZE_0);
> + memcpy(new_ptr + ACC_5GUL_OFFSET_0,
> + prev_ptr + ACC_5GUL_OFFSET_0, ACC_5GUL_SIZE_1);
> desc->req.op_addr = prev_desc->req.op_addr;
> /* Copy FCW. */
> - rte_memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
> - prev_ptr + ACC_DESC_FCW_OFFSET,
> - ACC_FCW_LD_BLEN);
> + memcpy(new_ptr + ACC_DESC_FCW_OFFSET,
> + prev_ptr + ACC_DESC_FCW_OFFSET, ACC_FCW_LD_BLEN);
> vrb_dma_desc_ld_update(op, &desc->req, input, h_output,
> &in_offset, &h_out_offset,
> &h_out_length, harq_layout);
> @@ -2566,7 +2564,8 @@ vrb_enqueue_ldpc_dec_one_op_tb(struct
> acc_queue *q, struct rte_bbdev_dec_op *op,
> fcw_offset = (desc_idx << 8) + ACC_DESC_FCW_OFFSET;
> desc->req.data_ptrs[0].address = q->ring_addr_iova +
> fcw_offset;
> desc->req.data_ptrs[0].blen = ACC_FCW_LD_BLEN;
> - rte_memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
> ACC_FCW_LD_BLEN);
> + memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
> + ACC_FCW_LD_BLEN);
> desc->req.fcw_ld.tb_trailer_size = (c - r - 1) * trail_len;
> ret = vrb_dma_desc_ld_fill(op, &desc->req, &input,
> h_output, &in_offset, &h_out_offset, @@ -
> 3991,7 +3990,7 @@ enqueue_mldts_split_op(struct acc_queue *q, struct
> rte_bbdev_mldts_op *op,
> if (symb == 0)
> desc->req.cbs_in_tb = num_syms;
> else
> - rte_memcpy(&desc->req.fcw_mldts, fcw,
> ACC_FCW_MLDTS_BLEN);
> + memcpy(&desc->req.fcw_mldts, fcw,
> ACC_FCW_MLDTS_BLEN);
> desc->req.data_ptrs[1].address =
> rte_pktmbuf_iova_offset(input_q, in_offset);
> desc->req.data_ptrs[1].blen = q_size;
> in_offset += q_size;
> @@ -4337,7 +4336,7 @@ vrb1_configure(const char *dev_name, struct
> rte_acc_conf *conf)
> struct acc_device *d = bbdev->data->dev_private;
>
> /* Store configuration. */
> - rte_memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
> + memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
>
> /* Check we are already out of PG. */
> status = acc_reg_read(d, VRB1_PfHiSectionPowerGatingAck); @@ -
> 4744,7 +4743,7 @@ vrb2_configure(const char *dev_name, struct
> rte_acc_conf *conf)
> struct acc_device *d = bbdev->data->dev_private;
>
> /* Store configuration. */
> - rte_memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
> + memcpy(&d->acc_conf, conf, sizeof(d->acc_conf));
>
> /* Explicitly releasing AXI as this may be stopped after PF FLR/BME. */
> address = VRB2_PfDmaAxiControl;
> diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c
> b/drivers/baseband/la12xx/bbdev_la12xx.c
> index bb754a5395..23e2fdb811 100644
> --- a/drivers/baseband/la12xx/bbdev_la12xx.c
> +++ b/drivers/baseband/la12xx/bbdev_la12xx.c
> @@ -597,8 +597,8 @@ dequeue_single_op(struct bbdev_la12xx_q_priv
> *q_priv, void *dst)
>
> op = q_priv->bbdev_op[ci];
>
> - rte_memcpy(dst, q_priv->msg_ch_vaddr[ci],
> - sizeof(struct bbdev_ipc_enqueue_op));
> + memcpy(dst, q_priv->msg_ch_vaddr[ci],
> + sizeof(struct bbdev_ipc_enqueue_op));
>
> /* Move Consumer Index forward */
> ci++;
> --
> 2.43.0
^ permalink raw reply [flat|nested] 205+ messages in thread
* Re: [PATCH v3 17/30] baseband: replace use of fixed size rte_memcpy
2024-04-05 1:22 ` Chautru, Nicolas
@ 2024-04-05 15:02 ` Stephen Hemminger
0 siblings, 0 replies; 205+ messages in thread
From: Stephen Hemminger @ 2024-04-05 15:02 UTC (permalink / raw)
To: Chautru, Nicolas; +Cc: dev, Gagandeep Singh, Hemant Agrawal
On Fri, 5 Apr 2024 01:22:59 +0000
"Chautru, Nicolas" <nicolas.chautru@intel.com> wrote:
> Hi Stephen,
>
> Your script is causing some odd line split which are not required I believe. Also doing mix of space and tabs.
>
> - rte_memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld, ACC_FCW_LD_BLEN);
> + memcpy(&desc->req.fcw_ld, &desc_first->req.fcw_ld,
> + ACC_FCW_LD_BLEN);
The coccinelle spatch tool seems to still think that max line length should be 80.
Will fix these manually.
^ permalink raw reply [flat|nested] 205+ messages in thread
end of thread, other threads:[~2024-04-05 15:02 UTC | newest]
Thread overview: 205+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-29 22:57 [PATCH 00/71] replace use of fixed size rte_memcpy Stephen Hemminger
2024-02-29 22:57 ` [PATCH 01/71] cocci/rte_memcpy: add script to eliminate " Stephen Hemminger
2024-03-01 8:07 ` Morten Brørup
2024-02-29 22:57 ` [PATCH 02/71] eal: replace use of " Stephen Hemminger
2024-02-29 22:57 ` [PATCH 03/71] ethdev: " Stephen Hemminger
2024-02-29 22:57 ` [PATCH 04/71] eventdev: " Stephen Hemminger
2024-02-29 22:57 ` [PATCH 05/71] cryptodev: " Stephen Hemminger
2024-02-29 22:57 ` [PATCH 06/71] ip_frag: " Stephen Hemminger
2024-02-29 22:57 ` [PATCH 07/71] net: " Stephen Hemminger
2024-02-29 22:57 ` [PATCH 08/71] lpm: " Stephen Hemminger
2024-02-29 22:57 ` [PATCH 09/71] node: " Stephen Hemminger
2024-02-29 22:57 ` [PATCH 10/71] pdcp: " Stephen Hemminger
2024-02-29 22:57 ` [PATCH 11/71] pipeline: " Stephen Hemminger
2024-02-29 22:57 ` [PATCH 12/71] rib: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 13/71] security: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 14/71] net/mlx5: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 15/71] net/nfp: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 16/71] net/ngbe: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 17/71] net/null: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 18/71] net/pcap: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 19/71] net/sfc: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 20/71] net/tap: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 21/71] net/txgbe: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 22/71] raw/ifpga: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 23/71] raw/skeleton: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 24/71] net/hns3: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 25/71] net/i40e: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 26/71] net/iavf: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 27/71] net/ice: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 28/71] net/idpf: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 29/71] net/ipn3ke: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 30/71] net/ixgbe: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 31/71] net/memif: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 32/71] net/qede: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 33/71] baseband/acc: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 34/71] baseband/la12xx: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 35/71] common/idpf: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 36/71] common/qat: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 37/71] compress/qat: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 38/71] crypto/ccp: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 39/71] crypto/cnxk: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 40/71] crypto/dpaa_sec: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 41/71] crypto/ipsec_mb: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 42/71] crypto/qat: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 43/71] crypto/scheduler: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 44/71] event/cnxk: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 45/71] event/dlb2: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 46/71] event/dpaa2: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 47/71] event/octeontx: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 48/71] mempool/dpaa: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 49/71] mempool/dpaa2: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 50/71] ml/cnxk: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 51/71] net/af_xdp: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 52/71] net/avp: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 53/71] net/axgbe: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 54/71] net/bnx2x: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 55/71] net/bnxt: " Stephen Hemminger
2024-03-01 2:54 ` Somnath Kotur
2024-02-29 22:58 ` [PATCH 56/71] net/bonding: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 57/71] net/cnxk: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 58/71] net/cpfl: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 59/71] net/cxgbe: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 60/71] net/dpaa2: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 61/71] net/e1000: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 62/71] net/enic: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 63/71] net/failsafe: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 64/71] net/gve/base: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 65/71] net/hinic: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 66/71] net/mvpp2: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 67/71] app/test-pmd: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 68/71] app/graph: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 69/71] app/test-eventdev: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 70/71] app/test: " Stephen Hemminger
2024-02-29 22:58 ` [PATCH 71/71] examples: " Stephen Hemminger
2024-03-01 8:38 ` [PATCH 00/71] " Bruce Richardson
2024-03-01 11:06 ` Hemant Agrawal
2024-03-01 12:55 ` Konstantin Ananyev
2024-03-01 18:55 ` Ajit Khaparde
2024-03-01 13:53 ` David Marchand
2024-03-01 17:14 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Stephen Hemminger
2024-03-01 17:14 ` [PATCH v2 01/71] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy Stephen Hemminger
2024-03-02 11:19 ` Mattias Rönnblom
2024-03-02 17:02 ` Stephen Hemminger
2024-03-02 17:39 ` Morten Brørup
2024-03-01 17:14 ` [PATCH v2 02/71] eal: replace use of " Stephen Hemminger
2024-03-01 17:14 ` [PATCH v2 03/71] ethdev: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 04/71] eventdev: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 05/71] cryptodev: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 06/71] ip_frag: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 07/71] net: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 08/71] lpm: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 09/71] node: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 10/71] pdcp: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 11/71] pipeline: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 12/71] rib: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 13/71] security: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 14/71] net/mlx5: " Stephen Hemminger
2024-03-08 18:16 ` Dariusz Sosnowski
2024-03-01 17:15 ` [PATCH v2 15/71] net/nfp: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 16/71] net/ngbe: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 17/71] net/null: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 18/71] net/pcap: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 19/71] net/sfc: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 20/71] net/tap: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 21/71] net/txgbe: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 22/71] raw/ifpga: " Stephen Hemminger
2024-03-05 9:13 ` Xu, Rosen
2024-03-01 17:15 ` [PATCH v2 23/71] raw/skeleton: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 24/71] net/hns3: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 25/71] net/i40e: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 26/71] net/iavf: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 27/71] net/ice: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 28/71] net/idpf: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 29/71] net/ipn3ke: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 30/71] net/ixgbe: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 31/71] net/memif: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 32/71] net/qede: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 33/71] baseband/acc: " Stephen Hemminger
2024-03-02 1:01 ` Chautru, Nicolas
2024-03-02 3:23 ` Stephen Hemminger
2024-03-04 18:39 ` Chautru, Nicolas
2024-03-01 17:15 ` [PATCH v2 34/71] baseband/la12xx: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 35/71] common/idpf: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 36/71] common/qat: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 37/71] compress/qat: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 38/71] crypto/ccp: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 39/71] crypto/cnxk: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 40/71] crypto/dpaa_sec: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 41/71] crypto/ipsec_mb: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 42/71] crypto/qat: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 43/71] crypto/scheduler: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 44/71] event/cnxk: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 45/71] event/dlb2: " Stephen Hemminger
2024-03-05 17:07 ` Sevincer, Abdullah
2024-03-05 18:30 ` Stephen Hemminger
2024-03-06 15:24 ` Sevincer, Abdullah
2024-03-01 17:15 ` [PATCH v2 46/71] event/dpaa2: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 47/71] event/octeontx: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 48/71] mempool/dpaa: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 49/71] mempool/dpaa2: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 50/71] ml/cnxk: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 51/71] net/af_xdp: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 52/71] net/avp: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 53/71] net/axgbe: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 54/71] net/bnx2x: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 55/71] net/bnxt: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 56/71] net/bonding: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 57/71] net/cnxk: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 58/71] net/cpfl: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 59/71] net/cxgbe: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 60/71] net/dpaa2: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 61/71] net/e1000: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 62/71] net/enic: " Stephen Hemminger
2024-03-01 17:15 ` [PATCH v2 63/71] net/failsafe: " Stephen Hemminger
2024-03-01 17:16 ` [PATCH v2 64/71] net/gve/base: " Stephen Hemminger
2024-03-01 17:16 ` [PATCH v2 65/71] net/hinic: " Stephen Hemminger
2024-03-01 17:16 ` [PATCH v2 66/71] net/mvpp2: " Stephen Hemminger
2024-03-01 17:16 ` [PATCH v2 67/71] app/test-pmd: " Stephen Hemminger
2024-03-01 17:16 ` [PATCH v2 68/71] app/graph: " Stephen Hemminger
2024-03-01 17:16 ` [PATCH v2 69/71] app/test-eventdev: " Stephen Hemminger
2024-03-01 17:16 ` [PATCH v2 70/71] app/test: " Stephen Hemminger
2024-03-01 17:16 ` [PATCH v2 71/71] examples: " Stephen Hemminger
2024-03-01 17:50 ` [PATCH v2 00/71] replace use of fixed size rte_mempcy Tyler Retzlaff
2024-03-02 11:14 ` Mattias Rönnblom
2024-03-02 12:01 ` Mattias Rönnblom
2024-03-02 13:05 ` Morten Brørup
2024-03-02 16:37 ` Stephen Hemminger
2024-03-02 17:32 ` Morten Brørup
2024-03-02 16:35 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 01/30] cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 02/30] eal: replace use of " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 03/30] ethdev: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 04/30] eventdev: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 05/30] cryptodev: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 06/30] ip_frag: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 07/30] net: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 08/30] lpm: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 09/30] node: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 10/30] pdcp: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 11/30] pipeline: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 12/30] rib: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 13/30] security: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 14/30] bus: remove unneeded rte_memcpy.h include Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 15/30] net: replace use of fixed size rte_memcpy Stephen Hemminger
2024-04-04 11:07 ` Slava Ovsiienko
2024-04-02 21:50 ` [PATCH v3 16/30] raw: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 17/30] baseband: " Stephen Hemminger
2024-04-05 1:22 ` Chautru, Nicolas
2024-04-05 15:02 ` Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 18/30] common: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 19/30] crypto: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 20/30] " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 21/30] event: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 22/30] mempool: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 23/30] ml/cnxk: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 24/30] app/test-pmd: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 25/30] app/graph: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 26/30] app/test-eventdev: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 27/30] app/test: " Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 28/30] app/test-pipeline: remove unused rte_memcpy.h include Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 29/30] app/test-bbdev: remove unnecessary include of rte_memcpy.h Stephen Hemminger
2024-04-02 21:50 ` [PATCH v3 30/30] examples: replace use of fixed size rte_memcpy Stephen Hemminger
2024-04-04 7:50 ` [PATCH v3 00/30] replace rte_memcpy of fixed size with memcpy Konstantin Ananyev
2024-04-04 15:52 ` Tyler Retzlaff
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).