summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
diff options
context:
space:
mode:
authorJian Shen2018-01-05 11:18:10 +0100
committerDavid S. Miller2018-01-08 20:06:17 +0100
commitc5f654805c9b145f035e06551c5c3dcf3d8db652 (patch)
treebb58462e141679893ec6894232398dc5f1a9fdcd /drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
parentnet: hns3: Remove repeat statistic of rx_errors (diff)
downloadkernel-qcow2-linux-c5f654805c9b145f035e06551c5c3dcf3d8db652.tar.gz
kernel-qcow2-linux-c5f654805c9b145f035e06551c5c3dcf3d8db652.tar.xz
kernel-qcow2-linux-c5f654805c9b145f035e06551c5c3dcf3d8db652.zip
net: hns3: Modify the update period of packet statistics
It takes more than 200 query response messages between driver and IMP, while updating the packet statistics. It's too heavy for IMP to update it per second. Extend the update period of packet statistics data from 1 second to 300 seconds(if too long, the statistics may overflow). As a result, we need to update it while querying with ifconfig tool to keep the statistics data fresh. Signed-off-by: Jian Shen <shenjian15@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hns3_enet.c')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3_enet.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 565d85db30df..79c5daa26a43 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -1126,6 +1126,7 @@ hns3_nic_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
{
struct hns3_nic_priv *priv = netdev_priv(netdev);
int queue_num = priv->ae_handle->kinfo.num_tqps;
+ struct hnae3_handle *handle = priv->ae_handle;
struct hns3_enet_ring *ring;
unsigned int start;
unsigned int idx;
@@ -1134,6 +1135,8 @@ hns3_nic_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
u64 tx_pkts = 0;
u64 rx_pkts = 0;
+ handle->ae_algo->ops->update_stats(handle, &netdev->stats);
+
for (idx = 0; idx < queue_num; idx++) {
/* fetch the tx stats */
ring = priv->ring_data[idx].ring;