From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 883CE1D90 for ; Tue, 28 Nov 2017 14:23:01 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Nov 2017 05:23:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,468,1505804400"; d="scan'208";a="7174053" Received: from silpixa00399502.ir.intel.com (HELO silpixa00399502.ger.corp.intel.com) ([10.237.223.218]) by orsmga003.jf.intel.com with ESMTP; 28 Nov 2017 05:22:58 -0800 From: Marko Kovacevic To: dev@dpdk.org Cc: david.hunt@intel.com, marko.kovacevic@intel.com Date: Tue, 28 Nov 2017 13:22:00 +0000 Message-Id: <20171128132203.43181-1-marko.kovacevic@intel.com> X-Mailer: git-send-email 2.9.5 Subject: [dpdk-dev] [PATCH v2 1/4] power: changed unsigned to unsigned int X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Nov 2017 13:23:02 -0000 Signed-off-by: Marko Kovacevic --- lib/librte_power/guest_channel.c | 6 +++--- lib/librte_power/guest_channel.h | 6 +++--- lib/librte_power/rte_power.c | 4 ++-- lib/librte_power/rte_power.h | 12 ++++++------ lib/librte_power/rte_power_acpi_cpufreq.c | 16 ++++++++-------- lib/librte_power/rte_power_kvm_vm.c | 20 ++++++++++---------- lib/librte_power/rte_power_kvm_vm.h | 18 +++++++++--------- 7 files changed, 41 insertions(+), 41 deletions(-) diff --git a/lib/librte_power/guest_channel.c b/lib/librte_power/guest_channel.c index fa5de0f..e7ffc80 100644 --- a/lib/librte_power/guest_channel.c +++ b/lib/librte_power/guest_channel.c @@ -51,7 +51,7 @@ static int global_fds[RTE_MAX_LCORE]; int -guest_channel_host_connect(const char *path, unsigned lcore_id) +guest_channel_host_connect(const char *path, unsigned int lcore_id) { int flags, ret; struct channel_packet pkt; @@ -118,7 +118,7 @@ guest_channel_host_connect(const char *path, unsigned lcore_id) } int -guest_channel_send_msg(struct channel_packet *pkt, unsigned lcore_id) +guest_channel_send_msg(struct channel_packet *pkt, unsigned int lcore_id) { int ret, buffer_len = sizeof(*pkt); void *buffer = pkt; @@ -156,7 +156,7 @@ int rte_power_guest_channel_send_msg(struct channel_packet *pkt, void -guest_channel_host_disconnect(unsigned lcore_id) +guest_channel_host_disconnect(unsigned int lcore_id) { if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, GUEST_CHANNEL, "Channel(%u) is out of range 0...%d\n", diff --git a/lib/librte_power/guest_channel.h b/lib/librte_power/guest_channel.h index 741339c..12c2587 100644 --- a/lib/librte_power/guest_channel.h +++ b/lib/librte_power/guest_channel.h @@ -53,7 +53,7 @@ extern "C" { * - 0 on success. * - Negative on error. */ -int guest_channel_host_connect(const char *path, unsigned lcore_id); +int guest_channel_host_connect(const char *path, unsigned int lcore_id); /** * Disconnect from an already connected Virtio-Serial Endpoint. @@ -63,7 +63,7 @@ int guest_channel_host_connect(const char *path, unsigned lcore_id); * lcore_id. * */ -void guest_channel_host_disconnect(unsigned lcore_id); +void guest_channel_host_disconnect(unsigned int lcore_id); /** * Send a message contained in pkt over the Virtio-Serial to the host endpoint. @@ -79,7 +79,7 @@ void guest_channel_host_disconnect(unsigned lcore_id); * - Negative on channel not connected. * - errno on write to channel error. */ -int guest_channel_send_msg(struct channel_packet *pkt, unsigned lcore_id); +int guest_channel_send_msg(struct channel_packet *pkt, unsigned int lcore_id); /** * Send a message contained in pkt over the Virtio-Serial to the host endpoint. diff --git a/lib/librte_power/rte_power.c b/lib/librte_power/rte_power.c index b327a86..e7f35cf 100644 --- a/lib/librte_power/rte_power.c +++ b/lib/librte_power/rte_power.c @@ -106,7 +106,7 @@ rte_power_get_env(void) { } int -rte_power_init(unsigned lcore_id) +rte_power_init(unsigned int lcore_id) { int ret = -1; @@ -138,7 +138,7 @@ rte_power_init(unsigned lcore_id) } int -rte_power_exit(unsigned lcore_id) +rte_power_exit(unsigned int lcore_id) { if (global_default_env == PM_ENV_ACPI_CPUFREQ) return rte_power_acpi_cpufreq_exit(lcore_id); diff --git a/lib/librte_power/rte_power.h b/lib/librte_power/rte_power.h index b17b7a5..9b54039 100644 --- a/lib/librte_power/rte_power.h +++ b/lib/librte_power/rte_power.h @@ -91,7 +91,7 @@ enum power_management_env rte_power_get_env(void); * - 0 on success. * - Negative on error. */ -int rte_power_init(unsigned lcore_id); +int rte_power_init(unsigned int lcore_id); /** * Exit power management on a specific lcore. This will call the environment @@ -104,7 +104,7 @@ int rte_power_init(unsigned lcore_id); * - 0 on success. * - Negative on error. */ -int rte_power_exit(unsigned lcore_id); +int rte_power_exit(unsigned int lcore_id); /** * Get the available frequencies of a specific lcore. @@ -121,7 +121,7 @@ int rte_power_exit(unsigned lcore_id); * @return * The number of available frequencies. */ -typedef uint32_t (*rte_power_freqs_t)(unsigned lcore_id, uint32_t *freqs, +typedef uint32_t (*rte_power_freqs_t)(unsigned int lcore_id, uint32_t *freqs, uint32_t num); extern rte_power_freqs_t rte_power_freqs; @@ -137,7 +137,7 @@ extern rte_power_freqs_t rte_power_freqs; * @return * The current index of available frequencies. */ -typedef uint32_t (*rte_power_get_freq_t)(unsigned lcore_id); +typedef uint32_t (*rte_power_get_freq_t)(unsigned int lcore_id); extern rte_power_get_freq_t rte_power_get_freq; @@ -157,7 +157,7 @@ extern rte_power_get_freq_t rte_power_get_freq; * - 0 on success without frequency changed. * - Negative on error. */ -typedef int (*rte_power_set_freq_t)(unsigned lcore_id, uint32_t index); +typedef int (*rte_power_set_freq_t)(unsigned int lcore_id, uint32_t index); extern rte_power_set_freq_t rte_power_set_freq; @@ -173,7 +173,7 @@ extern rte_power_set_freq_t rte_power_set_freq; * - 0 on success without frequency changed. * - Negative on error. */ -typedef int (*rte_power_freq_change_t)(unsigned lcore_id); +typedef int (*rte_power_freq_change_t)(unsigned int lcore_id); /** * Scale up the frequency of a specific lcore according to the available diff --git a/lib/librte_power/rte_power_acpi_cpufreq.c b/lib/librte_power/rte_power_acpi_cpufreq.c index 6b0cdb2..618bf45 100644 --- a/lib/librte_power/rte_power_acpi_cpufreq.c +++ b/lib/librte_power/rte_power_acpi_cpufreq.c @@ -106,7 +106,7 @@ enum power_state { * Power info per lcore. */ struct rte_power_info { - unsigned lcore_id; /**< Logical core id */ + unsigned int lcore_id; /**< Logical core id */ uint32_t freqs[RTE_MAX_LCORE_FREQS]; /**< Frequency array */ uint32_t nb_freqs; /**< number of available freqs */ FILE *f; /**< FD of scaling_setspeed */ @@ -311,7 +311,7 @@ power_init_for_setting_freq(struct rte_power_info *pi) } int -rte_power_acpi_cpufreq_init(unsigned lcore_id) +rte_power_acpi_cpufreq_init(unsigned int lcore_id) { struct rte_power_info *pi; @@ -419,7 +419,7 @@ power_set_governor_original(struct rte_power_info *pi) } int -rte_power_acpi_cpufreq_exit(unsigned lcore_id) +rte_power_acpi_cpufreq_exit(unsigned int lcore_id) { struct rte_power_info *pi; @@ -481,7 +481,7 @@ rte_power_acpi_cpufreq_freqs(unsigned lcore_id, uint32_t *freqs, uint32_t num) } uint32_t -rte_power_acpi_cpufreq_get_freq(unsigned lcore_id) +rte_power_acpi_cpufreq_get_freq(unsigned int lcore_id) { if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); @@ -503,7 +503,7 @@ rte_power_acpi_cpufreq_set_freq(unsigned lcore_id, uint32_t index) } int -rte_power_acpi_cpufreq_freq_down(unsigned lcore_id) +rte_power_acpi_cpufreq_freq_down(unsigned int lcore_id) { struct rte_power_info *pi; @@ -521,7 +521,7 @@ rte_power_acpi_cpufreq_freq_down(unsigned lcore_id) } int -rte_power_acpi_cpufreq_freq_up(unsigned lcore_id) +rte_power_acpi_cpufreq_freq_up(unsigned int lcore_id) { struct rte_power_info *pi; @@ -539,7 +539,7 @@ rte_power_acpi_cpufreq_freq_up(unsigned lcore_id) } int -rte_power_acpi_cpufreq_freq_max(unsigned lcore_id) +rte_power_acpi_cpufreq_freq_max(unsigned int lcore_id) { if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); @@ -561,7 +561,7 @@ rte_power_acpi_cpufreq_freq_max(unsigned lcore_id) } int -rte_power_acpi_cpufreq_freq_min(unsigned lcore_id) +rte_power_acpi_cpufreq_freq_min(unsigned int lcore_id) { struct rte_power_info *pi; diff --git a/lib/librte_power/rte_power_kvm_vm.c b/lib/librte_power/rte_power_kvm_vm.c index 9906062..52cac0c 100644 --- a/lib/librte_power/rte_power_kvm_vm.c +++ b/lib/librte_power/rte_power_kvm_vm.c @@ -46,7 +46,7 @@ static struct channel_packet pkt[CHANNEL_CMDS_MAX_VM_CHANNELS]; int -rte_power_kvm_vm_init(unsigned lcore_id) +rte_power_kvm_vm_init(unsigned int lcore_id) { if (lcore_id >= CHANNEL_CMDS_MAX_VM_CHANNELS) { RTE_LOG(ERR, POWER, "Core(%u) is out of range 0...%d\n", @@ -59,14 +59,14 @@ rte_power_kvm_vm_init(unsigned lcore_id) } int -rte_power_kvm_vm_exit(unsigned lcore_id) +rte_power_kvm_vm_exit(unsigned int lcore_id) { guest_channel_host_disconnect(lcore_id); return 0; } uint32_t -rte_power_kvm_vm_freqs(__attribute__((unused)) unsigned lcore_id, +rte_power_kvm_vm_freqs(__attribute__((unused)) unsigned int lcore_id, __attribute__((unused)) uint32_t *freqs, __attribute__((unused)) uint32_t num) { @@ -76,7 +76,7 @@ rte_power_kvm_vm_freqs(__attribute__((unused)) unsigned lcore_id, } uint32_t -rte_power_kvm_vm_get_freq(__attribute__((unused)) unsigned lcore_id) +rte_power_kvm_vm_get_freq(__attribute__((unused)) unsigned int lcore_id) { RTE_LOG(ERR, POWER, "rte_power_get_freq is not implemented " "for Virtual Machine Power Management\n"); @@ -84,7 +84,7 @@ rte_power_kvm_vm_get_freq(__attribute__((unused)) unsigned lcore_id) } int -rte_power_kvm_vm_set_freq(__attribute__((unused)) unsigned lcore_id, +rte_power_kvm_vm_set_freq(__attribute__((unused)) unsigned int lcore_id, __attribute__((unused)) uint32_t index) { RTE_LOG(ERR, POWER, "rte_power_set_freq is not implemented " @@ -93,7 +93,7 @@ rte_power_kvm_vm_set_freq(__attribute__((unused)) unsigned lcore_id, } static inline int -send_msg(unsigned lcore_id, uint32_t scale_direction) +send_msg(unsigned int lcore_id, uint32_t scale_direction) { int ret; @@ -112,25 +112,25 @@ send_msg(unsigned lcore_id, uint32_t scale_direction) } int -rte_power_kvm_vm_freq_up(unsigned lcore_id) +rte_power_kvm_vm_freq_up(unsigned int lcore_id) { return send_msg(lcore_id, CPU_POWER_SCALE_UP); } int -rte_power_kvm_vm_freq_down(unsigned lcore_id) +rte_power_kvm_vm_freq_down(unsigned int lcore_id) { return send_msg(lcore_id, CPU_POWER_SCALE_DOWN); } int -rte_power_kvm_vm_freq_max(unsigned lcore_id) +rte_power_kvm_vm_freq_max(unsigned int lcore_id) { return send_msg(lcore_id, CPU_POWER_SCALE_MAX); } int -rte_power_kvm_vm_freq_min(unsigned lcore_id) +rte_power_kvm_vm_freq_min(unsigned int lcore_id) { return send_msg(lcore_id, CPU_POWER_SCALE_MIN); } diff --git a/lib/librte_power/rte_power_kvm_vm.h b/lib/librte_power/rte_power_kvm_vm.h index 9af41d6..96349c5 100644 --- a/lib/librte_power/rte_power_kvm_vm.h +++ b/lib/librte_power/rte_power_kvm_vm.h @@ -58,7 +58,7 @@ extern "C" { * - 0 on success. * - Negative on error. */ -int rte_power_kvm_vm_init(unsigned lcore_id); +int rte_power_kvm_vm_init(unsigned int lcore_id); /** * Exit power management on a specific lcore. @@ -70,7 +70,7 @@ int rte_power_kvm_vm_init(unsigned lcore_id); * - 0 on success. * - Negative on error. */ -int rte_power_kvm_vm_exit(unsigned lcore_id); +int rte_power_kvm_vm_exit(unsigned int lcore_id); /** * Get the available frequencies of a specific lcore. @@ -86,7 +86,7 @@ int rte_power_kvm_vm_exit(unsigned lcore_id); * @return * -ENOTSUP */ -uint32_t rte_power_kvm_vm_freqs(unsigned lcore_id, uint32_t *freqs, +uint32_t rte_power_kvm_vm_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num); /** @@ -99,7 +99,7 @@ uint32_t rte_power_kvm_vm_freqs(unsigned lcore_id, uint32_t *freqs, * @return * -ENOTSUP */ -uint32_t rte_power_kvm_vm_get_freq(unsigned lcore_id); +uint32_t rte_power_kvm_vm_get_freq(unsigned int lcore_id); /** * Set the new frequency for a specific lcore by indicating the index of @@ -114,7 +114,7 @@ uint32_t rte_power_kvm_vm_get_freq(unsigned lcore_id); * @return * -ENOTSUP */ -int rte_power_kvm_vm_set_freq(unsigned lcore_id, uint32_t index); +int rte_power_kvm_vm_set_freq(unsigned int lcore_id, uint32_t index); /** * Scale up the frequency of a specific lcore. This request is forwarded to the @@ -128,7 +128,7 @@ int rte_power_kvm_vm_set_freq(unsigned lcore_id, uint32_t index); * - 1 on success. * - Negative on error. */ -int rte_power_kvm_vm_freq_up(unsigned lcore_id); +int rte_power_kvm_vm_freq_up(unsigned int lcore_id); /** * Scale down the frequency of a specific lcore according to the available @@ -142,7 +142,7 @@ int rte_power_kvm_vm_freq_up(unsigned lcore_id); * - 1 on success. * - Negative on error. */ -int rte_power_kvm_vm_freq_down(unsigned lcore_id); +int rte_power_kvm_vm_freq_down(unsigned int lcore_id); /** * Scale up the frequency of a specific lcore to the highest according to the @@ -156,7 +156,7 @@ int rte_power_kvm_vm_freq_down(unsigned lcore_id); * - 1 on success. * - Negative on error. */ -int rte_power_kvm_vm_freq_max(unsigned lcore_id); +int rte_power_kvm_vm_freq_max(unsigned int lcore_id); /** * Scale down the frequency of a specific lcore to the lowest according to the @@ -170,7 +170,7 @@ int rte_power_kvm_vm_freq_max(unsigned lcore_id); * - 1 on success. * - Negative on error. */ -int rte_power_kvm_vm_freq_min(unsigned lcore_id); +int rte_power_kvm_vm_freq_min(unsigned int lcore_id); /** * It should be protected outside of this function for threadsafe. -- 2.9.5