提交 982e52ff 编写于 作者: C Chiqijun 提交者: Yang Yingliang

net/hinic: VF does not display firmware statistics

driver inclusion
category: bugfix
bugzilla: 4472

-----------------------------------------------------------------------

It takes a long time to obtain the firmware statistics, which can easily
cause the hot migration to fail. Therefore, delete the firmware statistics
of the VF, and the corresponding statistics can be obtained from the PF.
Signed-off-by: NChiqijun <chiqijun@huawei.com>
Reviewed-by: NLuoshaokai <luoshaokai@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 97e14465
...@@ -1170,11 +1170,13 @@ static int hinic_get_sset_count(struct net_device *netdev, int sset) ...@@ -1170,11 +1170,13 @@ static int hinic_get_sset_count(struct net_device *netdev, int sset)
case ETH_SS_STATS: case ETH_SS_STATS:
q_num = nic_dev->num_qps; q_num = nic_dev->num_qps;
count = ARRAY_LEN(hinic_netdev_stats) + count = ARRAY_LEN(hinic_netdev_stats) +
ARRAY_LEN(hinic_nic_dev_stats) + ARRAY_LEN(hinic_nic_dev_stats) +
ARRAY_LEN(hinic_function_stats) +
(ARRAY_LEN(hinic_tx_queue_stats) + (ARRAY_LEN(hinic_tx_queue_stats) +
ARRAY_LEN(hinic_rx_queue_stats)) * q_num; ARRAY_LEN(hinic_rx_queue_stats)) * q_num;
if (!HINIC_FUNC_IS_VF(nic_dev->hwdev))
count += ARRAY_LEN(hinic_function_stats);
if (!HINIC_FUNC_IS_VF(nic_dev->hwdev) && if (!HINIC_FUNC_IS_VF(nic_dev->hwdev) &&
FUNC_SUPPORT_PORT_SETTING(nic_dev->hwdev)) FUNC_SUPPORT_PORT_SETTING(nic_dev->hwdev))
count += ARRAY_LEN(hinic_port_stats); count += ARRAY_LEN(hinic_port_stats);
...@@ -1625,15 +1627,19 @@ static void hinic_get_ethtool_stats(struct net_device *netdev, ...@@ -1625,15 +1627,19 @@ static void hinic_get_ethtool_stats(struct net_device *netdev,
data[i] = (hinic_nic_dev_stats[j].size == data[i] = (hinic_nic_dev_stats[j].size ==
sizeof(u64)) ? *(u64 *)p : *(u32 *)p; sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
} }
err = hinic_get_vport_stats(nic_dev->hwdev, &vport_stats);
if (err)
nicif_err(nic_dev, drv, netdev,
"Failed to get function stats from fw\n");
for (j = 0; j < ARRAY_LEN(hinic_function_stats); j++, i++) { if (!HINIC_FUNC_IS_VF(nic_dev->hwdev)) {
p = (char *)(&vport_stats) + hinic_function_stats[j].offset; err = hinic_get_vport_stats(nic_dev->hwdev, &vport_stats);
data[i] = (hinic_function_stats[j].size == if (err)
sizeof(u64)) ? *(u64 *)p : *(u32 *)p; nicif_err(nic_dev, drv, netdev,
"Failed to get function stats from fw\n");
for (j = 0; j < ARRAY_LEN(hinic_function_stats); j++, i++) {
p = (char *)(&vport_stats) +
hinic_function_stats[j].offset;
data[i] = (hinic_function_stats[j].size ==
sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
}
} }
if (!HINIC_FUNC_IS_VF(nic_dev->hwdev) && if (!HINIC_FUNC_IS_VF(nic_dev->hwdev) &&
...@@ -1689,10 +1695,12 @@ static void hinic_get_strings(struct net_device *netdev, ...@@ -1689,10 +1695,12 @@ static void hinic_get_strings(struct net_device *netdev,
p += ETH_GSTRING_LEN; p += ETH_GSTRING_LEN;
} }
for (i = 0; i < ARRAY_LEN(hinic_function_stats); i++) { if (!HINIC_FUNC_IS_VF(nic_dev->hwdev)) {
memcpy(p, hinic_function_stats[i].name, for (i = 0; i < ARRAY_LEN(hinic_function_stats); i++) {
ETH_GSTRING_LEN); memcpy(p, hinic_function_stats[i].name,
p += ETH_GSTRING_LEN; ETH_GSTRING_LEN);
p += ETH_GSTRING_LEN;
}
} }
if (!HINIC_FUNC_IS_VF(nic_dev->hwdev) && if (!HINIC_FUNC_IS_VF(nic_dev->hwdev) &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册