patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Dongdong Liu <liudongdong3@huawei.com>
To: <dev@dpdk.org>, <andrew.rybchenko@oktetlabs.ru>,
	<ferruh.yigit@amd.com>, <thomas@monjalon.net>
Cc: <stable@dpdk.org>, <fengchengwen@huawei.com>,
	<yisen.zhuang@huawei.com>, <liudongdong3@huawei.com>,
	<lihuisong@huawei.com>, <haijie1@huawei.com>
Subject: [PATCH 10/19] net/hns3: fix header file self contained
Date: Fri, 30 Sep 2022 15:22:11 +0800	[thread overview]
Message-ID: <20220930072220.20753-11-liudongdong3@huawei.com> (raw)
In-Reply-To: <20220930072220.20753-1-liudongdong3@huawei.com>

From: Chengwen Feng <fengchengwen@huawei.com>

Header files should be self contained and should not be cyclically
dependent. This patch fixed it.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu <humin29@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_cmd.h    | 3 +++
 drivers/net/hns3/hns3_common.c | 2 +-
 drivers/net/hns3/hns3_dcb.h    | 4 ++++
 drivers/net/hns3/hns3_ethdev.c | 2 +-
 drivers/net/hns3/hns3_fdir.h   | 5 +++++
 drivers/net/hns3/hns3_flow.h   | 3 +++
 drivers/net/hns3/hns3_intr.c   | 2 +-
 drivers/net/hns3/hns3_mbx.h    | 4 ++++
 drivers/net/hns3/hns3_mp.h     | 2 ++
 drivers/net/hns3/hns3_regs.h   | 3 +++
 drivers/net/hns3/hns3_rss.h    | 2 ++
 drivers/net/hns3/hns3_rxtx.c   | 2 +-
 drivers/net/hns3/hns3_rxtx.h   | 9 +++++++++
 drivers/net/hns3/hns3_stats.h  | 5 +++++
 drivers/net/hns3/hns3_tm.h     | 2 ++
 15 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/drivers/net/hns3/hns3_cmd.h b/drivers/net/hns3/hns3_cmd.h
index 82c999061d..bee96c1e46 100644
--- a/drivers/net/hns3/hns3_cmd.h
+++ b/drivers/net/hns3/hns3_cmd.h
@@ -7,6 +7,9 @@
 
 #include <stdint.h>
 
+#include <rte_byteorder.h>
+#include <rte_spinlock.h>
+
 #define HNS3_CMDQ_TX_TIMEOUT		30000
 #define HNS3_CMDQ_CLEAR_WAIT_TIME	200
 #define HNS3_CMDQ_RX_INVLD_B		0
diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c
index e732f68238..14291193cb 100644
--- a/drivers/net/hns3/hns3_common.c
+++ b/drivers/net/hns3/hns3_common.c
@@ -7,10 +7,10 @@
 #include <ethdev_pci.h>
 #include <rte_pci.h>
 
-#include "hns3_common.h"
 #include "hns3_logs.h"
 #include "hns3_regs.h"
 #include "hns3_rxtx.h"
+#include "hns3_common.h"
 
 int
 hns3_fw_version_get(struct rte_eth_dev *eth_dev, char *fw_version,
diff --git a/drivers/net/hns3/hns3_dcb.h b/drivers/net/hns3/hns3_dcb.h
index e06ec177c8..9d9e7684c1 100644
--- a/drivers/net/hns3/hns3_dcb.h
+++ b/drivers/net/hns3/hns3_dcb.h
@@ -7,7 +7,11 @@
 
 #include <stdint.h>
 
+#include <ethdev_driver.h>
+#include <rte_ethdev.h>
+
 #include "hns3_cmd.h"
+#include "hns3_ethdev.h"
 
 #define HNS3_ETHER_MAX_RATE		100000
 
diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c
index a1348f93a7..60e933998a 100644
--- a/drivers/net/hns3/hns3_ethdev.c
+++ b/drivers/net/hns3/hns3_ethdev.c
@@ -6,7 +6,6 @@
 #include <bus_pci_driver.h>
 #include <ethdev_pci.h>
 
-#include "hns3_ethdev.h"
 #include "hns3_common.h"
 #include "hns3_dump.h"
 #include "hns3_logs.h"
@@ -16,6 +15,7 @@
 #include "hns3_dcb.h"
 #include "hns3_mp.h"
 #include "hns3_flow.h"
+#include "hns3_ethdev.h"
 
 #define HNS3_SERVICE_INTERVAL		1000000 /* us */
 #define HNS3_SERVICE_QUICK_INTERVAL	10
diff --git a/drivers/net/hns3/hns3_fdir.h b/drivers/net/hns3/hns3_fdir.h
index d81f04a3f3..1a14f1eceb 100644
--- a/drivers/net/hns3/hns3_fdir.h
+++ b/drivers/net/hns3/hns3_fdir.h
@@ -5,6 +5,10 @@
 #ifndef _HNS3_FDIR_H_
 #define _HNS3_FDIR_H_
 
+#include <stdint.h>
+
+#include <rte_flow.h>
+
 struct hns3_fd_key_cfg {
 	uint8_t key_sel;
 	uint8_t inner_sipv6_word_en;
@@ -177,6 +181,7 @@ struct hns3_fdir_info {
 };
 
 struct hns3_adapter;
+struct hns3_hw;
 
 int hns3_init_fd_config(struct hns3_adapter *hns);
 int hns3_fdir_filter_init(struct hns3_adapter *hns);
diff --git a/drivers/net/hns3/hns3_flow.h b/drivers/net/hns3/hns3_flow.h
index 854fbb7ff0..ec94510152 100644
--- a/drivers/net/hns3/hns3_flow.h
+++ b/drivers/net/hns3/hns3_flow.h
@@ -6,6 +6,9 @@
 #define _HNS3_FLOW_H_
 
 #include <rte_flow.h>
+#include <ethdev_driver.h>
+
+#include "hns3_rss.h"
 
 struct hns3_flow_counter {
 	LIST_ENTRY(hns3_flow_counter) next; /* Pointer to the next counter. */
diff --git a/drivers/net/hns3/hns3_intr.c b/drivers/net/hns3/hns3_intr.c
index 4bdcd6070b..57679254ee 100644
--- a/drivers/net/hns3/hns3_intr.c
+++ b/drivers/net/hns3/hns3_intr.c
@@ -10,9 +10,9 @@
 
 #include "hns3_common.h"
 #include "hns3_logs.h"
-#include "hns3_intr.h"
 #include "hns3_regs.h"
 #include "hns3_rxtx.h"
+#include "hns3_intr.h"
 
 #define SWITCH_CONTEXT_US	10
 
diff --git a/drivers/net/hns3/hns3_mbx.h b/drivers/net/hns3/hns3_mbx.h
index 0172a2e288..97f704426c 100644
--- a/drivers/net/hns3/hns3_mbx.h
+++ b/drivers/net/hns3/hns3_mbx.h
@@ -5,6 +5,10 @@
 #ifndef _HNS3_MBX_H_
 #define _HNS3_MBX_H_
 
+#include <stdint.h>
+
+#include <rte_spinlock.h>
+
 enum HNS3_MBX_OPCODE {
 	HNS3_MBX_RESET = 0x01,          /* (VF -> PF) assert reset */
 	HNS3_MBX_ASSERTING_RESET,       /* (PF -> VF) PF is asserting reset */
diff --git a/drivers/net/hns3/hns3_mp.h b/drivers/net/hns3/hns3_mp.h
index a74221d086..230230bbfe 100644
--- a/drivers/net/hns3/hns3_mp.h
+++ b/drivers/net/hns3/hns3_mp.h
@@ -5,6 +5,8 @@
 #ifndef _HNS3_MP_H_
 #define _HNS3_MP_H_
 
+#include <ethdev_driver.h>
+
 /* Local data for primary or secondary process. */
 struct hns3_process_local_data {
 	bool init_done; /* Process action register completed flag. */
diff --git a/drivers/net/hns3/hns3_regs.h b/drivers/net/hns3/hns3_regs.h
index 5812eb39db..2636429844 100644
--- a/drivers/net/hns3/hns3_regs.h
+++ b/drivers/net/hns3/hns3_regs.h
@@ -5,6 +5,9 @@
 #ifndef _HNS3_REGS_H_
 #define _HNS3_REGS_H_
 
+#include <ethdev_driver.h>
+#include <rte_dev_info.h>
+
 /* bar registers for cmdq */
 #define HNS3_CMDQ_TX_ADDR_L_REG		0x27000
 #define HNS3_CMDQ_TX_ADDR_H_REG		0x27004
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index 1589c67c59..6cae5f8634 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -4,6 +4,7 @@
 
 #ifndef _HNS3_RSS_H_
 #define _HNS3_RSS_H_
+
 #include <rte_ethdev.h>
 #include <rte_flow.h>
 
@@ -91,6 +92,7 @@ static inline uint32_t roundup_pow_of_two(uint32_t x)
 extern const uint8_t hns3_hash_key[HNS3_RSS_KEY_SIZE];
 
 struct hns3_adapter;
+struct hns3_hw;
 
 int hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 			     struct rte_eth_rss_conf *rss_conf);
diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 0a342ed9a2..f1163ce8a9 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -17,10 +17,10 @@
 #endif
 
 #include "hns3_common.h"
-#include "hns3_rxtx.h"
 #include "hns3_regs.h"
 #include "hns3_logs.h"
 #include "hns3_mp.h"
+#include "hns3_rxtx.h"
 
 #define HNS3_CFG_DESC_NUM(num)	((num) / 8 - 1)
 #define HNS3_RX_RING_PREFETCTH_MASK	3
diff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h
index 455f8b9419..f2d73043b7 100644
--- a/drivers/net/hns3/hns3_rxtx.h
+++ b/drivers/net/hns3/hns3_rxtx.h
@@ -6,7 +6,16 @@
 #define _HNS3_RXTX_H_
 
 #include <stdint.h>
+
+#include <ethdev_driver.h>
 #include <rte_mbuf_core.h>
+#include <rte_ethdev.h>
+#include <rte_ethdev_core.h>
+#include <rte_io.h>
+#include <rte_mempool.h>
+#include <rte_memzone.h>
+
+#include "hns3_ethdev.h"
 
 #define	HNS3_MIN_RING_DESC	64
 #define	HNS3_MAX_RING_DESC	32768
diff --git a/drivers/net/hns3/hns3_stats.h b/drivers/net/hns3/hns3_stats.h
index 9d84072205..9a360f8870 100644
--- a/drivers/net/hns3/hns3_stats.h
+++ b/drivers/net/hns3/hns3_stats.h
@@ -5,6 +5,9 @@
 #ifndef _HNS3_STATS_H_
 #define _HNS3_STATS_H_
 
+#include <ethdev_driver.h>
+#include <rte_ethdev.h>
+
 /* TQP stats */
 struct hns3_tqp_stats {
 	uint64_t rcb_tx_ring_pktnum_rcd; /* Total num of transmitted packets */
@@ -145,6 +148,8 @@ struct hns3_reset_stats;
 #define HNS3_IMISSED_STATS_FIELD_OFFSET(f) \
 	(offsetof(struct hns3_rx_missed_stats, f))
 
+struct hns3_hw;
+
 int hns3_stats_get(struct rte_eth_dev *eth_dev,
 		   struct rte_eth_stats *rte_stats);
 int hns3_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
diff --git a/drivers/net/hns3/hns3_tm.h b/drivers/net/hns3/hns3_tm.h
index 83e9cc8ba9..47345eeed1 100644
--- a/drivers/net/hns3/hns3_tm.h
+++ b/drivers/net/hns3/hns3_tm.h
@@ -105,6 +105,8 @@ hns3_tm_calc_node_tc_no(struct hns3_tm_conf *conf, uint32_t node_id)
 		return 0;
 }
 
+struct hns3_hw;
+
 void hns3_tm_conf_init(struct rte_eth_dev *dev);
 void hns3_tm_conf_uninit(struct rte_eth_dev *dev);
 int hns3_tm_ops_get(struct rte_eth_dev *dev __rte_unused, void *arg);
-- 
2.22.0


  parent reply	other threads:[~2022-09-30  7:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30  7:22 [PATCH 00/19] some bugfixes and clean code for hns3 - part2 Dongdong Liu
2022-09-30  7:22 ` [PATCH 01/19] net/hns3: fix have no valid RSS rule Dongdong Liu
2022-09-30  7:22 ` [PATCH 02/19] net/hns3: fix RSS filter restore Dongdong Liu
2022-09-30  7:22 ` [PATCH 03/19] net/hns3: fix the lock protection of RSS flow rule Dongdong Liu
2022-09-30  7:22 ` [PATCH 04/19] net/hns3: fix RSS flow rule restore failed Dongdong Liu
2022-09-30  7:22 ` [PATCH 05/19] net/hns3: move flow direction rule recovery position Dongdong Liu
2022-09-30  7:22 ` [PATCH 06/19] net/hns3: fix hns3 restore filter function input Dongdong Liu
2022-09-30  7:22 ` [PATCH 07/19] net/hns3: fix gcov compile warning Dongdong Liu
2022-09-30  7:22 ` [PATCH 08/19] net/hns3: fix incorrect packet type report for GENEVE Dongdong Liu
2022-09-30  7:22 ` [PATCH 09/19] net/hns3: fix magic numbers Dongdong Liu
2022-09-30  7:22 ` Dongdong Liu [this message]
2022-09-30  7:22 ` [PATCH 11/19] net/hns3: remove unused structure definition Dongdong Liu
2022-09-30  7:22 ` [PATCH 12/19] net/hns3: do not use reserved identifier macro Dongdong Liu
2022-09-30  7:22 ` [PATCH 13/19] net/hns3: fix fail to enable IPV4 or IPV6 packet RSS Dongdong Liu
2022-09-30  7:22 ` [PATCH 14/19] net/hns3: fix some spelling errors Dongdong Liu
2022-09-30  7:22 ` [PATCH 15/19] net/hns3: fix inconsistent RSS behavior Dongdong Liu
2022-09-30  7:22 ` [PATCH 16/19] net/hns3: add check for L3 and L4 type Dongdong Liu
2022-09-30  7:22 ` [PATCH 17/19] net/hns3: revert fix mailbox communication with HW Dongdong Liu
2022-09-30  7:22 ` [PATCH 18/19] net/hns3: fix VF mark wrong message processed Dongdong Liu
2022-09-30  7:22 ` [PATCH 19/19] net/hns3: fix the obtaination of minimum Tx frame length Dongdong Liu
2022-10-05  6:18 ` [PATCH 00/19] some bugfixes and clean code for hns3 - part2 Andrew Rybchenko

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=20220930072220.20753-11-liudongdong3@huawei.com \
    --to=liudongdong3@huawei.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=ferruh.yigit@amd.com \
    --cc=haijie1@huawei.com \
    --cc=lihuisong@huawei.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=yisen.zhuang@huawei.com \
    /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).