Skip to content

Commit 090bc03

Browse files
kuba-moodavem330
authored andcommitted
netdevsim: fix duplicated debugfs directory
The "ethtool" debugfs directory holds per-netdev knobs, so move it from the device instance directory to the port directory. This fixes the following warning when creating multiple ports: debugfs: Directory 'ethtool' with parent 'netdevsim1' already present! Fixes: ff1f7c1 ("netdevsim: add pause frame stats") Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent dfa6692 commit 090bc03

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/net/netdevsim/ethtool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void nsim_ethtool_init(struct netdevsim *ns)
5454

5555
ns->netdev->ethtool_ops = &nsim_ethtool_ops;
5656

57-
ethtool = debugfs_create_dir("ethtool", ns->nsim_dev->ddir);
57+
ethtool = debugfs_create_dir("ethtool", ns->nsim_dev_port->ddir);
5858

5959
dir = debugfs_create_dir("pause", ethtool);
6060
debugfs_create_bool("report_stats_rx", 0600, dir,

tools/testing/selftests/drivers/net/netdevsim/ethtool-pause.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
NSIM_ID=$((RANDOM % 1024))
55
NSIM_DEV_SYS=/sys/bus/netdevsim/devices/netdevsim$NSIM_ID
6-
NSIM_DEV_DFS=/sys/kernel/debug/netdevsim/netdevsim$NSIM_ID
6+
NSIM_DEV_DFS=/sys/kernel/debug/netdevsim/netdevsim$NSIM_ID/ports/0
77
NSIM_NETDEV=
88
num_passes=0
99
num_errors=0

0 commit comments

Comments
 (0)