From patchwork Fri Nov 9 22:07:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 150698 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp392666ljp; Fri, 9 Nov 2018 14:09:15 -0800 (PST) X-Google-Smtp-Source: AJdET5f/r1SzF5BlBZUcvMUt9tWKI5I1c2qydqE05D25Fn3vHBer/XDyh+aeLJdJif/ZTrVcVdgk X-Received: by 2002:a62:c6c8:: with SMTP id x69-v6mr10836363pfk.37.1541801355292; Fri, 09 Nov 2018 14:09:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541801355; cv=none; d=google.com; s=arc-20160816; b=ADUVUAnwlNDDqECu1tQurfdggTKXMA4/sZPtloRtnF667HxrYqPQcJlgCZj93TZ9CV t2gpq9iePzIkKzOESUaLEEB3Tp60NURp0czRi1tX/qqxcxeFVBNEcjjDj+5O9jX20To2 CljYkW2IuWTZgVUHx7WNgdTpq1JWhN1Z4Zh2+96SYuG65/exQRem4kKfsDOZjxnRdVYt 4MGHrh1m+ZNXPlsM4rcM0DgEY3V28B82GU6+lk7Y0IJxjljlyA7Nql7NJLgbiULbvacb 7B6GnPHK5b/+8T/9EwRYJS1FQl+oVZla63+DOfwicTcerLi6UQONWw/++XSYeLUs/l91 JcvA== 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=DkKo/5N3uLNPgJasJvcHFn7KVNi8fekdtkbKzs+BcNA=; b=S00W+E3lMxXMZGRNJF9GqnaT5YU9OFSCIs9ut/yLj87qoOvmXH3HWAyhOHWvr1MtMK OguEnLEZoIoglcnK3b7yQNF2bZsorrN8UBppXM5yDLqcHKOsoyVhmQBURY8pASxlnOwq MsW1CxiSPwtJ6GMgKBXvwnprj7FOrkDuQEuBTRWUUMOsEoWAB/tlyjfiu38U+tZKenAV 5mRySbpX8TYftx4LQqW0OYXmm6acHFMEVkjNGzi+Yk3bDIULRxJ3Vc0VqevrsuCkM5fk +Ci82NgHnT8N/YoGV4ukIJiRkLKv/AqhOQ1C55jghj5qYiE9/vp1wNhGW6+zlHsHJEaw icZQ== 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 t13si7341906pgm.175.2018.11.09.14.09.15; Fri, 09 Nov 2018 14:09:15 -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 S1728814AbeKJHvn (ORCPT + 32 others); Sat, 10 Nov 2018 02:51:43 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:15076 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728644AbeKJHvn (ORCPT ); Sat, 10 Nov 2018 02:51:43 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 13CE87F18F831; Sat, 10 Nov 2018 06:09:09 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.54) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.408.0; Sat, 10 Nov 2018 06:09:03 +0800 From: Salil Mehta To: CC: , , , , , , , , , , , liuzhongzhu Subject: [RFC PATCH 08/10] net: hns3: Add PFC config info query function Date: Fri, 9 Nov 2018 22:07:41 +0000 Message-ID: <20181109220743.10264-9-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20181109220743.10264-1-salil.mehta@huawei.com> References: <20181109220743.10264-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 27757be..8edb4e9 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c @@ -133,6 +133,7 @@ static void hns3_dbg_help(struct hnae3_handle *h) dev_info(&h->pdev->dev, "dump tc\n"); dev_info(&h->pdev->dev, "dump tm\n"); dev_info(&h->pdev->dev, "dump checksum\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 4fa546f..a71e9d0 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c @@ -341,6 +341,29 @@ static void hclge_dbg_dump_checksum(struct hclge_dev *hdev) "inner_sctp", "enable", "disable"); } +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) { @@ -410,6 +433,8 @@ int hclge_dbg_run_cmd(struct hnae3_handle *handle, char *cmd_buf) hclge_dbg_dump_tm(hdev); } else if (strncmp(cmd_buf, "dump checksum", 13) == 0) { hclge_dbg_dump_checksum(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;