[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aCMlIRyTkxBvlcQ9@test-OptiPlex-Tower-Plus-7010>
Date: Tue, 13 May 2025 16:25:29 +0530
From: Hariprasad Kelam <hkelam@...vell.com>
To: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: Sunil Goutham <sgoutham@...vell.com>, Linu Cherian <lcherian@...vell.com>,
Geetha sowjanya <gakula@...vell.com>, Jerin Jacob <jerinj@...vell.com>,
Subbaraya Sundeep <sbhatta@...vell.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
"Bharat
Bhushan" <bbhushan2@...vell.com>
Subject: Re: [net-next] octeontx2-pf: ethtool: Display "Autoneg" and "Port"
fields
On 2025-05-13 at 11:43:51, Hariprasad Kelam (hkelam@...vell.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@...vell.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
>
>
Powered by blists - more mailing lists