public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Vikas Gupta <vikas.gupta@broadcom.com>
Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	andrew+netdev@lunn.ch, horms@kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, michael.chan@broadcom.com,
	pavan.chebbi@broadcom.com, vsrama-krishna.nemani@broadcom.com,
	rajashekar.hudumula@broadcom.com, ajit.khaparde@broadcom.com,
	Bhargava Marreddy <bhargava.marreddy@broadcom.com>
Subject: Re: [PATCH net-next v8 03/10] bng_en: add ethtool link settings, get_link, and nway_reset
Date: Fri, 20 Mar 2026 20:11:24 -0700	[thread overview]
Message-ID: <20260320201124.7cab8b5d@kernel.org> (raw)
In-Reply-To: <20260319055124.1350670-4-vikas.gupta@broadcom.com>

On Thu, 19 Mar 2026 11:21:17 +0530 Vikas Gupta wrote:
> +bnge_force_link_speed(struct net_device *dev, u32 ethtool_speed, u32 lanes)
> +{
> +	u16 support_pam4_spds, support_spds2, support_spds;
> +	struct bnge_ethtool_link_info *elink_info;
> +	struct bnge_net *bn = netdev_priv(dev);
> +	struct bnge_link_info *link_info;
> +	u8 sig_mode = BNGE_SIG_MODE_NRZ;
> +	struct bnge_dev *bd = bn->bd;
> +	u32 lanes_needed = 1;
> +	u16 fw_speed = 0;
> +
> +	elink_info = &bn->eth_link_info;
> +	link_info = &bd->link_info;
> +	support_pam4_spds = link_info->support_pam4_speeds;
> +	support_spds2 = link_info->support_speeds2;
> +	support_spds = link_info->support_speeds;
> +
> +	switch (ethtool_speed) {
> +	case SPEED_50000:
> +		if (((support_spds & BNGE_LINK_SPEED_MSK_50GB) ||
> +		     (support_spds2 & BNGE_LINK_SPEEDS2_MSK_50GB)) &&
> +		    lanes != 1) {
> +			fw_speed = PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_50GB;
> +			lanes_needed = 2;
> +		} else if (support_pam4_spds & BNGE_LINK_PAM4_SPEED_MSK_50GB) {
> +			fw_speed = PORT_PHY_CFG_REQ_FORCE_PAM4_LINK_SPEED_50GB;
> +			sig_mode = BNGE_SIG_MODE_PAM4;
> +		} else if (support_spds2 & BNGE_LINK_SPEEDS2_MSK_50GB_PAM4) {
> +			fw_speed = BNGE_LINK_SPEED_50GB_PAM4;
> +			sig_mode = BNGE_SIG_MODE_PAM4;
> +		}

Looking thru this review:
https://sashiko.dev/#/patchset/20260319055124.1350670-1-vikas.gupta%40broadcom.com

I agree that you are playing a little loose with the requested lane
count. Why are you calculating your own lanes_needed if user provided
explicit lane count? We must match user request if set or return an
error.

Another thing that jumped out at me was that stats may transiently go
backwards in patch 8.

Please look carefully thru that review, there may be more worth
addressing.

Bhargava is correct in the responses to patches 9 and 10 FWIW.
The AI was wrong on those.
-- 
pw-bot: cr

  parent reply	other threads:[~2026-03-21  3:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19  5:51 [PATCH net-next v8 00/10] bng_en: add link management and statistics support Vikas Gupta
2026-03-19  5:51 ` [PATCH net-next v8 01/10] bng_en: add per-PF workqueue, timer, and slow-path task Vikas Gupta
2026-03-19  5:51 ` [PATCH net-next v8 02/10] bng_en: query PHY capabilities and report link status Vikas Gupta
2026-03-19  5:51 ` [PATCH net-next v8 03/10] bng_en: add ethtool link settings, get_link, and nway_reset Vikas Gupta
2026-03-20 11:26   ` Simon Horman
2026-03-21  3:11   ` Jakub Kicinski [this message]
2026-03-19  5:51 ` [PATCH net-next v8 04/10] bng_en: implement ethtool pauseparam operations Vikas Gupta
2026-03-19  5:51 ` [PATCH net-next v8 05/10] bng_en: add support for link async events Vikas Gupta
2026-03-19  5:51 ` [PATCH net-next v8 06/10] bng_en: add HW stats infra and structured ethtool ops Vikas Gupta
2026-03-19  5:51 ` [PATCH net-next v8 07/10] bng_en: periodically fetch and accumulate hardware statistics Vikas Gupta
2026-03-19  5:51 ` [PATCH net-next v8 08/10] bng_en: implement ndo_get_stats64 Vikas Gupta
2026-03-19  5:51 ` [PATCH net-next v8 09/10] bng_en: implement netdev_stat_ops Vikas Gupta
2026-03-20 11:27   ` Simon Horman
2026-03-20 20:27     ` Bhargava Chenna Marreddy
2026-03-21  9:15       ` Simon Horman
2026-03-19  5:51 ` [PATCH net-next v8 10/10] bng_en: add support for ethtool -S stats display Vikas Gupta
2026-03-20 11:27   ` Simon Horman
2026-03-20 19:51     ` Bhargava Chenna Marreddy
2026-03-21  9:06       ` Simon Horman

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=20260320201124.7cab8b5d@kernel.org \
    --to=kuba@kernel.org \
    --cc=ajit.khaparde@broadcom.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bhargava.marreddy@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pavan.chebbi@broadcom.com \
    --cc=rajashekar.hudumula@broadcom.com \
    --cc=vikas.gupta@broadcom.com \
    --cc=vsrama-krishna.nemani@broadcom.com \
    /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