get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 45188,
    "url": "https://patches.dpdk.org/api/patches/45188/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20180924082333.12812-1-harry.van.haaren@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.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": "<20180924082333.12812-1-harry.van.haaren@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180924082333.12812-1-harry.van.haaren@intel.com",
    "date": "2018-09-24T08:23:31",
    "name": "[v3,1/3] event: add function for reading unlink in progress",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "98a916858aa74144d327c05ad7a4b01a0aa9decb",
    "submitter": {
        "id": 317,
        "url": "https://patches.dpdk.org/api/people/317/?format=api",
        "name": "Van Haaren, Harry",
        "email": "harry.van.haaren@intel.com"
    },
    "delegate": {
        "id": 310,
        "url": "https://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20180924082333.12812-1-harry.van.haaren@intel.com/mbox/",
    "series": [
        {
            "id": 1459,
            "url": "https://patches.dpdk.org/api/series/1459/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1459",
            "date": "2018-09-24T08:23:31",
            "name": "[v3,1/3] event: add function for reading unlink in progress",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/1459/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/45188/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/45188/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 230462B9D;\n\tMon, 24 Sep 2018 10:25:02 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 4D3501AFF\n\tfor <dev@dpdk.org>; Mon, 24 Sep 2018 10:25:00 +0200 (CEST)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t24 Sep 2018 01:24:59 -0700",
            "from silpixa00399779.ir.intel.com (HELO\n\tsilpixa00399779.ger.corp.intel.com) ([10.237.223.187])\n\tby fmsmga005.fm.intel.com with ESMTP; 24 Sep 2018 01:24:58 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.54,297,1534834800\"; d=\"scan'208\";a=\"265170291\"",
        "From": "Harry van Haaren <harry.van.haaren@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "jerin.jacob@caviumnetworks.com,\n\tHarry van Haaren <harry.van.haaren@intel.com>",
        "Date": "Mon, 24 Sep 2018 09:23:31 +0100",
        "Message-Id": "<20180924082333.12812-1-harry.van.haaren@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20180920112251.47854-1-harry.van.haaren@intel.com>",
        "References": "<20180920112251.47854-1-harry.van.haaren@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3 1/3] event: add function for reading unlink in\n\tprogress",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This commit introduces a new function in the eventdev API,\nwhich allows applications to read the number of unlink requests\nin progress on a particular port of an eventdev instance.\n\nThis information allows applications to verify when no more packets\nfrom a particular queue (or any queue) will arrive at a port.\nThe application could decide to stop polling, or put the core into\na sleep state if it wishes, as it is ensured that no new packets\nwill arrive at a particular port anymore if all queues are unlinked.\n\nSuggested-by: Matias Elo <matias.elo@nokia.com>\nSigned-off-by: Harry van Haaren <harry.van.haaren@intel.com>\nAcked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>\n\n---\n\nv3:\n- Fix ack (was missing a > symbol) (Checkpatch email report)\n\nv2:\n- Fix @see function_name() syntax (Jerin)\n- Add @warning to indicate experimental API in header\n- Update unlink() return docs to state async behaviour\n- Added Ack as per ML\n\nCheers, -Harry\n---\n lib/librte_eventdev/rte_eventdev.c           | 22 +++++++++++\n lib/librte_eventdev/rte_eventdev.h           | 39 +++++++++++++++++---\n lib/librte_eventdev/rte_eventdev_pmd.h       | 19 ++++++++++\n lib/librte_eventdev/rte_eventdev_version.map |  1 +\n 4 files changed, 75 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c\nindex 801810edd..0a8572b7b 100644\n--- a/lib/librte_eventdev/rte_eventdev.c\n+++ b/lib/librte_eventdev/rte_eventdev.c\n@@ -980,6 +980,28 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,\n \treturn diag;\n }\n \n+int __rte_experimental\n+rte_event_port_unlinks_in_progress(uint8_t dev_id, uint8_t port_id)\n+{\n+\tstruct rte_eventdev *dev;\n+\n+\tRTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);\n+\tdev = &rte_eventdevs[dev_id];\n+\tif (!is_valid_port(dev, port_id)) {\n+\t\tRTE_EDEV_LOG_ERR(\"Invalid port_id=%\" PRIu8, port_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t/* Return 0 if the PMD does not implement unlinks in progress.\n+\t * This allows PMDs which handle unlink synchronously to not implement\n+\t * this function at all.\n+\t */\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->port_unlinks_in_progress, 0);\n+\n+\treturn (*dev->dev_ops->port_unlinks_in_progress)(dev,\n+\t\t\tdev->data->ports[port_id]);\n+}\n+\n int\n rte_event_port_links_get(uint8_t dev_id, uint8_t port_id,\n \t\t\t uint8_t queues[], uint8_t priorities[])\ndiff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h\nindex b6fd6ee7f..a24213ea7 100644\n--- a/lib/librte_eventdev/rte_eventdev.h\n+++ b/lib/librte_eventdev/rte_eventdev.h\n@@ -1656,12 +1656,13 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,\n  * event port designated by its *port_id* on the event device designated\n  * by its *dev_id*.\n  *\n- * The unlink establishment shall disable the event port *port_id* from\n- * receiving events from the specified event queue *queue_id*\n- *\n+ * The unlink call issues an async request to disable the event port *port_id*\n+ * from receiving events from the specified event queue *queue_id*.\n  * Event queue(s) to event port unlink establishment can be changed at runtime\n  * without re-configuring the device.\n  *\n+ * @see rte_event_port_unlinks_in_progress() to poll for completed unlinks.\n+ *\n  * @param dev_id\n  *   The identifier of the device.\n  *\n@@ -1679,21 +1680,47 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,\n  *   NULL.\n  *\n  * @return\n- * The number of unlinks actually established. The return value can be less\n+ * The number of unlinks successfully requested. The return value can be less\n  * than the value of the *nb_unlinks* parameter when the implementation has the\n  * limitation on specific queue to port unlink establishment or\n  * if invalid parameters are specified.\n  * If the return value is less than *nb_unlinks*, the remaining queues at the\n- * end of queues[] are not established, and the caller has to take care of them.\n+ * end of queues[] are not unlinked, and the caller has to take care of them.\n  * If return value is less than *nb_unlinks* then implementation shall update\n  * the rte_errno accordingly, Possible rte_errno values are\n  * (-EINVAL) Invalid parameter\n- *\n  */\n int\n rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,\n \t\t      uint8_t queues[], uint16_t nb_unlinks);\n \n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * Returns the number of unlinks in progress.\n+ *\n+ * This function provides the application with a method to detect when an\n+ * unlink has been completed by the implementation.\n+ *\n+ * @see rte_event_port_unlink() to issue unlink requests.\n+ *\n+ * @param dev_id\n+ *   The indentifier of the device.\n+ *\n+ * @param port_id\n+ *   Event port identifier to select port to check for unlinks in progress.\n+ *\n+ * @return\n+ * The number of unlinks that are in progress. A return of zero indicates that\n+ * there are no outstanding unlink requests. A positive return value indicates\n+ * the number of unlinks that are in progress, but are not yet complete.\n+ * A negative return value indicates an error, -EINVAL indicates an invalid\n+ * parameter passed for *dev_id* or *port_id*.\n+ */\n+int __rte_experimental\n+rte_event_port_unlinks_in_progress(uint8_t dev_id, uint8_t port_id);\n+\n /**\n  * Retrieve the list of source event queues and its associated service priority\n  * linked to the destination event port designated by its *port_id*\ndiff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h\nindex 3fbb4d2b2..65645730a 100644\n--- a/lib/librte_eventdev/rte_eventdev_pmd.h\n+++ b/lib/librte_eventdev/rte_eventdev_pmd.h\n@@ -332,6 +332,23 @@ typedef int (*eventdev_port_link_t)(struct rte_eventdev *dev, void *port,\n typedef int (*eventdev_port_unlink_t)(struct rte_eventdev *dev, void *port,\n \t\tuint8_t queues[], uint16_t nb_unlinks);\n \n+/**\n+ * Unlinks in progress. Returns number of unlinks that the PMD is currently\n+ * performing, but have not yet been completed.\n+ *\n+ * @param dev\n+ *   Event device pointer\n+ *\n+ * @param port\n+ *   Event port pointer\n+ *\n+ * @return\n+ *   Returns the number of in-progress unlinks. Zero is returned if none are\n+ *   in progress.\n+ */\n+typedef int (*eventdev_port_unlinks_in_progress_t)(struct rte_eventdev *dev,\n+\t\tvoid *port);\n+\n /**\n  * Converts nanoseconds to *timeout_ticks* value for rte_event_dequeue()\n  *\n@@ -815,6 +832,8 @@ struct rte_eventdev_ops {\n \t/**< Link event queues to an event port. */\n \teventdev_port_unlink_t port_unlink;\n \t/**< Unlink event queues from an event port. */\n+\teventdev_port_unlinks_in_progress_t port_unlinks_in_progress;\n+\t/**< Unlinks in progress on an event port. */\n \teventdev_dequeue_timeout_ticks_t timeout_ticks;\n \t/**< Converts ns to *timeout_ticks* value for rte_event_dequeue() */\n \teventdev_dump_t dump;\ndiff --git a/lib/librte_eventdev/rte_eventdev_version.map b/lib/librte_eventdev/rte_eventdev_version.map\nindex 12835e9f2..24e7a45c0 100644\n--- a/lib/librte_eventdev/rte_eventdev_version.map\n+++ b/lib/librte_eventdev/rte_eventdev_version.map\n@@ -96,6 +96,7 @@ EXPERIMENTAL {\n \trte_event_crypto_adapter_stats_reset;\n \trte_event_crypto_adapter_stop;\n \trte_event_eth_rx_adapter_cb_register;\n+\trte_event_port_unlinks_in_progress;\n \trte_event_timer_adapter_caps_get;\n \trte_event_timer_adapter_create;\n \trte_event_timer_adapter_create_ext;\n",
    "prefixes": [
        "v3",
        "1/3"
    ]
}