From: Chengwen Feng <fengcheng...@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 <fengcheng...@huawei.com>
Signed-off-by: Dengdui Huang <huangdeng...@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(-)

diff --git a/drivers/net/hns3/hns3_dump.c b/drivers/net/hns3/hns3_dump.c
index 6c43ec486e..63c6b4ef2c 100644
--- a/drivers/net/hns3/hns3_dump.c
+++ b/drivers/net/hns3/hns3_dump.c
@@ -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,
diff --git a/drivers/net/hns3/hns3_ethdev_vf.c 
b/drivers/net/hns3/hns3_ethdev_vf.c
index 1cb8a9ccc1..632409c5d0 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -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;
diff --git a/drivers/net/hns3/hns3_mbx.h b/drivers/net/hns3/hns3_mbx.h
index c73f34fb32..651c6b9023 100644
--- a/drivers/net/hns3/hns3_mbx.h
+++ b/drivers/net/hns3/hns3_mbx.h
@@ -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;
-- 
2.33.0

Reply via email to