From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id D286C1B11F for ; Fri, 12 Apr 2019 15:56:47 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2019 06:56:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,341,1549958400"; d="scan'208";a="160799638" Received: from lgosiewx-mobl.ger.corp.intel.com ([10.103.104.80]) by fmsmga002.fm.intel.com with ESMTP; 12 Apr 2019 06:56:45 -0700 From: Lukasz Gosiewski To: david.hunt@intel.com Cc: dev@dpdk.org, lukaszx.krakowiak@intel.com, Lukasz Gosiewski Date: Fri, 12 Apr 2019 15:54:31 +0200 Message-Id: <20190412135431.3308-3-lukaszx.gosiewski@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20190412135431.3308-1-lukaszx.gosiewski@intel.com> References: <20190408104518.21960-1-lukaszx.krakowiak@intel.com> <20190412135431.3308-1-lukaszx.gosiewski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Sat, 13 Apr 2019 14:35:08 +0200 Subject: [dpdk-dev] [PATCH v2 2/2] doc: update according to the fifo per core impl 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: Fri, 12 Apr 2019 13:56:48 -0000 From: Lukasz Krakowiak Updated power management docs for fifo JSON API. Removed from JSON API: * 'name' * 'resource_id' * 'core_list' Signed-off-by: Lukasz Krakowiak Signed-off-by: Lukasz Gosiewski --- .../sample_app_ug/vm_power_management.rst | 53 ++++--------------- 1 file changed, 11 insertions(+), 42 deletions(-) diff --git a/doc/guides/sample_app_ug/vm_power_management.rst b/doc/guides/sample_app_ug/vm_power_management.rst index 14d432e78..7b2c78ffc 100644 --- a/doc/guides/sample_app_ug/vm_power_management.rst +++ b/doc/guides/sample_app_ug/vm_power_management.rst @@ -380,9 +380,16 @@ parsing functionality will not be present in the app. Sending a command or policy to the power manager application is achieved by simply opening a fifo file, writing a JSON string to that fifo, and closing -the file. +the file. In actual implementation every core has own dedicated fifo[0..n], +where n is number of the last available core. +Having a dedicated fifo file per core allows using standard filesystem permissions +to ensure a given container can only write JSON commands into fifos it is allowed +to use. -The fifo is at /tmp/powermonitor/fifo +The fifo is at /tmp/powermonitor/fifo[0..n] + +For example all cmds put to the /tmp/powermonitor/fifo7, will have +effect only on CPU[7]. The jason string can be a policy or instruction, and takes the following format: @@ -405,19 +412,6 @@ arrays, etc. Examples of policies follow later in this document. The allowed names and value types are as follows: -:Pair Name: "name" -:Description: Name of the VM or Host. Allows the parser to associate the - policy with the relevant VM or Host OS. -:Type: string -:Values: any valid string -:Required: yes -:Example: - - .. code-block:: javascript - - "name", "ubuntu2" - - :Pair Name: "command" :Description: The type of packet we're sending to the power manager. We can be creating or destroying a policy, or sending a direct command to adjust @@ -509,17 +503,6 @@ names and value types are as follows: "max_packet_thresh": 500000 -:Pair Name: "core_list" -:Description: The cores to which to apply the policy. -:Type: array of integers -:Values: array with list of virtual CPUs. -:Required: only policy CREATE/DESTROY -:Example: - - .. code-block:: javascript - - "core_list":[ 10, 11 ] - :Pair Name: "workload" :Description: When our policy is of type WORKLOAD, we need to specify how heavy our workload is. @@ -566,17 +549,6 @@ names and value types are as follows: "unit", "SCALE_MAX" -:Pair Name: "resource_id" -:Description: The core to which to apply the power command. -:Type: integer -:Values: valid core id for VM or host OS. -:Required: only POWER instruction -:Example: - - .. code-block:: javascript - - "resource_id": 10 - JSON API Examples ~~~~~~~~~~~~~~~~~ @@ -598,7 +570,6 @@ Profile destroy example: .. code-block:: javascript {"profile": { - "name": "ubuntu", "command": "destroy", }} @@ -607,17 +578,15 @@ Power command example: .. code-block:: javascript {"command": { - "name": "ubuntu", "unit": "SCALE_MAX", - "resource_id": 10 }} To send a JSON string to the Power Manager application, simply paste the -example JSON string into a text file and cat it into the fifo: +example JSON string into a text file and cat it into the proper fifo: .. code-block:: console - cat file.json >/tmp/powermonitor/fifo + cat file.json >/tmp/powermonitor/fifo[0..n] The console of the Power Manager application should indicate the command that was just received via the fifo. -- 2.17.1 -------------------------------------------------------------- Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id B9557A0096 for ; Sat, 13 Apr 2019 14:35:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0835D1B0F8; Sat, 13 Apr 2019 14:35:20 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id D286C1B11F for ; Fri, 12 Apr 2019 15:56:47 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2019 06:56:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,341,1549958400"; d="scan'208";a="160799638" Received: from lgosiewx-mobl.ger.corp.intel.com ([10.103.104.80]) by fmsmga002.fm.intel.com with ESMTP; 12 Apr 2019 06:56:45 -0700 From: Lukasz Gosiewski To: david.hunt@intel.com Cc: dev@dpdk.org, lukaszx.krakowiak@intel.com, Lukasz Gosiewski Date: Fri, 12 Apr 2019 15:54:31 +0200 Message-Id: <20190412135431.3308-3-lukaszx.gosiewski@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20190412135431.3308-1-lukaszx.gosiewski@intel.com> References: <20190408104518.21960-1-lukaszx.krakowiak@intel.com> <20190412135431.3308-1-lukaszx.gosiewski@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Sat, 13 Apr 2019 14:35:08 +0200 Subject: [dpdk-dev] [PATCH v2 2/2] doc: update according to the fifo per core impl 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" Message-ID: <20190412135431._vNOn0cbwwLczYHTw28CPbzZo3LhEgJx9whflNF93yc@z> From: Lukasz Krakowiak Updated power management docs for fifo JSON API. Removed from JSON API: * 'name' * 'resource_id' * 'core_list' Signed-off-by: Lukasz Krakowiak Signed-off-by: Lukasz Gosiewski --- .../sample_app_ug/vm_power_management.rst | 53 ++++--------------- 1 file changed, 11 insertions(+), 42 deletions(-) diff --git a/doc/guides/sample_app_ug/vm_power_management.rst b/doc/guides/sample_app_ug/vm_power_management.rst index 14d432e78..7b2c78ffc 100644 --- a/doc/guides/sample_app_ug/vm_power_management.rst +++ b/doc/guides/sample_app_ug/vm_power_management.rst @@ -380,9 +380,16 @@ parsing functionality will not be present in the app. Sending a command or policy to the power manager application is achieved by simply opening a fifo file, writing a JSON string to that fifo, and closing -the file. +the file. In actual implementation every core has own dedicated fifo[0..n], +where n is number of the last available core. +Having a dedicated fifo file per core allows using standard filesystem permissions +to ensure a given container can only write JSON commands into fifos it is allowed +to use. -The fifo is at /tmp/powermonitor/fifo +The fifo is at /tmp/powermonitor/fifo[0..n] + +For example all cmds put to the /tmp/powermonitor/fifo7, will have +effect only on CPU[7]. The jason string can be a policy or instruction, and takes the following format: @@ -405,19 +412,6 @@ arrays, etc. Examples of policies follow later in this document. The allowed names and value types are as follows: -:Pair Name: "name" -:Description: Name of the VM or Host. Allows the parser to associate the - policy with the relevant VM or Host OS. -:Type: string -:Values: any valid string -:Required: yes -:Example: - - .. code-block:: javascript - - "name", "ubuntu2" - - :Pair Name: "command" :Description: The type of packet we're sending to the power manager. We can be creating or destroying a policy, or sending a direct command to adjust @@ -509,17 +503,6 @@ names and value types are as follows: "max_packet_thresh": 500000 -:Pair Name: "core_list" -:Description: The cores to which to apply the policy. -:Type: array of integers -:Values: array with list of virtual CPUs. -:Required: only policy CREATE/DESTROY -:Example: - - .. code-block:: javascript - - "core_list":[ 10, 11 ] - :Pair Name: "workload" :Description: When our policy is of type WORKLOAD, we need to specify how heavy our workload is. @@ -566,17 +549,6 @@ names and value types are as follows: "unit", "SCALE_MAX" -:Pair Name: "resource_id" -:Description: The core to which to apply the power command. -:Type: integer -:Values: valid core id for VM or host OS. -:Required: only POWER instruction -:Example: - - .. code-block:: javascript - - "resource_id": 10 - JSON API Examples ~~~~~~~~~~~~~~~~~ @@ -598,7 +570,6 @@ Profile destroy example: .. code-block:: javascript {"profile": { - "name": "ubuntu", "command": "destroy", }} @@ -607,17 +578,15 @@ Power command example: .. code-block:: javascript {"command": { - "name": "ubuntu", "unit": "SCALE_MAX", - "resource_id": 10 }} To send a JSON string to the Power Manager application, simply paste the -example JSON string into a text file and cat it into the fifo: +example JSON string into a text file and cat it into the proper fifo: .. code-block:: console - cat file.json >/tmp/powermonitor/fifo + cat file.json >/tmp/powermonitor/fifo[0..n] The console of the Power Manager application should indicate the command that was just received via the fifo. -- 2.17.1 -------------------------------------------------------------- Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.