get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 88171,
    "url": "https://patches.dpdk.org/api/patches/88171/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210224155553.26893-10-kalesh-anakkur.purayil@broadcom.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": "<20210224155553.26893-10-kalesh-anakkur.purayil@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210224155553.26893-10-kalesh-anakkur.purayil@broadcom.com",
    "date": "2021-02-24T15:55:51",
    "name": "[09/11] net/bnxt: fix firmware fatal error handling",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ba560b2cad19fb7c8ed8cc974626785484e3ac17",
    "submitter": {
        "id": 1479,
        "url": "https://patches.dpdk.org/api/people/1479/?format=api",
        "name": "Kalesh A P",
        "email": "kalesh-anakkur.purayil@broadcom.com"
    },
    "delegate": {
        "id": 1766,
        "url": "https://patches.dpdk.org/api/users/1766/?format=api",
        "username": "ajitkhaparde",
        "first_name": "Ajit",
        "last_name": "Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210224155553.26893-10-kalesh-anakkur.purayil@broadcom.com/mbox/",
    "series": [
        {
            "id": 15364,
            "url": "https://patches.dpdk.org/api/series/15364/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=15364",
            "date": "2021-02-24T15:55:42",
            "name": "bnxt fixes",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/15364/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/88171/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/88171/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 D45D5A054F;\n\tWed, 24 Feb 2021 16:35:00 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 32B56160883;\n\tWed, 24 Feb 2021 16:33:47 +0100 (CET)",
            "from relay.smtp-ext.broadcom.com (saphodev.broadcom.com\n [192.19.232.172])\n by mails.dpdk.org (Postfix) with ESMTP id 0006716087A\n for <dev@dpdk.org>; Wed, 24 Feb 2021 16:33:45 +0100 (CET)",
            "from dhcp-10-123-153-22.dhcp.broadcom.net\n (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22])\n by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 7AB6580F9;\n Wed, 24 Feb 2021 07:33:44 -0800 (PST)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 7AB6580F9",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n s=dkimrelay; t=1614180825;\n bh=vJTZXrg4SrYbCvKo42zcIQvR6eDy4YcvF8TStqs5+WI=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=cLHGM2IPHiEvJlCvKTpGAixjmfxNB0UiaVFU/cjNWD7iQlkFm6Xvego/cCcS6gG7L\n nqiHhkRvPz9krA9A9V/aVyW8zVzLKs588IhkC201HSZI9wveNqoLpdXCM4vZ/odxEa\n p6No01PH0tv5cL3geZ74mIxtZUy1cTsZhFuG4Du4=",
        "From": "Kalesh A P <kalesh-anakkur.purayil@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com,\n\tajit.khaparde@broadcom.com",
        "Date": "Wed, 24 Feb 2021 21:25:51 +0530",
        "Message-Id": "<20210224155553.26893-10-kalesh-anakkur.purayil@broadcom.com>",
        "X-Mailer": "git-send-email 2.10.1",
        "In-Reply-To": "<20210224155553.26893-1-kalesh-anakkur.purayil@broadcom.com>",
        "References": "<20210224155553.26893-1-kalesh-anakkur.purayil@broadcom.com>",
        "Subject": "[dpdk-dev] [PATCH 09/11] net/bnxt: fix firmware fatal error handling",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>\n\nDuring some fatal firmware error conditions, the PCI config space\nregister 0x2e which normally contains the subsystem ID will become\n0xffff. This register will revert back to the normal value after\nthe chip has completed core reset. If we detect this condition,\nwe can poll this config register immediately for the value to revert.\nBecause we use config read cycles to poll this register, there is no\npossibility of Master Abort if we happen to read it during core reset.\nThis speeds up recovery significantly as we don't have to wait for the\nconservative min_time before polling to see if the firmware has come\nout of reset. As soon as this register changes value we can proceed\nto re-initialize the device.\n\nFixes: df6cd7c1f73a (\"net/bnxt: handle reset notify async event from FW\")\nCc: stable@dpdk.org\n\nSigned-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>\nReviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>\nReviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/bnxt_ethdev.c | 56 ++++++++++++++++++++++++++++++++++++++++--\n drivers/net/bnxt/bnxt_util.h   |  2 ++\n 2 files changed, 56 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c\nindex 17bda86..986e40a 100644\n--- a/drivers/net/bnxt/bnxt_ethdev.c\n+++ b/drivers/net/bnxt/bnxt_ethdev.c\n@@ -3715,6 +3715,32 @@ static void bnxt_dev_cleanup(struct bnxt *bp)\n \tbnxt_uninit_resources(bp, true);\n }\n \n+static int\n+bnxt_check_fw_reset_done(struct bnxt *bp)\n+{\n+\tint timeout = bp->fw_reset_max_msecs;\n+\tuint16_t val = 0;\n+\tint rc;\n+\n+\tdo {\n+\t\trc = rte_pci_read_config(bp->pdev, &val, sizeof(val), PCI_SUBSYSTEM_ID_OFFSET);\n+\t\tif (rc < 0) {\n+\t\t\tPMD_DRV_LOG(ERR, \"Failed to read PCI offset 0x%x\", PCI_SUBSYSTEM_ID_OFFSET);\n+\t\t\treturn rc;\n+\t\t}\n+\t\tif (val != 0xffff)\n+\t\t\tbreak;\n+\t\trte_delay_ms(1);\n+\t} while (timeout--);\n+\n+\tif (val == 0xffff) {\n+\t\tPMD_DRV_LOG(ERR, \"Firmware reset aborted, PCI config space invalid\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int bnxt_restore_vlan_filters(struct bnxt *bp)\n {\n \tstruct rte_eth_dev *dev = bp->eth_dev;\n@@ -3812,6 +3838,13 @@ static void bnxt_dev_recover(void *arg)\n \tint rc = 0;\n \n \tpthread_mutex_lock(&bp->err_recovery_lock);\n+\n+\tif (!bp->fw_reset_min_msecs) {\n+\t\trc = bnxt_check_fw_reset_done(bp);\n+\t\tif (rc)\n+\t\t\tgoto err;\n+\t}\n+\n \t/* Clear Error flag so that device re-init should happen */\n \tbp->flags &= ~BNXT_FLAG_FATAL_ERROR;\n \n@@ -3863,14 +3896,33 @@ static void bnxt_dev_recover(void *arg)\n void bnxt_dev_reset_and_resume(void *arg)\n {\n \tstruct bnxt *bp = arg;\n+\tuint32_t us = US_PER_MS * bp->fw_reset_min_msecs;\n+\tuint16_t val = 0;\n \tint rc;\n \n \tbnxt_dev_cleanup(bp);\n \n \tbnxt_wait_for_device_shutdown(bp);\n \n-\trc = rte_eal_alarm_set(US_PER_MS * bp->fw_reset_min_msecs,\n-\t\t\t       bnxt_dev_recover, (void *)bp);\n+\t/* During some fatal firmware error conditions, the PCI config space\n+\t * register 0x2e which normally contains the subsystem ID will become\n+\t * 0xffff. This register will revert back to the normal value after\n+\t * the chip has completed core reset. If we detect this condition,\n+\t * we can poll this config register immediately for the value to revert.\n+\t */\n+\tif (bp->flags & BNXT_FLAG_FATAL_ERROR) {\n+\t\trc = rte_pci_read_config(bp->pdev, &val, sizeof(val), PCI_SUBSYSTEM_ID_OFFSET);\n+\t\tif (rc < 0) {\n+\t\t\tPMD_DRV_LOG(ERR, \"Failed to read PCI offset 0x%x\", PCI_SUBSYSTEM_ID_OFFSET);\n+\t\t\treturn;\n+\t\t}\n+\t\tif (val == 0xffff) {\n+\t\t\tbp->fw_reset_min_msecs = 0;\n+\t\t\tus = 1;\n+\t\t}\n+\t}\n+\n+\trc = rte_eal_alarm_set(us, bnxt_dev_recover, (void *)bp);\n \tif (rc)\n \t\tPMD_DRV_LOG(ERR, \"Error setting recovery alarm\");\n }\ndiff --git a/drivers/net/bnxt/bnxt_util.h b/drivers/net/bnxt/bnxt_util.h\nindex 8de55e1..64e97ee 100644\n--- a/drivers/net/bnxt/bnxt_util.h\n+++ b/drivers/net/bnxt/bnxt_util.h\n@@ -10,6 +10,8 @@\n #define BIT(n)\t(1UL << (n))\n #endif /* BIT */\n \n+#define PCI_SUBSYSTEM_ID_OFFSET\t0x2e\n+\n int bnxt_check_zero_bytes(const uint8_t *bytes, int len);\n void bnxt_eth_hw_addr_random(uint8_t *mac_addr);\n \n",
    "prefixes": [
        "09/11"
    ]
}