get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 116639,
    "url": "https://patches.dpdk.org/api/patches/116639/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220922074151.39450-3-fengchengwen@huawei.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": "<20220922074151.39450-3-fengchengwen@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220922074151.39450-3-fengchengwen@huawei.com",
    "date": "2022-09-22T07:41:48",
    "name": "[v9,2/5] ethdev: support proactive error handling mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "7945e597b369eca9b604d66cce869067ac203f6e",
    "submitter": {
        "id": 2146,
        "url": "https://patches.dpdk.org/api/people/2146/?format=api",
        "name": "fengchengwen",
        "email": "fengchengwen@huawei.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220922074151.39450-3-fengchengwen@huawei.com/mbox/",
    "series": [
        {
            "id": 24773,
            "url": "https://patches.dpdk.org/api/series/24773/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=24773",
            "date": "2022-09-22T07:41:51",
            "name": "support error handling mode",
            "version": 9,
            "mbox": "https://patches.dpdk.org/series/24773/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/116639/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/116639/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 5E076A0543;\n\tThu, 22 Sep 2022 09:48:36 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7EABB42B6E;\n\tThu, 22 Sep 2022 09:48:13 +0200 (CEST)",
            "from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189])\n by mails.dpdk.org (Postfix) with ESMTP id 9045A40F17\n for <dev@dpdk.org>; Thu, 22 Sep 2022 09:48:07 +0200 (CEST)",
            "from dggpeml500024.china.huawei.com (unknown [172.30.72.54])\n by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MY6lk36rpzHppZ;\n Thu, 22 Sep 2022 15:45:54 +0800 (CST)",
            "from localhost.localdomain (10.67.165.24) by\n dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2375.31; Thu, 22 Sep 2022 15:48:04 +0800"
        ],
        "From": "Chengwen Feng <fengchengwen@huawei.com>",
        "To": "<thomas@monjalon.net>, <ferruh.yigit@xilinx.com>, <ferruh.yigit@amd.com>",
        "CC": "<dev@dpdk.org>, <kalesh-anakkur.purayil@broadcom.com>,\n <somnath.kotur@broadcom.com>, <ajit.khaparde@broadcom.com>, <mdr@ashroe.eu>,\n <Andrew.Rybchenko@oktetlabs.ru>",
        "Subject": "[PATCH v9 2/5] ethdev: support proactive error handling mode",
        "Date": "Thu, 22 Sep 2022 07:41:48 +0000",
        "Message-ID": "<20220922074151.39450-3-fengchengwen@huawei.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20220922074151.39450-1-fengchengwen@huawei.com>",
        "References": "<20220128124831.427-1-kalesh-anakkur.purayil@broadcom.com>\n <20220922074151.39450-1-fengchengwen@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.67.165.24]",
        "X-ClientProxiedBy": "dggems705-chm.china.huawei.com (10.3.19.182) To\n dggpeml500024.china.huawei.com (7.185.36.10)",
        "X-CFilter-Loop": "Reflected",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>\n\nSome PMDs (e.g. hns3) could detect hardware or firmware errors, and try\nto recover from the errors. In this process, the PMD sets the data path\npointers to dummy functions (which will prevent the crash), and also\nmake sure the control path operations failed with retcode -EBUSY.\n\nThe above error handling mode is known as\nRTE_ETH_ERROR_HANDLE_MODE_PROACTIVE (proactive error handling mode).\n\nIn some service scenarios, application needs to be aware of the event\nto determine whether to migrate services. So three events were\nintroduced:\n\n1) RTE_ETH_EVENT_ERR_RECOVERING: used to notify the application that it\ndetected an error and the recovery is being started. Upon receiving the\nevent, the application should not invoke any control path APIs until\nreceiving RTE_ETH_EVENT_RECOVERY_SUCCESS or\nRTE_ETH_EVENT_RECOVERY_FAILED event.\n\n2) RTE_ETH_EVENT_RECOVERY_SUCCESS: used to notify the application that\nit recovers successful from the error, the PMD already re-configures\nthe port to the state prior to the error.\n\n3) RTE_ETH_EVENT_RECOVERY_FAILED: used to notify the application that it\nrecovers failed from the error, the port should not usable anymore. The\napplication should close the port.\n\nSigned-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>\nSigned-off-by: Somnath Kotur <somnath.kotur@broadcom.com>\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\nReviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n app/test-pmd/config.c                   |  2 ++\n doc/guides/prog_guide/poll_mode_drv.rst | 39 +++++++++++++++++++++++++\n doc/guides/rel_notes/release_22_11.rst  | 12 ++++++++\n lib/ethdev/rte_ethdev.h                 | 33 +++++++++++++++++++++\n 4 files changed, 86 insertions(+)",
    "diff": "diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex 0c10c663e9..b716d2a15f 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -924,6 +924,8 @@ port_infos_display(portid_t port_id)\n \t}\n \tif (dev_info.err_handle_mode == RTE_ETH_ERROR_HANDLE_MODE_PASSIVE)\n \t\tprintf(\"Device error handling mode: passive\\n\");\n+\telse if (dev_info.err_handle_mode == RTE_ETH_ERROR_HANDLE_MODE_PROACTIVE)\n+\t\tprintf(\"Device error handling mode: proactive\\n\");\n }\n \n void\ndiff --git a/doc/guides/prog_guide/poll_mode_drv.rst b/doc/guides/prog_guide/poll_mode_drv.rst\nindex 9d081b1cba..232dc459b0 100644\n--- a/doc/guides/prog_guide/poll_mode_drv.rst\n+++ b/doc/guides/prog_guide/poll_mode_drv.rst\n@@ -627,3 +627,42 @@ by application.\n The PMD itself should not call rte_eth_dev_reset(). The PMD can trigger\n the application to handle reset event. It is duty of application to\n handle all synchronization before it calls rte_eth_dev_reset().\n+\n+The above error handling mode is known as ``RTE_ETH_ERROR_HANDLE_MODE_PASSIVE``.\n+\n+Proactive Error Handling Mode\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+If PMD supports ``RTE_ETH_ERROR_HANDLE_MODE_PROACTIVE``, it means once detect\n+hardware or firmware errors, the PMD will try to recover from the errors. In\n+this process, the PMD sets the data path pointers to dummy functions (which\n+will prevent the crash), and also make sure the control path operations failed\n+with retcode -EBUSY.\n+\n+Also in this process, from the perspective of application, services are\n+affected. For example, the Rx/Tx bust APIs cannot receive and send packets,\n+and the control plane API return failure.\n+\n+In some service scenarios, application needs to be aware of the event to\n+determine whether to migrate services. So three events were introduced:\n+\n+* RTE_ETH_EVENT_ERR_RECOVERING: used to notify the application that it detected\n+  an error and the recovery is being started. Upon receiving the event, the\n+  application should not invoke any control path APIs until receiving\n+  RTE_ETH_EVENT_RECOVERY_SUCCESS or RTE_ETH_EVENT_RECOVERY_FAILED event.\n+\n+\n+* RTE_ETH_EVENT_RECOVERY_SUCCESS: used to notify the application that it\n+  recovers successful from the error, the PMD already re-configures the port to\n+  the state prior to the error.\n+\n+* RTE_ETH_EVENT_RECOVERY_FAILED: used to notify the application that it\n+  recovers failed from the error, the port should not usable anymore. the\n+  application should close the port.\n+\n+.. note::\n+        * Before the PMD reports the recovery result, the PMD may report the\n+          ``RTE_ETH_EVENT_ERR_RECOVERING`` event again, because a larger error\n+          may occur during the recovery.\n+        * The error handling mode supported by the PMD can be reported through\n+          the ``rte_eth_dev_info_get`` API.\ndiff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst\nindex 8c021cf050..fc85e5fa87 100644\n--- a/doc/guides/rel_notes/release_22_11.rst\n+++ b/doc/guides/rel_notes/release_22_11.rst\n@@ -55,6 +55,18 @@ New Features\n      Also, make sure to start the actual text at the margin.\n      =======================================================\n \n+* **Added proactive error handling mode for ethdev.**\n+\n+  Added proactive error handling mode for ethdev, and three event were\n+  introduced:\n+\n+  * Added new event: ``RTE_ETH_EVENT_ERR_RECOVERING`` for the PMD to report\n+    that the port is recovering from an error.\n+  * Added new event: ``RTE_ETH_EVENT_RECOVER_SUCCESS`` for the PMD to report\n+    that the port recover successful from an error.\n+  * Added new event: ``RTE_ETH_EVENT_RECOVER_FAILED`` for the PMD to report\n+    that the prot recover failed from an error.\n+\n \n Removed Items\n -------------\ndiff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h\nindex 930b0a2fff..d3e81b98a7 100644\n--- a/lib/ethdev/rte_ethdev.h\n+++ b/lib/ethdev/rte_ethdev.h\n@@ -1859,6 +1859,12 @@ enum rte_eth_err_handle_mode {\n \t * application invoke @see rte_eth_dev_reset to recover the port.\n \t */\n \tRTE_ETH_ERROR_HANDLE_MODE_PASSIVE,\n+\t/** Proactive error handling, after the PMD detect that a reset is\n+\t * required, the PMD reports @see RTE_ETH_EVENT_ERR_RECOVERING event,\n+\t * and do recovery internally, finally, reports the recovery result\n+\t * event (@see RTE_ETH_EVENT_RECOVERY_*).\n+\t */\n+\tRTE_ETH_ERROR_HANDLE_MODE_PROACTIVE,\n };\n \n /**\n@@ -3944,6 +3950,33 @@ enum rte_eth_event_type {\n \t * @see rte_eth_rx_avail_thresh_set()\n \t */\n \tRTE_ETH_EVENT_RX_AVAIL_THRESH,\n+\t/** Port recovering from a hardware or firmware error.\n+\t * If PMD supports proactive error recovery, it should trigger this\n+\t * event to notify application that it detected an error and the\n+\t * recovery is being started. Upon receiving the event, the application\n+\t * should not invoke any control path APIs (such as\n+\t * rte_eth_dev_configure/rte_eth_dev_stop...) until receiving\n+\t * RTE_ETH_EVENT_RECOVERY_SUCCESS or RTE_ETH_EVENT_RECOVERY_FAILED\n+\t * event.\n+\t * The PMD will set the data path pointers to dummy functions, and\n+\t * re-set the data patch pointers to non-dummy functions before reports\n+\t * RTE_ETH_EVENT_RECOVERY_SUCCESS event. It means that the application\n+\t * cannot send or receive any packets during this period.\n+\t * @note Before the PMD reports the recovery result, the PMD may report\n+\t * the RTE_ETH_EVENT_ERR_RECOVERING event again, because a larger error\n+\t * may occur during the recovery.\n+\t */\n+\tRTE_ETH_EVENT_ERR_RECOVERING,\n+\t/** Port recovers successful from the error.\n+\t * The PMD already re-configures the port to the state prior to the\n+\t * error.\n+\t */\n+\tRTE_ETH_EVENT_RECOVERY_SUCCESS,\n+\t/** Port recovers failed from the error.\n+\t * It means that the port should not usable anymore. The application\n+\t * should close the port.\n+\t */\n+\tRTE_ETH_EVENT_RECOVERY_FAILED,\n \tRTE_ETH_EVENT_MAX       /**< max value of this enum */\n };\n \n",
    "prefixes": [
        "v9",
        "2/5"
    ]
}