From: Kalesh AP Date: Wed, 22 Sep 2021 08:30:44 +0000 (+0530) Subject: net/bnxt: fix function driver register/unregister X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=61ad5c1ac9de245e7d20a67375d56682c70bebde;p=dpdk.git net/bnxt: fix function driver register/unregister 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 Reviewed-by: Ajit Khaparde Reviewed-by: Lance Richardson Reviewed-by: Somnath Kotur --- diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 097dd10de9..dc7dee1d2a 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -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) { diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 585cdeded8..d4d8581af1 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -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); diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h index b311ff59c0..6dc23b93ac 100644 --- a/drivers/net/bnxt/bnxt_hwrm.h +++ b/drivers/net/bnxt/bnxt_hwrm.h @@ -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);