From patchwork Fri Nov 9 22:07:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 150703 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp393727ljp; Fri, 9 Nov 2018 14:10:23 -0800 (PST) X-Google-Smtp-Source: AJdET5foRi4mjukhhavM4IEnW3RP1rDAbA/YPJtiHs306APhIICZHtJuKAyDB/v+ViKcB1YxZJVN X-Received: by 2002:a63:d252:: with SMTP id t18mr9072685pgi.133.1541801423067; Fri, 09 Nov 2018 14:10:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541801423; cv=none; d=google.com; s=arc-20160816; b=C9hD9AH0TpDRoHP4JA8nBTfJv/K2rmAitqJ+1/4ZrKtSsovO7d2+bgpPhrl8Lc54Xg DwTN9AiAI9X5z9oIDXIAvf6HbH5pmSVjGBAdwIhDYkaocDTHfdl92QdiN855TMWvWPTY f+RmM1q+eplc0lcVPp1wSy0ZQzPgi5MgXsRzkDuBGFN3bcy5XgRtVSl+YtU8EUMmTIAZ RWqpA4D4HNdE9rLyHU7gqPvSEqJyHo07pOqFhm1fTElLOKCSike8vkaT/G3bHusO4hrC H55Ih17no2/AtsQHjLrrjBYl6UQ0hE5pKZzgbdLGfhEbDPI/7ObjYk7ZgYh+t/h33GK1 CIHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=rz57P8AG4xfZiWe/T/+IZwu7hrbJf+VLdPiwmbTQs/c=; b=TmN8H0wK80UHAXaYhyVs+kLnf4oMUCqKqUVqDjslCmVVKolqpcIiGvUcTr+uTjfoSi Os2mS3408z12qcqpgUb4Kez3XRDyJt2gHao31UQzd0XKpnzcMMFS2je3N2FonVoVMPUi 8SuTfQtiYe8tRorqnhTP0C8spOpLzDSHh5Jj2p4e0FRbOlo11Bbn3sDdOqNheT5sM0sK u1q+nGJ0V65t4TD/pXkXMWmod5hgIXn+V/iVXL5BI2p7zLSC73s4ncNheBg6iQEbeFoy DSUTNVpBpR62nqY6OWzbuJs7dcNyA+uijZFpgz/d6GSESL38dxuGAb4CV9wN9hsPjgIY SUCg== 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 u129-v6si1382718pfb.201.2018.11.09.14.10.22; Fri, 09 Nov 2018 14:10:23 -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 S1728547AbeKJHvT (ORCPT + 32 others); Sat, 10 Nov 2018 02:51:19 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:15073 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728468AbeKJHvT (ORCPT ); Sat, 10 Nov 2018 02:51:19 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id AD4E020D40163; Sat, 10 Nov 2018 06:08:43 +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:08:35 +0800 From: Salil Mehta To: CC: , , , , , , , , , , Subject: [RFC PATCH 00/10] net: hns3: Adds support of debugfs to HNS3 driver Date: Fri, 9 Nov 2018 22:07:33 +0000 Message-ID: <20181109220743.10264-1-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 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 This patchset adds support of debugfs to the HNS3 driver. Support has been added to query info related to below items: 1. Queue related 2. Flow Director 3. Promisc mode 4. TC config 5. Transmit Module/Scheduler 6. Checksum 7. QoS buffer 8. QoS prio map Note: This patch-set has been floated as an RFC as it is an an effort to understand what type information can be fetched from the kernel and how it can be exported to user-space in the HNS3 driver. There are few questions revolving our minds like, 1. Is it allowed to dump the information of register in the syslog using the printk or we should use debugfs to export information to user-space using file interface only? 2. Can we export the information from the firmware to the userspace using debugfs? 3. Debugfs looks more unstructured unlike sysfs. Is there any de-facto standard of the user-api or drivers are allowed to use it in any way to expose the information from kernel. 4. Last but not least, is there any good driver reference within kernel which can be used as a reference. We could see Intel IXGBE/i40e/mellanox drivers having debugfs interface but with some discussions it looked they have some of the *might be* objectionable implementations. 5. With the idea started from Greg KH original patch Link: https://lwn.net/Articles/115282/ Is the heart-and-soul of debugfs i.e. the reason why it was created still the same? It would be a great help if people can help in throwing light and reviewing this patch-set. Thanks! liuzhongzhu (10): net: hns3: Add debugfs framework registration net: hns3: Add "queue info" query function net: hns3: Add "FD flow table" info query function net: hns3: Add "promisc mode" config info query function net: hns3: Add "tc config" info query function net: hns3: Add "tm config" info query function net: hns3: Add checksum info query function net: hns3: Add PFC config info query function net: hns3: Add "qos prio map" info query function net: hns3: Add "qos buffer" config info query function drivers/net/ethernet/hisilicon/hns3/Makefile | 2 +- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 2 + drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 264 +++++++++ drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 17 +- drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 4 + .../net/ethernet/hisilicon/hns3/hns3pf/Makefile | 2 +- .../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 4 + .../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 589 +++++++++++++++++++++ .../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.h | 24 + .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 1 + .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 1 + .../net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h | 6 + 12 files changed, 912 insertions(+), 4 deletions(-) create mode 100644 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c create mode 100644 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c create mode 100644 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.h -- 2.7.4