linux/Documentation/networking
Michal Kubecek 10b518d4e6 ethtool: netlink bitset handling
The ethtool netlink code uses common framework for passing arbitrary
length bit sets to allow future extensions. A bitset can be a list (only
one bitmap) or can consist of value and mask pair (used e.g. when client
want to modify only some bits). A bitset can use one of two formats:
verbose (bit by bit) or compact.

Verbose format consists of bitset size (number of bits), list flag and
an array of bit nests, telling which bits are part of the list or which
bits are in the mask and which of them are to be set. In requests, bits
can be identified by index (position) or by name. In replies, kernel
provides both index and name. Verbose format is suitable for "one shot"
applications like standard ethtool command as it avoids the need to
either keep bit names (e.g. link modes) in sync with kernel or having to
add an extra roundtrip for string set request (e.g. for private flags).

Compact format uses one (list) or two (value/mask) arrays of 32-bit
words to store the bitmap(s). It is more suitable for long running
applications (ethtool in monitor mode or network management daemons)
which can retrieve the names once and then pass only compact bitmaps to
save space.

Userspace requests can use either format; ETHTOOL_FLAG_COMPACT_BITSETS
flag in request header tells kernel which format to use in reply.
Notifications always use compact format.

As some code uses arrays of unsigned long for internal representation and
some arrays of u32 (or even a single u32), two sets of parse/compose
helpers are introduced. To avoid code duplication, helpers for unsigned
long arrays are implemented as wrappers around helpers for u32 arrays.
There are two reasons for this choice: (1) u32 arrays are more frequent in
ethtool code and (2) unsigned long array can be always interpreted as an
u32 array on little endian 64-bit and all 32-bit architectures while we
would need special handling for odd number of u32 words in the opposite
direction.

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-12-27 16:40:01 -08:00
..
caif docs: net: convert two README files to ReST format 2019-07-31 13:31:56 -06:00
device_drivers nfp: add support for TLV device stats 2019-12-10 17:34:43 -08:00
dsa docs: net: dsa: sja1105: Add info about the Time-Aware Scheduler 2019-09-16 21:32:58 +02:00
mac80211_hwsim docs: net: convert two README files to ReST format 2019-07-31 13:31:56 -06:00
6lowpan.txt docs: networking: fix minor typos in various documentation files 2018-06-04 17:21:28 -04:00
6pack.txt
af_xdp.rst xsk: Extend documentation for Rx|Tx-only sockets and shared umems 2019-11-10 19:30:46 -08:00
alias.rst docs: networking: Convert alias.txt to rst 2018-07-18 15:28:27 -07:00
altera_tse.txt
arcnet-hardware.txt
arcnet.txt
atm.txt
ax25.txt
batman-adv.rst batman-adv: Drop documentation about sysfs files 2019-03-25 09:31:35 +01:00
baycom.txt
bonding.txt bonding: add documentation for peer_notif_delay 2019-07-13 19:29:21 -07:00
bridge.rst docs: networking: Convert bridge.txt to rst 2018-07-18 15:28:27 -07:00
can_ucan_protocol.rst can: ucan: add driver for Theobroma Systems UCAN devices 2018-07-27 10:40:16 +02:00
can.rst docs: can.rst: fix a footnote reference 2018-06-15 12:48:59 -03:00
cdc_mbim.txt
checksum-offloads.rst doc: networking: shorten the main title in offloads documents 2019-01-07 15:27:51 -07:00
cops.txt
cxacru-cf.py
cxacru.txt
dccp.txt
dctcp.txt
decnet.txt Documentation: decnet: remove reference to CONFIG_DECNET_ROUTE_FWMARK 2019-04-21 11:25:11 -07:00
defza.txt FDDI: defza: Add support for DEC FDDIcontroller 700 TURBOchannel adapter 2018-10-15 21:46:06 -07:00
devlink-health.txt devlink: Add Documentation/networking/devlink-health.txt 2019-02-07 10:34:29 -08:00
devlink-info-versions.rst devlink: Add new info version tags for ASIC and FW 2019-09-05 09:24:43 +02:00
devlink-params-bnxt.txt devlink: Add Documentation/networking/devlink-params-bnxt.txt 2018-10-04 13:49:43 -07:00
devlink-params-mlx5.txt net/mlx5: Handle "enable_roce" devlink param 2019-11-11 12:15:29 -08:00
devlink-params-mlxsw.txt mlxsw: spectrum: add "acl_region_rehash_interval" devlink param 2019-02-08 15:02:50 -08:00
devlink-params-mv88e6xxx.txt net: dsa: mv88e6xxx: Add devlink param for ATU hash algorithm. 2019-10-28 16:21:02 -07:00
devlink-params-nfp.txt nfp: devlink: add 'reset_dev_on_drv_probe' support 2019-09-10 17:29:27 +01:00
devlink-params-ti-cpsw-switch.txt Documentation: networking: add cpsw switchdev based driver documentation 2019-11-20 11:25:24 -08:00
devlink-params.txt devlink: Add new "enable_roce" generic device param 2019-11-11 12:15:29 -08:00
devlink-trap-netdevsim.rst Documentation: Add description of netdevsim traps 2019-08-17 12:40:09 -07:00
devlink-trap.rst Here's the main documentation changes for 5.5: 2019-12-02 11:51:02 -08:00
dns_resolver.txt
driver.txt
eql.txt
ethtool-netlink.rst ethtool: netlink bitset handling 2019-12-27 16:40:01 -08:00
failover.rst net: Introduce generic failover module 2018-05-28 22:59:54 -04:00
fib_trie.txt
filter.txt bpf, doc: Change right arguments for JIT example code 2019-11-15 22:36:35 +01:00
fore200e.txt
framerelay.txt
gen_stats.txt
generic_netlink.txt
generic-hdlc.txt
gtp.txt docs: networking: fix minor typos in various documentation files 2018-06-04 17:21:28 -04:00
hinic.txt
ieee802154.rst doc: net: ieee802154: introduce IEEE 802.15.4 subsystem doc in rst style 2019-03-01 17:03:00 -08:00
ila.txt docs: networking: fix minor typos in various documentation files 2018-06-04 17:21:28 -04:00
index.rst ethtool: introduce ethtool netlink interface 2019-12-27 16:40:01 -08:00
ip_dynaddr.txt
ip-sysctl.txt net-tcp: Disable TCP ssthresh metrics cache by default 2019-12-09 20:17:48 -08:00
ipddp.txt
iphase.txt
ipsec.txt docs: networking: fix minor typos in various documentation files 2018-06-04 17:21:28 -04:00
ipv6.txt
ipvlan.txt docs: networking: fix minor typos in various documentation files 2018-06-04 17:21:28 -04:00
ipvs-sysctl.txt
j1939.rst can: j1939: fix address claim code example 2019-12-08 11:52:02 +01:00
kapi.rst
kcm.txt docs: networking: fix minor typos in various documentation files 2018-06-04 17:21:28 -04:00
l2tp.txt
lapb-module.txt
ltpc.txt
mac80211-auth-assoc-deauth.txt
mac80211-injection.txt
mpls-sysctl.txt Documentation/networking: fix default_ttl typo in mpls-sysctl 2019-07-01 10:41:33 -07:00
msg_zerocopy.rst doc: fix link to MSG_ZEROCOPY patchset 2019-03-18 09:50:21 -07:00
multiqueue.txt
net_dim.txt net: update net_dim documentation after rename 2019-10-10 16:37:10 -07:00
net_failover.rst docs: networking: Fix failover build warnings 2018-07-16 11:23:54 -07:00
netconsole.txt
netdev-FAQ.rst Documentation: fix netdev-FAQ.rst markup warning 2019-05-01 09:12:51 -04:00
netdev-features.txt docs-networking: fix typo in define 2018-11-21 10:30:30 -08:00
netdevices.txt
netfilter-sysctl.txt
netif-msg.txt
nf_conntrack-sysctl.txt netfilter: conntrack: register sysctl table for gre 2018-12-21 00:51:25 +01:00
nf_flowtable.txt netfilter: nf_flowtable: remove duplicated transition in diagram 2019-03-19 15:02:52 +01:00
nfc.rst docs: networking: nfc: change to rst format 2019-11-23 11:00:19 -08:00
openvswitch.txt
operstates.txt Documentation: bring operstate documentation up-to-date 2019-02-11 12:38:51 -08:00
packet_mmap.txt doc: remove out of date links and info from packet mmap 2018-03-16 10:48:52 -04:00
phonet.txt
phy.rst Here's the main documentation changes for 5.5: 2019-12-02 11:51:02 -08:00
pktgen.txt
PLIP.txt
ppp_generic.txt compat_ioctl: handle PPPIOCGIDLE for 64-bit time_t 2019-10-23 17:23:47 +02:00
proc_net_tcp.txt
radiotap-headers.txt
ray_cs.txt
rds.txt linux-next: DOC: RDS: Fix a typo in rds.txt 2019-06-12 09:56:29 -07:00
regulatory.txt
rxrpc.txt rxrpc: Allow the kernel to mark a call as being non-interruptible 2019-05-16 16:25:20 +01:00
scaling.rst doc: networking: integrate scaling document into doc tree 2019-01-20 19:10:49 -07:00
sctp.txt
secid.txt
seg6-sysctl.txt
segmentation-offloads.rst networking: : fix typos in code comments 2019-05-20 20:24:34 -04:00
sfp-phylink.rst net: phylink: clarify where phylink should be used 2019-09-16 16:53:44 +02:00
skfp.txt
snmp_counter.rst networking: fix snmp_counter.rst Doc. Warnings 2019-03-17 19:37:08 -07:00
strparser.txt strparser: Corrected typo in documentation. 2018-06-24 16:40:20 +09:00
switchdev.txt switchdev: Remove unused transaction item queue 2019-03-01 21:35:19 -08:00
tc-actions-env-rules.txt
tcp-thin.txt
team.txt
timestamping.txt docs: ptp.txt: convert to ReST and move to driver-api 2019-06-14 14:31:27 -06:00
tls-offload-layers.svg Documentation: add TLS offload documentation 2019-05-22 12:18:20 -07:00
tls-offload-reorder-bad.svg Documentation: add TLS offload documentation 2019-05-22 12:18:20 -07:00
tls-offload-reorder-good.svg Documentation: add TLS offload documentation 2019-05-22 12:18:20 -07:00
tls-offload.rst Documentation: TLS: Add missing counter description 2019-11-05 18:34:06 -08:00
tls.rst net/tls: add TlsDeviceRxResync statistic 2019-10-05 16:29:00 -07:00
tproxy.txt netfilter: doc: Add nf_tables part in tproxy.txt 2018-08-16 19:37:07 +02:00
tuntap.txt net: docs: replace IPX in tuntap documentation 2019-08-08 18:06:53 -07:00
udplite.txt
vrf.txt net: provide a sysctl raw_l3mdev_accept for raw socket lookup with VRFs 2018-11-07 16:12:38 -08:00
vxlan.txt
x25-iface.txt
x25.txt
xfrm_device.txt net: switch secpath to use skb extension infrastructure 2018-12-19 11:21:38 -08:00
xfrm_proc.txt
xfrm_sync.txt
xfrm_sysctl.txt
z8530book.rst
z8530drv.txt