get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 57794,
    "url": "https://patches.dpdk.org/api/patches/57794/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190822055400.30119-4-ajit.khaparde@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": "<20190822055400.30119-4-ajit.khaparde@broadcom.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190822055400.30119-4-ajit.khaparde@broadcom.com",
    "date": "2019-08-22T05:53:50",
    "name": "[03/13] net/bnxt: handle reset notify async event from FW",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "6ed3dfefa5a5b4d7ebda1847657d9d12b2750dc3",
    "submitter": {
        "id": 501,
        "url": "https://patches.dpdk.org/api/people/501/?format=api",
        "name": "Ajit Khaparde",
        "email": "ajit.khaparde@broadcom.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/20190822055400.30119-4-ajit.khaparde@broadcom.com/mbox/",
    "series": [
        {
            "id": 6099,
            "url": "https://patches.dpdk.org/api/series/6099/?format=api",
            "web_url": "https://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": "https://patches.dpdk.org/series/6099/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/57794/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/57794/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 0E0661BF3B;\n\tThu, 22 Aug 2019 07:54:19 +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 64FA31BF27\n\tfor <dev@dpdk.org>; Thu, 22 Aug 2019 07:54:08 +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 33B0F30C24E;\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 BF91AAC06AD;\n\tWed, 21 Aug 2019 22:54:03 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 33B0F30C24E",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n\ts=dkimrelay; t=1566453244;\n\tbh=PQCoqNCizt8lfTjiwktpZSd4xvNowgtiIIs+9YfLLdI=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=rKypvrkkSsDIH9GnzALMk+0SMrknEq0fTw7x3F3vI7j+rviYnqV6Xn3hhoVezj01w\n\tS7O51ziQIGP+M2SoRHL8zKADKyNhhbRyNbOLXQVLpiEWJULarop9ms2RYn7v6+aJml\n\tLKLXIy8E0E4aUGuYDIy2qWz4otj48zKzdXxInvTc=",
        "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:50 -0700",
        "Message-Id": "<20190822055400.30119-4-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 03/13] net/bnxt: handle reset notify async event\n\tfrom FW",
        "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\nWhen the FW upgrade is initiated the current instance\nof FW issues a HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY\nasync notification to the driver. On receiving this notification,\nthe PMD shall quiesce itself and poll on the HWRM_VER_GET FW\ncommand at regular intervals.\n\nOnce the VER_GET command succeeds, the driver should go through\nthe rediscovery process and re-initialize the device.\n\nAlso register with FW for the reset notify async event.\n\nSigned-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>\nReviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\nReviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>\n---\n drivers/net/bnxt/bnxt.h        |  15 +++++\n drivers/net/bnxt/bnxt_cpr.c    |  14 +++++\n drivers/net/bnxt/bnxt_cpr.h    |   1 +\n drivers/net/bnxt/bnxt_ethdev.c | 110 ++++++++++++++++++++++++++++-----\n drivers/net/bnxt/bnxt_hwrm.c   |  39 +++++++++---\n drivers/net/bnxt/bnxt_hwrm.h   |   2 +\n 6 files changed, 158 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h\nindex 49418cac9..8797b032e 100644\n--- a/drivers/net/bnxt/bnxt.h\n+++ b/drivers/net/bnxt/bnxt.h\n@@ -333,6 +333,16 @@ struct bnxt_ctx_mem_info {\n \tstruct bnxt_ctx_pg_info *tqm_mem[BNXT_MAX_TC_Q];\n };\n \n+/* Maximum Firmware Reset bail out value in milliseconds */\n+#define BNXT_MAX_FW_RESET_TIMEOUT\t6000\n+/* Minimum time required for the firmware readiness in milliseconds */\n+#define BNXT_MIN_FW_READY_TIMEOUT\t2000\n+/* Frequency for the firmware readiness check in milliseconds */\n+#define BNXT_FW_READY_WAIT_INTERVAL\t100\n+\n+#define US_PER_MS\t\t\t1000\n+#define NS_PER_US\t\t\t1000\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@@ -358,6 +368,8 @@ struct bnxt {\n #define BNXT_FLAG_DFLT_VNIC_SET\t(1 << 12)\n #define BNXT_FLAG_THOR_CHIP\t(1 << 13)\n #define BNXT_FLAG_STINGRAY\t(1 << 14)\n+#define BNXT_FLAG_FW_RESET\t(1 << 15)\n+#define BNXT_FLAG_FATAL_ERROR\t(1 << 16)\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@@ -461,6 +473,9 @@ struct bnxt {\n \tstruct bnxt_ptp_cfg     *ptp_cfg;\n \tuint16_t\t\tvf_resv_strategy;\n \tstruct bnxt_ctx_mem_info        *ctx;\n+\n+\tuint16_t\t\tfw_reset_min_msecs;\n+\tuint16_t\t\tfw_reset_max_msecs;\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_cpr.c b/drivers/net/bnxt/bnxt_cpr.c\nindex 655bcf1a8..cefb5db2a 100644\n--- a/drivers/net/bnxt/bnxt_cpr.c\n+++ b/drivers/net/bnxt/bnxt_cpr.c\n@@ -40,6 +40,20 @@ void bnxt_handle_async_event(struct bnxt *bp,\n \tcase HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED:\n \t\tPMD_DRV_LOG(INFO, \"Port conn async event\\n\");\n \t\tbreak;\n+\tcase HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY:\n+\t\t/* timestamp_lo/hi values are in units of 100ms */\n+\t\tbp->fw_reset_max_msecs = async_cmp->timestamp_hi ?\n+\t\t\trte_le_to_cpu_16(async_cmp->timestamp_hi) * 100 :\n+\t\t\tBNXT_MAX_FW_RESET_TIMEOUT;\n+\t\tbp->fw_reset_min_msecs = async_cmp->timestamp_lo ?\n+\t\t\tasync_cmp->timestamp_lo * 100 :\n+\t\t\tBNXT_MIN_FW_READY_TIMEOUT;\n+\t\tPMD_DRV_LOG(INFO,\n+\t\t\t    \"Firmware non-fatal reset event received\\n\");\n+\n+\t\tbp->flags |= BNXT_FLAG_FW_RESET;\n+\t\tbnxt_dev_reset_and_resume(bp);\n+\t\tbreak;\n \tdefault:\n \t\tPMD_DRV_LOG(INFO, \"handle_async_event id = 0x%x\\n\", event_id);\n \t\tbreak;\ndiff --git a/drivers/net/bnxt/bnxt_cpr.h b/drivers/net/bnxt/bnxt_cpr.h\nindex 8c6a34b61..4f86e3f60 100644\n--- a/drivers/net/bnxt/bnxt_cpr.h\n+++ b/drivers/net/bnxt/bnxt_cpr.h\n@@ -106,5 +106,6 @@ struct bnxt;\n void bnxt_handle_async_event(struct bnxt *bp, struct cmpl_base *cmp);\n void bnxt_handle_fwd_req(struct bnxt *bp, struct cmpl_base *cmp);\n int bnxt_event_hwrm_resp_handler(struct bnxt *bp, struct cmpl_base *cmp);\n+int bnxt_dev_reset_and_resume(struct bnxt *bp);\n \n #endif\ndiff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c\nindex 33ff4a5a7..1aef227f2 100644\n--- a/drivers/net/bnxt/bnxt_ethdev.c\n+++ b/drivers/net/bnxt/bnxt_ethdev.c\n@@ -11,6 +11,7 @@\n #include <rte_ethdev_pci.h>\n #include <rte_malloc.h>\n #include <rte_cycles.h>\n+#include <rte_alarm.h>\n \n #include \"bnxt.h\"\n #include \"bnxt_cpr.h\"\n@@ -166,6 +167,8 @@ static int bnxt_vlan_offload_set_op(struct rte_eth_dev *dev, int mask);\n static void bnxt_print_link_info(struct rte_eth_dev *eth_dev);\n static int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu);\n static int bnxt_dev_uninit(struct rte_eth_dev *eth_dev);\n+static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev);\n+static int bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev);\n \n int is_bnxt_in_error(struct bnxt *bp)\n {\n@@ -201,19 +204,25 @@ static uint16_t  bnxt_rss_hash_tbl_size(const struct bnxt *bp)\n \treturn bnxt_rss_ctxts(bp) * BNXT_RSS_ENTRIES_PER_CTX_THOR;\n }\n \n-static void bnxt_free_mem(struct bnxt *bp)\n+static void bnxt_free_mem(struct bnxt *bp, bool reconfig)\n {\n \tbnxt_free_filter_mem(bp);\n \tbnxt_free_vnic_attributes(bp);\n \tbnxt_free_vnic_mem(bp);\n \n-\tbnxt_free_stats(bp);\n-\tbnxt_free_tx_rings(bp);\n-\tbnxt_free_rx_rings(bp);\n+\t/* tx/rx rings are configured as part of *_queue_setup callbacks.\n+\t * If the number of rings change across fw update,\n+\t * we don't have much choice except to warn the user.\n+\t */\n+\tif (!reconfig) {\n+\t\tbnxt_free_stats(bp);\n+\t\tbnxt_free_tx_rings(bp);\n+\t\tbnxt_free_rx_rings(bp);\n+\t}\n \tbnxt_free_async_cp_ring(bp);\n }\n \n-static int bnxt_alloc_mem(struct bnxt *bp)\n+static int bnxt_alloc_mem(struct bnxt *bp, bool reconfig)\n {\n \tint rc;\n \n@@ -244,7 +253,7 @@ static int bnxt_alloc_mem(struct bnxt *bp)\n \treturn 0;\n \n alloc_mem_err:\n-\tbnxt_free_mem(bp);\n+\tbnxt_free_mem(bp, reconfig);\n \treturn rc;\n }\n \n@@ -3483,6 +3492,72 @@ static const struct eth_dev_ops bnxt_dev_ops = {\n \t.timesync_read_tx_timestamp = bnxt_timesync_read_tx_timestamp,\n };\n \n+static void bnxt_dev_cleanup(struct bnxt *bp)\n+{\n+\tbnxt_set_hwrm_link_config(bp, false);\n+\tbp->link_info.link_up = 0;\n+\tif (bp->dev_stopped == 0)\n+\t\tbnxt_dev_stop_op(bp->eth_dev);\n+\n+\tbnxt_uninit_resources(bp, true);\n+}\n+\n+static void bnxt_dev_recover(void *arg)\n+{\n+\tstruct bnxt *bp = arg;\n+\tint timeout = bp->fw_reset_max_msecs;\n+\tint rc = 0;\n+\n+\tdo {\n+\t\trc = bnxt_hwrm_ver_get(bp);\n+\t\tif (rc == 0)\n+\t\t\tbreak;\n+\t\trte_delay_ms(BNXT_FW_READY_WAIT_INTERVAL);\n+\t\ttimeout -= BNXT_FW_READY_WAIT_INTERVAL;\n+\t} while (rc && timeout);\n+\n+\tif (rc) {\n+\t\tPMD_DRV_LOG(ERR, \"FW is not Ready after reset\\n\");\n+\t\tgoto err;\n+\t}\n+\n+\trc = bnxt_init_resources(bp, true);\n+\tif (rc) {\n+\t\tPMD_DRV_LOG(ERR,\n+\t\t\t    \"Failed to initialize resources after reset\\n\");\n+\t\tgoto err;\n+\t}\n+\t/* clear reset flag as the device is initialized now */\n+\tbp->flags &= ~BNXT_FLAG_FW_RESET;\n+\n+\trc = bnxt_dev_start_op(bp->eth_dev);\n+\tif (rc) {\n+\t\tPMD_DRV_LOG(ERR, \"Failed to start port after reset\\n\");\n+\t\tgoto err;\n+\t}\n+\n+\tPMD_DRV_LOG(INFO, \"Recovered from FW reset\\n\");\n+\treturn;\n+err:\n+\tbp->flags |= BNXT_FLAG_FATAL_ERROR;\n+\tbnxt_uninit_resources(bp, false);\n+\tPMD_DRV_LOG(ERR, \"Failed to recover from FW reset\\n\");\n+}\n+\n+int bnxt_dev_reset_and_resume(struct bnxt *bp)\n+{\n+\tint rc;\n+\n+\tbnxt_dev_cleanup(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+\tif (rc)\n+\t\tPMD_DRV_LOG(ERR, \"Error setting recovery alarm\");\n+\n+\treturn rc;\n+}\n+\n static bool bnxt_vf_pciid(uint16_t id)\n {\n \tif (id == BROADCOM_DEV_ID_57304_VF ||\n@@ -3998,7 +4073,7 @@ static int bnxt_init_fw(struct bnxt *bp)\n \treturn 0;\n }\n \n-static int bnxt_init_resources(struct bnxt *bp)\n+static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev)\n {\n \tint rc;\n \n@@ -4006,9 +4081,11 @@ static int bnxt_init_resources(struct bnxt *bp)\n \tif (rc)\n \t\treturn rc;\n \n-\trc = bnxt_setup_mac_addr(bp->eth_dev);\n-\tif (rc)\n-\t\treturn rc;\n+\tif (!reconfig_dev) {\n+\t\trc = bnxt_setup_mac_addr(bp->eth_dev);\n+\t\tif (rc)\n+\t\t\treturn rc;\n+\t}\n \n \tbnxt_config_vf_req_fwd(bp);\n \n@@ -4035,7 +4112,7 @@ static int bnxt_init_resources(struct bnxt *bp)\n \t\t}\n \t}\n \n-\trc = bnxt_alloc_mem(bp);\n+\trc = bnxt_alloc_mem(bp, reconfig_dev);\n \tif (rc)\n \t\treturn rc;\n \n@@ -4109,7 +4186,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)\n \t\t\t    \"Failed to allocate hwrm resource rc: %x\\n\", rc);\n \t\tgoto error_free;\n \t}\n-\trc = bnxt_init_resources(bp);\n+\trc = bnxt_init_resources(bp, false);\n \tif (rc)\n \t\tgoto error_free;\n \n@@ -4130,18 +4207,19 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)\n }\n \n static int\n-bnxt_uninit_resources(struct bnxt *bp)\n+bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev)\n {\n \tint rc;\n \n \tbnxt_disable_int(bp);\n \tbnxt_free_int(bp);\n-\tbnxt_free_mem(bp);\n+\tbnxt_free_mem(bp, reconfig_dev);\n \tbnxt_hwrm_func_buf_unrgtr(bp);\n \trc = bnxt_hwrm_func_driver_unregister(bp, 0);\n \tbp->flags &= ~BNXT_FLAG_REGISTERED;\n \tbnxt_free_ctx_mem(bp);\n-\tbnxt_free_hwrm_resources(bp);\n+\tif (!reconfig_dev)\n+\t\tbnxt_free_hwrm_resources(bp);\n \n \treturn rc;\n }\n@@ -4157,7 +4235,7 @@ bnxt_dev_uninit(struct rte_eth_dev *eth_dev)\n \n \tPMD_DRV_LOG(DEBUG, \"Calling Device uninit\\n\");\n \n-\trc = bnxt_uninit_resources(bp);\n+\trc = bnxt_uninit_resources(bp, false);\n \n \tif (bp->grp_info != NULL) {\n \t\trte_free(bp->grp_info);\ndiff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c\nindex 24a5a0914..b27dbe87e 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.c\n+++ b/drivers/net/bnxt/bnxt_hwrm.c\n@@ -26,7 +26,7 @@\n \n #include <rte_io.h>\n \n-#define HWRM_CMD_TIMEOUT\t\t6000000\n+#define HWRM_SHORT_CMD_TIMEOUT\t\t50000\n #define HWRM_SPEC_CODE_1_8_3\t\t0x10803\n #define HWRM_VERSION_1_9_1\t\t0x10901\n #define HWRM_VERSION_1_9_2\t\t0x10903\n@@ -97,6 +97,14 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,\n \t\tGRCPF_REG_KONG_CHANNEL_OFFSET : GRCPF_REG_CHIMP_CHANNEL_OFFSET;\n \tuint16_t mb_trigger_offset = use_kong_mb ?\n \t\tGRCPF_REG_KONG_COMM_TRIGGER : GRCPF_REG_CHIMP_COMM_TRIGGER;\n+\tuint32_t timeout;\n+\n+\t/* Do not send HWRM commands to firmware in error state */\n+\tif (bp->flags & BNXT_FLAG_FATAL_ERROR)\n+\t\treturn 0;\n+\n+\t/* For VER_GET command, set timeout as 50ms */\n+\ttimeout = HWRM_SHORT_CMD_TIMEOUT;\n \n \tif (bp->flags & BNXT_FLAG_SHORT_CMD ||\n \t    msg_len > bp->max_req_len) {\n@@ -139,7 +147,7 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,\n \trte_write32(1, bar);\n \n \t/* Poll for the valid bit */\n-\tfor (i = 0; i < HWRM_CMD_TIMEOUT; i++) {\n+\tfor (i = 0; i < timeout; i++) {\n \t\t/* Sanity check on the resp->resp_len */\n \t\trte_rmb();\n \t\tif (resp->resp_len && resp->resp_len <= bp->max_resp_len) {\n@@ -151,7 +159,12 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,\n \t\trte_delay_us(1);\n \t}\n \n-\tif (i >= HWRM_CMD_TIMEOUT) {\n+\tif (i >= timeout) {\n+\t\t/* Suppress VER_GET timeout messages during reset recovery */\n+\t\tif (bp->flags & BNXT_FLAG_FW_RESET &&\n+\t\t    rte_cpu_to_le_16(req->req_type) == HWRM_VER_GET)\n+\t\t\treturn -ETIMEDOUT;\n+\n \t\tPMD_DRV_LOG(ERR, \"Error(timeout) sending msg 0x%04x\\n\",\n \t\t\t    req->req_type);\n \t\treturn -ETIMEDOUT;\n@@ -657,12 +670,15 @@ int bnxt_hwrm_func_reset(struct bnxt *bp)\n int bnxt_hwrm_func_driver_register(struct bnxt *bp)\n {\n \tint rc;\n+\tuint32_t flags = 0;\n \tstruct hwrm_func_drv_rgtr_input req = {.req_type = 0 };\n \tstruct hwrm_func_drv_rgtr_output *resp = bp->hwrm_cmd_resp_addr;\n \n \tif (bp->flags & BNXT_FLAG_REGISTERED)\n \t\treturn 0;\n \n+\tflags = HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_HOT_RESET_SUPPORT;\n+\n \tHWRM_PREP(req, FUNC_DRV_RGTR, BNXT_USE_CHIMP_MB);\n \treq.enables = rte_cpu_to_le_32(HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER |\n \t\t\tHWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD);\n@@ -683,14 +699,16 @@ int bnxt_hwrm_func_driver_register(struct bnxt *bp)\n \t\t * this HWRM sniffer list in FW because DPDK PF driver does\n \t\t * not support this.\n \t\t */\n-\t\treq.flags =\n-\t\trte_cpu_to_le_32(HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE);\n+\t\tflags |= HWRM_FUNC_DRV_RGTR_INPUT_FLAGS_FWD_NONE_MODE;\n \t}\n \n+\treq.flags = rte_cpu_to_le_32(flags);\n+\n \treq.async_event_fwd[0] |=\n \t\trte_cpu_to_le_32(ASYNC_CMPL_EVENT_ID_LINK_STATUS_CHANGE |\n \t\t\t\t ASYNC_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED |\n-\t\t\t\t ASYNC_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE);\n+\t\t\t\t ASYNC_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE |\n+\t\t\t\t ASYNC_CMPL_EVENT_ID_RESET_NOTIFY);\n \treq.async_event_fwd[1] |=\n \t\trte_cpu_to_le_32(ASYNC_CMPL_EVENT_ID_PF_DRVR_UNLOAD |\n \t\t\t\t ASYNC_CMPL_EVENT_ID_VF_CFG_CHANGE);\n@@ -837,7 +855,10 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)\n \n \trc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);\n \n-\tHWRM_CHECK_RESULT();\n+\tif (bp->flags & BNXT_FLAG_FW_RESET)\n+\t\tHWRM_CHECK_RESULT_SILENT();\n+\telse\n+\t\tHWRM_CHECK_RESULT();\n \n \tPMD_DRV_LOG(INFO, \"%d.%d.%d:%d.%d.%d\\n\",\n \t\tresp->hwrm_intf_maj_8b, resp->hwrm_intf_min_8b,\n@@ -2685,6 +2706,10 @@ int bnxt_hwrm_func_qcfg(struct bnxt *bp, uint16_t *mtu)\n \tif (BNXT_VF(bp) && (flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF)) {\n \t\tbp->flags |= BNXT_FLAG_TRUSTED_VF_EN;\n \t\tPMD_DRV_LOG(INFO, \"Trusted VF cap enabled\\n\");\n+\t} else if (BNXT_VF(bp) &&\n+\t\t   !(flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF)) {\n+\t\tbp->flags &= ~BNXT_FLAG_TRUSTED_VF_EN;\n+\t\tPMD_DRV_LOG(INFO, \"Trusted VF cap disabled\\n\");\n \t}\n \n \tif (mtu)\ndiff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h\nindex c882fc2a1..a03620532 100644\n--- a/drivers/net/bnxt/bnxt_hwrm.h\n+++ b/drivers/net/bnxt/bnxt_hwrm.h\n@@ -21,6 +21,8 @@ struct bnxt_cp_ring_info;\n \t(1 << HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED)\n #define ASYNC_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE\t\\\n \t(1 << HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE)\n+#define ASYNC_CMPL_EVENT_ID_RESET_NOTIFY \\\n+\t(1 << HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY)\n #define ASYNC_CMPL_EVENT_ID_PF_DRVR_UNLOAD\t\\\n \t(1 << (HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD - 32))\n #define ASYNC_CMPL_EVENT_ID_VF_CFG_CHANGE\t\\\n",
    "prefixes": [
        "03/13"
    ]
}