docs: uapi: netlink: update netlink specs linkWith the recent parser_yaml extension, and the removal of theauto-generated ReST source files, the location of netlinkspecs changed.Update uAPI acc
docs: uapi: netlink: update netlink specs linkWith the recent parser_yaml extension, and the removal of theauto-generated ReST source files, the location of netlinkspecs changed.Update uAPI accordingly.Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
show more ...
docs: netlink: netlink-raw.rst: use :ref: instead of :doc:Currently, rt documents are referred with:Documentation/userspace-api/netlink/netlink-raw.rst: :doc:`rt-link<../../networking/netlink_spe
docs: netlink: netlink-raw.rst: use :ref: instead of :doc:Currently, rt documents are referred with:Documentation/userspace-api/netlink/netlink-raw.rst: :doc:`rt-link<../../networking/netlink_spec/rt-link>`Documentation/userspace-api/netlink/netlink-raw.rst: :doc:`tc<../../networking/netlink_spec/tc>`Documentation/userspace-api/netlink/netlink-raw.rst: :doc:`tc<../../networking/netlink_spec/tc>`Having :doc: references with relative paths doesn't always work,as it may have troubles when O= is used. Also that's hard tomaintain, and may break if we change the way rst files aregenerated from yaml. Better to use instead a reference forthe netlink family.So, replace them by Sphinx cross-reference tag that arecreated by ynl_gen_rst.py.Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
netlink: specs: rename rtnetlink specs in accordance with family nameThe rtnetlink family names are set to rt-$name within the YAMLbut the files are called rt_$name. C codegen assumes that thegen
netlink: specs: rename rtnetlink specs in accordance with family nameThe rtnetlink family names are set to rt-$name within the YAMLbut the files are called rt_$name. C codegen assumes that thegenerated file name will match the family. The use of dashesis in line with our general expectation that name propertiesin the spec use dashes not underscores (even tho, as Donaldpoints out most genl families use underscores in the name).We have 3 un-ideal options to choose from: - accept the slight inconsistency with old families using _, or - accept the slight annoyance with all languages having to do s/-/_/ when looking up family ID, or - accept the inconsistency with all name properties in new YAML spec being separated with - and just the family name always using _.Pick option 1 and rename the rtnl spec files.Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>Reviewed-by: Donald Hunter <donald.hunter@gmail.com>Link: https://patch.msgid.link/20250410014658.782120-2-kuba@kernel.orgSigned-off-by: Jakub Kicinski <kuba@kernel.org>
tools: ynl: move python code to separate sub-directoryMove python code to a separate directory so it can bepackaged as a python module. Updates existing referencesin selftests and docs.Also ren
tools: ynl: move python code to separate sub-directoryMove python code to a separate directory so it can bepackaged as a python module. Updates existing referencesin selftests and docs.Also rename ynl-gen-[c|rst] to ynl_gen_[c|rst], avoiddashes as these prevent easy imports for entrypoints.Signed-off-by: Jan Stancek <jstancek@redhat.com>Reviewed-by: Donald Hunter <donald.hunter@gmail.com>Link: https://patch.msgid.link/a4151bad0e6984e7164d395125ce87fd2e048bf1.1736343575.git.jstancek@redhat.comSigned-off-by: Jakub Kicinski <kuba@kernel.org>
ynl: support enum-cnt-name attribute in legacy definitionsThis is similar to existing attr-cnt-name in the attributesto allow changing the name of the 'count' enum entry.Signed-off-by: Stanislav
ynl: support enum-cnt-name attribute in legacy definitionsThis is similar to existing attr-cnt-name in the attributesto allow changing the name of the 'count' enum entry.Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>Link: https://patch.msgid.link/20241204155549.641348-2-sdf@fomichev.meSigned-off-by: Jakub Kicinski <kuba@kernel.org>
ynl: support binary and integer sub-type for indexed-arrayAdd binary and integer sub-type support for indexed-array to display bondarp and ns targets. Here is what the result looks like: # ip li
ynl: support binary and integer sub-type for indexed-arrayAdd binary and integer sub-type support for indexed-array to display bondarp and ns targets. Here is what the result looks like: # ip link add bond0 type bond mode 1 \ arp_ip_target 192.168.1.1,192.168.1.2 ns_ip6_target 2001::1,2001::2 # ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/rt_link.yaml \ --do getlink --json '{"ifname": "bond0"}' --output-json | jq '.linkinfo' "arp-ip-target": [ "192.168.1.1", "192.168.1.2" ], [...] "ns-ip6-target": [ "2001::1", "2001::2" ],Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>Link: https://lore.kernel.org/r/20240404063114.1221532-3-liuhangbin@gmail.comSigned-off-by: Jakub Kicinski <kuba@kernel.org>
ynl: rename array-nest to indexed-arraySome implementations, like bonding, has nest array with same attr type.To support all kinds of entries under one nest array. As discussed[1],let's rename ar
ynl: rename array-nest to indexed-arraySome implementations, like bonding, has nest array with same attr type.To support all kinds of entries under one nest array. As discussed[1],let's rename array-nest to indexed-array, and assuming the value isa nest by passing the type via sub-type.[1] https://lore.kernel.org/netdev/20240312100105.16a59086@kernel.org/Suggested-by: Jakub Kicinski <kuba@kernel.org>Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>Link: https://lore.kernel.org/r/20240404063114.1221532-2-liuhangbin@gmail.comSigned-off-by: Jakub Kicinski <kuba@kernel.org>
doc/netlink: Describe nested structs in netlink raw docsAdd a description and example of nested struct definitionsto the netlink raw documentation.Signed-off-by: Donald Hunter <donald.hunter@gma
doc/netlink: Describe nested structs in netlink raw docsAdd a description and example of nested struct definitionsto the netlink raw documentation.Signed-off-by: Donald Hunter <donald.hunter@gmail.com>Reviewed-by: Jiri Pirko <jiri@nvidia.com>Link: https://lore.kernel.org/r/20240129223458.52046-12-donald.hunter@gmail.comSigned-off-by: Jakub Kicinski <kuba@kernel.org>
doc/netlink: Describe sub-message selector resolutionUpdate the netlink-raw docs to add a description of sub-message selectorresolution to explain that selector resolution is constrained by thesp
doc/netlink: Describe sub-message selector resolutionUpdate the netlink-raw docs to add a description of sub-message selectorresolution to explain that selector resolution is constrained by thespec.Signed-off-by: Donald Hunter <donald.hunter@gmail.com>Reviewed-by: Jiri Pirko <jiri@nvidia.com>Link: https://lore.kernel.org/r/20240129223458.52046-4-donald.hunter@gmail.comSigned-off-by: Jakub Kicinski <kuba@kernel.org>
doc/netlink: Document the sub-message format for netlink-rawDocument the spec format used by netlink-raw families like rt and tc.Reviewed-by: Jakub Kicinski <kuba@kernel.org>Signed-off-by: Donal
doc/netlink: Document the sub-message format for netlink-rawDocument the spec format used by netlink-raw families like rt and tc.Reviewed-by: Jakub Kicinski <kuba@kernel.org>Signed-off-by: Donald Hunter <donald.hunter@gmail.com>Link: https://lore.kernel.org/r/20231215093720.18774-4-donald.hunter@gmail.comSigned-off-by: Jakub Kicinski <kuba@kernel.org>
docs: netlink: add NLMSG_DONE message format for doit actionsIn case NLMSG_DONE message is sent as a reply to doit action, multiplekernel implementation do not send anything else than struct nlmsg
docs: netlink: add NLMSG_DONE message format for doit actionsIn case NLMSG_DONE message is sent as a reply to doit action, multiplekernel implementation do not send anything else than struct nlmsghdr.Add this note to the Netlink intro documentation.Signed-off-by: Jiri Pirko <jiri@nvidia.com>Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>Link: https://lore.kernel.org/r/20231201180154.864007-1-jiri@resnulli.usSigned-off-by: Jakub Kicinski <kuba@kernel.org>
docs: netlink: link to family documentations from spec infoTo increase the chances of people finding the rendered docsadd a link to specs.rst and index.rst.Add a label in the generated index.rst
docs: netlink: link to family documentations from spec infoTo increase the chances of people finding the rendered docsadd a link to specs.rst and index.rst.Add a label in the generated index.rst and while at it adjustthe title a little bit.Reviewed-by: Breno Leitao <leitao@debian.org>Reviewed-by: Donald Hunter <donald.hunter@gmail.com>Reviewed-by: Jiri Pirko <jiri@nvidia.com>Link: https://lore.kernel.org/r/20231129041427.2763074-1-kuba@kernel.orgSigned-off-by: Jakub Kicinski <kuba@kernel.org>
tools: ynl-gen: introduce support for bitfield32 attribute typeIntroduce support for attribute type bitfield32.Note that since the generated code works with struct nla_bitfield32,the generator ad
tools: ynl-gen: introduce support for bitfield32 attribute typeIntroduce support for attribute type bitfield32.Note that since the generated code works with struct nla_bitfield32,the generator adds netlink.h to the list of includes for userspaceheaders in case any bitfield32 is present.Note that this is added only to genetlink-legacy scheme as requestedby Jakub Kicinski.Signed-off-by: Jiri Pirko <jiri@nvidia.com>Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>Link: https://lore.kernel.org/r/20231021112711.660606-3-jiri@resnulli.usSigned-off-by: Jakub Kicinski <kuba@kernel.org>
netlink: add variable-length / auto integersWe currently push everyone to use padding to align 64b valuesin netlink. Un-padded nla_put_u64() doesn't even exist any more.The story behind this pos
netlink: add variable-length / auto integersWe currently push everyone to use padding to align 64b valuesin netlink. Un-padded nla_put_u64() doesn't even exist any more.The story behind this possibly start with this thread:https://lore.kernel.org/netdev/20121204.130914.1457976839967676240.davem@davemloft.net/where DaveM was concerned about the alignment of a structurecontaining 64b stats. If user space tries to access such structdirectly: struct some_stats *stats = nla_data(attr); printf("A: %llu", stats->a);lack of alignment may become problematic for some architectures.These days we most often put every single member in a separateattribute, meaning that the code above would use a helper likenla_get_u64(), which can deal with alignment internally.Even for arches which don't have good unaligned access - accessaligned to 4B should be pretty efficient.Kernel and well known libraries deal with unaligned input already.Padded 64b is quite space-inefficient (64b + pad means at worst 16Bper attr vs 32b which takes 8B). It is also more typing: if (nla_put_u64_pad(rsp, NETDEV_A_SOMETHING_SOMETHING, value, NETDEV_A_SOMETHING_PAD))Create a new attribute type which will use 32 bits at netlinklevel if value is small enough (probably most of the time?),and (4B-aligned) 64 bits otherwise. Kernel API is just: if (nla_put_uint(rsp, NETDEV_A_SOMETHING_SOMETHING, value))Calling this new type "just" sint / uint with no specific sizewill hopefully also make people more comfortable with using it.Currently telling people "don't use u8, you may need the bits,and netlink will round up to 4B, anyway" is the #1 commentwe give to newcomers.In terms of netlink layout it looks like this: 0 4 8 12 1632b: [nlattr][ u32 ]64b: [ pad ][nlattr][ u64 ]uint(32) [nlattr][ u32 ]uint(64) [nlattr][ u64 ]Signed-off-by: Jakub Kicinski <kuba@kernel.org>Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>Signed-off-by: David S. Miller <davem@davemloft.net>
docs: netlink: clean up after deprecating versionJiri moved version to legacy specs in commit 0f07415ebb78 ("netlink:specs: don't allow version to be specified for genetlink").Update the document
docs: netlink: clean up after deprecating versionJiri moved version to legacy specs in commit 0f07415ebb78 ("netlink:specs: don't allow version to be specified for genetlink").Update the documentation.Reviewed-by: Jiri Pirko <jiri@nvidia.com>Link: https://lore.kernel.org/r/20231016214540.1822392-1-kuba@kernel.orgSigned-off-by: Jakub Kicinski <kuba@kernel.org>
Merge tag 'net-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netPull networking updates from Jakub Kicinski: "Including fixes from netfilter and bpf. Current release - regres
Merge tag 'net-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netPull networking updates from Jakub Kicinski: "Including fixes from netfilter and bpf. Current release - regressions: - eth: stmmac: fix failure to probe without MAC interface specified Current release - new code bugs: - docs: netlink: fix missing classic_netlink doc reference Previous releases - regressions: - deal with integer overflows in kmalloc_reserve() - use sk_forward_alloc_get() in sk_get_meminfo() - bpf_sk_storage: fix the missing uncharge in sk_omem_alloc - fib: avoid warn splat in flow dissector after packet mangling - skb_segment: call zero copy functions before using skbuff frags - eth: sfc: check for zero length in EF10 RX prefix Previous releases - always broken: - af_unix: fix msg_controllen test in scm_pidfd_recv() for MSG_CMSG_COMPAT - xsk: fix xsk_build_skb() dereferencing possible ERR_PTR() - netfilter: - nft_exthdr: fix non-linear header modification - xt_u32, xt_sctp: validate user space input - nftables: exthdr: fix 4-byte stack OOB write - nfnetlink_osf: avoid OOB read - one more fix for the garbage collection work from last release - igmp: limit igmpv3_newpack() packet size to IP_MAX_MTU - bpf, sockmap: fix preempt_rt splat when using raw_spin_lock_t - handshake: fix null-deref in handshake_nl_done_doit() - ip: ignore dst hint for multipath routes to ensure packets are hashed across the nexthops - phy: micrel: - correct bit assignments for cable test errata - disable EEE according to the KSZ9477 errata Misc: - docs/bpf: document compile-once-run-everywhere (CO-RE) relocations - Revert "net: macsec: preserve ingress frame ordering", it appears to have been developed against an older kernel, problem doesn't exist upstream"* tag 'net-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (95 commits) net: enetc: distinguish error from valid pointers in enetc_fixup_clear_rss_rfs() Revert "net: team: do not use dynamic lockdep key" net: hns3: remove GSO partial feature bit net: hns3: fix the port information display when sfp is absent net: hns3: fix invalid mutex between tc qdisc and dcb ets command issue net: hns3: fix debugfs concurrency issue between kfree buffer and read net: hns3: fix byte order conversion issue in hclge_dbg_fd_tcam_read() net: hns3: Support query tx timeout threshold by debugfs net: hns3: fix tx timeout issue net: phy: Provide Module 4 KSZ9477 errata (DS80000754C) netfilter: nf_tables: Unbreak audit log reset netfilter: ipset: add the missing IP_SET_HASH_WITH_NET0 macro for ip_set_hash_netportnet.c netfilter: nft_set_rbtree: skip sync GC for new elements in this transaction netfilter: nf_tables: uapi: Describe NFTA_RULE_CHAIN_ID netfilter: nfnetlink_osf: avoid OOB read netfilter: nftables: exthdr: fix 4-byte stack OOB write selftests/bpf: Check bpf_sk_storage has uncharged sk_omem_alloc bpf: bpf_sk_storage: Fix the missing uncharge in sk_omem_alloc bpf: bpf_sk_storage: Fix invalid wait context lockdep report s390/bpf: Pass through tail call counter in trampolines ...
Merge tag 'docs-6.6' of git://git.lwn.net/linuxPull documentation updates from Jonathan Corbet: "Documentation work keeps chugging along; this includes: - Work from Carlos Bilbao to integrate
Merge tag 'docs-6.6' of git://git.lwn.net/linuxPull documentation updates from Jonathan Corbet: "Documentation work keeps chugging along; this includes: - Work from Carlos Bilbao to integrate rustdoc output into the generated HTML documentation. This took some work to figure out how to do it without slowing the docs build and without creating people who don't have Rust installed, but Carlos got there - Move the loongarch and mips architecture documentation under Documentation/arch/ - Some more maintainer documentation from Jakub ... plus the usual assortment of updates, translations, and fixes"* tag 'docs-6.6' of git://git.lwn.net/linux: (56 commits) Docu: genericirq.rst: fix irq-example input: docs: pxrc: remove reference to phoenix-sim Documentation: serial-console: Fix literal block marker docs/mm: remove references to hmm_mirror ops and clean typos docs/zh_CN: correct regi_chg(),regi_add() to region_chg(),region_add() Documentation: Fix typos Documentation/ABI: Fix typos scripts: kernel-doc: fix macro handling in enums scripts: kernel-doc: parse DEFINE_DMA_UNMAP_[ADDR|LEN] Documentation: riscv: Update boot image header since EFI stub is supported Documentation: riscv: Add early boot document Documentation: arm: Add bootargs to the table of added DT parameters docs: kernel-parameters: Refer to the correct bitmap function doc: update params of memhp_default_state= docs: Add book to process/kernel-docs.rst docs: sparse: fix invalid link addresses docs: vfs: clean up after the iterate() removal docs: Add a section on surveys to the researcher guidelines docs: move mips under arch docs: move loongarch under arch ...
doc/netlink: Fix missing classic_netlink doc referenceAdd missing cross-reference label for classic_netlink.Fixes: 2db8abf0b455 ("doc/netlink: Document the netlink-raw schema extensions")Signed-
doc/netlink: Fix missing classic_netlink doc referenceAdd missing cross-reference label for classic_netlink.Fixes: 2db8abf0b455 ("doc/netlink: Document the netlink-raw schema extensions")Signed-off-by: Donald Hunter <donald.hunter@gmail.com>Link: https://lore.kernel.org/r/20230829085539.36354-1-donald.hunter@gmail.comSigned-off-by: Jakub Kicinski <kuba@kernel.org>
doc/netlink: Document the netlink-raw schema extensionsAdd a doc page for netlink-raw that describes the schema attributesneeded for netlink-raw.Signed-off-by: Donald Hunter <donald.hunter@gmail
doc/netlink: Document the netlink-raw schema extensionsAdd a doc page for netlink-raw that describes the schema attributesneeded for netlink-raw.Signed-off-by: Donald Hunter <donald.hunter@gmail.com>Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>Link: https://lore.kernel.org/r/20230825122756.7603-5-donald.hunter@gmail.comSigned-off-by: Jakub Kicinski <kuba@kernel.org>
doc/netlink: Update genetlink-legacy documentationAdd documentation for recently added genetlink-legacy schema attributes.Remove statements about 'work in progress' and 'todo'.Signed-off-by: Don
doc/netlink: Update genetlink-legacy documentationAdd documentation for recently added genetlink-legacy schema attributes.Remove statements about 'work in progress' and 'todo'.Signed-off-by: Donald Hunter <donald.hunter@gmail.com>Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>Link: https://lore.kernel.org/r/20230825122756.7603-4-donald.hunter@gmail.comSigned-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation: Fix typosFix typos in Documentation.Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>Link: https://lore.kernel.org/r/20230814212822.193684-4-helgaas@kernel.orgSigned-off-by: Jon
Documentation: Fix typosFix typos in Documentation.Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>Link: https://lore.kernel.org/r/20230814212822.193684-4-helgaas@kernel.orgSigned-off-by: Jonathan Corbet <corbet@lwn.net>
tools: ynl: user space helpersAdd "fixed" part of the user space Netlink Spec-based library.This will get linked with the protocol implementations to forma full API.Acked-by: Willem de Bruijn <
tools: ynl: user space helpersAdd "fixed" part of the user space Netlink Spec-based library.This will get linked with the protocol implementations to forma full API.Acked-by: Willem de Bruijn <willemb@google.com>Signed-off-by: Jakub Kicinski <kuba@kernel.org>
docs: netlink: document the sub-type attribute propertyAdd a definition for sub-type to the protocol spec doc and a description ofits usage for C arrays in genetlink-legacy.Signed-off-by: Donald
docs: netlink: document the sub-type attribute propertyAdd a definition for sub-type to the protocol spec doc and a description ofits usage for C arrays in genetlink-legacy.Signed-off-by: Donald Hunter <donald.hunter@gmail.com>Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>Signed-off-by: Jakub Kicinski <kuba@kernel.org>
docs: netlink: document struct support for genetlink-legacyDescribe the genetlink-legacy support for using struct definitionsfor fixed headers and for binary attributes.Signed-off-by: Donald Hun
docs: netlink: document struct support for genetlink-legacyDescribe the genetlink-legacy support for using struct definitionsfor fixed headers and for binary attributes.Signed-off-by: Donald Hunter <donald.hunter@gmail.com>Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>Signed-off-by: Jakub Kicinski <kuba@kernel.org>
ynl: broaden the license even moreI relicensed Netlink spec code to GPL-2.0 OR BSD-3-Clause butwe still put a slightly different license on the uAPI headerthan the rest of the code. Use the Linux
ynl: broaden the license even moreI relicensed Netlink spec code to GPL-2.0 OR BSD-3-Clause butwe still put a slightly different license on the uAPI headerthan the rest of the code. Use the Linux-syscall-note on allthe specs and all generated code. It's moot for kernel code,but should not hurt. This way the licenses match everywhere.Cc: Chuck Lever <chuck.lever@oracle.com>Fixes: 37d9df224d1e ("ynl: re-license uniformly under GPL-2.0 OR BSD-3-Clause")Reviewed-by: Chuck Lever <chuck.lever@oracle.com>Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12