Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: ethtool: clarify the bit-by-bit bitset format description

Clarify the bit-by-bit bitset format's behavior around mandatory
attributes and bit identification. More specifically, the following
changes are made:

* Rephrase a misleading sentence which implies name and index are
mutually exclusive
* Describe that ETHTOOL_A_BITSET_BITS nest is mandatory
* Describe that a request fails if inconsistent identifiers are given

Signed-off-by: Yohei Kojima <yk@y-koj.net>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/ef90a56965ca66e57aa177929ce3e10c5ca815fa.1772031974.git.yk@y-koj.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Yohei Kojima and committed by
Jakub Kicinski
5cf47393 f22b4e6f

+8 -4
+8 -4
Documentation/networking/ethtool-netlink.rst
··· 96 96 type is used. For arbitrary length bitmaps, ethtool netlink uses a nested 97 97 attribute with contents of one of two forms: compact (two binary bitmaps 98 98 representing bit values and mask of affected bits) and bit-by-bit (list of 99 - bits identified by either index or name). 99 + bits identified by index or name). 100 100 101 101 Verbose (bit-by-bit) bitsets allow sending symbolic names for bits together 102 102 with their values which saves a round trip (when the bitset is passed in a ··· 156 156 | | | ``ETHTOOL_A_BITSET_BIT_VALUE`` | flag | present if bit is set | 157 157 +-+-+--------------------------------+--------+-----------------------------+ 158 158 159 - Bit size is optional for bit-by-bit form. ``ETHTOOL_A_BITSET_BITS`` nest can 159 + For bit-by-bit form, ``ETHTOOL_A_BITSET_SIZE`` is optional, and 160 + ``ETHTOOL_A_BITSET_BITS`` is mandatory. ``ETHTOOL_A_BITSET_BITS`` nest can 160 161 only contain ``ETHTOOL_A_BITSET_BITS_BIT`` attributes but there can be an 161 162 arbitrary number of them. A bit may be identified by its index or by its 162 163 name. When used in requests, listed bits are set to 0 or 1 according to 163 - ``ETHTOOL_A_BITSET_BIT_VALUE``, the rest is preserved. A request fails if 164 - index exceeds kernel bit length or if name is not recognized. 164 + ``ETHTOOL_A_BITSET_BIT_VALUE``, the rest is preserved. 165 + 166 + A request fails if index exceeds kernel bit length or if name is not 167 + recognized. If both name and index are set, the request will fail if they 168 + point to different bits. 165 169 166 170 When ``ETHTOOL_A_BITSET_NOMASK`` flag is present, bitset is interpreted as 167 171 a simple bitmap. ``ETHTOOL_A_BITSET_BIT_VALUE`` attributes are not used in