[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260105163923.49104-1-gal@nvidia.com>
Date: Mon, 5 Jan 2026 18:39:23 +0200
From: Gal Pressman <gal@...dia.com>
To: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>, Andrew Lunn <andrew+netdev@...n.ch>,
<netdev@...r.kernel.org>
CC: Andrew Lunn <andrew@...n.ch>, Simon Horman <horms@...nel.org>, "Gal
Pressman" <gal@...dia.com>, Dragos Tatulea <dtatulea@...dia.com>
Subject: [PATCH net-next] ethtool: Clarify len/n_stats fields in/out semantics
Document that the 'len' field in ethtool_gstrings and 'n_stats' field in
ethtool_stats serve dual purposes: on entry they specify the number of
items requested, and on return they indicate the number actually
returned (which is not necessarily the same).
Reviewed-by: Dragos Tatulea <dtatulea@...dia.com>
Signed-off-by: Gal Pressman <gal@...dia.com>
---
include/uapi/linux/ethtool.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index eb7ff2602fbb..f66adf15a3c8 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -1094,7 +1094,8 @@ enum ethtool_module_fw_flash_status {
* struct ethtool_gstrings - string set for data tagging
* @cmd: Command number = %ETHTOOL_GSTRINGS
* @string_set: String set ID; one of &enum ethtool_stringset
- * @len: On return, the number of strings in the string set
+ * @len: On entry, the number of strings requested.
+ * On return, the number of strings returned.
* @data: Buffer for strings. Each string is null-padded to a size of
* %ETH_GSTRING_LEN.
*
@@ -1177,7 +1178,8 @@ struct ethtool_test {
/**
* struct ethtool_stats - device-specific statistics
* @cmd: Command number = %ETHTOOL_GSTATS
- * @n_stats: On return, the number of statistics
+ * @n_stats: On entry, the number of stats requested.
+ On return, the number of stats returned.
* @data: Array of statistics
*
* Users must use %ETHTOOL_GSSET_INFO or %ETHTOOL_GDRVINFO to find the
--
2.40.1
Powered by blists - more mailing lists