DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Long Wu <long.wu@corigine.com>,
	stable@dpdk.org, Peng Zhang <peng.zhang@corigine.com>,
	Chaoyong He <chaoyong.he@corigine.com>
Subject: [PATCH 4/6] net/nfp: fix disable CPP service
Date: Wed, 19 Jun 2024 11:06:53 +0800	[thread overview]
Message-ID: <20240619030655.3216268-5-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20240619030655.3216268-1-chaoyong.he@corigine.com>

From: Long Wu <long.wu@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: stable@dpdk.org

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@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


  parent reply	other threads:[~2024-06-19  3:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19  3:06 [PATCH 0/6] refactor the service module Chaoyong He
2024-06-19  3:06 ` [PATCH 1/6] net/nfp: fix check logic for device arguments Chaoyong He
2024-06-19  3:06 ` [PATCH 2/6] net/nfp: remove redundant NFP service code Chaoyong He
2024-06-19  3:06 ` [PATCH 3/6] net/nfp: remove the flower service dead loop Chaoyong He
2024-06-19  3:06 ` Chaoyong He [this message]
2024-06-19  3:06 ` [PATCH 5/6] net/nfp: add CPP service enable option Chaoyong He
2024-06-19  3:06 ` [PATCH 6/6] net/nfp: add CPP service abnormal exit logic Chaoyong He
2024-07-06 18:51 ` [PATCH 0/6] refactor the service module Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240619030655.3216268-5-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=long.wu@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=peng.zhang@corigine.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).