Thread (38 messages) 38 messages, 6 authors, 2024-01-25

Re: [PATCH net-next v5 05/13] net: ethtool: Allow passing a phy index for some commands

From: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: 2024-01-05 08:34:01
Also in: linux-arm-kernel, lkml

Hello Jakub,

On Thu, 4 Jan 2024 15:15:16 -0800
Jakub Kicinski [off-list ref] wrote:
On Thu, 21 Dec 2023 19:00:38 +0100 Maxime Chevallier wrote:
quoted
@@ -20,6 +21,7 @@ const struct nla_policy ethnl_header_policy[] = {
 					    .len = ALTIFNAMSIZ - 1 },
 	[ETHTOOL_A_HEADER_FLAGS]	= NLA_POLICY_MASK(NLA_U32,
 							  ETHTOOL_FLAGS_BASIC),
+	[ETHTOOL_A_HEADER_PHY_INDEX]		= NLA_POLICY_MIN(NLA_U32, 1),
 };
 
 const struct nla_policy ethnl_header_policy_stats[] = {
@@ -28,6 +30,7 @@ const struct nla_policy ethnl_header_policy_stats[] = {
 					    .len = ALTIFNAMSIZ - 1 },
 	[ETHTOOL_A_HEADER_FLAGS]	= NLA_POLICY_MASK(NLA_U32,
 							  ETHTOOL_FLAGS_STATS),
+	[ETHTOOL_A_HEADER_PHY_INDEX]		= NLA_POLICY_MIN(NLA_U32, 1),
 };  
You should define (copy/paste) a new header policy and use it
only for commands which actually make use of the PHY index.
That's why we have separate copies already for stats.
Ah OK I didn't know that, I'll do this. Thanks !

Maxime
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help