Thread (8 messages) flat view 8 messages, 3 authors, 1d ago

Re: [PATCH net 2/2] net: macb: reject an unknown link speed in the taprio setup

From: Aleksei Sviridkin <hidden>
Date: 2026-09-04 23:45:37
Also in: lkml

On Wed, 2 Sep 2026 18:37, Andrew Lunn wrote:
Can ethtool_validate_speed() be used?
No, it returns true for SPEED_UNKNOWN:

	static inline int ethtool_validate_speed(__u32 speed)
	{
		return speed <= __KERNEL_INT_MAX || speed == (__u32)SPEED_UNKNOWN;
	}

It answers "is this a legal encoding of a speed", which is the question
you want when a speed arrives from userspace, and that is where its
callers use it: net/ethtool/ioctl.c and otx2_ethtool.c both validate
what was passed in.

Here the speed goes the other way. We read it back and need it usable,
and SPEED_UNKNOWN is a legal encoding of something unusable, so the
helper would accept the one value the patch exists to reject.

v2 is coming with the commit message Théo asked for.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help