From patchwork Thu Nov 22 14:09:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 151784 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp798644ljp; Thu, 22 Nov 2018 06:11:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/XhhnqFLqdbabecvXBRAdjQuqGwfYinw04vfiEE02rnO2Dl2wOlyWdXKNQf8zryAs71qFpK X-Received: by 2002:a63:2f86:: with SMTP id v128mr9866994pgv.407.1542895899784; Thu, 22 Nov 2018 06:11:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542895899; cv=none; d=google.com; s=arc-20160816; b=kTj5VymtWnxANlN9EivOhsw/pzN7pZ+HNoI3utOwHb6pjqsAmiVHBn/6i7l/hFD5a1 agFksCcYTIrABmMlISPgYjXXJFe6ncjBZbqBMjjALzuW+8M9B6FRKg0gtlTqDLAgCCw7 zAiYzKkZ292diE6HOsXq8FU4sB6lqhX+pXj4WxUUrja9WC0BGL2KDYSB0t66QbZNY5jd HwcRMWeO6iCuM+sr9hUEeF8xFU8FJNMIohiv2qJv8XF3gD0+ljYF0aWlLpNA4Ruvz6Hm qtRAy1om/dvjCquFhX1979TlgLr4K7ndiTnsI+ukdOyvkI5KnzK8NnkQRdiWluJ8H4pu VNFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=oXh3bXxNKtAMrzJkEwuLYOoCvB3VHHf2hQhJyZh+6tc=; b=mbQvDSkiguLaBdtpNjYjf2ZpXxTl7lov4VlDsHD7qtYvaKLVzjQ0QFvE37CdONiVfN OEWFT3Bv7NyJvhfyPfdDhS0NsIlmvXuA5/qpKuhwTEMqN1IllHOIIi1puvTkmKXTQ7ss dhxR45TCqlVX9y1i8B/Yw5quPChEeCkG/Eg4JwQhPmXy0a4BeurMCy6xBhiylZSLIstX qWV/GnA/9Jts0OPAR9R829YH2nnLnbAZx3uYgYCc0zBkS/qZ55XAwinTVa/n3qiEp4AZ QJbRziDmch5KxwT/Z9DiCloCDI1vRG0MVe4OPCI4UDES35iBTgYoUQN0+IO54xUA/Vi+ n+ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si46328333pgh.368.2018.11.22.06.11.39; Thu, 22 Nov 2018 06:11:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404124AbeKWAvJ (ORCPT + 32 others); Thu, 22 Nov 2018 19:51:09 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:15579 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2391738AbeKWAvC (ORCPT ); Thu, 22 Nov 2018 19:51:02 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 3463EE010CC1E; Thu, 22 Nov 2018 22:11:19 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.54) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.408.0; Thu, 22 Nov 2018 22:11:09 +0800 From: Salil Mehta To: CC: , , , , , , , liuzhongzhu Subject: [PATCH V2 net-next 6/8] net: hns3: Add "qos pause" config info query function Date: Thu, 22 Nov 2018 14:09:46 +0000 Message-ID: <20181122140948.23504-7-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20181122140948.23504-1-salil.mehta@huawei.com> References: <20181122140948.23504-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: liuzhongzhu This patch prints qos pause config information. debugfs command: echo dump qos pause cfg > cmd Sample Command: root@(none)# echo dump qos pause cfg > cmd hns3 0000:7d:00.0: dump qos pause cfg hns3 0000:7d:00.0: pause_trans_gap: 0xff hns3 0000:7d:00.0: pause_trans_time: 0xffff root@(none)# Signed-off-by: liuzhongzhu Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 1 + .../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 25 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c index 478c133..6258695 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c @@ -132,6 +132,7 @@ static void hns3_dbg_help(struct hnae3_handle *h) dev_info(&h->pdev->dev, "dump fd tcam\n"); dev_info(&h->pdev->dev, "dump tc\n"); dev_info(&h->pdev->dev, "dump tm\n"); + dev_info(&h->pdev->dev, "dump qos pause cfg\n"); } static ssize_t hns3_dbg_cmd_read(struct file *filp, char __user *buffer, diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c index e8f1233..37b312b 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c @@ -242,6 +242,29 @@ static void hclge_dbg_dump_tm(struct hclge_dev *hdev) cmd, ret); } +static void hclge_dbg_dump_qos_pause_cfg(struct hclge_dev *hdev) +{ + struct hclge_cfg_pause_param_cmd *pause_param; + struct hclge_desc desc; + int ret; + + hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_CFG_MAC_PARA, true); + + ret = hclge_cmd_send(&hdev->hw, &desc, 1); + if (ret) { + dev_err(&hdev->pdev->dev, "dump checksum fail, status is %d.\n", + ret); + return; + } + + pause_param = (struct hclge_cfg_pause_param_cmd *)desc.data; + dev_info(&hdev->pdev->dev, "dump qos pause cfg\n"); + dev_info(&hdev->pdev->dev, "pause_trans_gap: 0x%x\n", + pause_param->pause_trans_gap); + dev_info(&hdev->pdev->dev, "pause_trans_time: 0x%x\n", + pause_param->pause_trans_time); +} + static void hclge_dbg_fd_tcam_read(struct hclge_dev *hdev, u8 stage, bool sel_x, u32 loc) { @@ -307,6 +330,8 @@ int hclge_dbg_run_cmd(struct hnae3_handle *handle, char *cmd_buf) hclge_dbg_dump_tc(hdev); } else if (strncmp(cmd_buf, "dump tm", 7) == 0) { hclge_dbg_dump_tm(hdev); + } else if (strncmp(cmd_buf, "dump qos pause cfg", 18) == 0) { + hclge_dbg_dump_qos_pause_cfg(hdev); } else { dev_info(&hdev->pdev->dev, "unknown command\n"); return -EINVAL;