List comments

GET /api/patches/52337/comments/
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

[
    {
        "id": 101472,
        "web_url": "http://patches.dpdk.org/comment/101472/",
        "msgid": "<29cd9e80-a972-43a9-4277-1d34617d9f2a@intel.com>",
        "list_archive_url": "https://inbox.dpdk.org/dev/29cd9e80-a972-43a9-4277-1d34617d9f2a@intel.com",
        "date": "2019-09-26T13:00:12",
        "subject": "Re: [dpdk-dev] [PATCH v5 2/4] power: extend guest channel API for\n\treading",
        "submitter": {
            "id": 342,
            "url": "http://patches.dpdk.org/api/people/342/",
            "name": "David Hunt",
            "email": "david.hunt@intel.com"
        },
        "content": "On 05/04/2019 14:24, Hajkowski wrote:\n> From: Marcin Hajkowski <marcinx.hajkowski@intel.com>\n>\n> Added new experimental API rte_power_guest_channel_receive_msg\n> which gives possibility to receive messages send to guest.\n>\n> Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>\n> ---\n>   lib/librte_power/channel_commands.h    |  5 +++\n>   lib/librte_power/guest_channel.c       | 60 ++++++++++++++++++++++++++\n>   lib/librte_power/guest_channel.h       | 35 +++++++++++++++\n>   lib/librte_power/rte_power_version.map |  1 +\n>   4 files changed, 101 insertions(+)\n>\n> diff --git a/lib/librte_power/channel_commands.h b/lib/librte_power/channel_commands.h\n> index e7b93a797..33fd53a6d 100644\n> --- a/lib/librte_power/channel_commands.h\n> +++ b/lib/librte_power/channel_commands.h\n> @@ -28,6 +28,11 @@ extern \"C\" {\n>   #define CPU_POWER_SCALE_MIN     4\n>   #define CPU_POWER_ENABLE_TURBO  5\n>   #define CPU_POWER_DISABLE_TURBO 6\n> +\n> +/* Generic Power Command Response */\n> +#define CPU_POWER_CMD_ACK       1\n> +#define CPU_POWER_CMD_NACK      2\n> +\n>   #define HOURS 24\n>   \n>   #define MAX_VFS 10\n> diff --git a/lib/librte_power/guest_channel.c b/lib/librte_power/guest_channel.c\n> index 9cf7d2cb2..888423891 100644\n> --- a/lib/librte_power/guest_channel.c\n> +++ b/lib/librte_power/guest_channel.c\n> @@ -10,6 +10,7 @@\n>   #include <fcntl.h>\n>   #include <string.h>\n>   #include <errno.h>\n> +#include <poll.h>\n>   \n>   \n>   #include <rte_log.h>\n> @@ -19,6 +20,9 @@\n>   \n>   #define RTE_LOGTYPE_GUEST_CHANNEL RTE_LOGTYPE_USER1\n>   \n> +/* Timeout for incoming message in milliseconds. */\n> +#define TIMEOUT 10\n> +\n>   static int global_fds[RTE_MAX_LCORE] = { [0 ... RTE_MAX_LCORE-1] = -1 };\n>   \n>   int\n> @@ -125,6 +129,62 @@ int rte_power_guest_channel_send_msg(struct channel_packet *pkt,\n>   \treturn guest_channel_send_msg(pkt, lcore_id);\n>   }\n>   \n> +int power_guest_channel_read_msg(struct channel_packet *pkt,\n> +\t\t\tunsigned int lcore_id)\n> +{\n> +\tint ret;\n> +\tstruct pollfd fds;\n> +\tvoid *buffer = pkt;\n> +\tint buffer_len = sizeof(*pkt);\n> +\n> +\tfds.fd = global_fds[lcore_id];\n> +\tfds.events = POLLIN;\n> +\n> +\tret = poll(&fds, 1, TIMEOUT);\n> +\tif (ret == 0) {\n> +\t\tRTE_LOG(DEBUG, GUEST_CHANNEL, \"Timeout occurred during poll function.\\n\");\n> +\t\treturn -1;\n> +\t} else if (ret < 0) {\n> +\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Error occurred during poll function: %s\\n\",\n> +\t\t\t\tstrerror(ret));\n> +\t\treturn -1;\n> +\t}\n> +\n> +\tif (lcore_id >= RTE_MAX_LCORE) {\n> +\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Channel(%u) is out of range 0...%d\\n\",\n> +\t\t\t\tlcore_id, RTE_MAX_LCORE-1);\n> +\t\treturn -1;\n> +\t}\n> +\n> +\tif (global_fds[lcore_id] < 0) {\n> +\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Channel is not connected\\n\");\n> +\t\treturn -1;\n> +\t}\n> +\n> +\twhile (buffer_len > 0) {\n> +\t\tret = read(global_fds[lcore_id],\n> +\t\t\t\tbuffer, buffer_len);\n> +\t\tif (ret < 0) {\n> +\t\t\tif (errno == EINTR)\n> +\t\t\t\tcontinue;\n> +\t\t\treturn -1;\n> +\t\t}\n> +\t\tif (ret == 0) {\n> +\t\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Expected more data, but connection has been closed.\\n\");\n> +\t\t\treturn -1;\n> +\t\t}\n> +\t\tbuffer = (char *)buffer + ret;\n> +\t\tbuffer_len -= ret;\n> +\t}\n> +\n> +\treturn 0;\n> +}\n> +\n> +int rte_power_guest_channel_receive_msg(struct channel_packet *pkt,\n> +\t\t\tunsigned int lcore_id)\n> +{\n> +\treturn power_guest_channel_read_msg(pkt, lcore_id);\n> +}\n>   \n>   void\n>   guest_channel_host_disconnect(unsigned int lcore_id)\n> diff --git a/lib/librte_power/guest_channel.h b/lib/librte_power/guest_channel.h\n> index 373d39898..7c385df39 100644\n> --- a/lib/librte_power/guest_channel.h\n> +++ b/lib/librte_power/guest_channel.h\n> @@ -68,6 +68,41 @@ int guest_channel_send_msg(struct channel_packet *pkt, unsigned int lcore_id);\n>   int rte_power_guest_channel_send_msg(struct channel_packet *pkt,\n>   \t\t\tunsigned int lcore_id);\n>   \n> +/**\n> + * Read a message contained in pkt over the Virtio-Serial\n> + * from the host endpoint.\n> + *\n> + * @param pkt\n> + *  Pointer to a populated struct channel_packet\n> + *\n> + * @param lcore_id\n> + *  lcore_id.\n> + *\n> + * @return\n> + *  - 0 on success.\n> + *  - Negative on error.\n> + */\n> +int power_guest_channel_read_msg(struct channel_packet *pkt,\n> +\t\tunsigned int lcore_id);\n> +\n> +/**\n> + * Receive a message contained in pkt over the Virtio-Serial\n> + * from the host endpoint.\n> + *\n> + * @param pkt\n> + *  Pointer to a populated struct channel_packet\n> + *\n> + * @param lcore_id\n> + *  lcore_id.\n> + *\n> + * @return\n> + *  - 0 on success.\n> + *  - Negative on error.\n> + */\n> +int __rte_experimental\n> +rte_power_guest_channel_receive_msg(struct channel_packet *pkt,\n> +\t\t\tunsigned int lcore_id);\n> +\n>   #ifdef __cplusplus\n>   }\n>   #endif\n> diff --git a/lib/librte_power/rte_power_version.map b/lib/librte_power/rte_power_version.map\n> index 042917360..69f5ea3f4 100644\n> --- a/lib/librte_power/rte_power_version.map\n> +++ b/lib/librte_power/rte_power_version.map\n> @@ -44,4 +44,5 @@ EXPERIMENTAL {\n>   \trte_power_empty_poll_stat_update;\n>   \trte_power_poll_stat_fetch;\n>   \trte_power_poll_stat_update;\n> +\trte_power_guest_channel_receive_msg;\n>   };\n\n\nI tested this with the later patches in the set, and the acknowledges \nsuccessfully get back to the guest from the host in the form of an Ack \nor Nack for various commands sent from the guest.\n\nTested-by: David Hunt <david.hunt@intel.com>",
        "headers": {
            "X-Amp-File-Uploaded": "False",
            "Subject": "Re: [dpdk-dev] [PATCH v5 2/4] power: extend guest channel API for\n\treading",
            "List-Post": "<mailto:dev@dpdk.org>",
            "X-Original-To": "patchwork@dpdk.org",
            "Message-ID": "<29cd9e80-a972-43a9-4277-1d34617d9f2a@intel.com>",
            "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
            "From": "\"Hunt, David\" <david.hunt@intel.com>",
            "Return-Path": "<dev-bounces@dpdk.org>",
            "X-BeenThere": "dev@dpdk.org",
            "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
            "Date": "Thu, 26 Sep 2019 14:00:12 +0100",
            "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101\n\tThunderbird/60.7.2",
            "In-Reply-To": "<20190405132455.15468-3-marcinx.hajkowski@intel.com>",
            "MIME-Version": "1.0",
            "Errors-To": "dev-bounces@dpdk.org",
            "References": "<20190405132455.15468-1-marcinx.hajkowski@intel.com>\n\t<20190405132455.15468-3-marcinx.hajkowski@intel.com>",
            "X-Amp-Result": "SKIPPED(no attachment in message)",
            "Delivered-To": "patchwork@dpdk.org",
            "Precedence": "list",
            "Received": [
                "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 804F737A2;\n\tThu, 26 Sep 2019 15:00:30 +0200 (CEST)",
                "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby dpdk.org (Postfix) with ESMTP id 1CAED34F3\n\tfor <dev@dpdk.org>; Thu, 26 Sep 2019 15:00:28 +0200 (CEST)",
                "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t26 Sep 2019 06:00:28 -0700",
                "from dhunt5-mobl4.ger.corp.intel.com (HELO [10.237.221.113])\n\t([10.237.221.113])\n\tby orsmga006-auth.jf.intel.com with ESMTP/TLS/AES256-SHA;\n\t26 Sep 2019 06:00:27 -0700"
            ],
            "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
            "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
            "To": "20190402082121.5472-1-marcinx.hajkowski@intel.com",
            "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
            "Sender": "\"dev\" <dev-bounces@dpdk.org>",
            "Content-Language": "en-US",
            "Content-Type": "text/plain; charset=utf-8; format=flowed",
            "X-Mailman-Version": "2.1.15",
            "Cc": "dev@dpdk.org, Marcin Hajkowski <marcinx.hajkowski@intel.com>",
            "Content-Transfer-Encoding": "7bit",
            "X-IronPort-AV": "E=Sophos;i=\"5.64,552,1559545200\"; d=\"scan'208\";a=\"194119577\""
        }
    },
    {
        "id": 101501,
        "web_url": "http://patches.dpdk.org/comment/101501/",
        "msgid": "<F5C6929789601049BEB7272E26735598A5D3A6@IRSMSX106.ger.corp.intel.com>",
        "list_archive_url": "https://inbox.dpdk.org/dev/F5C6929789601049BEB7272E26735598A5D3A6@IRSMSX106.ger.corp.intel.com",
        "date": "2019-09-26T15:53:15",
        "subject": "Re: [dpdk-dev] [PATCH v5 2/4] power: extend guest channel API\n\tfor\treading",
        "submitter": {
            "id": 825,
            "url": "http://patches.dpdk.org/api/people/825/",
            "name": "Daly, Lee",
            "email": "lee.daly@intel.com"
        },
        "content": "> On 05/04/2019 14:24, Hajkowski wrote:\n> > From: Marcin Hajkowski <marcinx.hajkowski@intel.com>\n> >\n> > Added new experimental API rte_power_guest_channel_receive_msg\n> > which gives possibility to receive messages send to guest.\n> >\n> > Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>\n> > ---\n> >   lib/librte_power/channel_commands.h    |  5 +++\n> >   lib/librte_power/guest_channel.c       | 60 ++++++++++++++++++++++++++\n> >   lib/librte_power/guest_channel.h       | 35 +++++++++++++++\n> >   lib/librte_power/rte_power_version.map |  1 +\n> >   4 files changed, 101 insertions(+)\n> >\n> > diff --git a/lib/librte_power/channel_commands.h\n> > b/lib/librte_power/channel_commands.h\n\n\n<...>\n\n> > diff --git a/lib/librte_power/rte_power_version.map\n> > b/lib/librte_power/rte_power_version.map\n> > index 042917360..69f5ea3f4 100644\n> > --- a/lib/librte_power/rte_power_version.map\n> > +++ b/lib/librte_power/rte_power_version.map\n> > @@ -44,4 +44,5 @@ EXPERIMENTAL {\n> >   \trte_power_empty_poll_stat_update;\n> >   \trte_power_poll_stat_fetch;\n> >   \trte_power_poll_stat_update;\n> > +\trte_power_guest_channel_receive_msg;\n> >   };\nNit Pick, new api should be added in alphabetical order, i.e after \"rte_power_empty_poll_stat_update\" .\n\n> \n> \n> I tested this with the later patches in the set, and the acknowledges\n> successfully get back to the guest from the host in the form of an Ack or Nack\n> for various commands sent from the guest.\n> \n> Tested-by: David Hunt <david.hunt@intel.com>\n> \n\nFeel free to add my ack after the above minor change. \nAcked-by: Lee Daly <lee.daly@intel.com>",
        "headers": {
            "X-Amp-File-Uploaded": "False",
            "Subject": "Re: [dpdk-dev] [PATCH v5 2/4] power: extend guest channel API\n\tfor\treading",
            "List-Post": "<mailto:dev@dpdk.org>",
            "X-Original-To": "patchwork@dpdk.org",
            "Message-ID": "<F5C6929789601049BEB7272E26735598A5D3A6@IRSMSX106.ger.corp.intel.com>",
            "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
            "From": "\"Daly, Lee\" <lee.daly@intel.com>",
            "Return-Path": "<dev-bounces@dpdk.org>",
            "X-MS-Has-Attach": "",
            "X-BeenThere": "dev@dpdk.org",
            "dlp-product": "dlpe-windows",
            "dlp-reaction": "no-action",
            "x-titus-metadata-40": "eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGY1MzdmMTctOTVmMy00M2VmLTllZGEtY2FjYmUwZDNhY2Q0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidXBWQXg0R3dhR2w4Q3hHZG9LSTQrUENjYTdFSDQrODFJTm1pK2tkZGZJc2VrRUZjbCtmZXJIQk5TMHpkRXlDUSJ9",
            "Accept-Language": "en-US",
            "CC": "\"dev@dpdk.org\" <dev@dpdk.org>, Marcin Hajkowski\n\t<marcinx.hajkowski@intel.com>",
            "Date": "Thu, 26 Sep 2019 15:53:15 +0000",
            "In-Reply-To": "<29cd9e80-a972-43a9-4277-1d34617d9f2a@intel.com>",
            "x-ctpclassification": "CTP_NT",
            "Errors-To": "dev-bounces@dpdk.org",
            "References": "<20190405132455.15468-1-marcinx.hajkowski@intel.com>\n\t<20190405132455.15468-3-marcinx.hajkowski@intel.com>\n\t<29cd9e80-a972-43a9-4277-1d34617d9f2a@intel.com>",
            "X-Amp-Result": "SKIPPED(no attachment in message)",
            "Delivered-To": "patchwork@dpdk.org",
            "Precedence": "list",
            "Received": [
                "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A44E48F96;\n\tThu, 26 Sep 2019 17:53:20 +0200 (CEST)",
                "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 8A73F5B32\n\tfor <dev@dpdk.org>; Thu, 26 Sep 2019 17:53:18 +0200 (CEST)",
                "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t26 Sep 2019 08:53:17 -0700",
                "from irsmsx104.ger.corp.intel.com ([163.33.3.159])\n\tby fmsmga006.fm.intel.com with ESMTP; 26 Sep 2019 08:53:17 -0700",
                "from irsmsx106.ger.corp.intel.com ([169.254.8.184]) by\n\tIRSMSX104.ger.corp.intel.com ([169.254.5.103]) with mapi id\n\t14.03.0439.000; Thu, 26 Sep 2019 16:53:16 +0100"
            ],
            "x-originating-ip": "[163.33.239.181]",
            "MIME-Version": "1.0",
            "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
            "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
            "Thread-Topic": "[dpdk-dev] [PATCH v5 2/4] power: extend guest channel API for\n\treading",
            "To": "\"Hunt, David\" <david.hunt@intel.com>,\n\t\"20190402082121.5472-1-marcinx.hajkowski@intel.com\"\n\t<20190402082121.5472-1-marcinx.hajkowski@intel.com>",
            "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
            "Sender": "\"dev\" <dev-bounces@dpdk.org>",
            "Content-Language": "en-US",
            "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
            "Content-Type": "text/plain; charset=\"utf-8\"",
            "X-ExtLoop1": "1",
            "Content-Transfer-Encoding": "base64",
            "dlp-version": "11.2.0.6",
            "X-Mailman-Version": "2.1.15",
            "Thread-Index": "AQHVdGpwgihSp6YOsU68mTEm1/008qc+GwVQ",
            "X-MS-TNEF-Correlator": "",
            "X-IronPort-AV": "E=Sophos;i=\"5.64,552,1559545200\"; d=\"scan'208\";a=\"390767040\""
        }
    }
]