net/bnxt: fix function driver register/unregister
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Wed, 22 Sep 2021 08:30:44 +0000 (14:00 +0530)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Sun, 26 Sep 2021 21:14:21 +0000 (23:14 +0200)
1. Fix to use correct fields in the request structure of
   HWRM_FUNC_DRV_RGTR.
2. Remove the "flags" argument to bnxt_hwrm_func_driver_unregister()
   as it is not needed.

Fixes: beb3087f5056 ("net/bnxt: add driver register/unregister")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_hwrm.c
drivers/net/bnxt/bnxt_hwrm.h

index 097dd10..dc7dee1 100644 (file)
@@ -6156,7 +6156,7 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev)
                bp->pf->vf_req_buf = NULL;
        }
 
-       rc = bnxt_hwrm_func_driver_unregister(bp, 0);
+       rc = bnxt_hwrm_func_driver_unregister(bp);
        bp->flags &= ~BNXT_FLAG_REGISTERED;
        bnxt_free_ctx_mem(bp);
        if (!reconfig_dev) {
index 585cded..d4d8581 100644 (file)
@@ -1059,9 +1059,9 @@ int bnxt_hwrm_func_driver_register(struct bnxt *bp)
        HWRM_PREP(&req, HWRM_FUNC_DRV_RGTR, BNXT_USE_CHIMP_MB);
        req.enables = rte_cpu_to_le_32(HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_VER |
                        HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD);
-       req.ver_maj = RTE_VER_YEAR;
-       req.ver_min = RTE_VER_MONTH;
-       req.ver_upd = RTE_VER_MINOR;
+       req.ver_maj_8b = RTE_VER_YEAR;
+       req.ver_min_8b = RTE_VER_MONTH;
+       req.ver_upd_8b = RTE_VER_MINOR;
 
        if (BNXT_PF(bp)) {
                req.enables |= rte_cpu_to_le_32(
@@ -1370,7 +1370,7 @@ error:
        return rc;
 }
 
-int bnxt_hwrm_func_driver_unregister(struct bnxt *bp, uint32_t flags)
+int bnxt_hwrm_func_driver_unregister(struct bnxt *bp)
 {
        int rc;
        struct hwrm_func_drv_unrgtr_input req = {.req_type = 0 };
@@ -1380,7 +1380,6 @@ int bnxt_hwrm_func_driver_unregister(struct bnxt *bp, uint32_t flags)
                return 0;
 
        HWRM_PREP(&req, HWRM_FUNC_DRV_UNRGTR, BNXT_USE_CHIMP_MB);
-       req.flags = flags;
 
        rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
 
index b311ff5..6dc23b9 100644 (file)
@@ -145,7 +145,7 @@ int bnxt_hwrm_func_buf_unrgtr(struct bnxt *bp);
 int bnxt_hwrm_func_driver_register(struct bnxt *bp);
 int bnxt_hwrm_func_qcaps(struct bnxt *bp);
 int bnxt_hwrm_func_reset(struct bnxt *bp);
-int bnxt_hwrm_func_driver_unregister(struct bnxt *bp, uint32_t flags);
+int bnxt_hwrm_func_driver_unregister(struct bnxt *bp);
 int bnxt_hwrm_func_qstats(struct bnxt *bp, uint16_t fid,
                          struct rte_eth_stats *stats,
                          struct hwrm_func_qstats_output *func_qstats);