Re: [PATCH net-next v9 2/3] net: ethtool: add KSZ87xx low-loss cable PHY tunables

From: Marek Vasut

Date: Thu Jun 04 2026 - 23:17:57 EST


On 6/5/26 4:35 AM, Jakub Kicinski wrote:
On Thu, 4 Jun 2026 13:41:19 +0200 Paolo Abeni wrote:
@@ -3114,6 +3114,9 @@ static int ethtool_phy_tunable_valid(const struct ethtool_tunable *tuna)
switch (tuna->id) {
case ETHTOOL_PHY_DOWNSHIFT:
case ETHTOOL_PHY_FAST_LINK_DOWN:
+ case ETHTOOL_PHY_SHORT_CABLE_PRESET:
+ case ETHTOOL_PHY_LPF_BW:
+ case ETHTOOL_PHY_DSP_EQ_INIT_VALUE:
if (tuna->len != sizeof(u8) ||
tuna->type_id != ETHTOOL_TUNABLE_U8)
return -EINVAL;

[Severity: High]
Is it intentional to enforce an 8-bit type constraint for bandwidth and DSP
equalizer tunables?

This heavily couples the global API to the 8-bit register layout of the
KSZ87xx hardware without defining generic units like Hz for bandwidth.

AFAIK this is the one comment from AI that survives scrutiny.
Seems unlikely we'd need more bits, but then again - why not.
u32 should be our default for integer values, u8 is more for
booleans.

Why waste memory space if we are already sure the space would not be used.