mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Erni Sri Satya Vennela <ernis@linux.microsoft.com>
Cc: 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,
	longli@microsoft.com, kotaranov@microsoft.com, horms@kernel.org,
	brett.creeley@amd.com, surenb@google.com,
	schakrabarti@linux.microsoft.com, kent.overstreet@linux.dev,
	shradhagupta@linux.microsoft.com, erick.archer@outlook.com,
	rosenp@gmail.com, linux-hyperv@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-rdma@vger.kernel.org
Subject: Re: [PATCH 1/3] net: mana: Add speed support in mana_get_link_ksettings
Date: Thu, 20 Mar 2025 14:37:47 +0100	[thread overview]
Message-ID: <f4e84b99-53b5-455d-bad2-ef638cafdeae@lunn.ch> (raw)
In-Reply-To: <1742473341-15262-2-git-send-email-ernis@linux.microsoft.com>

> +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

  reply	other threads:[~2025-03-20 13:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-20 12:22 [PATCH 0/3] Add support for speed in MANA ethtool Erni Sri Satya Vennela
2025-03-20 12:22 ` [PATCH 1/3] net: mana: Add speed support in mana_get_link_ksettings Erni Sri Satya Vennela
2025-03-20 13:37   ` Andrew Lunn [this message]
2025-03-24 17:43     ` Erni Sri Satya Vennela
2025-03-24 18:44       ` Andrew Lunn
2025-03-25 16:25         ` Erni Sri Satya Vennela
2025-03-25 16:43           ` Andrew Lunn
2025-03-20 12:22 ` [PATCH 2/3] net: mana: Implement set_link_ksettings in ethtool for speed Erni Sri Satya Vennela
2025-03-20 13:43   ` Andrew Lunn
2025-03-25 17:09     ` Erni Sri Satya Vennela
2025-03-25 17:52       ` Andrew Lunn
2025-03-25 19:21         ` Jakub Kicinski
2025-03-25 19:53           ` [EXTERNAL] " Haiyang Zhang
2025-03-25 19:58             ` Andrew Lunn
2025-03-25 20:28               ` Haiyang Zhang
2025-03-25 20:38                 ` Andrew Lunn
2025-03-31  9:08                   ` Erni Sri Satya Vennela
2025-04-17  8:12                     ` Erni Sri Satya Vennela
2025-03-20 12:22 ` [PATCH 3/3] net: mana: Handle unsupported HWC commands Erni Sri Satya Vennela
2025-04-17  7:57 [PATCH 0/3] net: mana: Add HTB Qdisc offload support Erni Sri Satya Vennela
2025-04-17  7:57 ` [PATCH 1/3] net: mana: Add speed support in mana_get_link_ksettings Erni Sri Satya Vennela
2025-04-17 13:38   ` Zhu Yanjun
2025-04-17 19:44     ` Erni Sri Satya Vennela

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=f4e84b99-53b5-455d-bad2-ef638cafdeae@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=andrew+netdev@lunn.ch \
    --cc=brett.creeley@amd.com \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@google.com \
    --cc=erick.archer@outlook.com \
    --cc=ernis@linux.microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=horms@kernel.org \
    --cc=kent.overstreet@linux.dev \
    --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=linux-rdma@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rosenp@gmail.com \
    --cc=schakrabarti@linux.microsoft.com \
    --cc=shradhagupta@linux.microsoft.com \
    --cc=surenb@google.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

all inboxes | Powered by JetHome®