[PATCH v2 68/68] power: replace use of rte_memcpy
Stephen Hemminger
stephen at networkplumber.org
Fri Aug 21 21:25:03 CEST 2026
All the uses of rte_memcpy() in the power drivers are in the
frequency list query API, which is control path only. Regular
memcpy() has no performance disadvantage there and gets more
compile time checking of the arguments.
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
drivers/power/acpi/acpi_cpufreq.c | 4 ++--
drivers/power/amd_pstate/amd_pstate_cpufreq.c | 4 ++--
drivers/power/amd_uncore/amd_uncore.c | 5 ++---
drivers/power/cppc/cppc_cpufreq.c | 4 ++--
drivers/power/intel_pstate/intel_pstate_cpufreq.c | 3 +--
drivers/power/intel_uncore/intel_uncore.c | 5 ++---
6 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/drivers/power/acpi/acpi_cpufreq.c b/drivers/power/acpi/acpi_cpufreq.c
index af85a8cdec..03769a0276 100644
--- a/drivers/power/acpi/acpi_cpufreq.c
+++ b/drivers/power/acpi/acpi_cpufreq.c
@@ -5,8 +5,8 @@
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
+#include <string.h>
-#include <rte_memcpy.h>
#include <rte_stdatomic.h>
#include <rte_string_fns.h>
@@ -364,7 +364,7 @@ power_acpi_cpufreq_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num)
POWER_LOG(ERR, "Buffer size is not enough");
return 0;
}
- rte_memcpy(freqs, pi->freqs, pi->nb_freqs * sizeof(uint32_t));
+ memcpy(freqs, pi->freqs, pi->nb_freqs * sizeof(uint32_t));
return pi->nb_freqs;
}
diff --git a/drivers/power/amd_pstate/amd_pstate_cpufreq.c b/drivers/power/amd_pstate/amd_pstate_cpufreq.c
index af9c1309f3..7efaf7b944 100644
--- a/drivers/power/amd_pstate/amd_pstate_cpufreq.c
+++ b/drivers/power/amd_pstate/amd_pstate_cpufreq.c
@@ -5,8 +5,8 @@
*/
#include <stdlib.h>
+#include <string.h>
-#include <rte_memcpy.h>
#include <rte_stdatomic.h>
#include "amd_pstate_cpufreq.h"
@@ -483,7 +483,7 @@ power_amd_pstate_cpufreq_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t
POWER_LOG(ERR, "Buffer size is not enough");
return 0;
}
- rte_memcpy(freqs, pi->freqs, pi->nb_freqs * sizeof(uint32_t));
+ memcpy(freqs, pi->freqs, pi->nb_freqs * sizeof(uint32_t));
return pi->nb_freqs;
}
diff --git a/drivers/power/amd_uncore/amd_uncore.c b/drivers/power/amd_uncore/amd_uncore.c
index c3e95cdc08..f9dc0c814f 100644
--- a/drivers/power/amd_uncore/amd_uncore.c
+++ b/drivers/power/amd_uncore/amd_uncore.c
@@ -5,8 +5,7 @@
#include <errno.h>
#include <dirent.h>
#include <fnmatch.h>
-
-#include <rte_memcpy.h>
+#include <string.h>
#include "amd_uncore.h"
#include "power_common.h"
@@ -269,7 +268,7 @@ power_amd_uncore_freqs(unsigned int pkg, unsigned int die, uint32_t *freqs, uint
POWER_LOG(ERR, "Buffer size is not enough");
return 0;
}
- rte_memcpy(freqs, ui->freqs, ui->nb_freqs * sizeof(uint32_t));
+ memcpy(freqs, ui->freqs, ui->nb_freqs * sizeof(uint32_t));
return ui->nb_freqs;
}
diff --git a/drivers/power/cppc/cppc_cpufreq.c b/drivers/power/cppc/cppc_cpufreq.c
index aed44c1212..b4bfe1865f 100644
--- a/drivers/power/cppc/cppc_cpufreq.c
+++ b/drivers/power/cppc/cppc_cpufreq.c
@@ -4,8 +4,8 @@
*/
#include <stdlib.h>
+#include <string.h>
-#include <rte_memcpy.h>
#include <rte_stdatomic.h>
#include "cppc_cpufreq.h"
@@ -469,7 +469,7 @@ power_cppc_cpufreq_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num)
POWER_LOG(ERR, "Buffer size is not enough");
return 0;
}
- rte_memcpy(freqs, pi->freqs, pi->nb_freqs * sizeof(uint32_t));
+ memcpy(freqs, pi->freqs, pi->nb_freqs * sizeof(uint32_t));
return pi->nb_freqs;
}
diff --git a/drivers/power/intel_pstate/intel_pstate_cpufreq.c b/drivers/power/intel_pstate/intel_pstate_cpufreq.c
index dfbb5635a1..da0ea562c7 100644
--- a/drivers/power/intel_pstate/intel_pstate_cpufreq.c
+++ b/drivers/power/intel_pstate/intel_pstate_cpufreq.c
@@ -11,7 +11,6 @@
#include <errno.h>
#include <inttypes.h>
-#include <rte_memcpy.h>
#include <rte_stdatomic.h>
#include "rte_power_pmd_mgmt.h"
@@ -679,7 +678,7 @@ power_pstate_cpufreq_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num)
POWER_LOG(ERR, "Buffer size is not enough");
return 0;
}
- rte_memcpy(freqs, pi->freqs, pi->nb_freqs * sizeof(uint32_t));
+ memcpy(freqs, pi->freqs, pi->nb_freqs * sizeof(uint32_t));
return pi->nb_freqs;
}
diff --git a/drivers/power/intel_uncore/intel_uncore.c b/drivers/power/intel_uncore/intel_uncore.c
index 6759ea1445..2cbcf864d5 100644
--- a/drivers/power/intel_uncore/intel_uncore.c
+++ b/drivers/power/intel_uncore/intel_uncore.c
@@ -5,8 +5,7 @@
#include <errno.h>
#include <dirent.h>
#include <fnmatch.h>
-
-#include <rte_memcpy.h>
+#include <string.h>
#include "intel_uncore.h"
#include "power_common.h"
@@ -394,7 +393,7 @@ power_intel_uncore_freqs(unsigned int pkg, unsigned int die, uint32_t *freqs, ui
POWER_LOG(ERR, "Buffer size is not enough");
return 0;
}
- rte_memcpy(freqs, ui->freqs, ui->nb_freqs * sizeof(uint32_t));
+ memcpy(freqs, ui->freqs, ui->nb_freqs * sizeof(uint32_t));
return ui->nb_freqs;
}
--
2.53.0
More information about the dev
mailing list