[PATCH v11 1/1] ethdev: add link connector type

Sunil Kumar Kori skori at marvell.com
Thu Sep 11 12:37:48 CEST 2025


> > From: Sunil Kumar Kori <skori at marvell.com>
> >
> > Adding link connector parameter to provide the type of connection for
> > a port like twisted pair, fiber etc.
> >
> > Also added an API to convert the RTE_ETH_LINK_CONNECTOR_XXX to a
> > readable string.
> >
> > Signed-off-by: Nithin Dabilpuram <ndabilpuram at marvell.com>
> > Signed-off-by: Sunil Kumar Kori <skori at marvell.com>
> > ---
> 
> [...]
> 
> > +* **Added ethdev API to get link connector.**
> > +
> > +  * Added API to report type of link connection for a port.
> > +    The following connectors are enumerated:
> > +
> > +   * NONE
> > +   * TP
> > +   * FIBER
> > +   * BNC
> > +   * DAC
> > +   * XFI, SFI
> > +   * MII, SGMII, QSGMII
> > +   * AUI, XLAUI, GAUI, AUI, CAUI, LAUI
> > +   * SFP, SFP_PLUS, SFP28, SFP_DD
> > +   * QSFP, QSFP_PLUS, QSFP28, QSFP56, QSFP_DD
> > +   * OTHER
> 
> Please use the string names, not the enum name, here.
> E.g. Twisted Pair instead of TP, and SFP+ instead of SFP_PLUS.
> 
> > +
> > +    By default, it reports ``RTE_ETH_LINK_CONNECTOR_NONE``
> > +    unless driver specifies it.
> > +
> >  * **Added speed 800G.**
> >
> >    Added Ethernet link speed for 800 Gb/s as it is well standardized
> > in IEEE, @@ -124,6 +144,9 @@ ABI Changes
> >  * eal: The structure ``rte_mp_msg`` alignment has been updated to 8
> > bytes to limit unaligned
> >    accesses in messages payload.
> >
> > +* ethdev: Added ``link_connector`` field to ``rte_eth_link``
> > +structure
> > +  to report type of link connection for a port.
> 
> connection -> connector
> 
> [...]
> 
> >  /**
> >   * A structure used to retrieve link-level information of an Ethernet
> > port.
> >   */
> > @@ -343,6 +382,7 @@ struct rte_eth_link {
> >  			uint16_t link_duplex  : 1;  /**<
> > RTE_ETH_LINK_[HALF/FULL]_DUPLEX */
> >  			uint16_t link_autoneg : 1;  /**<
> > RTE_ETH_LINK_[AUTONEG/FIXED] */
> >  			uint16_t link_status  : 1;  /**<
> > RTE_ETH_LINK_[DOWN/UP] */
> > +			uint16_t link_connector : 5;  /**<
> > RTE_ETH_LINK_CONNECTOR_XXX */
> 
> Please use 6 bits instead of 5, so it is more future proof.
> With the connector types already defined, 5 bits only leaves room for six more
> connector types.
> 
> Remember to update the value of RTE_ETH_LINK_CONNECTOR_OTHER from 31 to
> 63.
> 
> -Morten

Ack. Sent next version.


More information about the dev mailing list