net/hns3: add check for deferred start queue when rollback
[dpdk.git] / drivers / net / hns3 / hns3_stats.h
index 01b4f36..b5cd618 100644 (file)
@@ -1,15 +1,10 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018-2019 Hisilicon Limited.
+ * Copyright(c) 2018-2021 HiSilicon Limited.
  */
 
 #ifndef _HNS3_STATS_H_
 #define _HNS3_STATS_H_
 
-/* stats macro */
-#define HNS3_MAC_CMD_NUM               21
-#define HNS3_RD_FIRST_STATS_NUM                2
-#define HNS3_RD_OTHER_STATS_NUM                4
-
 /* TQP stats */
 struct hns3_tqp_stats {
        uint64_t rcb_tx_ring_pktnum_rcd; /* Total num of transmitted packets */
@@ -22,6 +17,7 @@ struct hns3_tqp_stats {
 struct hns3_mac_stats {
        uint64_t mac_tx_mac_pause_num;
        uint64_t mac_rx_mac_pause_num;
+       uint64_t rsv0;
        uint64_t mac_tx_pfc_pri0_pkt_num;
        uint64_t mac_tx_pfc_pri1_pkt_num;
        uint64_t mac_tx_pfc_pri2_pkt_num;
@@ -58,7 +54,7 @@ struct hns3_mac_stats {
        uint64_t mac_tx_1519_2047_oct_pkt_num;
        uint64_t mac_tx_2048_4095_oct_pkt_num;
        uint64_t mac_tx_4096_8191_oct_pkt_num;
-       uint64_t rsv0;
+       uint64_t rsv1;
        uint64_t mac_tx_8192_9216_oct_pkt_num;
        uint64_t mac_tx_9217_12287_oct_pkt_num;
        uint64_t mac_tx_12288_16383_oct_pkt_num;
@@ -85,7 +81,7 @@ struct hns3_mac_stats {
        uint64_t mac_rx_1519_2047_oct_pkt_num;
        uint64_t mac_rx_2048_4095_oct_pkt_num;
        uint64_t mac_rx_4096_8191_oct_pkt_num;
-       uint64_t rsv1;
+       uint64_t rsv2;
        uint64_t mac_rx_8192_9216_oct_pkt_num;
        uint64_t mac_rx_9217_12287_oct_pkt_num;
        uint64_t mac_rx_12288_16383_oct_pkt_num;
@@ -112,6 +108,7 @@ struct hns3_mac_stats {
 
 struct hns3_rx_missed_stats {
        uint64_t rpu_rx_drop_cnt;
+       uint64_t ssu_rx_drop_cnt;
 };
 
 /* store statistics names and its offset in stats structure */
@@ -156,17 +153,17 @@ int hns3_dev_xstats_get_names(struct rte_eth_dev *dev,
                              struct rte_eth_xstat_name *xstats_names,
                              __rte_unused unsigned int size);
 int hns3_dev_xstats_get_by_id(struct rte_eth_dev *dev,
-                             __rte_unused const uint64_t *ids,
-                             __rte_unused uint64_t *values,
+                             const uint64_t *ids,
+                             uint64_t *values,
                              uint32_t size);
 int hns3_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
-                                   struct rte_eth_xstat_name *xstats_names,
                                    const uint64_t *ids,
+                                   struct rte_eth_xstat_name *xstats_names,
                                    uint32_t size);
 int hns3_stats_reset(struct rte_eth_dev *dev);
-void hns3_error_int_stats_add(struct hns3_adapter *hns, const char *err);
-int hns3_tqp_stats_init(struct hns3_hw *hw);
-void hns3_tqp_stats_uninit(struct hns3_hw *hw);
-int hns3_update_imissed_stats(struct hns3_hw *hw, bool is_clear);
+int hns3_stats_init(struct hns3_hw *hw);
+void hns3_stats_uninit(struct hns3_hw *hw);
+int hns3_query_mac_stats_reg_num(struct hns3_hw *hw);
+void hns3_update_hw_stats(struct hns3_hw *hw);
 
 #endif /* _HNS3_STATS_H_ */