[4/6] net/hns3: VF support parse max TC number
Checks
Commit Message
From: Chengwen Feng <fengchengwen@huawei.com>
The mailbox message HNS3_MBX_GET_BASIC_INFO can obtain the maximum
number of TCs of the device. The VF does not support multiple TCs,
therefore, this field is not saved.
Now the VF needs to support multiple TCs, therefore, this field needs
to be saved.
This commit also support dump the TC info.
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
---
drivers/net/hns3/hns3_dump.c | 2 ++
drivers/net/hns3/hns3_ethdev_vf.c | 1 +
drivers/net/hns3/hns3_mbx.h | 2 +-
3 files changed, 4 insertions(+), 1 deletion(-)
@@ -209,6 +209,7 @@ hns3_get_device_basic_info(FILE *file, struct rte_eth_dev *dev)
" - Device Base Info:\n"
"\t -- name: %s\n"
"\t -- adapter_state=%s\n"
+ "\t -- tc_max=%u tc_num=%u\n"
"\t -- nb_rx_queues=%u nb_tx_queues=%u\n"
"\t -- total_tqps_num=%u tqps_num=%u intr_tqps_num=%u\n"
"\t -- rss_size_max=%u alloc_rss_size=%u tx_qnum_per_tc=%u\n"
@@ -221,6 +222,7 @@ hns3_get_device_basic_info(FILE *file, struct rte_eth_dev *dev)
"\t -- intr_conf: lsc=%u rxq=%u\n",
dev->data->name,
hns3_get_adapter_state_name(hw->adapter_state),
+ hw->dcb_info.tc_max, hw->dcb_info.num_tc,
dev->data->nb_rx_queues, dev->data->nb_tx_queues,
hw->total_tqps_num, hw->tqps_num, hw->intr_tqps_num,
hw->rss_size_max, hw->alloc_rss_size, hw->tx_qnum_per_tc,
@@ -853,6 +853,7 @@ hns3vf_get_basic_info(struct hns3_hw *hw)
}
basic_info = (struct hns3_basic_info *)resp_msg;
+ hw->dcb_info.tc_max = basic_info->tc_max;
hw->dcb_info.hw_tc_map = basic_info->hw_tc_map;
hw->dcb_info.num_tc = hns3vf_get_num_tc(hw);
hw->pf_vf_if_version = basic_info->pf_vf_if_version;
@@ -53,7 +53,7 @@ enum HNS3_MBX_OPCODE {
struct hns3_basic_info {
uint8_t hw_tc_map;
- uint8_t rsv;
+ uint8_t tc_max;
uint16_t pf_vf_if_version;
/* capabilities of VF dependent on PF */
uint32_t caps;