Re: [PATCH v2 net-next] octeontx2-pf: report port connector type in ethtool link ksettings

From: Ratheesh Kannoth

Date: Mon Sep 07 2026 - 22:32:28 EST


On 2026-09-08 at 03:10:38, Jakub Kicinski (kuba@xxxxxxxxxx) wrote:
> On Mon, 7 Sep 2026 09:58:27 +0530 Ratheesh Kannoth wrote:
> > 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.
>
> I said:
>
> drivers should not blindly pass values between uAPI and the FW.
>
> That means you have to add some explicit validation/translation
> for each value even if they are numerically identical.

A field_get() would be OK to satisfy this translation ?

cmd->base.port = FIELD_GET(GENMASK(7, 0), rsp->fwdata.port);