Skip to content

Commit a2a7221

Browse files
Luo JiePaolo Abeni
authored andcommitted
net: ethernet: qualcomm: Add PPE debugfs support for PPE counters
The PPE hardware counters maintain counters for packets handled by the various functional blocks of PPE. They help in tracing the packets passed through PPE and debugging any packet drops. The counters displayed by this debugfs file are ones that are common for all Ethernet ports, and they do not include the counters that are specific for a MAC port. Hence they cannot be displayed using ethtool. The per-MAC counters will be supported using "ethtool -S" along with the netdevice driver. The PPE hardware various type counters are made available through the debugfs files under directory "/sys/kernel/debug/ppe/". Signed-off-by: Luo Jie <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 8cc72c6 commit a2a7221

File tree

6 files changed

+1012
-1
lines changed

6 files changed

+1012
-1
lines changed

drivers/net/ethernet/qualcomm/ppe/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
#
55

66
obj-$(CONFIG_QCOM_PPE) += qcom-ppe.o
7-
qcom-ppe-objs := ppe.o ppe_config.o
7+
qcom-ppe-objs := ppe.o ppe_config.o ppe_debugfs.o

drivers/net/ethernet/qualcomm/ppe/ppe.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "ppe.h"
1818
#include "ppe_config.h"
19+
#include "ppe_debugfs.h"
1920

2021
#define PPE_PORT_MAX 8
2122
#define PPE_CLK_RATE 353000000
@@ -204,11 +205,20 @@ static int qcom_ppe_probe(struct platform_device *pdev)
204205
if (ret)
205206
return dev_err_probe(dev, ret, "PPE HW config failed\n");
206207

208+
ppe_debugfs_setup(ppe_dev);
207209
platform_set_drvdata(pdev, ppe_dev);
208210

209211
return 0;
210212
}
211213

214+
static void qcom_ppe_remove(struct platform_device *pdev)
215+
{
216+
struct ppe_device *ppe_dev;
217+
218+
ppe_dev = platform_get_drvdata(pdev);
219+
ppe_debugfs_teardown(ppe_dev);
220+
}
221+
212222
static const struct of_device_id qcom_ppe_of_match[] = {
213223
{ .compatible = "qcom,ipq9574-ppe" },
214224
{}
@@ -221,6 +231,7 @@ static struct platform_driver qcom_ppe_driver = {
221231
.of_match_table = qcom_ppe_of_match,
222232
},
223233
.probe = qcom_ppe_probe,
234+
.remove = qcom_ppe_remove,
224235
};
225236
module_platform_driver(qcom_ppe_driver);
226237

drivers/net/ethernet/qualcomm/ppe/ppe.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111

1212
struct device;
1313
struct regmap;
14+
struct dentry;
1415

1516
/**
1617
* struct ppe_device - PPE device private data.
1718
* @dev: PPE device structure.
1819
* @regmap: PPE register map.
1920
* @clk_rate: PPE clock rate.
2021
* @num_ports: Number of PPE ports.
22+
* @debugfs_root: Debugfs root entry.
2123
* @num_icc_paths: Number of interconnect paths.
2224
* @icc_paths: Interconnect path array.
2325
*
@@ -30,6 +32,7 @@ struct ppe_device {
3032
struct regmap *regmap;
3133
unsigned long clk_rate;
3234
unsigned int num_ports;
35+
struct dentry *debugfs_root;
3336
unsigned int num_icc_paths;
3437
struct icc_bulk_data icc_paths[] __counted_by(num_icc_paths);
3538
};

0 commit comments

Comments
 (0)