[dpdk-dev] [RFC PATCH 1/4] power: make channel commands header public
Bruce Richardson
bruce.richardson at intel.com
Fri May 3 16:08:58 CEST 2019
The channel_commands.h header file is required by applications wanting to
use the power management capabilities - as evidenced by the fact that the
vm_power_manager example app needs to include it. Therefore we should make
the header file public.
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
examples/vm_power_manager/Makefile | 2 +-
examples/vm_power_manager/channel_manager.c | 2 +-
examples/vm_power_manager/channel_monitor.c | 1 -
examples/vm_power_manager/channel_monitor.h | 2 +-
examples/vm_power_manager/vm_power_cli.c | 1 -
lib/librte_power/Makefile | 4 +++-
lib/librte_power/guest_channel.c | 2 +-
lib/librte_power/guest_channel.h | 2 --
lib/librte_power/meson.build | 4 +++-
lib/librte_power/power_kvm_vm.c | 2 +-
.../{channel_commands.h => rte_channel_commands.h} | 0
11 files changed, 11 insertions(+), 11 deletions(-)
rename lib/librte_power/{channel_commands.h => rte_channel_commands.h} (100%)
diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile
index 2fdb991d7..d93f900f7 100644
--- a/examples/vm_power_manager/Makefile
+++ b/examples/vm_power_manager/Makefile
@@ -26,7 +26,7 @@ else
SRCS-y += oob_monitor_nop.c
endif
-CFLAGS += -O3 -I$(RTE_SDK)/lib/librte_power/
+CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
LDLIBS += -lvirt
diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c
index 084681747..755ac0425 100644
--- a/examples/vm_power_manager/channel_manager.c
+++ b/examples/vm_power_manager/channel_manager.c
@@ -24,11 +24,11 @@
#include <rte_log.h>
#include <rte_atomic.h>
#include <rte_spinlock.h>
+#include <rte_channel_commands.h>
#include <libvirt/libvirt.h>
#include "channel_manager.h"
-#include "channel_commands.h"
#include "channel_monitor.h"
#include "power_manager.h"
diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c
index 4a287109b..9ae90c63f 100644
--- a/examples/vm_power_manager/channel_monitor.c
+++ b/examples/vm_power_manager/channel_monitor.c
@@ -32,7 +32,6 @@
#include <libvirt/libvirt.h>
#include "channel_monitor.h"
-#include "channel_commands.h"
#include "channel_manager.h"
#include "power_manager.h"
#include "oob_monitor.h"
diff --git a/examples/vm_power_manager/channel_monitor.h b/examples/vm_power_manager/channel_monitor.h
index 7362a80d2..a8bc9a4f1 100644
--- a/examples/vm_power_manager/channel_monitor.h
+++ b/examples/vm_power_manager/channel_monitor.h
@@ -5,8 +5,8 @@
#ifndef CHANNEL_MONITOR_H_
#define CHANNEL_MONITOR_H_
+#include <rte_channel_commands.h>
#include "channel_manager.h"
-#include "channel_commands.h"
struct core_share {
unsigned int pcpu;
diff --git a/examples/vm_power_manager/vm_power_cli.c b/examples/vm_power_manager/vm_power_cli.c
index 89b000d92..a67387cef 100644
--- a/examples/vm_power_manager/vm_power_cli.c
+++ b/examples/vm_power_manager/vm_power_cli.c
@@ -21,7 +21,6 @@
#include "channel_manager.h"
#include "channel_monitor.h"
#include "power_manager.h"
-#include "channel_commands.h"
struct cmd_quit_result {
cmdline_fixed_string_t quit;
diff --git a/lib/librte_power/Makefile b/lib/librte_power/Makefile
index ab771528f..f192cb334 100644
--- a/lib/librte_power/Makefile
+++ b/lib/librte_power/Makefile
@@ -21,6 +21,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_POWER) += rte_power_empty_poll.c
SRCS-$(CONFIG_RTE_LIBRTE_POWER) += power_pstate_cpufreq.c
# install this header file
-SYMLINK-$(CONFIG_RTE_LIBRTE_POWER)-include := rte_power.h rte_power_empty_poll.h
+SYMLINK-$(CONFIG_RTE_LIBRTE_POWER)-include := rte_power.h
+SYMLINK-$(CONFIG_RTE_LIBRTE_POWER)-include += rte_power_empty_poll.h
+SYMLINK-$(CONFIG_RTE_LIBRTE_POWER)-include += rte_channel_commands.h
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/lib/librte_power/guest_channel.c b/lib/librte_power/guest_channel.c
index c17ea46b4..bb35fecec 100644
--- a/lib/librte_power/guest_channel.c
+++ b/lib/librte_power/guest_channel.c
@@ -13,9 +13,9 @@
#include <rte_log.h>
+#include <rte_channel_commands.h>
#include "guest_channel.h"
-#include "channel_commands.h"
#define RTE_LOGTYPE_GUEST_CHANNEL RTE_LOGTYPE_USER1
diff --git a/lib/librte_power/guest_channel.h b/lib/librte_power/guest_channel.h
index 373d39898..6219063d3 100644
--- a/lib/librte_power/guest_channel.h
+++ b/lib/librte_power/guest_channel.h
@@ -8,8 +8,6 @@
extern "C" {
#endif
-#include <channel_commands.h>
-
/**
* Connect to the Virtio-Serial VM end-point located in path. It is
* thread safe for unique lcore_ids. This function must be only called once from
diff --git a/lib/librte_power/meson.build b/lib/librte_power/meson.build
index cc6c30075..237f9d59c 100644
--- a/lib/librte_power/meson.build
+++ b/lib/librte_power/meson.build
@@ -8,5 +8,7 @@ sources = files('rte_power.c', 'power_acpi_cpufreq.c',
'power_kvm_vm.c', 'guest_channel.c',
'rte_power_empty_poll.c',
'power_pstate_cpufreq.c')
-headers = files('rte_power.h','rte_power_empty_poll.h')
+headers = files('rte_power.h',
+ 'rte_power_empty_poll.h',
+ 'rte_channel_commands.h')
deps += ['timer']
diff --git a/lib/librte_power/power_kvm_vm.c b/lib/librte_power/power_kvm_vm.c
index 277ebbeae..1c60551a4 100644
--- a/lib/librte_power/power_kvm_vm.c
+++ b/lib/librte_power/power_kvm_vm.c
@@ -5,9 +5,9 @@
#include <string.h>
#include <rte_log.h>
+#include <rte_channel_commands.h>
#include "guest_channel.h"
-#include "channel_commands.h"
#include "power_kvm_vm.h"
#include "power_common.h"
diff --git a/lib/librte_power/channel_commands.h b/lib/librte_power/rte_channel_commands.h
similarity index 100%
rename from lib/librte_power/channel_commands.h
rename to lib/librte_power/rte_channel_commands.h
--
2.20.1
More information about the dev
mailing list