summaryrefslogtreecommitdiff
path: root/include/linux/ethtool.h
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2014-02-12 22:14:53 +0000
committerDavid S. Miller <davem@davemloft.net>2014-02-12 17:33:03 -0500
commit6e201c857b68ea994c9ac85718eb3d50dcf40d92 (patch)
treef8c5ec10761812f6de9f63c274e3aa62d0bec40f /include/linux/ethtool.h
parentf432c095f78cd77df049bd0a8322e91ed6d3c59a (diff)
ethtool: Document the general convention for VLAs in kernel space
Various ethtool command structures are declared with zero-length array at the end which are intended to be variable-length in userland (relying on lack of compiler bounds checking). However, in the kernel the structure and array are always allocated and passed to driver operations separately. Make that explicit. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r--include/linux/ethtool.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index c8e3e7e39c6b..0a114d05f68d 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -183,6 +183,9 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings)
* hold the RTNL lock.
*
* See the structures used by these operations for further documentation.
+ * Note that for all operations using a structure ending with a zero-
+ * length array, the array is allocated separately in the kernel and
+ * is passed to the driver as an additional parameter.
*
* See &struct net_device and &struct net_device_ops for documentation
* of the generic netdev features interface.