From: Long Wu <long...@corigine.com>

The CPP service is enabled in 'nfp_pf_init()', so it should be disabled
in corresponding free function 'nfp_pf_uninit()'.

Fixes: 600f6d2c7704 ("net/nfp: add service module")
Cc: sta...@dpdk.org

Signed-off-by: Long Wu <long...@corigine.com>
Reviewed-by: Peng Zhang <peng.zh...@corigine.com>
Reviewed-by: Chaoyong He <chaoyong...@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower_representor.c | 3 ---
 drivers/net/nfp/nfp_cpp_bridge.c                | 6 ++++++
 drivers/net/nfp/nfp_cpp_bridge.h                | 1 +
 drivers/net/nfp/nfp_ethdev.c                    | 1 +
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c 
b/drivers/net/nfp/flower/nfp_flower_representor.c
index f1451fcca2..700957f945 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -457,9 +457,6 @@ nfp_flower_repr_dev_close(struct rte_eth_dev *dev)
        /* Stop flower service first */
        nfp_flower_service_stop(app_fw_flower, hw_priv);
 
-       /* Disable cpp service */
-       nfp_service_disable(&pf_dev->cpp_service_info);
-
        /* Now it is safe to free all PF resources */
        nfp_uninit_app_fw_flower(hw_priv);
        nfp_pf_uninit(hw_priv);
diff --git a/drivers/net/nfp/nfp_cpp_bridge.c b/drivers/net/nfp/nfp_cpp_bridge.c
index 441c0d2843..fc73fa20ab 100644
--- a/drivers/net/nfp/nfp_cpp_bridge.c
+++ b/drivers/net/nfp/nfp_cpp_bridge.c
@@ -45,6 +45,12 @@ nfp_enable_cpp_service(struct nfp_pf_dev *pf_dev)
        return 0;
 }
 
+void
+nfp_disable_cpp_service(struct nfp_pf_dev *pf_dev)
+{
+       nfp_service_disable(&pf_dev->cpp_service_info);
+}
+
 /*
  * Serving a write request to NFP from host programs. The request
  * sends the write size and the CPP target. The bridge makes use
diff --git a/drivers/net/nfp/nfp_cpp_bridge.h b/drivers/net/nfp/nfp_cpp_bridge.h
index 406c961dce..93026c10f4 100644
--- a/drivers/net/nfp/nfp_cpp_bridge.h
+++ b/drivers/net/nfp/nfp_cpp_bridge.h
@@ -9,5 +9,6 @@
 #include "nfp_net_common.h"
 
 int nfp_enable_cpp_service(struct nfp_pf_dev *pf_dev);
+void nfp_disable_cpp_service(struct nfp_pf_dev *pf_dev);
 
 #endif /* __NFP_CPP_BRIDGE_H__ */
diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index ddbbd736db..76bbaf1f50 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -641,6 +641,7 @@ nfp_pf_uninit(struct nfp_net_hw_priv *hw_priv)
 {
        struct nfp_pf_dev *pf_dev = hw_priv->pf_dev;
 
+       nfp_disable_cpp_service(pf_dev);
        nfp_cpp_area_release_free(pf_dev->mac_stats_area);
        nfp_cpp_area_release_free(pf_dev->qc_area);
        free(pf_dev->sym_tbl);
-- 
2.39.1

Reply via email to