Netdev List
 help / color / mirror / Atom feed
From: Hariprasad Kelam <hkelam@marvell.com>
To: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: Sunil Goutham <sgoutham@marvell.com>,
	Linu Cherian <lcherian@marvell.com>,
	Geetha sowjanya <gakula@marvell.com>,
	Jerin Jacob <jerinj@marvell.com>,
	Subbaraya Sundeep <sbhatta@marvell.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"Bharat Bhushan" <bbhushan2@marvell.com>
Subject: Re: [net-next] octeontx2-pf: ethtool: Display "Autoneg" and "Port" fields
Date: Tue, 13 May 2025 16:25:29 +0530	[thread overview]
Message-ID: <aCMlIRyTkxBvlcQ9@test-OptiPlex-Tower-Plus-7010> (raw)
In-Reply-To: <20250513061351.720880-1-hkelam@marvell.com>

On 2025-05-13 at 11:43:51, Hariprasad Kelam (hkelam@marvell.com) wrote:

Please ignore this patch, accidentally submitted old version

> The Octeontx2/CN10k netdev drivers access a shared firmware structure
> to obtain link configuration details, such as supported and advertised
> link modes.
> 
> This patch updates the shared firmware data to include additional
> fields like 'Autonegotiation' and 'Port type'.
> 
> example output:
>   ethtool ethx
> 	 Advertised auto-negotiation: Yes
> 	 Port: Twisted Pair
> 
> Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
> ---
>  drivers/net/ethernet/marvell/octeontx2/af/mbox.h          | 4 +++-
>  drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c | 5 +++++
>  2 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h
> index 005ca8a056c0..4a305c183987 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h
> @@ -652,7 +652,9 @@ struct cgx_lmac_fwdata_s {
>  	/* Only applicable if SFP/QSFP slot is present */
>  	struct sfp_eeprom_s sfp_eeprom;
>  	struct phy_s phy;
> -#define LMAC_FWDATA_RESERVED_MEM 1021
> +	u64 advertised_an:1;
> +	u64 port;
> +#define LMAC_FWDATA_RESERVED_MEM 1019
>  	u64 reserved[LMAC_FWDATA_RESERVED_MEM];
>  };
>  
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> index 010385b29988..d49d76eabc07 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> @@ -1190,6 +1190,7 @@ static int otx2_get_link_ksettings(struct net_device *netdev,
>  	cmd->base.duplex  = pfvf->linfo.full_duplex;
>  	cmd->base.speed   = pfvf->linfo.speed;
>  	cmd->base.autoneg = pfvf->linfo.an;
> +	cmd->base.port    = rsp->fwdata.port;
>  
>  	rsp = otx2_get_fwdata(pfvf);
>  	if (IS_ERR(rsp))
> @@ -1199,6 +1200,10 @@ static int otx2_get_link_ksettings(struct net_device *netdev,
>  		ethtool_link_ksettings_add_link_mode(cmd,
>  						     supported,
>  						     Autoneg);
> +	if (rsp->fwdata.advertised_an)
> +		ethtool_link_ksettings_add_link_mode(cmd,
> +						     advertising,
> +						     Autoneg);
>  
>  	otx2_get_link_mode_info(rsp->fwdata.advertised_link_modes,
>  				OTX2_MODE_ADVERTISED, cmd);
> -- 
> 2.34.1
> 
> 

  reply	other threads:[~2025-05-13 10:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13  6:13 [net-next] octeontx2-pf: ethtool: Display "Autoneg" and "Port" fields Hariprasad Kelam
2025-05-13 10:55 ` Hariprasad Kelam [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-05-19 11:23 Hariprasad Kelam
2025-05-20 23:50 ` Jakub Kicinski
2025-05-22 11:11   ` Hariprasad Kelam

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=aCMlIRyTkxBvlcQ9@test-OptiPlex-Tower-Plus-7010 \
    --to=hkelam@marvell.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bbhushan2@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=kuba@kernel.org \
    --cc=lcherian@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.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