From patchwork Wed Sep 12 14:49:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hunt, David" X-Patchwork-Id: 44612 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9871B4C9F; Wed, 12 Sep 2018 16:50:11 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D19184C95 for ; Wed, 12 Sep 2018 16:50:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Sep 2018 07:50:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,365,1531810800"; d="scan'208";a="261983206" Received: from silpixa00399952.ir.intel.com (HELO silpixa00399952.ger.corp.intel.com) ([10.237.223.64]) by fmsmga005.fm.intel.com with ESMTP; 12 Sep 2018 07:49:32 -0700 From: David Hunt To: dev@dpdk.org Cc: john.mcnamara@intel.com, stephen@networkplumber.org, lei.a.yao@intel.com Date: Wed, 12 Sep 2018 15:49:23 +0100 Message-Id: <20180912144930.50578-1-david.hunt@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180830105422.1198-1-david.hunt@intel.com> References: <20180830105422.1198-1-david.hunt@intel.com> Subject: [dpdk-dev] [PATCH v2 0/7] add json power policy interface for containers 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Patch v2: * Fixed review comments from Stephen Hemminger and Lei A Yao. * Added a check in the Makefile for libjansson-dev. Will Warn user and build without JSON functionality if not present, will build including JSON functionality if it is present. The current vm_power_manager example app has the capability to accept power policies from virtual machines via virtio-serial channels. These power policies allow a virtual machine to give information to the power manager to allow the power manager take care of the power management of the virtual machine based on the information in the policy. This power policy functionality is limited to virtual machines sending the policies to the power manager (which runs in the Host OS), and a solution was needed for additional methods of sending power policies to the power manager app. The main use-case for this modification is for containers and host applications that wish to send polices to the power manager. This patchset adds the capability to send power polices and power commands to the vm_power_manager app via JSON strings through a fifo on the file system. For example, given the following file, policy.json: {"policy": { "name": "ubuntu2", "command": "create", "policy_type": "TIME", "busy_hours":[ 17, 18, 19, 20, 21, 22, 23 ], "quiet_hours":[ 2, 3, 4, 5, 6 ], "core_list":[ 11, 12, 13 ] }} Then running the command: cat policy.json >/tmp/powermonitor/fifo.0 The policy is sent to the vm_power_manager. The power manager app then parses the JSON data, and inserts the policy into the array of policies. Part of the patch series contains documentation updates to give all the details of the valid name-value pairs, the data types, etc. [1/7] examples/power: add checks around hypervisor [2/7] lib/power: add changes for host commands/policies [3/7] examples/power: add necessary changes to guest app [4/7] examples/power: add host channel to power manager [5/7] examples/power: add json string handling [6/7] doc/vm_power_manager: add JSON interface API info [7/7] examples/power: add json example files