linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Huazhong Tan <tanhuazhong@huawei.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<salil.mehta@huawei.com>, <yisen.zhuang@huawei.com>,
	<linuxarm@huawei.com>, <nhorman@redhat.com>,
	liuzhongzhu <liuzhongzhu@huawei.com>,
	Peng Li <lipeng321@huawei.com>,
	Huazhong Tan <tanhuazhong@huawei.com>
Subject: [PATCH net-next 11/12] net: hns3: add queue's statistics update to service task
Date: Fri, 19 Apr 2019 11:05:46 +0800	[thread overview]
Message-ID: <1555643147-52407-12-git-send-email-tanhuazhong@huawei.com> (raw)
In-Reply-To: <1555643147-52407-1-git-send-email-tanhuazhong@huawei.com>

From: liuzhongzhu <liuzhongzhu@huawei.com>

This patch updates VF's TQP statistic info in the service task,
and adds a limitation to prevent update too frequently.

Signed-off-by: liuzhongzhu <liuzhongzhu@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 8 ++++++++
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index ac06568..f9d98f8 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -1649,6 +1649,7 @@ static void hclgevf_service_timer(struct timer_list *t)
 
 	mod_timer(&hdev->service_timer, jiffies + 5 * HZ);
 
+	hdev->stats_timer++;
 	hclgevf_task_schedule(hdev);
 }
 
@@ -1769,9 +1770,16 @@ static void hclgevf_keep_alive_task(struct work_struct *work)
 
 static void hclgevf_service_task(struct work_struct *work)
 {
+	struct hnae3_handle *handle;
 	struct hclgevf_dev *hdev;
 
 	hdev = container_of(work, struct hclgevf_dev, service_task);
+	handle = &hdev->nic;
+
+	if (hdev->stats_timer >= HCLGEVF_STATS_TIMER_INTERVAL) {
+		hclgevf_tqps_update_stats(handle);
+		hdev->stats_timer = 0;
+	}
 
 	/* request the link status from the PF. PF would be able to tell VF
 	 * about such updates in future so we might remove this later
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h
index d39c032..ee3a6cb 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h
@@ -116,6 +116,8 @@
 #define HCLGEVF_S_IP_BIT		BIT(3)
 #define HCLGEVF_V_TAG_BIT		BIT(4)
 
+#define HCLGEVF_STATS_TIMER_INTERVAL	(36)
+
 enum hclgevf_evt_cause {
 	HCLGEVF_VECTOR0_EVENT_RST,
 	HCLGEVF_VECTOR0_EVENT_MBX,
@@ -281,6 +283,7 @@ struct hclgevf_dev {
 	struct hnae3_client *nic_client;
 	struct hnae3_client *roce_client;
 	u32 flag;
+	u32 stats_timer;
 };
 
 static inline bool hclgevf_is_reset_pending(struct hclgevf_dev *hdev)
-- 
2.7.4


  parent reply	other threads:[~2019-04-19  3:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-19  3:05 [PATCH net-next 00/12] net: hns3: add some DFX info for HNS3 driver Huazhong Tan
2019-04-19  3:05 ` [PATCH net-next 01/12] net: hns3: add reset statistics info for PF Huazhong Tan
2019-04-19  3:05 ` [PATCH net-next 02/12] net: hns3: add reset statistics for VF Huazhong Tan
2019-04-19  3:05 ` [PATCH net-next 03/12] net: hns3: add some debug information for hclge_check_event_cause Huazhong Tan
2019-04-19  3:05 ` [PATCH net-next 04/12] net: hns3: add some debug info for hclgevf_get_mbx_resp() Huazhong Tan
2019-04-19  3:05 ` [PATCH net-next 05/12] net: hns3: refine tx timeout count handle Huazhong Tan
2019-04-19  3:05 ` [PATCH net-next 06/12] net: hns3: fix loop condition of hns3_get_tx_timeo_queue_info() Huazhong Tan
2019-04-19  3:05 ` [PATCH net-next 07/12] net: hns3: dump more information when tx timeout happens Huazhong Tan
2019-04-19  3:05 ` [PATCH net-next 08/12] net: hns3: Add support for netif message level settings Huazhong Tan
2019-04-19  3:05 ` [PATCH net-next 09/12] net: hns3: add support for dump ncl config by debugfs Huazhong Tan
2019-04-19  3:05 ` [PATCH net-next 10/12] net: hns3: Add handling of MAC tunnel interruption Huazhong Tan
2019-04-19 11:29   ` Neil Horman
2019-04-20  1:05     ` tanhuazhong
2019-04-19  3:05 ` Huazhong Tan [this message]
2019-04-19  3:05 ` [PATCH net-next 12/12] net: hns3: add function type check for debugfs help information Huazhong Tan
2019-04-20  1:43 ` [PATCH net-next 00/12] net: hns3: add some DFX info for HNS3 driver David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1555643147-52407-12-git-send-email-tanhuazhong@huawei.com \
    --to=tanhuazhong@huawei.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=lipeng321@huawei.com \
    --cc=liuzhongzhu@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=salil.mehta@huawei.com \
    --cc=yisen.zhuang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).