get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/64274/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 64274,
    "url": "http://patchwork.dpdk.org/api/patches/64274/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200107145637.8922-1-laurent.hardy@6wind.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20200107145637.8922-1-laurent.hardy@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200107145637.8922-1-laurent.hardy@6wind.com",
    "date": "2020-01-07T14:56:37",
    "name": "librte_ethdev: extend dpdk api led control to query capability",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "ac40437776b45be895dd7d9d2536d805242baee7",
    "submitter": {
        "id": 606,
        "url": "http://patchwork.dpdk.org/api/people/606/?format=api",
        "name": "Laurent Hardy",
        "email": "laurent.hardy@6wind.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20200107145637.8922-1-laurent.hardy@6wind.com/mbox/",
    "series": [
        {
            "id": 8006,
            "url": "http://patchwork.dpdk.org/api/series/8006/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=8006",
            "date": "2020-01-07T14:56:37",
            "name": "librte_ethdev: extend dpdk api led control to query capability",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/8006/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/64274/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/64274/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id B78FDA046B;\n\tTue,  7 Jan 2020 15:57:28 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4FF121D9C2;\n\tTue,  7 Jan 2020 15:57:28 +0100 (CET)",
            "from mail-wm1-f66.google.com (mail-wm1-f66.google.com\n [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id CBEC61D9B0\n for <dev@dpdk.org>; Tue,  7 Jan 2020 15:57:26 +0100 (CET)",
            "by mail-wm1-f66.google.com with SMTP id c127so14382713wme.1\n for <dev@dpdk.org>; Tue, 07 Jan 2020 06:57:26 -0800 (PST)",
            "from sphinx.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com.\n [62.23.145.78])\n by smtp.gmail.com with ESMTPSA id f17sm27257216wmc.8.2020.01.07.06.57.24\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 07 Jan 2020 06:57:24 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google;\n h=from:to:cc:subject:date:message-id:mime-version\n :content-transfer-encoding;\n bh=IUMs+isQjToFjSGsYXcl6Sbc2s0qHfrj4l8Mkd7P5FA=;\n b=PsJ5aZYOFJZ/rHSh/gxL7EM4bwbkcD1V0B8FvPf4Y0ZKpCHu/rMrW78BEc3sscanwQ\n 0wZGdESDxTW/d+4dAq0aD1t5bcEdaALypTrsRdA3NSwfLR+noYP0DfAfWhnbRwlT65bK\n epAxF5kOJhj7D7dhkjMYeHGoFe80VwuBoiOafw9IrZLEmERyt8CDCg211RT0jVl6Jp2Y\n eT85AI0c92yVPdraLmZpeoqqnz5ewt9w67X3NsMWmAxGWveqDB2tv/18Ox42uMjt+4AK\n KEJjVZlVwfTK0cJGEFUqIaais7maiK+Ez7W/7KQW8XXTWrqKJHTX4/LZWOpoDiWmDUVj\n fNaQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n :content-transfer-encoding;\n bh=IUMs+isQjToFjSGsYXcl6Sbc2s0qHfrj4l8Mkd7P5FA=;\n b=QQvJjzrhEiuRUMW7Mm+l0GJTST1muWY1RCjAeXDezd86IEva2sQZuvZGithGNZgbyl\n GH6HgLIy3i9JVqMXUm6gJgiMTFjWVBEwN18wlTFsGuyv97rhAjLmqfcCtEymOlqLNYcm\n XK0ifcO6UmJsdHgIz3t6NuOz4zrgKMC2cQ26w69cgM5c6DHXJz0VgbWgO5NdB4yNYYiq\n M2R0pAm0w42qzPfGI5bjEUMVcmG3I5Oq1rt3nwzFXZ5ksb5eAq3Z3VEgI3VOzmnH9kRc\n DvLteXZcutlj1vtqkTozL5Gdysf13yl8YkXLzkxgEa8Z/dn3wMVFBys+2me6l4D94vj5\n 1MOw==",
        "X-Gm-Message-State": "APjAAAU+YFiyMuGwB9jWLky9t0XRVx6sIkd1XfjPZXgodglTvShAoGb1\n 6xgJi7JFq9WvmyY9JdJSUGnc/b2m/R0=",
        "X-Google-Smtp-Source": "\n APXvYqzXaj3WW2Suu/MKNWg2cXsBaykvtb+3/+p1uWQQZQVsQ/x0bikeqPMOPK2yqNJH271aktcTxA==",
        "X-Received": "by 2002:a05:600c:2409:: with SMTP id\n 9mr38148057wmp.109.1578409046043;\n Tue, 07 Jan 2020 06:57:26 -0800 (PST)",
        "From": "Laurent Hardy <laurent.hardy@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "olivier.matz@6wind.com",
        "Date": "Tue,  7 Jan 2020 15:56:37 +0100",
        "Message-Id": "<20200107145637.8922-1-laurent.hardy@6wind.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH] librte_ethdev: extend dpdk api led control to\n\tquery capability",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "In current led control API we have no way to know if a device is able\nto handle on/off requests coming from the application.\nKnowing if the device is led control capable could be useful to avoid\nexchanges between application and kernel.\nUsing the on/off requests to flag if the device is led control capable\n(based on the ENOSUP returned error) is not convenient as such request\ncan change the led state on device.\n\nThis patch adds a new function rte_eth_led_ctrl_capable() that will look\nfor led_off/on dev ops availability on the related pmd, to know if the\ndevice is able to handle such led control requests (on/off).\n\nSigned-off-by: Laurent Hardy <laurent.hardy@6wind.com>\n---\n doc/guides/nics/features.rst             |  5 +++++\n lib/librte_ethdev/rte_ethdev.c           | 12 ++++++++++++\n lib/librte_ethdev/rte_ethdev.h           | 15 +++++++++++++++\n lib/librte_ethdev/rte_ethdev_core.h      |  4 ++++\n lib/librte_ethdev/rte_ethdev_version.map |  1 +\n 5 files changed, 37 insertions(+)",
    "diff": "diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst\nindex 8394a6595..012645dc5 100644\n--- a/doc/guides/nics/features.rst\n+++ b/doc/guides/nics/features.rst\n@@ -732,6 +732,11 @@ registers and register size).\n LED\n ---\n \n+Interrogates device to know if it is led control capable.\n+\n+* **[implements] eth_dev_ops**: ``dev_led_ctrl_capable``.\n+* **[related]    API**: ``rte_eth_led_ctrl_capable()``.\n+\n Supports turning on/off a software controllable LED on a device.\n \n * **[implements] eth_dev_ops**: ``dev_led_on``, ``dev_led_off``.\ndiff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 6e9cb243e..b259b6b19 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -3612,6 +3612,18 @@ rte_eth_led_off(uint16_t port_id)\n \treturn eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev));\n }\n \n+int\n+rte_eth_led_ctrl_capable(uint16_t port_id)\n+{\n+\tstruct rte_eth_dev *dev;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_led_off, -ENOTSUP);\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_led_on, -ENOTSUP);\n+\treturn 0;\n+}\n+\n /*\n  * Returns index into MAC address array of addr. Use 00:00:00:00:00:00 to find\n  * an empty spot.\ndiff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h\nindex 18a9defc2..a5bacd643 100644\n--- a/lib/librte_ethdev/rte_ethdev.h\n+++ b/lib/librte_ethdev/rte_ethdev.h\n@@ -3204,6 +3204,21 @@ int  rte_eth_led_on(uint16_t port_id);\n  */\n int  rte_eth_led_off(uint16_t port_id);\n \n+/**\n+ * Interrogate the Ethernet device to know if it is led control capable.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @return\n+ *   - (0) if successful.\n+ *   - (-ENOTSUP) if underlying hardware OR driver doesn't support\n+ *     that operation.\n+ *   - (-ENODEV) if *port_id* invalid.\n+ *   - (-EIO) if device is removed.\n+ */\n+int  __rte_experimental\n+rte_eth_led_ctrl_capable(uint16_t port_id);\n+\n /**\n  * Get current status of the Ethernet link flow control for Ethernet device\n  *\ndiff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h\nindex 7bf97e24e..6cf2a5242 100644\n--- a/lib/librte_ethdev/rte_ethdev_core.h\n+++ b/lib/librte_ethdev/rte_ethdev_core.h\n@@ -388,6 +388,9 @@ typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);\n typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);\n /**< @internal Turn off SW controllable LED on an Ethernet device */\n \n+typedef int (*eth_dev_led_ctrl_capable_t)(struct rte_eth_dev *dev);\n+/**< @internal Get led control capability on an Ethernet device */\n+\n typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);\n /**< @internal Remove MAC address from receive address register */\n \n@@ -675,6 +678,7 @@ struct eth_dev_ops {\n \n \teth_dev_led_on_t           dev_led_on;    /**< Turn on LED. */\n \teth_dev_led_off_t          dev_led_off;   /**< Turn off LED. */\n+\teth_dev_led_ctrl_capable_t dev_led_ctrl_capable;  /**< Get led control capability. */\n \n \tflow_ctrl_get_t            flow_ctrl_get; /**< Get flow control. */\n \tflow_ctrl_set_t            flow_ctrl_set; /**< Setup flow control. */\ndiff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map\nindex a7dacf2cf..776f3b5d6 100644\n--- a/lib/librte_ethdev/rte_ethdev_version.map\n+++ b/lib/librte_ethdev/rte_ethdev_version.map\n@@ -227,4 +227,5 @@ EXPERIMENTAL {\n \trte_flow_dynf_metadata_mask;\n \trte_flow_dynf_metadata_register;\n \trte_eth_dev_set_ptypes;\n+\trte_eth_led_ctrl_capable;\n };\n",
    "prefixes": []
}