[PATCH v2 32/68] net/dpaa2: replace use of rte_memcpy

Stephen Hemminger stephen at networkplumber.org
Fri Aug 21 21:24:27 CEST 2026


Don't need rte_memcpy for fixed size value.

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 drivers/net/dpaa2/base/dpaa2_hw_dpni.c |  1 -
 drivers/net/dpaa2/dpaa2_ethdev.c       |  1 -
 drivers/net/dpaa2/dpaa2_mux.c          | 36 +++++++++++++-------------
 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 +-
 7 files changed, 19 insertions(+), 24 deletions(-)

diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
index 26ad105c73..33b20c35f7 100644
--- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
+++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c
@@ -12,7 +12,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 f211357919..d6786b5cb0 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -12,7 +12,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_mux.c b/drivers/net/dpaa2/dpaa2_mux.c
index 7b7bf4161c..19b9388d41 100644
--- a/drivers/net/dpaa2/dpaa2_mux.c
+++ b/drivers/net/dpaa2/dpaa2_mux.c
@@ -151,12 +151,12 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 
 			spec = pattern[loop].spec;
 			mask = pattern[loop].mask;
-			rte_memcpy(&key_va[key_size],
-				&spec->hdr.next_proto_id, sizeof(uint8_t));
+			memcpy(&key_va[key_size], &spec->hdr.next_proto_id,
+			       sizeof(uint8_t));
 			if (mask) {
-				rte_memcpy(&mask_va[key_size],
-					&mask->hdr.next_proto_id,
-					sizeof(uint8_t));
+				memcpy(&mask_va[key_size],
+				       &mask->hdr.next_proto_id,
+				       sizeof(uint8_t));
 			} else {
 				mask_va[key_size] = 0xff;
 			}
@@ -179,11 +179,11 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 
 			spec = pattern[loop].spec;
 			mask = pattern[loop].mask;
-			rte_memcpy(&key_va[key_size],
-				&spec->tci, sizeof(uint16_t));
+			memcpy(&key_va[key_size], &spec->tci,
+			       sizeof(uint16_t));
 			if (mask) {
-				rte_memcpy(&mask_va[key_size],
-					&mask->tci, sizeof(uint16_t));
+				memcpy(&mask_va[key_size], &mask->tci,
+				       sizeof(uint16_t));
 			} else {
 				memset(&mask_va[key_size], 0xff,
 					sizeof(rte_be16_t));
@@ -206,12 +206,12 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 
 			spec = pattern[loop].spec;
 			mask = pattern[loop].mask;
-			rte_memcpy(&key_va[key_size],
-				&spec->hdr.dst_port, sizeof(rte_be16_t));
+			memcpy(&key_va[key_size], &spec->hdr.dst_port,
+			       sizeof(rte_be16_t));
 			if (mask) {
-				rte_memcpy(&mask_va[key_size],
-					&mask->hdr.dst_port,
-					sizeof(rte_be16_t));
+				memcpy(&mask_va[key_size],
+				       &mask->hdr.dst_port,
+				       sizeof(rte_be16_t));
 			} else {
 				memset(&mask_va[key_size], 0xff,
 					sizeof(rte_be16_t));
@@ -234,11 +234,11 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id,
 
 			spec = pattern[loop].spec;
 			mask = pattern[loop].mask;
-			rte_memcpy(&key_va[key_size],
-				&spec->type, sizeof(rte_be16_t));
+			memcpy(&key_va[key_size], &spec->type,
+			       sizeof(rte_be16_t));
 			if (mask) {
-				rte_memcpy(&mask_va[key_size],
-					&mask->type, sizeof(rte_be16_t));
+				memcpy(&mask_va[key_size], &mask->type,
+				       sizeof(rte_be16_t));
 			} else {
 				memset(&mask_va[key_size], 0xff,
 					sizeof(rte_be16_t));
diff --git a/drivers/net/dpaa2/dpaa2_recycle.c b/drivers/net/dpaa2/dpaa2_recycle.c
index f78d12362e..8dd10738ab 100644
--- a/drivers/net/dpaa2/dpaa2_recycle.c
+++ b/drivers/net/dpaa2/dpaa2_recycle.c
@@ -8,7 +8,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 c31d6556ad..baaaacc2e0 100644
--- a/drivers/net/dpaa2/dpaa2_rxtx.c
+++ b/drivers/net/dpaa2/dpaa2_rxtx.c
@@ -12,7 +12,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 6c3e6eb573..60dadb4776 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 36e815c356..497cd2dc84 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.53.0



More information about the dev mailing list