Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2250225pxk; Sun, 27 Sep 2020 00:17:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGFhMazgh3RSf9nQnAN6JLFXX4KKzxVvq3loCaDYUZhlGr/XIrhHTsx8O2v1f+L3sodOZN X-Received: by 2002:a17:906:7742:: with SMTP id o2mr10468632ejn.164.1601191034115; Sun, 27 Sep 2020 00:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601191034; cv=none; d=google.com; s=arc-20160816; b=NDSUjRJ4tXHVMO8IFl9xkeSoKcz9jSX+kX23eJEtHjyQ8ZlmTcwTT34yASQxnHjfB8 xuw0+MlY+uRAySz5+xUCHaFaOmeunivLjrZGs2OKKA0iXT20UH6dDZ7x3I69pD654Kn2 b9mHEyezV3pW9jFlOXxnrdJkqpKpO63vNIJ8PaCvL9pfXYmYjtnJq2tkh5GIKheCGOX5 VI5GvP4gk70MRU9pvwBng5KWIn8ulRnJvZjTVbIpWjRQI/tnRyQIKoKUOuTAqPSFCAK5 1fOyr2mAmpdu7GIsAvTgCbmKaOeuokIal3tlkDOay/a1EKz+ayI8DhxyIvlpeOFfje4f KMAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ux4nsjkoZhGM6XxyrHBJdGAEznJAUWeUZXNQ0fJ3cXs=; b=dA7grLJf6DSvCRqxlsS23YFlRW2tB9LwPbcqHo7BE32I7b679SMygOlDxk4pBJJT9D Tbb2RtTKa7UD3V3WF1jnkVpuh8x3hc4NSBFcwGP0/++NergV0a+eLglTj1SS0SQaZRXa fqeIVc4N3QcG0jkyjiZsqtEPtHyFi1ye3lEMfqlFj7lUFN/XoK+wq2c5QmKi4c224YGi AZarSqtl1cofep+qOY4qKaoaRdN/vC5TaF3Cm51kmhtEjsfSr1U+KqRWd9f9KdZrUrFg 6iMsEQItwnY5xrb/b3wwyYNlDv59HsGkTz6pEfzPZaaZfqSqY/MWexYsb8KiANGZ/Ras gB5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z4si4955666ejf.594.2020.09.27.00.16.51; Sun, 27 Sep 2020 00:17:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730490AbgI0HPs (ORCPT + 99 others); Sun, 27 Sep 2020 03:15:48 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:14248 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730331AbgI0HPr (ORCPT ); Sun, 27 Sep 2020 03:15:47 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 80729C7E5C3B3CBEFC70; Sun, 27 Sep 2020 15:15:41 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Sun, 27 Sep 2020 15:15:34 +0800 From: Huazhong Tan To: CC: , , , , , , Guangbin Huang , Huazhong Tan Subject: [PATCH net-next 06/10] net: hns3: add debugfs to dump device capabilities Date: Sun, 27 Sep 2020 15:12:44 +0800 Message-ID: <1601190768-50075-7-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601190768-50075-1-git-send-email-tanhuazhong@huawei.com> References: <1601190768-50075-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guangbin Huang Adds debugfs to dump each device capability whether is supported. Signed-off-by: Guangbin Huang Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c index 4fab82c..15333ec 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c @@ -244,6 +244,7 @@ static void hns3_dbg_help(struct hnae3_handle *h) dev_info(&h->pdev->dev, "queue info \n"); dev_info(&h->pdev->dev, "queue map\n"); dev_info(&h->pdev->dev, "bd info \n"); + dev_info(&h->pdev->dev, "dev capability\n"); if (!hns3_is_phys_func(h->pdev)) return; @@ -285,6 +286,27 @@ static void hns3_dbg_help(struct hnae3_handle *h) dev_info(&h->pdev->dev, "%s", printf_buf); } +static void hns3_dbg_dev_caps(struct hnae3_handle *h) +{ + struct hnae3_ae_dev *ae_dev = pci_get_drvdata(h->pdev); + unsigned long *caps; + + caps = ae_dev->caps; + + dev_info(&h->pdev->dev, "support FD: %s\n", + test_bit(HNAE3_DEV_SUPPORT_FD_B, caps) ? "yes" : "no"); + dev_info(&h->pdev->dev, "support GRO: %s\n", + test_bit(HNAE3_DEV_SUPPORT_GRO_B, caps) ? "yes" : "no"); + dev_info(&h->pdev->dev, "support FEC: %s\n", + test_bit(HNAE3_DEV_SUPPORT_FEC_B, caps) ? "yes" : "no"); + dev_info(&h->pdev->dev, "support UDP GSO: %s\n", + test_bit(HNAE3_DEV_SUPPORT_UDP_GSO_B, caps) ? "yes" : "no"); + dev_info(&h->pdev->dev, "support PTP: %s\n", + test_bit(HNAE3_DEV_SUPPORT_PTP_B, caps) ? "yes" : "no"); + dev_info(&h->pdev->dev, "support INT QL: %s\n", + test_bit(HNAE3_DEV_SUPPORT_INT_QL_B, caps) ? "yes" : "no"); +} + static ssize_t hns3_dbg_cmd_read(struct file *filp, char __user *buffer, size_t count, loff_t *ppos) { @@ -360,6 +382,8 @@ static ssize_t hns3_dbg_cmd_write(struct file *filp, const char __user *buffer, ret = hns3_dbg_queue_map(handle); else if (strncmp(cmd_buf, "bd info", 7) == 0) ret = hns3_dbg_bd_info(handle, cmd_buf); + else if (strncmp(cmd_buf, "dev capability", 14) == 0) + hns3_dbg_dev_caps(handle); else if (handle->ae_algo->ops->dbg_run_cmd) ret = handle->ae_algo->ops->dbg_run_cmd(handle, cmd_buf); else -- 2.7.4