From: Jacob Keller <jacob.e.keller@intel.com>
To: Erni Sri Satya Vennela <ernis@linux.microsoft.com>,
<kys@microsoft.com>, <haiyangz@microsoft.com>,
<wei.liu@kernel.org>, <decui@microsoft.com>,
<andrew+netdev@lunn.ch>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<shradhagupta@linux.microsoft.com>, <ssengar@linux.microsoft.com>,
<dipayanroy@linux.microsoft.com>, <shirazsaleem@microsoft.com>,
<kotaranov@microsoft.com>, <longli@microsoft.com>,
<linux-hyperv@vger.kernel.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v3] net: mana: Fix incorrect speed reported by debugfs
Date: Wed, 5 Nov 2025 14:15:58 -0800 [thread overview]
Message-ID: <d09ceb78-4f86-4114-8596-9b3d102de96b@intel.com> (raw)
In-Reply-To: <1762369468-32570-1-git-send-email-ernis@linux.microsoft.com>
[-- 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 --]
next prev parent reply other threads:[~2025-11-05 22:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2025-11-08 3:00 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d09ceb78-4f86-4114-8596-9b3d102de96b@intel.com \
--to=jacob.e.keller@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=dipayanroy@linux.microsoft.com \
--cc=edumazet@google.com \
--cc=ernis@linux.microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=kotaranov@microsoft.com \
--cc=kuba@kernel.org \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shirazsaleem@microsoft.com \
--cc=shradhagupta@linux.microsoft.com \
--cc=ssengar@linux.microsoft.com \
--cc=wei.liu@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox