Skip to content

Commit

Permalink
netdevsim: fix duplicated debugfs directory
Browse files Browse the repository at this point in the history
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 <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Sep 26, 2020
1 parent dfa6692 commit 090bc03
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/net/netdevsim/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void nsim_ethtool_init(struct netdevsim *ns)

ns->netdev->ethtool_ops = &nsim_ethtool_ops;

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

dir = debugfs_create_dir("pause", ethtool);
debugfs_create_bool("report_stats_rx", 0600, dir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

NSIM_ID=$((RANDOM % 1024))
NSIM_DEV_SYS=/sys/bus/netdevsim/devices/netdevsim$NSIM_ID
NSIM_DEV_DFS=/sys/kernel/debug/netdevsim/netdevsim$NSIM_ID
NSIM_DEV_DFS=/sys/kernel/debug/netdevsim/netdevsim$NSIM_ID/ports/0
NSIM_NETDEV=
num_passes=0
num_errors=0
Expand Down

0 comments on commit 090bc03

Please sign in to comment.