power: fix struct cache line-alignment issues

Message ID 20190505181216.30192-1-mattias.ronnblom@ericsson.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series power: fix struct cache line-alignment issues |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Mattias Rönnblom May 5, 2019, 6:12 p.m. UTC
  The ACPI and PState CPU frequency scaling drivers used the
__rte_cache_aligned attribute without including rte_memory.h, which
turns what looks as the declaration of a cache line-aligned struct
into a non-aligned struct declaration and the definition of an
instance of the struct.

Fixes: e6c6dc0f96 ("power: add p-state driver compatibility")
Fixes: 445c6528b5 ("power: common interface for guest and host")

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
---
 lib/librte_power/power_acpi_cpufreq.c   | 5 +++--
 lib/librte_power/power_pstate_cpufreq.c | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
  

Comments

Thomas Monjalon May 9, 2019, 6:55 p.m. UTC | #1
05/05/2019 20:12, Mattias Rönnblom:
> The ACPI and PState CPU frequency scaling drivers used the
> __rte_cache_aligned attribute without including rte_memory.h, which
> turns what looks as the declaration of a cache line-aligned struct
> into a non-aligned struct declaration and the definition of an
> instance of the struct.
> 
> Fixes: e6c6dc0f96 ("power: add p-state driver compatibility")
> Fixes: 445c6528b5 ("power: common interface for guest and host")
> 
> Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>

No review was done but it seems to be a good fix.

Applied, thanks
  

Patch

diff --git a/lib/librte_power/power_acpi_cpufreq.c b/lib/librte_power/power_acpi_cpufreq.c
index 5672c594e..7c386f891 100644
--- a/lib/librte_power/power_acpi_cpufreq.c
+++ b/lib/librte_power/power_acpi_cpufreq.c
@@ -12,9 +12,10 @@ 
 #include <signal.h>
 #include <limits.h>
 
-#include <rte_string_fns.h>
-#include <rte_memcpy.h>
 #include <rte_atomic.h>
+#include <rte_memcpy.h>
+#include <rte_memory.h>
+#include <rte_string_fns.h>
 
 #include "power_acpi_cpufreq.h"
 #include "power_common.h"
diff --git a/lib/librte_power/power_pstate_cpufreq.c b/lib/librte_power/power_pstate_cpufreq.c
index c2c4e8e14..30727f04b 100644
--- a/lib/librte_power/power_pstate_cpufreq.c
+++ b/lib/librte_power/power_pstate_cpufreq.c
@@ -14,9 +14,10 @@ 
 #include <errno.h>
 #include <inttypes.h>
 
-#include <rte_string_fns.h>
-#include <rte_memcpy.h>
 #include <rte_atomic.h>
+#include <rte_memcpy.h>
+#include <rte_memory.h>
+#include <rte_string_fns.h>
 
 #include "power_pstate_cpufreq.h"
 #include "power_common.h"