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 E62A1A046B for ; Mon, 24 Jun 2019 12:46:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E04A62C2B; Mon, 24 Jun 2019 12:46:04 +0200 (CEST) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id 68C892AB for ; Mon, 24 Jun 2019 12:46:03 +0200 (CEST) Received: by mail-pf1-f196.google.com with SMTP id r1so7266207pfq.12 for ; Mon, 24 Jun 2019 03:46:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=kkhh6+SrPZgmlllABDkUyznSdyqL3hIJGaPrkWUY5Fg=; b=m0oRuBKs7JYwD0vfW9n2OUlLxAIQbS4gBi7AsIpFJoOErUy8Ly+u0bZaJpBGTYaFxj ZgMQixGGRzRY/8dZbRZfZXQWO613DTB5iLeAeT4+2VW+7qYB/swZdGkFFZzyqA/pYkGe wAe7sIFweatBghtCQ8m/wZlpwcoMut8fl1TVG/q6Mt06exDw+RYJo1gH6KIiLHe3uKLz XXW6FQS51GN+Atf/B9d1PQsKM5J3ul3br9pUrtAUnkqK2cJcqRAeyphUp81MYaXzQ7RR Qk9Xkyp6t/Yyv3tQldLWmiMIvdR3B3hl9Y+5RJfhq+a+DRfqI1pKWbhpWs8ckZol3rZh NCHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=kkhh6+SrPZgmlllABDkUyznSdyqL3hIJGaPrkWUY5Fg=; b=IsJ0Ht+pMuz37F/yEFwCefoihsKGIVi6TG1+viru/LrfQ++nV3rXrdbyEKqynirgfM J9OLRTL4idpkLF21FVWfE2WVU9lofEuwAlKp4RdRDNFyeiNkV7oL8h5RctdJmWCNl193 W/F2+pgVs2AvhFLumzyeC1oBcU2YJc10c2qyMPYNKB7ztZbLt81CKSVXQcrwiuAUyk+i uIABZW/ROFrzsSKaNWUXhPVTle+OuU2EV5zgbTwHO4EzEmKxSkT0aW4j08yP5MO7CmTa dVDZxDw3JxSKFSPm+veAEK761fUp5IC7fbcDMc7ospw5J9PnyBxhXh0PofYcZqyN6+lp 9mmA== X-Gm-Message-State: APjAAAU5A3+iJedYeTbaDcDV+juBpAYpWRmCHuTXByMDprploUWqhLvm PMDakvrhv047nc+PfAQAaBPqbn4k X-Google-Smtp-Source: APXvYqxQEyL4Gs8JOEWc+21IsVYW4aylexAto5+/fPQb4OpvwIWcU/0Dy/5q8IFBhiy0JdqO50LXBw== X-Received: by 2002:a65:4841:: with SMTP id i1mr32768673pgs.37.1561373162411; Mon, 24 Jun 2019 03:46:02 -0700 (PDT) Received: from localhost.localdomain ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id k19sm4470865pgl.42.2019.06.24.03.46.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jun 2019 03:46:02 -0700 (PDT) From: yasufum.o@gmail.com To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Mon, 24 Jun 2019 19:45:58 +0900 Message-Id: <20190624104558.25306-1-yasufum.o@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [spp] [PATCH] docs: add API refs for cpu_layout and cpu_usage X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa This update is to add REST APIs for cpu_layout and cpu_usage of a server on which spp-ctl running. Signed-off-by: Yasufumi Ogawa --- docs/guides/api_ref/proc_independ.rst | 218 +++++++++++++++++++++++--- 1 file changed, 193 insertions(+), 25 deletions(-) diff --git a/docs/guides/api_ref/proc_independ.rst b/docs/guides/api_ref/proc_independ.rst index 52e3002..c6180fa 100644 --- a/docs/guides/api_ref/proc_independ.rst +++ b/docs/guides/api_ref/proc_independ.rst @@ -4,49 +4,60 @@ .. _spp_ctl_rest_api_proc_independ: -API Independent of Process Type -=============================== +Independent of Process Type +=========================== + GET /v1/processes ----------------- -Show the SPP processes connected to the ``spp-ctl``. +Show SPP processes connected with ``spp-ctl``. -* Normarl response codes: 200 +Response +~~~~~~~~ -Request example -~~~~~~~~~~~~~~~ +An array of dict of processes in which process type and secondary ID are +defined. So, primary process does not have this ID. -.. code-block:: console +.. _table_spp_ctl_processes_codes: - $ curl -X GET -H 'application/json' \ - http://127.0.0.1:7777/v1/processes +.. table:: Response code of getting processes. + +-------+-----------------------+ + | Value | Description | + | | | + +=======+=======================+ + | 200 | Normal response code. | + +-------+-----------------------+ -Response -~~~~~~~~ +.. _table_spp_ctl_processes: -An array of process objects. +.. table:: Response params of getting processes. -Process objects: + +-----------+---------+--------------------------------------------------+ + | Name | Type | Description | + | | | | + +===========+=========+==================================================+ + | type | string | Process type such as ``primary``, ``nfv`` or so. | + +-----------+---------+--------------------------------------------------+ + | client-id | integer | Secondary ID, so ``primary`` does not have it. | + +-----------+---------+--------------------------------------------------+ -.. _table_spp_ctl_processes: -.. table:: Response params of getting processes info. +Examples +~~~~~~~~ - +-----------+---------+-----------------------------------------------------------------+ - | Name | Type | Description | - | | | | - +===========+=========+=================================================================+ - | type | string | process type. one of ``primary``, ``nfv`` or ``vf``. | - +-----------+---------+-----------------------------------------------------------------+ - | client-id | integer | client id. if type is ``primary`` this member does not exist. | - +-----------+---------+-----------------------------------------------------------------+ +Request +^^^^^^^ +.. code-block:: console -Response example -~~~~~~~~~~~~~~~~ + $ curl -X GET -H 'application/json' \ + http://127.0.0.1:7777/v1/processes + +Response +^^^^^^^^ .. code-block:: json @@ -63,3 +74,160 @@ Response example "client-id": 2 } ] + + +GET /v1/cpu_layout +------------------ + +Show CPU layout of a server on which ``spp-ctl`` running. + + +Response +~~~~~~~~ + +An array of CPU socket params which consists of each of physical core ID and +logical cores if hyper threading is enabled. + +.. _table_spp_ctl_cpu_layout_codes: + +.. table:: Response code of CPU layout. + + +-------+-----------------------+ + | Value | Description | + | | | + +=======+=======================+ + | 200 | Normal response code. | + +-------+-----------------------+ + + +.. _table_spp_ctl_cpu_layout: + +.. table:: Response params of getting CPU layout. + + +-----------+---------+-------------------------------+ + | Name | Type | Description | + | | | | + +===========+=========+===============================+ + | cores | array | Set of cores on a socket. | + +-----------+---------+-------------------------------+ + | core_id | integer | ID of physical core. | + +-----------+---------+-------------------------------+ + | lcores | array | Set of IDs of logical cores. | + +-----------+---------+-------------------------------+ + | socket_id | integer | Socket ID. | + +-----------+---------+-------------------------------+ + +Examples +~~~~~~~~ + +Request +^^^^^^^ + +.. code-block:: console + + $ curl -X GET -H 'application/json' \ + http://127.0.0.1:7777/v1/cpu_layout + +Response +^^^^^^^^ + +.. code-block:: json + + [ + { + "cores": [ + { + "core_id": 1, + "lcores": [2, 3] + }, + { + "core_id": 0, + "lcores": [0, 1] + }, + ... + { + "core_id": 2, + "lcores": [4, 5] + } + ], + "socket_id": 0 + } + ] + + +GET /v1/cpu_usage +------------------ + +Show CPU usage of a server on which ``spp-ctl`` running. + + +Response +~~~~~~~~ + +An array of CPU usage of each of SPP processes. This usage consists of +two params, master lcore and lcore set including master and slaves. + +.. _table_spp_ctl_cpu_layout_codes: + +.. table:: Response code of CPU layout. + + +-------+-----------------------+ + | Value | Description | + | | | + +=======+=======================+ + | 200 | Normal response code. | + +-------+-----------------------+ + + +.. _table_spp_ctl_cpu_layout: + +.. table:: Response params of getting CPU layout. + + +--------------+---------+-----------------------------------------------+ + | Name | Type | Description | + | | | | + +==============+=========+===============================================+ + | proc-type | string | Proc type such as ``primary``, ``nfv`` or so. | + +--------------+---------+-----------------------------------------------+ + | master-lcore | integer | Lcore ID of master. | + +--------------+---------+-----------------------------------------------+ + | lcores | array | All of Lcore IDs including master and slaves. | + +--------------+---------+-----------------------------------------------+ + +Examples +~~~~~~~~ + +Request +^^^^^^^ + +.. code-block:: console + + $ curl -X GET -H 'application/json' \ + http://127.0.0.1:7777/v1/cpu_usage + +Response +^^^^^^^^ + +.. code-block:: json + + [ + { + "proc-type": "primary", + "master-lcore": 0, + "lcores": [ + 0 + ] + }, + { + "proc-type": "nfv", + "client-id": 2, + "master-lcore": 1, + "lcores": [1, 2] + }, + { + "proc-type": "vf", + "client-id": 3, + "master-lcore": 1, + "lcores": [1, 3, 4, 5] + } + ] -- 2.17.1