All of lore.kernel.org
 help / color / mirror / Atom feed
* ethtool ioctl ABI: preferred way to expand uapi structure ethtool_eee for additional link modes?
@ 2024-01-04 15:14 Marek Behún
  2024-01-04 15:36 ` Andrew Lunn
  2024-01-04 16:17 ` Maxime Chevallier
  0 siblings, 2 replies; 6+ messages in thread
From: Marek Behún @ 2024-01-04 15:14 UTC (permalink / raw)
  To: Michal Kubecek, netdev; +Cc: Andrew Lunn, Russell King, Heiner Kallweit

Hello,

the legacy ioctls ETHTOOL_GSET and ETHTOOL_SSET, which pass structure
ethtool_cmd, were superseded by ETHTOOL_GLINKSETTINGS and
ETHTOOL_SLINKSETTINGS.

This was done because the original structure only contains 32-bit words
for supported, advertising and lp_advertising link modes. The new
structure ethtool_link_settings contains member
  s8 link_mode_masks_nwords;
and a flexible array
  __u32 link_mode_masks[];
in order to overcome this issue.

But currently we still have only legacy structure ethtool_eee for EEE
settings:
  struct ethtool_eee {
    __u32 cmd;
    __u32 supported;
    __u32 advertised;
    __u32 lp_advertised;
    __u32 eee_active;
    __u32 eee_enabled;
    __u32 tx_lpi_enabled;
    __u32 tx_lpi_timer;
    __u32 reserved[2];
  };

Thus ethtool is unable to get/set EEE configuration for example for
2500base-T and 5000base-T link modes, which are now available in
several PHY drivers.

We can remedy this by either:

- adding another ioctl for EEE settings, as was done with the GSET /
  SSET

- using the original ioctl, but making the structure flexible (we can
  replace the reserved fields with information that the array is
  flexible), i.e.:

  struct ethtool_eee {
    __u32 cmd;
    __u32 supported;
    __u32 advertised;
    __u32 lp_advertised;
    __u32 eee_active;
    __u32 eee_enabled;
    __u32 tx_lpi_enabled;
    __u32 tx_lpi_timer;
    s8 link_mode_masks_nwords; /* zero if legacy 32-bit link modes */
    __u8 reserved[7];
    __u32 link_mode_masks[];
    /* filled in if link_mode_masks_nwords > 0, with layout:
     * __u32 map_supported[link_mode_masks_nwords];
     * __u32 map_advertised[link_mode_masks_nwords];
     * __u32 map_lp_advertised[link_mode_masks_nwords];
     */
  };

  this way we will be left with another 7 reserved bytes for future (is
  this enough?)

What would you prefer?

Marek

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-01-04 16:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-04 15:14 ethtool ioctl ABI: preferred way to expand uapi structure ethtool_eee for additional link modes? Marek Behún
2024-01-04 15:36 ` Andrew Lunn
2024-01-04 16:06   ` Heiner Kallweit
2024-01-04 16:21     ` Marek Behún
2024-01-04 16:39   ` Heiner Kallweit
2024-01-04 16:17 ` Maxime Chevallier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.