netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v3] net: mana: Fix incorrect speed reported by debugfs
@ 2025-11-05 19:04 Erni Sri Satya Vennela
  2025-11-05 22:15 ` Jacob Keller
  2025-11-08  3:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Erni Sri Satya Vennela @ 2025-11-05 19:04 UTC (permalink / raw)
  To: kys, haiyangz, wei.liu, decui, andrew+netdev, davem, edumazet,
	kuba, pabeni, shradhagupta, ssengar, ernis, dipayanroy,
	shirazsaleem, kotaranov, longli, linux-hyperv, netdev,
	linux-kernel

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>
---
Changes in v3:
* Remove Fixes tag.
Changes in v2:
* Add Fixes tag.
---
 drivers/net/ethernet/microsoft/mana/mana_en.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
index 0142fd98392c..9d56bfefd755 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_en.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
@@ -814,7 +814,7 @@ static int mana_shaper_del(struct net_shaper_binding *binding,
 		/* Reset mana port context parameters */
 		apc->handle.id = 0;
 		apc->handle.scope = NET_SHAPER_SCOPE_UNSPEC;
-		apc->speed = 0;
+		apc->speed = apc->max_speed;
 	}
 
 	return err;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next v3] net: mana: Fix incorrect speed reported by debugfs
  2025-11-05 19:04 [PATCH net-next v3] net: mana: Fix incorrect speed reported by debugfs Erni Sri Satya Vennela
@ 2025-11-05 22:15 ` Jacob Keller
  2025-11-08  3:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Jacob Keller @ 2025-11-05 22:15 UTC (permalink / raw)
  To: Erni Sri Satya Vennela, kys, haiyangz, wei.liu, decui,
	andrew+netdev, davem, edumazet, kuba, pabeni, shradhagupta,
	ssengar, dipayanroy, shirazsaleem, kotaranov, longli,
	linux-hyperv, netdev, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1701 bytes --]



On 11/5/2025 11:04 AM, Erni Sri Satya Vennela wrote:
> 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>

> Changes in v3:
> * Remove Fixes tag.> Changes in v2:
> * Add Fixes tag.
> ---
>  drivers/net/ethernet/microsoft/mana/mana_en.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
> index 0142fd98392c..9d56bfefd755 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
> @@ -814,7 +814,7 @@ static int mana_shaper_del(struct net_shaper_binding *binding,
>  		/* Reset mana port context parameters */
>  		apc->handle.id = 0;
>  		apc->handle.scope = NET_SHAPER_SCOPE_UNSPEC;
> -		apc->speed = 0;
> +		apc->speed = apc->max_speed;
>  	}
>  
>  	return err;


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next v3] net: mana: Fix incorrect speed reported by debugfs
  2025-11-05 19:04 [PATCH net-next v3] net: mana: Fix incorrect speed reported by debugfs Erni Sri Satya Vennela
  2025-11-05 22:15 ` Jacob Keller
@ 2025-11-08  3:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-11-08  3:00 UTC (permalink / raw)
  To: Erni Sri Satya Vennela
  Cc: kys, haiyangz, wei.liu, decui, andrew+netdev, davem, edumazet,
	kuba, pabeni, shradhagupta, ssengar, dipayanroy, shirazsaleem,
	kotaranov, longli, linux-hyperv, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed,  5 Nov 2025 11:04:28 -0800 you wrote:
> 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
> 
> [...]

Here is the summary with links:
  - [net-next,v3] net: mana: Fix incorrect speed reported by debugfs
    https://git.kernel.org/netdev/net-next/c/140039580efa

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-08  3:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-05 19:04 [PATCH net-next v3] net: mana: Fix incorrect speed reported by debugfs Erni Sri Satya Vennela
2025-11-05 22:15 ` Jacob Keller
2025-11-08  3:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).