Re: [PATCH v2 net-next] octeontx2-pf: report port connector type in ethtool link ksettings
From: Leon Romanovsky
Date: Mon Sep 07 2026 - 03:28:30 EST
On Mon, Sep 07, 2026 at 09:58:27AM +0530, Ratheesh Kannoth wrote:
> From: Hariprasad Kelam <hkelam@xxxxxxxxxxx>
>
> otx2_get_link_ksettings() already fills speed, duplex, autoneg, link
> modes and FEC from CGX firmware data, but leaves cmd->base.port unset.
> As a result, ethtool does not show the physical connector type even
> though the firmware provides it in fwdata.port.
>
> Populate cmd->base.port from rsp->fwdata.port so users can see values
> such as PORT_TP or PORT_AUI via ethtool.
>
> Signed-off-by: Hariprasad Kelam <hkelam@xxxxxxxxxxx>
> Signed-off-by: Ratheesh Kannoth <rkannoth@xxxxxxxxxxx>
>
> ---
> v1 -> v2: Addressed sashiko comments.
> https://lore.kernel.org/netdev/20260904154833.3b32ea6a@xxxxxxxxxx/
> ---
> drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> index 9bee1b91eeaa..9b4c151b4d7d 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> @@ -1231,6 +1231,8 @@ static int otx2_get_link_ksettings(struct net_device *netdev,
> OTX2_MODE_SUPPORTED, cmd);
> otx2_get_fec_info(rsp->fwdata.supported_fec,
> OTX2_MODE_SUPPORTED, cmd);
> +
> + cmd->base.port = (u8)rsp->fwdata.port;
You should declare identical fields with the same type and avoid silently
casting variables.
Thanks
> return 0;
> }
>
> --
> 2.43.0
>
>