get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 57799,
    "url": "http://patches.dpdk.org/api/patches/57799/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190822055400.30119-7-ajit.khaparde@broadcom.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20190822055400.30119-7-ajit.khaparde@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190822055400.30119-7-ajit.khaparde@broadcom.com",
    "date": "2019-08-22T05:53:53",
    "name": "[06/13] net/bnxt: query firmware error recovery capabilities",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "ff9ee80aa20c94a0de917194d9fe46b3191e48cd",
    "submitter": {
        "id": 501,
        "url": "http://patches.dpdk.org/api/people/501/?format=api",
        "name": "Ajit Khaparde",
        "email": "ajit.khaparde@broadcom.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190822055400.30119-7-ajit.khaparde@broadcom.com/mbox/",
    "series": [
        {
            "id": 6099,
            "url": "http://patches.dpdk.org/api/series/6099/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6099",
            "date": "2019-08-22T05:53:47",
            "name": "bnxt patchset to support device error recovery",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/6099/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/57799/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/57799/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 8BE7A1BF5B;\n\tThu, 22 Aug 2019 07:54:28 +0200 (CEST)",
            "from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com\n\t[192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 8382E1BF2D\n\tfor <dev@dpdk.org>; Thu, 22 Aug 2019 07:54:09 +0200 (CEST)",
            "from nis-sj1-27.broadcom.com (nis-sj1-27.lvn.broadcom.net\n\t[10.75.144.136])\n\tby rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id CD8F730C1FF;\n\tWed, 21 Aug 2019 22:54:04 -0700 (PDT)",
            "from localhost.localdomain (unknown [10.230.30.225])\n\tby nis-sj1-27.broadcom.com (Postfix) with ESMTP id 672D8AC06AD;\n\tWed, 21 Aug 2019 22:54:04 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com CD8F730C1FF",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n\ts=dkimrelay; t=1566453244;\n\tbh=lHnHRogkp2zmKABJ1FQR28o5exoqptOuHPQMxkfy8HA=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ghZGFvmzUCwnAzpXkXAMQT7ERJGfUBsHzAgrnvHqk//YyRtN/Hk2dno0SmNWpKpLW\n\t2O508J+djB9FaNQ7LzRrfabtdhZXGwQVHWuLayMfTNPsAxGcC6tvexGD/QXt7TAjDn\n\t40f0jB3R/1Gz+mXYeIY7JAWOJi5tMii0uCTFRgtc=",
        "From": "Ajit Khaparde <ajit.khaparde@broadcom.com>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com, Kalesh AP <kalesh-anakkur.purayil@broadcom.com>, \n\tSomnath Kotur <somnath.kotur@broadcom.com>",
        "Date": "Wed, 21 Aug 2019 22:53:53 -0700",
        "Message-Id": "<20190822055400.30119-7-ajit.khaparde@broadcom.com>",
        "X-Mailer": "git-send-email 2.20.1 (Apple Git-117)",
        "In-Reply-To": "<20190822055400.30119-1-ajit.khaparde@broadcom.com>",
        "References": "<20190822055400.30119-1-ajit.khaparde@broadcom.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 06/13] net/bnxt: query firmware error recovery\n\tcapabilities",
        "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": "From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>\n\nIn Driver initiated error recovery process, driver has to know about\nthe registers offset and values to initiate FW reset. The HWRM command\nHWRM_ERROR_RECOVERY_QCFG is used to obtain all the registers and values\nrequired to initiate FW reset. This command response includes\nFW heart_beat register, health status register, Error counter register,\nregister offsets and values to do chip reset if firmware crashes and\nbecomes unresponsive.\n\nSigned-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>\nReviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>\nSigned-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/bnxt.h        | 27 +++++++++++\n drivers/net/bnxt/bnxt_ethdev.c | 10 ++++\n drivers/net/bnxt/bnxt_hwrm.c   | 89 ++++++++++++++++++++++++++++++++++\n drivers/net/bnxt/bnxt_hwrm.h   |  1 +\n 4 files changed, 127 insertions(+)",
    "diff": "diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h\nindex 394a2a941..19bd13a7f 100644\n--- a/drivers/net/bnxt/bnxt.h\n+++ b/drivers/net/bnxt/bnxt.h\n@@ -343,6 +343,29 @@ struct bnxt_ctx_mem_info {\n #define US_PER_MS\t\t\t1000\n #define NS_PER_US\t\t\t1000\n \n+struct bnxt_error_recovery_info {\n+\t/* All units in milliseconds */\n+\tuint32_t\tdriver_polling_freq;\n+\tuint32_t\tmaster_func_wait_period;\n+\tuint32_t\tnormal_func_wait_period;\n+\tuint32_t\tmaster_func_wait_period_after_reset;\n+\tuint32_t\tmax_bailout_time_after_reset;\n+#define BNXT_FW_STATUS_REG\t\t0\n+#define BNXT_FW_HEARTBEAT_CNT_REG\t1\n+#define BNXT_FW_RECOVERY_CNT_REG\t2\n+#define BNXT_FW_RESET_INPROG_REG\t3\n+\tuint32_t\tstatus_regs[4];\n+\tuint32_t\treset_inprogress_reg_mask;\n+#define BNXT_NUM_RESET_REG\t16\n+\tuint8_t\t\treg_array_cnt;\n+\tuint32_t\treset_reg[BNXT_NUM_RESET_REG];\n+\tuint32_t\treset_reg_val[BNXT_NUM_RESET_REG];\n+\tuint8_t\t\tdelay_after_reset[BNXT_NUM_RESET_REG];\n+#define BNXT_FLAG_ERROR_RECOVERY_HOST\t(1 << 0)\n+#define BNXT_FLAG_ERROR_RECOVERY_CO_CPU\t(1 << 1)\n+\tuint32_t\tflags;\n+};\n+\n #define BNXT_HWRM_SHORT_REQ_LEN\t\tsizeof(struct hwrm_short_input)\n struct bnxt {\n \tvoid\t\t\t\t*bar0;\n@@ -371,6 +394,7 @@ struct bnxt {\n #define BNXT_FLAG_FW_RESET\t(1 << 15)\n #define BNXT_FLAG_FATAL_ERROR\t(1 << 16)\n #define BNXT_FLAG_FW_CAP_IF_CHANGE\t(1 << 17)\n+#define BNXT_FLAG_FW_CAP_ERROR_RECOVERY\t(1 << 18)\n #define BNXT_FLAG_EXT_STATS_SUPPORTED\t(1 << 29)\n #define BNXT_FLAG_NEW_RM\t(1 << 30)\n #define BNXT_FLAG_INIT_DONE\t(1U << 31)\n@@ -477,6 +501,9 @@ struct bnxt {\n \n \tuint16_t\t\tfw_reset_min_msecs;\n \tuint16_t\t\tfw_reset_max_msecs;\n+\n+\t/* Struct to hold adapter error recovery related info */\n+\tstruct bnxt_error_recovery_info *recovery_info;\n };\n \n int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete);\ndiff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c\nindex a0b9e8f9e..18046c00a 100644\n--- a/drivers/net/bnxt/bnxt_ethdev.c\n+++ b/drivers/net/bnxt/bnxt_ethdev.c\n@@ -4071,6 +4071,11 @@ static int bnxt_init_fw(struct bnxt *bp)\n \tif (rc)\n \t\treturn rc;\n \n+\t/* Get the adapter error recovery support info */\n+\trc = bnxt_hwrm_error_recovery_qcfg(bp);\n+\tif (rc)\n+\t\tbp->flags &= ~BNXT_FLAG_FW_CAP_ERROR_RECOVERY;\n+\n \tif (mtu >= RTE_ETHER_MIN_MTU && mtu <= BNXT_MAX_MTU &&\n \t    mtu != bp->eth_dev->data->mtu)\n \t\tbp->eth_dev->data->mtu = mtu;\n@@ -4228,6 +4233,11 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev)\n \tif (!reconfig_dev)\n \t\tbnxt_free_hwrm_resources(bp);\n \n+\tif (bp->recovery_info != NULL) {\n+\t\trte_free(bp->recovery_info);\n+\t\tbp->recovery_info = NULL;\n+\t}\n+\n \treturn rc;\n }\n \ndiff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c\nindex 17c7b5e9e..e2c993936 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.c\n+++ b/drivers/net/bnxt/bnxt_hwrm.c\n@@ -626,6 +626,13 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)\n \tif (flags & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_STATS_SUPPORTED)\n \t\tbp->flags |= BNXT_FLAG_EXT_STATS_SUPPORTED;\n \n+\tif (flags & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERROR_RECOVERY_CAPABLE) {\n+\t\tbp->flags |= BNXT_FLAG_FW_CAP_ERROR_RECOVERY;\n+\t\tPMD_DRV_LOG(DEBUG, \"Adapter Error recovery SUPPORTED\\n\");\n+\t} else {\n+\t\tbp->flags &= ~BNXT_FLAG_FW_CAP_ERROR_RECOVERY;\n+\t}\n+\n \tHWRM_UNLOCK();\n \n \treturn rc;\n@@ -4684,3 +4691,85 @@ int bnxt_hwrm_if_change(struct bnxt *bp, bool state)\n \n \treturn rc;\n }\n+\n+int bnxt_hwrm_error_recovery_qcfg(struct bnxt *bp)\n+{\n+\tstruct hwrm_error_recovery_qcfg_output *resp = bp->hwrm_cmd_resp_addr;\n+\tstruct bnxt_error_recovery_info *info;\n+\tstruct hwrm_error_recovery_qcfg_input req = {0};\n+\tuint32_t flags = 0;\n+\tunsigned int i;\n+\tint rc;\n+\n+\t/* Older FW does not have error recovery support */\n+\tif (!(bp->flags & BNXT_FLAG_FW_CAP_ERROR_RECOVERY))\n+\t\treturn 0;\n+\n+\tinfo = rte_zmalloc(\"bnxt_hwrm_error_recovery_qcfg\",\n+\t\t\t   sizeof(*info), 0);\n+\tbp->recovery_info = info;\n+\tif (info == NULL)\n+\t\treturn -ENOMEM;\n+\n+\tHWRM_PREP(req, ERROR_RECOVERY_QCFG, BNXT_USE_CHIMP_MB);\n+\n+\trc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);\n+\n+\tHWRM_CHECK_RESULT();\n+\n+\tflags = rte_le_to_cpu_32(resp->flags);\n+\tif (flags & HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_HOST)\n+\t\tinfo->flags |= BNXT_FLAG_ERROR_RECOVERY_HOST;\n+\telse if (flags & HWRM_ERROR_RECOVERY_QCFG_OUTPUT_FLAGS_CO_CPU)\n+\t\tinfo->flags |= BNXT_FLAG_ERROR_RECOVERY_CO_CPU;\n+\n+\tif ((info->flags & BNXT_FLAG_ERROR_RECOVERY_CO_CPU) &&\n+\t    !(bp->flags & BNXT_FLAG_KONG_MB_EN)) {\n+\t\trc = -EINVAL;\n+\t\tgoto err;\n+\t}\n+\n+\t/* FW returned values are in units of 100msec */\n+\tinfo->driver_polling_freq =\n+\t\trte_le_to_cpu_32(resp->driver_polling_freq) * 100;\n+\tinfo->master_func_wait_period =\n+\t\trte_le_to_cpu_32(resp->master_func_wait_period) * 100;\n+\tinfo->normal_func_wait_period =\n+\t\trte_le_to_cpu_32(resp->normal_func_wait_period) * 100;\n+\tinfo->master_func_wait_period_after_reset =\n+\t\trte_le_to_cpu_32(resp->master_func_wait_period_after_reset) * 100;\n+\tinfo->max_bailout_time_after_reset =\n+\t\trte_le_to_cpu_32(resp->max_bailout_time_after_reset) * 100;\n+\tinfo->status_regs[BNXT_FW_STATUS_REG] =\n+\t\trte_le_to_cpu_32(resp->fw_health_status_reg);\n+\tinfo->status_regs[BNXT_FW_HEARTBEAT_CNT_REG] =\n+\t\trte_le_to_cpu_32(resp->fw_heartbeat_reg);\n+\tinfo->status_regs[BNXT_FW_RECOVERY_CNT_REG] =\n+\t\trte_le_to_cpu_32(resp->fw_reset_cnt_reg);\n+\tinfo->status_regs[BNXT_FW_RESET_INPROG_REG] =\n+\t\trte_le_to_cpu_32(resp->reset_inprogress_reg);\n+\tinfo->reg_array_cnt =\n+\t\trte_le_to_cpu_32(resp->reg_array_cnt);\n+\n+\tif (info->reg_array_cnt >= BNXT_NUM_RESET_REG) {\n+\t\trc = -EINVAL;\n+\t\tgoto err;\n+\t}\n+\n+\tfor (i = 0; i < info->reg_array_cnt; i++) {\n+\t\tinfo->reset_reg[i] =\n+\t\t\trte_le_to_cpu_32(resp->reset_reg[i]);\n+\t\tinfo->reset_reg_val[i] =\n+\t\t\trte_le_to_cpu_32(resp->reset_reg_val[i]);\n+\t\tinfo->delay_after_reset[i] =\n+\t\t\tresp->delay_after_reset[i];\n+\t}\n+err:\n+\tHWRM_UNLOCK();\n+\n+\tif (rc) {\n+\t\trte_free(bp->recovery_info);\n+\t\tbp->recovery_info = NULL;\n+\t}\n+\treturn rc;\n+}\ndiff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h\nindex 2f57e950b..c332c129d 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.h\n+++ b/drivers/net/bnxt/bnxt_hwrm.h\n@@ -202,4 +202,5 @@ int bnxt_hwrm_tunnel_redirect_info(struct bnxt *bp, uint8_t tun_type,\n \t\t\t\t   uint16_t *dst_fid);\n int bnxt_hwrm_set_mac(struct bnxt *bp);\n int bnxt_hwrm_if_change(struct bnxt *bp, bool state);\n+int bnxt_hwrm_error_recovery_qcfg(struct bnxt *bp);\n #endif\n",
    "prefixes": [
        "06/13"
    ]
}