[11/13] net/nfp: improve modularazation of meter module

Message ID 20230920113454.739356-12-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_mtr.c | 16 ++++++++--------
 drivers/net/nfp/nfp_mtr.h |  2 --
 2 files changed, 8 insertions(+), 10 deletions(-)
  

Patch

diff --git a/drivers/net/nfp/nfp_mtr.c b/drivers/net/nfp/nfp_mtr.c
index afc4de4cc7..255977ec22 100644
--- a/drivers/net/nfp/nfp_mtr.c
+++ b/drivers/net/nfp/nfp_mtr.c
@@ -3,17 +3,17 @@ 
  * All rights reserved.
  */
 
-#include <rte_mtr_driver.h>
-#include <bus_pci_driver.h>
-#include <rte_malloc.h>
+#include "nfp_mtr.h"
+
 #include <rte_alarm.h>
+#include <rte_malloc.h>
+#include <rte_mtr_driver.h>
 
-#include "nfp_common.h"
-#include "nfp_mtr.h"
-#include "nfp_logs.h"
-#include "flower/nfp_flower.h"
-#include "flower/nfp_flower_cmsg.h"
 #include "flower/nfp_flower_representor.h"
+#include "nfp_logs.h"
+
+#define NFP_MAX_POLICY_CNT             NFP_MAX_MTR_CNT
+#define NFP_MAX_PROFILE_CNT            NFP_MAX_MTR_CNT
 
 #define NFP_FL_QOS_PPS          RTE_BIT32(15)
 #define NFP_FL_QOS_METER        RTE_BIT32(10)
diff --git a/drivers/net/nfp/nfp_mtr.h b/drivers/net/nfp/nfp_mtr.h
index 4b1360cad8..7ab0324721 100644
--- a/drivers/net/nfp/nfp_mtr.h
+++ b/drivers/net/nfp/nfp_mtr.h
@@ -15,8 +15,6 @@ 
  * The max count is 65536 defined by OF_METER_COUNT.
  */
 #define NFP_MAX_MTR_CNT                65536
-#define NFP_MAX_POLICY_CNT             NFP_MAX_MTR_CNT
-#define NFP_MAX_PROFILE_CNT            NFP_MAX_MTR_CNT
 
 /**
  * Struct nfp_mtr_profile - meter profile, stored in driver