[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250325162527.GA23398@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
Date: Tue, 25 Mar 2025 09:25:27 -0700
From: Erni Sri Satya Vennela <ernis@...ux.microsoft.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: kys@...rosoft.com, haiyangz@...rosoft.com, wei.liu@...nel.org,
decui@...rosoft.com, andrew+netdev@...n.ch, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
longli@...rosoft.com, kotaranov@...rosoft.com, horms@...nel.org,
brett.creeley@....com, surenb@...gle.com,
schakrabarti@...ux.microsoft.com, kent.overstreet@...ux.dev,
shradhagupta@...ux.microsoft.com, erick.archer@...look.com,
rosenp@...il.com, linux-hyperv@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-rdma@...r.kernel.org
Subject: Re: [PATCH 1/3] net: mana: Add speed support in
mana_get_link_ksettings
On Mon, Mar 24, 2025 at 07:44:39PM +0100, Andrew Lunn wrote:
> On Mon, Mar 24, 2025 at 10:43:39AM -0700, Erni Sri Satya Vennela wrote:
> > On Thu, Mar 20, 2025 at 02:37:47PM +0100, Andrew Lunn wrote:
> > > > +int mana_query_link_cfg(struct mana_port_context *apc)
> > > > +{
> > > > + struct net_device *ndev = apc->ndev;
> > > > + struct mana_query_link_config_req req = {};
> > > > + struct mana_query_link_config_resp resp = {};
> > > > + int err;
> > > > +
> > > > + mana_gd_init_req_hdr(&req.hdr, MANA_QUERY_LINK_CONFIG,
> > > > + sizeof(req), sizeof(resp));
> > > > +
> > > > + req.vport = apc->port_handle;
> > > > +
> > > > + err = mana_send_request(apc->ac, &req, sizeof(req), &resp,
> > > > + sizeof(resp));
> > > > +
> > > > + if (err) {
> > > > + netdev_err(ndev, "Failed to query link config: %d\n", err);
> > > > + goto out;
> > > > + }
> > > > +
> > > > + err = mana_verify_resp_hdr(&resp.hdr, MANA_QUERY_LINK_CONFIG,
> > > > + sizeof(resp));
> > > > +
> > > > + if (err || resp.hdr.status) {
> > > > + netdev_err(ndev, "Failed to query link config: %d, 0x%x\n", err,
> > > > + resp.hdr.status);
> > > > + if (!err)
> > > > + err = -EPROTO;
> > > > + goto out;
> > > > + }
> > > > +
> > > > + if (resp.qos_unconfigured) {
> > > > + err = -EINVAL;
> > > > + goto out;
> > > > + }
> > > > + apc->speed = resp.link_speed;
> > >
> > > Might be worth adding a comment that the firmware is returning speed
> > > in Mbps.
> > >
> > > Or name the struct member link_speed_mbps.
> > >
> > Thank you for your suggestion. I'll make this change for the next
> > version of this patchset.
>
> Please answer my other questions before posting the next version of
> the patch. I'm really questioning if this is the correct uAPI to be
> using. You have a very poor description of what you are trying to
> do. Maybe TC is the better fit? Does this speed apply to ingress and
> egress? If so, there are two leaky buckets, so why only one
> configuration value? Or can you only configure ingress?
>
The QoS control is at the hardware/firmware level and applies to the
egress rate.
> Also, if i understand correctly MANA is a virtual device and this is
> the VM side of it. If this is used for bandwidth limitation, why is
> the VM controlling this, not the hypervisor? What is the security
> model?
>
In certain cluster and hardware versions, Azure allows this API to
restrict the bandwidth limit to a lesser value than what was configured
by the Azure control plane. The device will not allow a higher limit
than what was configured through the Azure control plane to be set by
the VM through this API.
> Andrew
Powered by blists - more mailing lists