]> git.droids-corp.org - dpdk.git/commitdiff
net/hns3: cleanup includes
authorLijun Ou <oulijun@huawei.com>
Mon, 2 Nov 2020 14:38:19 +0000 (22:38 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 3 Nov 2020 22:35:07 +0000 (23:35 +0100)
Some header files have included by others. Also,
some header files have a header file self-contained
error will trigger building warning. As a result,
it is unnecessary and move it into the correct
location.

Beside, here also remove some unused lines.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
18 files changed:
drivers/net/hns3/hns3_cmd.c
drivers/net/hns3/hns3_cmd.h
drivers/net/hns3/hns3_dcb.c
drivers/net/hns3/hns3_dcb.h
drivers/net/hns3/hns3_ethdev.c
drivers/net/hns3/hns3_ethdev.h
drivers/net/hns3/hns3_ethdev_vf.c
drivers/net/hns3/hns3_fdir.c
drivers/net/hns3/hns3_flow.c
drivers/net/hns3/hns3_intr.c
drivers/net/hns3/hns3_intr.h
drivers/net/hns3/hns3_mbx.c
drivers/net/hns3/hns3_mp.c
drivers/net/hns3/hns3_regs.c
drivers/net/hns3/hns3_rss.c
drivers/net/hns3/hns3_rxtx.c
drivers/net/hns3/hns3_rxtx.h
drivers/net/hns3/hns3_stats.c

index 589547c7e60d4b7028a7e917ade0d4e434a8a8cb..4f52ed034d4865ff10df645b7c6f3d9838c2a45b 100644 (file)
@@ -2,21 +2,6 @@
  * Copyright(c) 2018-2019 Hisilicon Limited.
  */
 
-#include <errno.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/queue.h>
-#include <inttypes.h>
-#include <unistd.h>
-#include <rte_bus_pci.h>
-#include <rte_common.h>
-#include <rte_cycles.h>
-#include <rte_dev.h>
-#include <rte_eal.h>
-#include <rte_ether.h>
-#include <rte_ethdev_driver.h>
 #include <rte_ethdev_pci.h>
 #include <rte_io.h>
 
index 13550b9c7d3a25f90202627b24d9616c1e9b8df6..194c3a731be2f5db871cbcb981a779913f2c1363 100644 (file)
@@ -5,6 +5,8 @@
 #ifndef _HNS3_CMD_H_
 #define _HNS3_CMD_H_
 
+#include <stdint.h>
+
 #define HNS3_CMDQ_TX_TIMEOUT           30000
 #define HNS3_CMDQ_RX_INVLD_B           0
 #define HNS3_CMDQ_RX_OUTVLD_B          1
index ae8d8268d28358a180980b74a3dbc3f4e728627e..351eb87e9571fc58fd3e2aa7f1a598d3d05d6a1b 100644 (file)
@@ -2,17 +2,10 @@
  * Copyright(c) 2018-2019 Hisilicon Limited.
  */
 
-#include <errno.h>
-#include <inttypes.h>
-#include <stdbool.h>
-#include <string.h>
-#include <unistd.h>
 #include <rte_io.h>
-#include <rte_common.h>
 #include <rte_ethdev.h>
 
 #include "hns3_logs.h"
-#include "hns3_regs.h"
 #include "hns3_ethdev.h"
 #include "hns3_dcb.h"
 
index 7ab90933f339e73a01730d9823a3bcbbb3e7cafe..fee23d9b4cbe03bb5611c77c522957dd2de994ae 100644 (file)
@@ -5,6 +5,10 @@
 #ifndef _HNS3_DCB_H_
 #define _HNS3_DCB_H_
 
+#include <stdint.h>
+
+#include "hns3_cmd.h"
+
 #define HNS3_ETHER_MAX_RATE            100000
 
 /* MAC Pause */
index 180b313c01f21c640fc0eb83661ad3e8f3981b2d..84d83469c3675789886421cada69166dbb1011f3 100644 (file)
@@ -2,25 +2,10 @@
  * Copyright(c) 2018-2019 Hisilicon Limited.
  */
 
-#include <errno.h>
-#include <stdarg.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <inttypes.h>
-#include <unistd.h>
-#include <rte_atomic.h>
+#include <rte_alarm.h>
 #include <rte_bus_pci.h>
-#include <rte_common.h>
-#include <rte_cycles.h>
-#include <rte_dev.h>
-#include <rte_eal.h>
-#include <rte_ether.h>
-#include <rte_ethdev_driver.h>
 #include <rte_ethdev_pci.h>
-#include <rte_interrupts.h>
 #include <rte_io.h>
-#include <rte_log.h>
 #include <rte_pci.h>
 
 #include "hns3_ethdev.h"
@@ -3450,8 +3435,8 @@ hns3_is_rx_buf_ok(struct hns3_hw *hw, struct hns3_pkt_buf_alloc *buf_alloc,
                hi_thrd = shared_buf - pf->dv_buf_size;
 
                if (tc_num <= NEED_RESERVE_TC_NUM)
-                       hi_thrd = hi_thrd * BUF_RESERVE_PERCENT
-                                       / BUF_MAX_PERCENT;
+                       hi_thrd = hi_thrd * BUF_RESERVE_PERCENT /
+                                 BUF_MAX_PERCENT;
 
                if (tc_num)
                        hi_thrd = hi_thrd / tc_num;
@@ -6256,7 +6241,7 @@ static const struct rte_pci_id pci_id_hns3_map[] = {
        { RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_50GE_RDMA) },
        { RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_100G_RDMA_MACSEC) },
        { RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_200G_RDMA) },
-       { .vendor_id = 0, /* sentinel */ },
+       { .vendor_id = 0, }, /* sentinel */
 };
 
 static struct rte_pci_driver rte_hns3_pmd = {
index 531a6cb7ab12aeede3d84da6ac3eaea57382cb1f..63e0c2fb36c2a8f8146a6f257640200c2c287cad 100644 (file)
@@ -6,7 +6,6 @@
 #define _HNS3_ETHDEV_H_
 
 #include <sys/time.h>
-#include <rte_alarm.h>
 #include <rte_ethdev_driver.h>
 
 #include "hns3_cmd.h"
@@ -792,12 +791,8 @@ struct hns3_adapter {
 
 #define HNS3_DEV_PRIVATE_TO_HW(adapter) \
        (&((struct hns3_adapter *)adapter)->hw)
-#define HNS3_DEV_PRIVATE_TO_ADAPTER(adapter) \
-       ((struct hns3_adapter *)adapter)
 #define HNS3_DEV_PRIVATE_TO_PF(adapter) \
        (&((struct hns3_adapter *)adapter)->pf)
-#define HNS3VF_DEV_PRIVATE_TO_VF(adapter) \
-       (&((struct hns3_adapter *)adapter)->vf)
 #define HNS3_DEV_HW_TO_ADAPTER(hw) \
        container_of(hw, struct hns3_adapter, hw)
 
index 088a46fed8be7cf0ee4da2020e00866d2d1c79c5..fb55d5822b352dc1502485dc9be51ca10d9750e8 100644 (file)
@@ -2,29 +2,10 @@
  * Copyright(c) 2018-2019 Hisilicon Limited.
  */
 
-#include <errno.h>
-#include <stdio.h>
-#include <stdbool.h>
-#include <string.h>
-#include <inttypes.h>
-#include <unistd.h>
-#include <arpa/inet.h>
 #include <linux/pci_regs.h>
-
 #include <rte_alarm.h>
-#include <rte_atomic.h>
-#include <rte_bus_pci.h>
-#include <rte_byteorder.h>
-#include <rte_common.h>
-#include <rte_cycles.h>
-#include <rte_dev.h>
-#include <rte_eal.h>
-#include <rte_ether.h>
-#include <rte_ethdev_driver.h>
 #include <rte_ethdev_pci.h>
-#include <rte_interrupts.h>
 #include <rte_io.h>
-#include <rte_log.h>
 #include <rte_pci.h>
 #include <rte_vfio.h>
 
@@ -2887,7 +2868,7 @@ eth_hns3vf_pci_remove(struct rte_pci_device *pci_dev)
 static const struct rte_pci_id pci_id_hns3vf_map[] = {
        { RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_100G_VF) },
        { RTE_PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, HNS3_DEV_ID_100G_RDMA_PFC_VF) },
-       { .vendor_id = 0, /* sentinel */ },
+       { .vendor_id = 0, }, /* sentinel */
 };
 
 static struct rte_pci_driver rte_hns3vf_pmd = {
index 79e3028b6d42b1afb43ed3023a79b1c3f681443d..62ccabceecc98dda0983aa0101bb36b0f21be6db 100644 (file)
@@ -2,7 +2,6 @@
  * Copyright(c) 2018-2019 Hisilicon Limited.
  */
 
-#include <stdbool.h>
 #include <rte_ethdev_driver.h>
 #include <rte_hash.h>
 #include <rte_hash_crc.h>
index 0d5dd1a7af37c80ea94361c24ca14efbf4832d89..ff00dc1bc4ee1077f6a537605d416995f5a38cc8 100644 (file)
@@ -2,8 +2,6 @@
  * Copyright(c) 2018-2019 Hisilicon Limited.
  */
 
-#include <stdbool.h>
-#include <sys/queue.h>
 #include <rte_flow_driver.h>
 #include <rte_io.h>
 #include <rte_malloc.h>
index 2565688c5886863153be211db699da6125563d84..bfd2ba864bb017fc5f583bf0d30b9b06cf9c9f7d 100644 (file)
@@ -2,15 +2,11 @@
  * Copyright(c) 2018-2019 Hisilicon Limited.
  */
 
-#include <stdbool.h>
-#include <rte_atomic.h>
 #include <rte_alarm.h>
 #include <rte_cycles.h>
 #include <rte_ethdev.h>
 #include <rte_io.h>
 #include <rte_malloc.h>
-#include <rte_pci.h>
-#include <rte_bus_pci.h>
 
 #include "hns3_ethdev.h"
 #include "hns3_logs.h"
index 2b802bc7c47a147ed55e4d1c719ad52450ab7024..19de1aa2d89a27a6ee638e26f228d6410991616b 100644 (file)
@@ -5,6 +5,10 @@
 #ifndef _HNS3_INTR_H_
 #define _HNS3_INTR_H_
 
+#include <stdint.h>
+
+#include "hns3_ethdev.h"
+
 #define HNS3_PPP_MPF_ECC_ERR_INT0_EN           0xFFFFFFFF
 #define HNS3_PPP_MPF_ECC_ERR_INT0_EN_MASK      0xFFFFFFFF
 #define HNS3_PPP_MPF_ECC_ERR_INT1_EN           0xFFFFFFFF
index 305007a8230cf002b602762cded567daf2d4249d..adb23cb38d797b79165c99237754e245319bc2ca 100644 (file)
@@ -2,22 +2,8 @@
  * Copyright(c) 2018-2019 Hisilicon Limited.
  */
 
-#include <errno.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
-#include <unistd.h>
-#include <rte_byteorder.h>
-#include <rte_common.h>
-#include <rte_cycles.h>
-#include <rte_dev.h>
 #include <rte_ethdev_driver.h>
 #include <rte_io.h>
-#include <rte_spinlock.h>
-#include <rte_pci.h>
-#include <rte_bus_pci.h>
 
 #include "hns3_ethdev.h"
 #include "hns3_regs.h"
index 639f46ced87c6823bbd03edd23f392e212ecb5fe..a5e98ff72fc234ce01afa99549ef293a82b1fc33 100644 (file)
@@ -2,8 +2,6 @@
  * Copyright(c) 2018-2019 Hisilicon Limited.
  */
 
-#include <stdbool.h>
-
 #include <rte_eal.h>
 #include <rte_ethdev_driver.h>
 #include <rte_string_fns.h>
index 1b7dd7266d90e2625b8dd59516e5b592327cfb09..b2cc599f126adc12aafbfd50044af0ea3c5908af 100644 (file)
@@ -2,24 +2,8 @@
  * Copyright(c) 2018-2019 Hisilicon Limited.
  */
 
-#include <errno.h>
-#include <stdarg.h>
-#include <stdbool.h>
-#include <string.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <inttypes.h>
-#include <unistd.h>
-#include <rte_bus_pci.h>
-#include <rte_byteorder.h>
-#include <rte_common.h>
-#include <rte_dev.h>
-#include <rte_eal.h>
-#include <rte_ether.h>
-#include <rte_ethdev_driver.h>
 #include <rte_ethdev_pci.h>
 #include <rte_io.h>
-#include <rte_pci.h>
 
 #include "hns3_ethdev.h"
 #include "hns3_logs.h"
index a4e552b2215dbae6ea6ceb85d891626b68ecbea6..e2f04687b2396b4cfbb1b8107d1d61f82f409df9 100644 (file)
@@ -2,12 +2,9 @@
  * Copyright(c) 2018-2019 Hisilicon Limited.
  */
 
-#include <stdbool.h>
 #include <rte_ethdev.h>
 #include <rte_io.h>
 #include <rte_malloc.h>
-#include <rte_memcpy.h>
-#include <rte_spinlock.h>
 
 #include "hns3_ethdev.h"
 #include "hns3_logs.h"
index afb1e7d67092e5e37a31756fdadf1e0f11050f40..bd3ccf618b12cf5dc551b2bcafa60d237126981f 100644 (file)
@@ -2,27 +2,14 @@
  * Copyright(c) 2018-2019 Hisilicon Limited.
  */
 
-#include <stdarg.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <inttypes.h>
 #include <rte_bus_pci.h>
-#include <rte_byteorder.h>
 #include <rte_common.h>
 #include <rte_cycles.h>
-#include <rte_dev.h>
-#include <rte_eal.h>
-#include <rte_ether.h>
 #include <rte_vxlan.h>
 #include <rte_ethdev_driver.h>
 #include <rte_io.h>
-#include <rte_ip.h>
-#include <rte_gre.h>
 #include <rte_net.h>
 #include <rte_malloc.h>
-#include <rte_pci.h>
 #if defined(RTE_ARCH_ARM64) && defined(CC_SVE_SUPPORT)
 #include <rte_cpuflags.h>
 #endif
index 51504cabe87af53cfbcb6ca0cd3b5d3cfd3f2fdd..8b32abe52ad7d89fdf95f8728e98075765d31294 100644 (file)
@@ -5,6 +5,9 @@
 #ifndef _HNS3_RXTX_H_
 #define _HNS3_RXTX_H_
 
+#include <stdint.h>
+#include <rte_mbuf_core.h>
+
 #define        HNS3_MIN_RING_DESC      64
 #define        HNS3_MAX_RING_DESC      32768
 #define HNS3_DEFAULT_RING_DESC  1024
index 8c3c7cc01fc3f0724bcc860e324ea4431f8589f2..9bf6962eda66d1534970a928aeff471c671c6384 100644 (file)
@@ -2,13 +2,9 @@
  * Copyright(c) 2018-2019 Hisilicon Limited.
  */
 
-#include <stdbool.h>
-#include <stdint.h>
-#include <rte_common.h>
 #include <rte_ethdev.h>
 #include <rte_io.h>
 #include <rte_malloc.h>
-#include <rte_spinlock.h>
 
 #include "hns3_ethdev.h"
 #include "hns3_rxtx.h"