Re: [PATCH 1/3] net: mana: Add speed support in mana_get_link_ksettings
From: Erni Sri Satya Vennela <hidden>
Date: 2025-03-24 17:43:40
Also in:
linux-hyperv, linux-rdma, lkml
From: Erni Sri Satya Vennela <hidden>
Date: 2025-03-24 17:43:40
Also in:
linux-hyperv, linux-rdma, lkml
On Thu, Mar 20, 2025 at 02:37:47PM +0100, Andrew Lunn wrote:
quoted
+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.
Andrew