]> git.ipfire.org Git - thirdparty/linux.git/commit
net: mana: Fix incorrect speed reported by debugfs
authorErni Sri Satya Vennela <ernis@linux.microsoft.com>
Wed, 5 Nov 2025 19:04:28 +0000 (11:04 -0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 8 Nov 2025 02:49:14 +0000 (18:49 -0800)
commit140039580efa96d18576a6c9fa6b1158be8a1d0f
treeab1233471797c7ac32ffa244c38f903590aaa2f6
parent3f47e67dff1f7266e112c50313d63824f6f17102
net: mana: Fix incorrect speed reported by debugfs

Once the netshaper is created for MANA, the current bandwidth
is reported in debugfs like this:

$ sudo ./tools/net/ynl/pyynl/cli.py \
  --spec Documentation/netlink/specs/net_shaper.yaml \
  --do set \
  --json '{"ifindex":'3',
           "handle":{ "scope": "netdev", "id":'1' },
           "bw-max": 200000000 }'
None

$ sudo cat /sys/kernel/debug/mana/1/vport0/current_speed
200

After the shaper  is deleted, it is expected to report
the maximum speed supported by the SKU. But currently it is
reporting 0, which is incorrect.

Fix this inconsistency, by resetting apc->speed to apc->max_speed
during deletion of the shaper object. This will improve
readability and debuggability.

Signed-off-by: Erni Sri Satya Vennela <ernis@linux.microsoft.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/1762369468-32570-1-git-send-email-ernis@linux.microsoft.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microsoft/mana/mana_en.c