linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhu Yanjun <yanjun.zhu@linux.dev>
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,
	longli@microsoft.com, kotaranov@microsoft.com, horms@kernel.org,
	kent.overstreet@linux.dev, brett.creeley@amd.com,
	schakrabarti@linux.microsoft.com,
	shradhagupta@linux.microsoft.com, ssengar@linux.microsoft.com,
	rosenp@gmail.com, paulros@microsoft.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, 17 Apr 2025 15:38:26 +0200	[thread overview]
Message-ID: <b1e513f8-2e0d-4b09-aa10-02b7b593d3c9@linux.dev> (raw)
In-Reply-To: <1744876630-26918-2-git-send-email-ernis@linux.microsoft.com>

On 17.04.25 09:57, Erni Sri Satya Vennela wrote:
> Add support for speed in mana ethtool get_link_ksettings
> operation. This feature is not supported by all hardware.
> 
> Signed-off-by: Erni Sri Satya Vennela <ernis@linux.microsoft.com>
> Reviewed-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
> ---
>   drivers/net/ethernet/microsoft/mana/mana_en.c | 42 +++++++++++++++++++
>   .../ethernet/microsoft/mana/mana_ethtool.c    |  6 +++
>   include/net/mana/mana.h                       | 17 ++++++++
>   3 files changed, 65 insertions(+)
> 
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
> index 2bac6be8f6a0..ba550fc7ece0 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
> @@ -1156,6 +1156,48 @@ static int mana_cfg_vport_steering(struct mana_port_context *apc,
>   	return err;
>   }
>   
> +int mana_query_link_cfg(struct mana_port_context *apc)
> +{
> +	struct net_device *ndev = apc->ndev;
> +	struct mana_query_link_config_resp resp = {};
> +	struct mana_query_link_config_req req = {};
> +	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;

EPROTO means Protocol error. Thus, ENOTSUPP or EPROTONOSUPPORT is better?

Zhu Yanjun

> +		goto out;
> +	}
> +
> +	if (resp.qos_unconfigured) {
> +		err = -EINVAL;
> +		goto out;
> +	}
> +	apc->speed = resp.link_speed_mbps;
> +	return 0;
> +
> +out:
> +	return err;
> +}
> +


  reply	other threads:[~2025-04-17 13:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2025-04-17 19:44     ` Erni Sri Satya Vennela
2025-04-17  7:57 ` [PATCH 2/3] net: mana: Add sched HTB offload support Erni Sri Satya Vennela
2025-04-17 15:10   ` Stephen Hemminger
2025-04-17 19:47     ` Erni Sri Satya Vennela
2025-04-18  0:00       ` Jakub Kicinski
2025-04-18 16:53         ` Erni Sri Satya Vennela
2025-04-24  9:38           ` Simon Horman
2025-04-25  6:23             ` Erni Sri Satya Vennela
2025-04-17  7:57 ` [PATCH 3/3] net: mana: Handle unsupported HWC commands Erni Sri Satya Vennela
  -- strict thread matches above, loose matches on Subject: below --
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
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

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=b1e513f8-2e0d-4b09-aa10-02b7b593d3c9@linux.dev \
    --to=yanjun.zhu@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=brett.creeley@amd.com \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@google.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=paulros@microsoft.com \
    --cc=rosenp@gmail.com \
    --cc=schakrabarti@linux.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;
as well as URLs for NNTP newsgroup(s).