1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2022 HiSilicon Limited
5 #include <rte_kvargs.h>
6 #include <rte_bus_pci.h>
7 #include <ethdev_pci.h>
10 #include "hns3_common.h"
11 #include "hns3_logs.h"
12 #include "hns3_regs.h"
13 #include "hns3_rxtx.h"
16 get_adapter_state_name(uint32_t state)
18 static const char * const state_name[] = {
32 if (state < RTE_DIM(state_name))
33 return state_name[state];
39 get_io_func_hint_name(uint32_t hint)
42 case HNS3_IO_FUNC_HINT_NONE:
44 case HNS3_IO_FUNC_HINT_VEC:
46 case HNS3_IO_FUNC_HINT_SVE:
48 case HNS3_IO_FUNC_HINT_SIMPLE:
50 case HNS3_IO_FUNC_HINT_COMMON:
58 get_device_basic_info(FILE *file, struct rte_eth_dev *dev)
60 struct hns3_adapter *hns = dev->data->dev_private;
61 struct hns3_hw *hw = &hns->hw;
64 " - Device Base Info:\n"
66 "\t -- adapter_state=%s\n"
67 "\t -- nb_rx_queues=%u nb_tx_queues=%u\n"
68 "\t -- total_tqps_num=%u tqps_num=%u intr_tqps_num=%u\n"
69 "\t -- rss_size_max=%u alloc_rss_size=%u tx_qnum_per_tc=%u\n"
70 "\t -- min_tx_pkt_len=%u intr_mapping_mode=%u vlan_mode=%u\n"
71 "\t -- tso_mode=%u max_non_tso_bd_num=%u\n"
72 "\t -- max_tm_rate=%u Mbps\n"
73 "\t -- set link down: %s\n"
74 "\t -- rx_func_hint=%s tx_func_hint=%s\n"
75 "\t -- dev_flags: lsc=%d\n"
76 "\t -- intr_conf: lsc=%u rxq=%u\n",
78 get_adapter_state_name(hw->adapter_state),
79 dev->data->nb_rx_queues, dev->data->nb_tx_queues,
80 hw->total_tqps_num, hw->tqps_num, hw->intr_tqps_num,
81 hw->rss_size_max, hw->alloc_rss_size, hw->tx_qnum_per_tc,
82 hw->min_tx_pkt_len, hw->intr.mapping_mode, hw->vlan_mode,
83 hw->tso_mode, hw->max_non_tso_bd_num,
85 hw->set_link_down ? "Yes" : "No",
86 get_io_func_hint_name(hns->rx_func_hint),
87 get_io_func_hint_name(hns->tx_func_hint),
88 !!(dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC),
89 dev->data->dev_conf.intr_conf.lsc,
90 dev->data->dev_conf.intr_conf.rxq);
94 hns3_eth_dev_priv_dump(struct rte_eth_dev *dev, FILE *file)
96 get_device_basic_info(file, dev);