[12/13] net/nfp: improve modularazation of CPP bridge module

Message ID 20230920113454.739356-13-chaoyong.he@corigine.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series improve the modularization of NFP PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Chaoyong He Sept. 20, 2023, 11:34 a.m. UTC
  Try to keep the API small by move the logic which need not expose from
header file to source file verbatim.
Also remove the unneeded header file include statement of source file.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/nfp_cpp_bridge.c | 14 ++++++++++----
 drivers/net/nfp/nfp_cpp_bridge.h |  8 --------
 2 files changed, 10 insertions(+), 12 deletions(-)
  

Patch

diff --git a/drivers/net/nfp/nfp_cpp_bridge.c b/drivers/net/nfp/nfp_cpp_bridge.c
index a9998f3c08..ed9a946b0c 100644
--- a/drivers/net/nfp/nfp_cpp_bridge.c
+++ b/drivers/net/nfp/nfp_cpp_bridge.c
@@ -5,17 +5,23 @@ 
  * Small portions derived from code Copyright(c) 2010-2015 Intel Corporation.
  */
 
+#include "nfp_cpp_bridge.h"
+
 #include <unistd.h>
 #include <sys/ioctl.h>
 
 #include <rte_service_component.h>
 
 #include "nfpcore/nfp_cpp.h"
-#include "nfpcore/nfp_mip.h"
-#include "nfpcore/nfp_nsp.h"
-
 #include "nfp_logs.h"
-#include "nfp_cpp_bridge.h"
+
+#define NFP_CPP_MEMIO_BOUNDARY    (1 << 20)
+#define NFP_BRIDGE_OP_READ        20
+#define NFP_BRIDGE_OP_WRITE       30
+#define NFP_BRIDGE_OP_IOCTL       40
+
+#define NFP_IOCTL 'n'
+#define NFP_IOCTL_CPP_IDENTIFICATION _IOW(NFP_IOCTL, 0x8f, uint32_t)
 
 /* Prototypes */
 static int nfp_cpp_bridge_serve_write(int sockfd, struct nfp_cpp *cpp);
diff --git a/drivers/net/nfp/nfp_cpp_bridge.h b/drivers/net/nfp/nfp_cpp_bridge.h
index 85289e158b..e6a957a090 100644
--- a/drivers/net/nfp/nfp_cpp_bridge.h
+++ b/drivers/net/nfp/nfp_cpp_bridge.h
@@ -10,14 +10,6 @@ 
 
 #include "nfp_common.h"
 
-#define NFP_CPP_MEMIO_BOUNDARY	(1 << 20)
-#define NFP_BRIDGE_OP_READ	20
-#define NFP_BRIDGE_OP_WRITE	30
-#define NFP_BRIDGE_OP_IOCTL	40
-
-#define NFP_IOCTL 'n'
-#define NFP_IOCTL_CPP_IDENTIFICATION _IOW(NFP_IOCTL, 0x8f, uint32_t)
-
 int nfp_enable_cpp_service(struct nfp_pf_dev *pf_dev);
 int nfp_map_service(uint32_t service_id);