[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f4e84b99-53b5-455d-bad2-ef638cafdeae@lunn.ch>
Date: Thu, 20 Mar 2025 14:37:47 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Erni Sri Satya Vennela <ernis@...ux.microsoft.com>
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
> +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.
Andrew
Powered by blists - more mailing lists