diff mbox series

net/bnxt: fix function driver register/unregister functions

Message ID 20210922083044.21242-1-kalesh-anakkur.purayil@broadcom.com (mailing list archive)
State Accepted
Delegated to: Ajit Khaparde
Headers show
Series net/bnxt: fix function driver register/unregister functions | expand

Checks

Context Check Description
ci/github-robot: build success github build: passed
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-mellanox-Functional fail Functional Testing issues
ci/iol-broadcom-Functional fail Functional Testing issues
ci/iol-mellanox-Performance fail Performance Testing issues
ci/iol-broadcom-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Kalesh A P Sept. 22, 2021, 8:30 a.m. UTC
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

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 | 2 +-
 drivers/net/bnxt/bnxt_hwrm.c   | 9 ++++-----
 drivers/net/bnxt/bnxt_hwrm.h   | 2 +-
 3 files changed, 6 insertions(+), 7 deletions(-)

Comments

Ajit Khaparde Sept. 26, 2021, 9:16 p.m. UTC | #1
On Wed, Sep 22, 2021 at 1:10 AM Kalesh A P
<kalesh-anakkur.purayil@broadcom.com> wrote:
>
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
> 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>
Patch applied to dpdk-next-net-brcm. Thanks

> ---
>  drivers/net/bnxt/bnxt_ethdev.c | 2 +-
>  drivers/net/bnxt/bnxt_hwrm.c   | 9 ++++-----
>  drivers/net/bnxt/bnxt_hwrm.h   | 2 +-
>  3 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index 097dd10..dc7dee1 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 585cded..d4d8581 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 @@ int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout)
>         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 b311ff5..6dc23b9 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);
> --
> 2.10.1
>
diff mbox series

Patch

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 097dd10..dc7dee1 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 585cded..d4d8581 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 @@  int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout)
 	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 b311ff5..6dc23b9 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);