On Mon, Oct 26, 2026 at 10:03:36AM -0700, Stephen Hemminger wrote: > On Mon, 26 Oct 2026 17:04:00 +0100 > Dariusz Sosnowski <[email protected]> wrote: > > > +/** > > + * Retrieve the carrier state of a device. > > + * > > + * The IFF_RUNNING flag reported by SIOCGIFFLAGS reflects the RFC 2863 > > + * operational state, which the kernel only refreshes from its link watch > > + * work queue and which may therefore lag the actual carrier by up to a > > + * second. ETHTOOL_GLINK reports the carrier directly, and additionally > > + * flushes any link watch event still pending for the device. > > + * > > + * @param dev > > + * Pointer to Ethernet device structure. > > + * > > + * @return > > + * 1 if the carrier is up, 0 otherwise. > > + * Negative errno value is returned on error. > > + */ > > +int > > +mlx5_link_carrier_get(struct rte_eth_dev *dev) > > +{ > > + struct ethtool_value ecmd = { > > + .cmd = ETHTOOL_GLINK, > > + }; > > + struct ifreq ifr; > > + int ret; > > + > > + memset(&ifr, 0, sizeof(ifr)); > > Odd, why not use structure initialization for both?
Agreed, odd. I'll unify in v2

