X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fhns3%2Fhns3_stats.h;h=de5c40d6b556087f24802b48ac62808e2fe4be36;hb=70d2f42110576c670a67abd35a4bb6a2d0b00980;hp=365bae083df62298c36f2153e975a8aa0203ada2;hpb=8839c5e202f3f61209f1413ad10356d644fe9cfb;p=dpdk.git diff --git a/drivers/net/hns3/hns3_stats.h b/drivers/net/hns3/hns3_stats.h index 365bae083d..de5c40d6b5 100644 --- a/drivers/net/hns3/hns3_stats.h +++ b/drivers/net/hns3/hns3_stats.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018-2019 Hisilicon Limited. + * Copyright(c) 2018-2021 HiSilicon Limited. */ #ifndef _HNS3_STATS_H_ @@ -9,14 +9,13 @@ #define HNS3_MAC_CMD_NUM 21 #define HNS3_RD_FIRST_STATS_NUM 2 #define HNS3_RD_OTHER_STATS_NUM 4 -#define HNS3_VALUES_BYTES 8 /* TQP stats */ struct hns3_tqp_stats { uint64_t rcb_tx_ring_pktnum_rcd; /* Total num of transmitted packets */ uint64_t rcb_rx_ring_pktnum_rcd; /* Total num of received packets */ - uint64_t rcb_tx_ring_pktnum[HNS3_MAX_TQP_NUM_PER_FUNC]; - uint64_t rcb_rx_ring_pktnum[HNS3_MAX_TQP_NUM_PER_FUNC]; + uint64_t *rcb_rx_ring_pktnum; + uint64_t *rcb_tx_ring_pktnum; }; /* mac stats, Statistics counters collected by the MAC, opcode id: 0x0032 */ @@ -111,6 +110,11 @@ struct hns3_mac_stats { uint64_t mac_rx_ctrl_pkt_num; }; +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 */ struct hns3_xstats_name_offset { char name[RTE_ETH_XSTATS_NAME_SIZE]; @@ -128,25 +132,41 @@ struct hns3_reset_stats; (offsetof(struct hns3_reset_stats, f)) #define HNS3_RX_BD_ERROR_STATS_FIELD_OFFSET(f) \ - (offsetof(struct hns3_rx_queue, f)) + (offsetof(struct hns3_rx_bd_errors_stats, f)) + +#define HNS3_RXQ_DFX_STATS_FIELD_OFFSET(f) \ + (offsetof(struct hns3_rx_dfx_stats, f)) + +#define HNS3_TXQ_DFX_STATS_FIELD_OFFSET(f) \ + (offsetof(struct hns3_tx_dfx_stats, f)) -#define HNS3_TX_ERROR_STATS_FIELD_OFFSET(f) \ - (offsetof(struct hns3_tx_queue, f)) +#define HNS3_RXQ_BASIC_STATS_FIELD_OFFSET(f) \ + (offsetof(struct hns3_rx_basic_stats, f)) + +#define HNS3_TXQ_BASIC_STATS_FIELD_OFFSET(f) \ + (offsetof(struct hns3_tx_basic_stats, f)) + +#define HNS3_IMISSED_STATS_FIELD_OFFSET(f) \ + (offsetof(struct hns3_rx_missed_stats, f)) int hns3_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats); int hns3_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, unsigned int n); int hns3_dev_xstats_reset(struct rte_eth_dev *dev); -int hns3_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, +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, uint32_t size); int hns3_stats_reset(struct rte_eth_dev *dev); +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); + #endif /* _HNS3_STATS_H_ */