Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/442/?format=api
http://patches.dpdk.org/api/patches/442/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1411410879-28872-5-git-send-email-alan.carew@intel.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1411410879-28872-5-git-send-email-alan.carew@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1411410879-28872-5-git-send-email-alan.carew@intel.com", "date": "2014-09-22T18:34:33", "name": "[dpdk-dev,04/10] CPU Frequency Power Management(Host).", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "0bfe75f6107024182dd5f1bba509e972d64e1331", "submitter": { "id": 72, "url": "http://patches.dpdk.org/api/people/72/?format=api", "name": "Alan Carew", "email": "alan.carew@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1411410879-28872-5-git-send-email-alan.carew@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/442/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/442/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 58C9CB3AF;\n\tMon, 22 Sep 2014 20:29:44 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 9C11868B8\n\tfor <dev@dpdk.org>; Mon, 22 Sep 2014 20:29:38 +0200 (CEST)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP; 22 Sep 2014 11:35:22 -0700", "from sie-lab-212-143.ir.intel.com (HELO\n\tsilpixa00385294.ir.intel.com) ([10.237.212.143])\n\tby orsmga002.jf.intel.com with ESMTP; 22 Sep 2014 11:35:21 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.04,573,1406617200\"; d=\"scan'208\";a=\"606714456\"", "From": "Alan Carew <alan.carew@intel.com>", "To": "dev@dpdk.org", "Date": "Mon, 22 Sep 2014 19:34:33 +0100", "Message-Id": "<1411410879-28872-5-git-send-email-alan.carew@intel.com>", "X-Mailer": "git-send-email 1.9.3", "In-Reply-To": "<1411410879-28872-1-git-send-email-alan.carew@intel.com>", "References": "<1411410879-28872-1-git-send-email-alan.carew@intel.com>", "Subject": "[dpdk-dev] [PATCH 04/10] CPU Frequency Power Management(Host).", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "A wrapper around librte_power, providing locking around the non-threadsafe\nlibrary, allowing for frequency changes based on core masks and core numbers\nfrom both the CLI thread and epoll monitor thread.\n\nSigned-off-by: Alan Carew <alan.carew@intel.com>\n---\n examples/vm_power_manager/Makefile | 57 +++++++++++++++++++\n examples/vm_power_manager/main.c | 113 +++++++++++++++++++++++++++++++++++++\n examples/vm_power_manager/main.h | 52 +++++++++++++++++\n 3 files changed, 222 insertions(+)\n create mode 100644 examples/vm_power_manager/Makefile\n create mode 100644 examples/vm_power_manager/main.c\n create mode 100644 examples/vm_power_manager/main.h", "diff": "diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile\nnew file mode 100644\nindex 0000000..a2f00ea\n--- /dev/null\n+++ b/examples/vm_power_manager/Makefile\n@@ -0,0 +1,57 @@\n+# BSD LICENSE\n+#\n+# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+# All rights reserved.\n+#\n+# Redistribution and use in source and binary forms, with or without\n+# modification, are permitted provided that the following conditions\n+# are met:\n+#\n+# * Redistributions of source code must retain the above copyright\n+# notice, this list of conditions and the following disclaimer.\n+# * Redistributions in binary form must reproduce the above copyright\n+# notice, this list of conditions and the following disclaimer in\n+# the documentation and/or other materials provided with the\n+# distribution.\n+# * Neither the name of Intel Corporation nor the names of its\n+# contributors may be used to endorse or promote products derived\n+# from this software without specific prior written permission.\n+#\n+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+\n+ifeq ($(RTE_SDK),)\n+$(error \"Please define RTE_SDK environment variable\")\n+endif\n+\n+# Default target, can be overriden by command line or environment\n+RTE_TARGET ?= x86_64-default-linuxapp-gcc\n+\n+include $(RTE_SDK)/mk/rte.vars.mk\n+\n+# binary name\n+APP = vm_power_mgr\n+\n+# all source are stored in SRCS-y\n+SRCS-y := main.c vm_power_cli.c power_manager.c channel_manager.c\n+SRCS-y += channel_monitor.c\n+\n+CFLAGS += -O3 -lvirt -I$(RTE_SDK)/lib/librte_power_vm/\n+CFLAGS += $(WERROR_FLAGS)\n+\n+# workaround for a gcc bug with noreturn attribute\n+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603\n+ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)\n+CFLAGS_main.o += -Wno-return-type\n+endif\n+\n+include $(RTE_SDK)/mk/rte.extapp.mk\ndiff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c\nnew file mode 100644\nindex 0000000..fdb9e73\n--- /dev/null\n+++ b/examples/vm_power_manager/main.c\n@@ -0,0 +1,113 @@\n+/*-\n+ * BSD LICENSE\n+ *\n+ * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met:\n+ *\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in\n+ * the documentation and/or other materials provided with the\n+ * distribution.\n+ * * Neither the name of Intel Corporation nor the names of its\n+ * contributors may be used to endorse or promote products derived\n+ * from this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <stdio.h>\n+#include <string.h>\n+#include <stdint.h>\n+#include <errno.h>\n+#include <sys/epoll.h>\n+#include <fcntl.h>\n+#include <unistd.h>\n+#include <stdlib.h>\n+#include <unistd.h>\n+#include <signal.h>\n+#include <errno.h>\n+\n+#include <sys/queue.h>\n+\n+#include <rte_common.h>\n+#include <rte_eal.h>\n+#include <rte_launch.h>\n+#include <rte_log.h>\n+#include <rte_per_lcore.h>\n+#include <rte_lcore.h>\n+#include <rte_debug.h>\n+#include <rte_config.h>\n+\n+#include \"channel_manager.h\"\n+#include \"channel_monitor.h\"\n+#include \"power_manager.h\"\n+#include \"vm_power_cli.h\"\n+#include \"main.h\"\n+\n+static int\n+run_monitor(__attribute__((unused)) void *arg)\n+{\n+\tif (channel_manager_init(DEFAULT_HV_PATH) < 0) {\n+\t\tprintf(\"Unable to initialize channel manager\\n\");\n+\t\treturn -1;\n+\t}\n+\tif (channel_monitor_init() < 0) {\n+\t\tprintf(\"Unable to initialize channel monitor\\n\");\n+\t\treturn -1;\n+\t}\n+\trun_channel_monitor();\n+\treturn 0;\n+}\n+\n+static void\n+sig_handler(int signo)\n+{\n+\tprintf(\"Received signal %d, exiting...\\n\", signo);\n+\tchannel_monitor_exit();\n+\tchannel_manager_exit();\n+\tpower_manager_exit();\n+\n+}\n+\n+int\n+MAIN(int argc, char **argv)\n+{\n+\tint ret;\n+\tunsigned lcore_id;\n+\n+\tret = rte_eal_init(argc, argv);\n+\tif (ret < 0)\n+\t\trte_panic(\"Cannot init EAL\\n\");\n+\n+\tsignal(SIGINT, sig_handler);\n+\tsignal(SIGTERM, sig_handler);\n+\n+\tlcore_id = rte_get_next_lcore(-1, 1, 0);\n+\tif (lcore_id == RTE_MAX_LCORE) {\n+\t\tRTE_LOG(ERR, EAL, \"A minimum of two cores are required to run \"\n+\t\t\t\t\"application\\n\");\n+\t\treturn 0;\n+\t}\n+\trte_eal_remote_launch(run_monitor, NULL, lcore_id);\n+\n+\trun_cli(NULL);\n+\n+\trte_eal_mp_wait_lcore();\n+\treturn 0;\n+}\ndiff --git a/examples/vm_power_manager/main.h b/examples/vm_power_manager/main.h\nnew file mode 100644\nindex 0000000..7b4c3da\n--- /dev/null\n+++ b/examples/vm_power_manager/main.h\n@@ -0,0 +1,52 @@\n+/*-\n+ * BSD LICENSE\n+ *\n+ * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met:\n+ *\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in\n+ * the documentation and/or other materials provided with the\n+ * distribution.\n+ * * Neither the name of Intel Corporation nor the names of its\n+ * contributors may be used to endorse or promote products derived\n+ * from this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef _MAIN_H_\n+#define _MAIN_H_\n+\n+#ifdef RTE_EXEC_ENV_BAREMETAL\n+#define MAIN _main\n+#else\n+#define MAIN main\n+#endif\n+\n+int MAIN(int argc, char **argv);\n+\n+#endif /* _MAIN_H_ */\n+\n+#ifndef MAIN_H_\n+#define MAIN_H_\n+\n+\n+\n+#endif /* MAIN_H_ */\n", "prefixes": [ "dpdk-dev", "04/10" ] }{ "id": 442, "url": "