Networking changes for 6.8.

Core & protocols
 ----------------
 
  - Analyze and reorganize core networking structs (socks, netdev,
    netns, mibs) to optimize cacheline consumption and set up
    build time warnings to safeguard against future header changes.
    This improves TCP performances with many concurrent connections
    up to 40%.
 
  - Add page-pool netlink-based introspection, exposing the
    memory usage and recycling stats. This helps indentify
    bad PP users and possible leaks.
 
  - Refine TCP/DCCP source port selection to no longer favor even
    source port at connect() time when IP_LOCAL_PORT_RANGE is set.
    This lowers the time taken by connect() for hosts having
    many active connections to the same destination.
 
  - Refactor the TCP bind conflict code, shrinking related socket
    structs.
 
  - Refactor TCP SYN-Cookie handling, as a preparation step to
    allow arbitrary SYN-Cookie processing via eBPF.
 
  - Tune optmem_max for 0-copy usage, increasing the default value
    to 128KB and namespecifying it.
 
  - Allow coalescing for cloned skbs coming from page pools, improving
    RX performances with some common configurations.
 
  - Reduce extension header parsing overhead at GRO time.
 
  - Add bridge MDB bulk deletion support, allowing user-space to
    request the deletion of matching entries.
 
  - Reorder nftables struct members, to keep data accessed by the
    datapath first.
 
  - Introduce TC block ports tracking and use. This allows supporting
    multicast-like behavior at the TC layer.
 
  - Remove UAPI support for retired TC qdiscs (dsmark, CBQ and ATM) and
    classifiers (RSVP and tcindex).
 
  - More data-race annotations.
 
  - Extend the diag interface to dump TCP bound-only sockets.
 
  - Conditional notification of events for TC qdisc class and actions.
 
  - Support for WPAN dynamic associations with nearby devices, to form
    a sub-network using a specific PAN ID.
 
  - Implement SMCv2.1 virtual ISM device support.
 
  - Add support for Batman-avd mulicast packet type.
 
 BPF
 ---
 
  - Tons of verifier improvements:
    - BPF register bounds logic and range support along with a large
      test suite
    - log improvements
    - complete precision tracking support for register spills
    - track aligned STACK_ZERO cases as imprecise spilled registers. It
      improves the verifier "instructions processed" metric from single
      digit to 50-60% for some programs
    - support for user's global BPF subprogram arguments with few
      commonly requested annotations for a better developer experience
    - support tracking of BPF_JNE which helps cases when the compiler
      transforms (unsigned) "a > 0" into "if a == 0 goto xxx" and the
      like
    - several fixes
 
  - Add initial TX metadata implementation for AF_XDP with support in
    mlx5 and stmmac drivers. Two types of offloads are supported right
    now, that is, TX timestamp and TX checksum offload.
 
  - Fix kCFI bugs in BPF all forms of indirect calls from BPF into
    kernel and from kernel into BPF work with CFI enabled. This allows
    BPF to work with CONFIG_FINEIBT=y.
 
  - Change BPF verifier logic to validate global subprograms lazily
    instead of unconditionally before the main program, so they can be
    guarded using BPF CO-RE techniques.
 
  - Support uid/gid options when mounting bpffs.
 
  - Add a new kfunc which acquires the associated cgroup of a task
    within a specific cgroup v1 hierarchy where the latter is identified
    by its id.
 
  - Extend verifier to allow bpf_refcount_acquire() of a map value field
    obtained via direct load which is a use-case needed in sched_ext.
 
  - Add BPF link_info support for uprobe multi link along with bpftool
    integration for the latter.
 
  - Support for VLAN tag in XDP hints.
 
  - Remove deprecated bpfilter kernel leftovers given the project
    is developed in user-space (https://github.com/facebook/bpfilter).
 
 Misc
 ----
 
  - Support for parellel TC self-tests execution.
 
  - Increase MPTCP self-tests coverage.
 
  - Updated the bridge documentation, including several so-far
    undocumented features.
 
  - Convert all the net self-tests to run in unique netns, to
    avoid random failures due to conflict and allow concurrent
    runs.
 
  - Add TCP-AO self-tests.
 
  - Add kunit tests for both cfg80211 and mac80211.
 
  - Autogenerate Netlink families documentation from YAML spec.
 
  - Add yml-gen support for fixed headers and recursive nests, the
    tool can now generate user-space code for all genetlink families
    for which we have specs.
 
  - A bunch of additional module descriptions fixes.
 
  - Catch incorrect freeing of pages belonging to a page pool.
 
 Driver API
 ----------
 
  - Rust abstractions for network PHY drivers; do not cover yet the
    full C API, but already allow implementing functional PHY drivers
    in rust.
 
  - Introduce queue and NAPI support in the netdev Netlink interface,
    allowing complete access to the device <> NAPIs <> queues
    relationship.
 
  - Introduce notifications filtering for devlink to allow control
    application scale to thousands of instances.
 
  - Improve PHY validation, requesting rate matching information for
    each ethtool link mode supported by both the PHY and host.
 
  - Add support for ethtool symmetric-xor RSS hash.
 
  - ACPI based Wifi band RFI (WBRF) mitigation feature for the AMD
    platform.
 
  - Expose pin fractional frequency offset value over new DPLL generic
    netlink attribute.
 
  - Convert older drivers to platform remove callback returning void.
 
  - Add support for PHY package MMD read/write.
 
 New hardware / drivers
 ----------------------
 
  - Ethernet:
    - Octeon CN10K devices
    - Broadcom 5760X P7
    - Qualcomm SM8550 SoC
    - Texas Instrument DP83TG720S PHY
 
  - Bluetooth:
    - IMC Networks Bluetooth radio
 
 Removed
 -------
 
  - WiFi:
    - libertas 16-bit PCMCIA support
    - Atmel at76c50x drivers
    - HostAP ISA/PCMCIA style 802.11b driver
    - zd1201 802.11b USB dongles
    - Orinoco ISA/PCMCIA 802.11b driver
    - Aviator/Raytheon driver
    - Planet WL3501 driver
    - RNDIS USB 802.11b driver
 
 Drivers
 -------
 
  - Ethernet high-speed NICs:
    - Intel (100G, ice, idpf):
      - allow one by one port representors creation and removal
      - add temperature and clock information reporting
      - add get/set for ethtool's header split ringparam
      - add again FW logging
      - adds support switchdev hardware packet mirroring
      - iavf: implement symmetric-xor RSS hash
      - igc: add support for concurrent physical and free-running timers
      - i40e: increase the allowable descriptors
    - nVidia/Mellanox:
      - Preparation for Socket-Direct multi-dev netdev. That will allow
        in future releases combining multiple PFs devices attached to
        different NUMA nodes under the same netdev
    - Broadcom (bnxt):
      - TX completion handling improvements
      - add basic ntuple filter support
      - reduce MSIX vectors usage for MQPRIO offload
      - add VXLAN support, USO offload and TX coalesce completion for P7
    - Marvell Octeon EP:
      - xmit-more support
      - add PF-VF mailbox support and use it for FW notifications for VFs
    - Wangxun (ngbe/txgbe):
      - implement ethtool functions to operate pause param, ring param,
        coalesce channel number and msglevel
    - Netronome/Corigine (nfp):
      - add flow-steering support
      - support UDP segmentation offload
 
  - Ethernet NICs embedded, slower, virtual:
    - Xilinx AXI: remove duplicate DMA code adopting the dma engine driver
    - stmmac: add support for HW-accelerated VLAN stripping
    - TI AM654x sw: add mqprio, frame preemption & coalescing
    - gve: add support for non-4k page sizes.
    - virtio-net: support dynamic coalescing moderation
 
  - nVidia/Mellanox Ethernet datacenter switches:
    - allow firmware upgrade without a reboot
    - more flexible support for bridge flooding via the compressed
      FID flooding mode
 
  - Ethernet embedded switches:
    - Microchip:
      - fine-tune flow control and speed configurations in KSZ8xxx
      - KSZ88X3: enable setting rmii reference
    - Renesas:
      - add jumbo frames support
    - Marvell:
      - 88E6xxx: add "eth-mac" and "rmon" stats support
 
  - Ethernet PHYs:
    - aquantia: add firmware load support
    - at803x: refactor the driver to simplify adding support for more
      chip variants
    - NXP C45 TJA11xx: Add MACsec offload support
 
  - Wifi:
    - MediaTek (mt76):
      - NVMEM EEPROM improvements
      - mt7996 Extremely High Throughput (EHT) improvements
      - mt7996 Wireless Ethernet Dispatcher (WED) support
      - mt7996 36-bit DMA support
    - Qualcomm (ath12k):
      - support for a single MSI vector
      - WCN7850: support AP mode
    - Intel (iwlwifi):
      - new debugfs file fw_dbg_clear
      - allow concurrent P2P operation on DFS channels
 
  - Bluetooth:
    - QCA2066: support HFP offload
    - ISO: more broadcast-related improvements
    - NXP: better recovery in case receiver/transmitter get out of sync
 
 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEEg1AjqC77wbdLX2LbKSR5jcyPE6QFAmWdamsSHHBhYmVuaUBy
 ZWRoYXQuY29tAAoJECkkeY3MjxOkGC4P/2xjLzdw22ckSssuE9ORbGko9SNjnqHk
 PQh1E+26BHiCg5KB8VvzMsL78E79MRNXEattSW+1g7dhCvln3oi+Vd0WkdRkgt35
 98Iv18zLbbwFAJeyKvmLAPAkQkMLtVj19QILBBRrugF+egEZgVSE3JBcTAiKv2ZQ
 HzkabA171Ri6LpCcEEtY5XuaKvimGnGzF8YMFf8rX0wtqd2p5kbY9aMe47WAGxvU
 Vf9548XvH+A5yVH2/4/gujtUOpA/RHuhuCMb+oo0cZ+VCC1x9MGzoXzj6r87OTkf
 k2W1whNzcGoin92f+9Lk1JYMuiGKBH4QVaDdNXJnYFSJWPTE7RvRsPzYTSD4/GzK
 yEZbzSJXpy/2vDQm16NoAxl7evRs8Sorzkw4LQRviZHI/5SAkK2ZQiCK5CO8QSYy
 C1LELcV5kn6Foe24xWnrWLjAGug9oJnYoGPMU5gvPmFJMvUMXqm5rmbBgUWL5Rxw
 q1M6gVzabCyWUy6z2G2vaqW2ZntNVvCkdsLtIX0XZkcTzNoP0MA+TuhyGz4wbiuo
 PeyQp/mbGnDgCYggqKIA0YWrTVxkhFrKN520cbO8qXBQytV9oFbM/0/+C0/r/5WX
 pL1JVzLrh6l5ME7EIQfha8UOF9j8q4ueSwb40P3AR2NaZiDABM0zfUZ6+sx+91WF
 ucqPEcZB5cRE
 =1bW6
 -----END PGP SIGNATURE-----

Merge tag 'net-next-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next

Pull networking updates from Paolo Abeni:
 "The most interesting thing is probably the networking structs
  reorganization and a significant amount of changes is around
  self-tests.

  Core & protocols:

   - Analyze and reorganize core networking structs (socks, netdev,
     netns, mibs) to optimize cacheline consumption and set up build
     time warnings to safeguard against future header changes

     This improves TCP performances with many concurrent connections up
     to 40%

   - Add page-pool netlink-based introspection, exposing the memory
     usage and recycling stats. This helps indentify bad PP users and
     possible leaks

   - Refine TCP/DCCP source port selection to no longer favor even
     source port at connect() time when IP_LOCAL_PORT_RANGE is set. This
     lowers the time taken by connect() for hosts having many active
     connections to the same destination

   - Refactor the TCP bind conflict code, shrinking related socket
     structs

   - Refactor TCP SYN-Cookie handling, as a preparation step to allow
     arbitrary SYN-Cookie processing via eBPF

   - Tune optmem_max for 0-copy usage, increasing the default value to
     128KB and namespecifying it

   - Allow coalescing for cloned skbs coming from page pools, improving
     RX performances with some common configurations

   - Reduce extension header parsing overhead at GRO time

   - Add bridge MDB bulk deletion support, allowing user-space to
     request the deletion of matching entries

   - Reorder nftables struct members, to keep data accessed by the
     datapath first

   - Introduce TC block ports tracking and use. This allows supporting
     multicast-like behavior at the TC layer

   - Remove UAPI support for retired TC qdiscs (dsmark, CBQ and ATM) and
     classifiers (RSVP and tcindex)

   - More data-race annotations

   - Extend the diag interface to dump TCP bound-only sockets

   - Conditional notification of events for TC qdisc class and actions

   - Support for WPAN dynamic associations with nearby devices, to form
     a sub-network using a specific PAN ID

   - Implement SMCv2.1 virtual ISM device support

   - Add support for Batman-avd mulicast packet type

  BPF:

   - Tons of verifier improvements:
       - BPF register bounds logic and range support along with a large
         test suite
       - log improvements
       - complete precision tracking support for register spills
       - track aligned STACK_ZERO cases as imprecise spilled registers.
         This improves the verifier "instructions processed" metric from
         single digit to 50-60% for some programs
       - support for user's global BPF subprogram arguments with few
         commonly requested annotations for a better developer
         experience
       - support tracking of BPF_JNE which helps cases when the compiler
         transforms (unsigned) "a > 0" into "if a == 0 goto xxx" and the
         like
       - several fixes

   - Add initial TX metadata implementation for AF_XDP with support in
     mlx5 and stmmac drivers. Two types of offloads are supported right
     now, that is, TX timestamp and TX checksum offload

   - Fix kCFI bugs in BPF all forms of indirect calls from BPF into
     kernel and from kernel into BPF work with CFI enabled. This allows
     BPF to work with CONFIG_FINEIBT=y

   - Change BPF verifier logic to validate global subprograms lazily
     instead of unconditionally before the main program, so they can be
     guarded using BPF CO-RE techniques

   - Support uid/gid options when mounting bpffs

   - Add a new kfunc which acquires the associated cgroup of a task
     within a specific cgroup v1 hierarchy where the latter is
     identified by its id

   - Extend verifier to allow bpf_refcount_acquire() of a map value
     field obtained via direct load which is a use-case needed in
     sched_ext

   - Add BPF link_info support for uprobe multi link along with bpftool
     integration for the latter

   - Support for VLAN tag in XDP hints

   - Remove deprecated bpfilter kernel leftovers given the project is
     developed in user-space (https://github.com/facebook/bpfilter)

  Misc:

   - Support for parellel TC self-tests execution

   - Increase MPTCP self-tests coverage

   - Updated the bridge documentation, including several so-far
     undocumented features

   - Convert all the net self-tests to run in unique netns, to avoid
     random failures due to conflict and allow concurrent runs

   - Add TCP-AO self-tests

   - Add kunit tests for both cfg80211 and mac80211

   - Autogenerate Netlink families documentation from YAML spec

   - Add yml-gen support for fixed headers and recursive nests, the tool
     can now generate user-space code for all genetlink families for
     which we have specs

   - A bunch of additional module descriptions fixes

   - Catch incorrect freeing of pages belonging to a page pool

  Driver API:

   - Rust abstractions for network PHY drivers; do not cover yet the
     full C API, but already allow implementing functional PHY drivers
     in rust

   - Introduce queue and NAPI support in the netdev Netlink interface,
     allowing complete access to the device <> NAPIs <> queues
     relationship

   - Introduce notifications filtering for devlink to allow control
     application scale to thousands of instances

   - Improve PHY validation, requesting rate matching information for
     each ethtool link mode supported by both the PHY and host

   - Add support for ethtool symmetric-xor RSS hash

   - ACPI based Wifi band RFI (WBRF) mitigation feature for the AMD
     platform

   - Expose pin fractional frequency offset value over new DPLL generic
     netlink attribute

   - Convert older drivers to platform remove callback returning void

   - Add support for PHY package MMD read/write

  New hardware / drivers:

   - Ethernet:
       - Octeon CN10K devices
       - Broadcom 5760X P7
       - Qualcomm SM8550 SoC
       - Texas Instrument DP83TG720S PHY

   - Bluetooth:
       - IMC Networks Bluetooth radio

  Removed:

   - WiFi:
       - libertas 16-bit PCMCIA support
       - Atmel at76c50x drivers
       - HostAP ISA/PCMCIA style 802.11b driver
       - zd1201 802.11b USB dongles
       - Orinoco ISA/PCMCIA 802.11b driver
       - Aviator/Raytheon driver
       - Planet WL3501 driver
       - RNDIS USB 802.11b driver

  Driver updates:

   - Ethernet high-speed NICs:
       - Intel (100G, ice, idpf):
          - allow one by one port representors creation and removal
          - add temperature and clock information reporting
          - add get/set for ethtool's header split ringparam
          - add again FW logging
          - adds support switchdev hardware packet mirroring
          - iavf: implement symmetric-xor RSS hash
          - igc: add support for concurrent physical and free-running
            timers
          - i40e: increase the allowable descriptors
       - nVidia/Mellanox:
          - Preparation for Socket-Direct multi-dev netdev. That will
            allow in future releases combining multiple PFs devices
            attached to different NUMA nodes under the same netdev
       - Broadcom (bnxt):
          - TX completion handling improvements
          - add basic ntuple filter support
          - reduce MSIX vectors usage for MQPRIO offload
          - add VXLAN support, USO offload and TX coalesce completion
            for P7
       - Marvell Octeon EP:
          - xmit-more support
          - add PF-VF mailbox support and use it for FW notifications
            for VFs
       - Wangxun (ngbe/txgbe):
          - implement ethtool functions to operate pause param, ring
            param, coalesce channel number and msglevel
       - Netronome/Corigine (nfp):
          - add flow-steering support
          - support UDP segmentation offload

   - Ethernet NICs embedded, slower, virtual:
       - Xilinx AXI: remove duplicate DMA code adopting the dma engine
         driver
       - stmmac: add support for HW-accelerated VLAN stripping
       - TI AM654x sw: add mqprio, frame preemption & coalescing
       - gve: add support for non-4k page sizes.
       - virtio-net: support dynamic coalescing moderation

   - nVidia/Mellanox Ethernet datacenter switches:
       - allow firmware upgrade without a reboot
       - more flexible support for bridge flooding via the compressed
         FID flooding mode

   - Ethernet embedded switches:
       - Microchip:
          - fine-tune flow control and speed configurations in KSZ8xxx
          - KSZ88X3: enable setting rmii reference
       - Renesas:
          - add jumbo frames support
       - Marvell:
          - 88E6xxx: add "eth-mac" and "rmon" stats support

   - Ethernet PHYs:
       - aquantia: add firmware load support
       - at803x: refactor the driver to simplify adding support for more
         chip variants
       - NXP C45 TJA11xx: Add MACsec offload support

   - Wifi:
       - MediaTek (mt76):
          - NVMEM EEPROM improvements
          - mt7996 Extremely High Throughput (EHT) improvements
          - mt7996 Wireless Ethernet Dispatcher (WED) support
          - mt7996 36-bit DMA support
       - Qualcomm (ath12k):
          - support for a single MSI vector
          - WCN7850: support AP mode
       - Intel (iwlwifi):
          - new debugfs file fw_dbg_clear
          - allow concurrent P2P operation on DFS channels

   - Bluetooth:
       - QCA2066: support HFP offload
       - ISO: more broadcast-related improvements
       - NXP: better recovery in case receiver/transmitter get out of sync"

* tag 'net-next-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (1714 commits)
  lan78xx: remove redundant statement in lan78xx_get_eee
  lan743x: remove redundant statement in lan743x_ethtool_get_eee
  bnxt_en: Fix RCU locking for ntuple filters in bnxt_rx_flow_steer()
  bnxt_en: Fix RCU locking for ntuple filters in bnxt_srxclsrldel()
  bnxt_en: Remove unneeded variable in bnxt_hwrm_clear_vnic_filter()
  tcp: Revert no longer abort SYN_SENT when receiving some ICMP
  Revert "mlx5 updates 2023-12-20"
  Revert "net: stmmac: Enable Per DMA Channel interrupt"
  ipvlan: Remove usage of the deprecated ida_simple_xx() API
  ipvlan: Fix a typo in a comment
  net/sched: Remove ipt action tests
  net: stmmac: Use interrupt mode INTM=1 for per channel irq
  net: stmmac: Add support for TX/RX channel interrupt
  net: stmmac: Make MSI interrupt routine generic
  dt-bindings: net: snps,dwmac: per channel irq
  net: phy: at803x: make read_status more generic
  net: phy: at803x: add support for cdt cross short test for qca808x
  net: phy: at803x: refactor qca808x cable test get status function
  net: phy: at803x: generalize cdt fault length function
  net: ethernet: cortina: Drop TSO support
  ...
This commit is contained in:
Linus Torvalds 2024-01-11 10:07:29 -08:00
commit 3e7aeb78ab
1785 changed files with 91338 additions and 108932 deletions

View File

@ -608,6 +608,9 @@ Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Uwe Kleine-König <ukleinek@strlen.de>
Uwe Kleine-König <ukl@pengutronix.de>
Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Vadim Fedorenko <vadim.fedorenko@linux.dev> <vadfed@fb.com>
Vadim Fedorenko <vadim.fedorenko@linux.dev> <vadfed@meta.com>
Vadim Fedorenko <vadim.fedorenko@linux.dev> <vfedorenko@novek.ru>
Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Vara Reddy <quic_varar@quicinc.com> <varar@codeaurora.org>
Varadarajan Narayanan <quic_varada@quicinc.com> <varada@codeaurora.org>

View File

@ -97,7 +97,21 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
cp $(if $(patsubst /%,,$(DOCS_CSS)),$(abspath $(srctree)/$(DOCS_CSS)),$(DOCS_CSS)) $(BUILDDIR)/$3/_static/; \
fi
htmldocs:
YNL_INDEX:=$(srctree)/Documentation/networking/netlink_spec/index.rst
YNL_RST_DIR:=$(srctree)/Documentation/networking/netlink_spec
YNL_YAML_DIR:=$(srctree)/Documentation/netlink/specs
YNL_TOOL:=$(srctree)/tools/net/ynl/ynl-gen-rst.py
YNL_RST_FILES_TMP := $(patsubst %.yaml,%.rst,$(wildcard $(YNL_YAML_DIR)/*.yaml))
YNL_RST_FILES := $(patsubst $(YNL_YAML_DIR)%,$(YNL_RST_DIR)%, $(YNL_RST_FILES_TMP))
$(YNL_INDEX): $(YNL_RST_FILES)
$(Q)$(YNL_TOOL) -o $@ -x
$(YNL_RST_DIR)/%.rst: $(YNL_YAML_DIR)/%.yaml $(YNL_TOOL)
$(Q)$(YNL_TOOL) -i $< -o $@
htmldocs: $(YNL_INDEX)
@$(srctree)/scripts/sphinx-pre-install --version-check
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var)))

View File

@ -345,7 +345,10 @@ optmem_max
----------
Maximum ancillary buffer size allowed per socket. Ancillary data is a sequence
of struct cmsghdr structures with appended data.
of struct cmsghdr structures with appended data. TCP tx zerocopy also uses
optmem_max as a limit for its internal structures.
Default : 128 KB
fb_tunnels_only_for_init_net
----------------------------

View File

@ -352,7 +352,7 @@ can be used to query the contents of cpumasks.
.. kernel-doc:: kernel/bpf/cpumask.c
:identifiers: bpf_cpumask_first bpf_cpumask_first_zero bpf_cpumask_first_and
bpf_cpumask_test_cpu
bpf_cpumask_test_cpu bpf_cpumask_weight
.. kernel-doc:: kernel/bpf/cpumask.c
:identifiers: bpf_cpumask_equal bpf_cpumask_intersects bpf_cpumask_subset

View File

@ -0,0 +1,21 @@
.. SPDX-License-Identifier: GPL-2.0
.. _fs_kfuncs-header-label:
=====================
BPF filesystem kfuncs
=====================
BPF LSM programs need to access filesystem data from LSM hooks. The following
BPF kfuncs can be used to get these data.
* ``bpf_get_file_xattr()``
* ``bpf_get_fsverity_digest()``
To avoid recursions, these kfuncs follow the following rules:
1. These kfuncs are only permitted from BPF LSM function.
2. These kfuncs should not call into other LSM hooks, i.e. security_*(). For
example, ``bpf_get_file_xattr()`` does not use ``vfs_getxattr()``, because
the latter calls LSM hook ``security_inode_getxattr``.

View File

@ -21,6 +21,7 @@ that goes into great technical depth about the BPF Architecture.
helpers
kfuncs
cpumasks
fs_kfuncs
programs
maps
bpf_prog_run

View File

@ -135,6 +135,30 @@ Either way, the returned buffer is either NULL, or of size buffer_szk. Without t
annotation, the verifier will reject the program if a null pointer is passed in with
a nonzero size.
2.2.5 __str Annotation
----------------------------
This annotation is used to indicate that the argument is a constant string.
An example is given below::
__bpf_kfunc bpf_get_file_xattr(..., const char *name__str, ...)
{
...
}
In this case, ``bpf_get_file_xattr()`` can be called as::
bpf_get_file_xattr(..., "xattr_name", ...);
Or::
const char name[] = "xattr_name"; /* This need to be global */
int BPF_PROG(...)
{
...
bpf_get_file_xattr(..., name, ...);
...
}
.. _BPF_kfunc_nodef:

View File

@ -566,13 +566,9 @@ By reusing the same ``cases`` array from above, we can write the test as a
},
};
// Need a helper function to generate a name for each test case.
static void case_to_desc(const struct sha1_test_case *t, char *desc)
{
strcpy(desc, t->str);
}
// Creates `sha1_gen_params()` to iterate over `cases`.
KUNIT_ARRAY_PARAM(sha1, cases, case_to_desc);
// Creates `sha1_gen_params()` to iterate over `cases` while using
// the struct member `str` for the case description.
KUNIT_ARRAY_PARAM_DESC(sha1, cases, str);
// Looks no different from a normal test.
static void sha1_test(struct kunit *test)
@ -588,7 +584,7 @@ By reusing the same ``cases`` array from above, we can write the test as a
}
// Instead of KUNIT_CASE, we use KUNIT_CASE_PARAM and pass in the
// function declared by KUNIT_ARRAY_PARAM.
// function declared by KUNIT_ARRAY_PARAM or KUNIT_ARRAY_PARAM_DESC.
static struct kunit_case sha1_test_cases[] = {
KUNIT_CASE_PARAM(sha1_test, sha1_gen_params),
{}

View File

@ -46,4 +46,10 @@ $defs:
$ref: dsa-port.yaml#
unevaluatedProperties: false
oneOf:
- required:
- ports
- required:
- ethernet-ports
...

View File

@ -0,0 +1,88 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/dsa/marvell,mv88e6060.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Marvell MV88E6060 DSA switch
maintainers:
- Andrew Lunn <andrew@lunn.ch>
description:
The Marvell MV88E6060 switch has been produced and sold by Marvell
since at least 2008. The switch has one pin ADDR4 that controls the
MDIO address of the switch to be 0x10 or 0x00, and on the MDIO bus
connected to the switch, the PHYs inside the switch appear as
independent devices on address 0x00-0x04 or 0x10-0x14, so in difference
from many other DSA switches this switch does not have an internal
MDIO bus for the PHY devices.
properties:
compatible:
const: marvell,mv88e6060
description:
The MV88E6060 is the oldest Marvell DSA switch product, and
as such a bit limited in features compared to later hardware.
reg:
maxItems: 1
reset-gpios:
description:
GPIO to be used to reset the whole device
maxItems: 1
allOf:
- $ref: dsa.yaml#/$defs/ethernet-ports
required:
- compatible
- reg
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethernet-switch@16 {
compatible = "marvell,mv88e6060";
reg = <16>;
ethernet-ports {
#address-cells = <1>;
#size-cells = <0>;
ethernet-port@0 {
reg = <0>;
label = "lan1";
};
ethernet-port@1 {
reg = <1>;
label = "lan2";
};
ethernet-port@2 {
reg = <2>;
label = "lan3";
};
ethernet-port@3 {
reg = <3>;
label = "lan4";
};
ethernet-port@5 {
reg = <5>;
phy-mode = "rev-mii";
ethernet = <&ethc>;
fixed-link {
speed = <100>;
full-duplex;
};
};
};
};
};

View File

@ -0,0 +1,337 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/dsa/marvell,mv88e6xxx.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Marvell MV88E6xxx DSA switch family
maintainers:
- Andrew Lunn <andrew@lunn.ch>
description:
The Marvell MV88E6xxx switch series has been produced and sold
by Marvell since at least 2008. The switch has a few compatibles which
just indicate the base address of the switch, then operating systems
can investigate switch ID registers to find out which actual version
of the switch it is dealing with.
properties:
compatible:
oneOf:
- enum:
- marvell,mv88e6085
- marvell,mv88e6190
- marvell,mv88e6250
description: |
marvell,mv88e6085: This switch uses base address 0x10.
This switch and its siblings will be autodetected from
ID registers found in the switch, so only "marvell,mv88e6085" should be
specified. This includes the following list of MV88Exxxx switches:
6085, 6095, 6097, 6123, 6131, 6141, 6161, 6165, 6171, 6172, 6175, 6176,
6185, 6240, 6320, 6321, 6341, 6350, 6351, 6352
marvell,mv88e6190: This switch uses base address 0x00.
This switch and its siblings will be autodetected from
ID registers found in the switch, so only "marvell,mv88e6190" should be
specified. This includes the following list of MV88Exxxx switches:
6190, 6190X, 6191, 6290, 6361, 6390, 6390X
marvell,mv88e6250: This switch uses base address 0x08 or 0x18.
This switch and its siblings will be autodetected from
ID registers found in the switch, so only "marvell,mv88e6250" should be
specified. This includes the following list of MV88Exxxx switches:
6220, 6250
- items:
- const: marvell,turris-mox-mv88e6085
- const: marvell,mv88e6085
- items:
- const: marvell,turris-mox-mv88e6190
- const: marvell,mv88e6190
reg:
maxItems: 1
eeprom-length:
$ref: /schemas/types.yaml#/definitions/uint32
description: Set to the length of an EEPROM connected to the switch. Must be
set if the switch can not detect the presence and/or size of a connected
EEPROM, otherwise optional.
reset-gpios:
description:
GPIO to be used to reset the whole device
maxItems: 1
interrupts:
description: The switch provides an external interrupt line, but it is
not always used by target systems.
maxItems: 1
interrupt-controller:
description: The switch has an internal interrupt controller used by
the different sub-blocks.
'#interrupt-cells':
description: The internal interrupt controller only supports triggering
on active high level interrupts so the second cell must alway be set to
IRQ_TYPE_LEVEL_HIGH.
const: 2
mdio:
$ref: /schemas/net/mdio.yaml#
unevaluatedProperties: false
description: Marvell MV88E6xxx switches have an varying combination of
internal and external MDIO buses, in some cases a combined bus that
can be used both internally and externally. This node is for the
primary bus, used internally and sometimes also externally.
mdio-external:
$ref: /schemas/net/mdio.yaml#
unevaluatedProperties: false
description: Marvell MV88E6xxx switches that have a separate external
MDIO bus use this port to access external components on the MDIO bus.
properties:
compatible:
const: marvell,mv88e6xxx-mdio-external
required:
- compatible
allOf:
- $ref: dsa.yaml#/$defs/ethernet-ports
required:
- compatible
- reg
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethernet-switch@0 {
compatible = "marvell,mv88e6085";
reg = <0>;
reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
sw_phy0: ethernet-phy@0 {
reg = <0x0>;
};
sw_phy1: ethernet-phy@1 {
reg = <0x1>;
};
sw_phy2: ethernet-phy@2 {
reg = <0x2>;
};
sw_phy3: ethernet-phy@3 {
reg = <0x3>;
};
};
ethernet-ports {
#address-cells = <1>;
#size-cells = <0>;
ethernet-port@0 {
reg = <0>;
label = "lan4";
phy-handle = <&sw_phy0>;
phy-mode = "internal";
};
ethernet-port@1 {
reg = <1>;
label = "lan3";
phy-handle = <&sw_phy1>;
phy-mode = "internal";
};
ethernet-port@2 {
reg = <2>;
label = "lan2";
phy-handle = <&sw_phy2>;
phy-mode = "internal";
};
ethernet-port@3 {
reg = <3>;
label = "lan1";
phy-handle = <&sw_phy3>;
phy-mode = "internal";
};
ethernet-port@5 {
reg = <5>;
ethernet = <&fec>;
phy-mode = "rgmii-id";
fixed-link {
speed = <1000>;
full-duplex;
};
};
};
};
};
- |
#include <dt-bindings/interrupt-controller/irq.h>
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethernet-switch@0 {
compatible = "marvell,mv88e6190";
#interrupt-cells = <2>;
interrupt-controller;
interrupt-parent = <&gpio1>;
interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
pinctrl-0 = <&switch_interrupt_pins>;
pinctrl-names = "default";
reg = <0>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
switch0phy1: ethernet-phy@1 {
reg = <0x1>;
};
switch0phy2: ethernet-phy@2 {
reg = <0x2>;
};
switch0phy3: ethernet-phy@3 {
reg = <0x3>;
};
switch0phy4: ethernet-phy@4 {
reg = <0x4>;
};
switch0phy5: ethernet-phy@5 {
reg = <0x5>;
};
switch0phy6: ethernet-phy@6 {
reg = <0x6>;
};
switch0phy7: ethernet-phy@7 {
reg = <0x7>;
};
switch0phy8: ethernet-phy@8 {
reg = <0x8>;
};
};
mdio-external {
compatible = "marvell,mv88e6xxx-mdio-external";
#address-cells = <1>;
#size-cells = <0>;
phy1: ethernet-phy@b {
reg = <0xb>;
compatible = "ethernet-phy-ieee802.3-c45";
};
phy2: ethernet-phy@c {
reg = <0xc>;
compatible = "ethernet-phy-ieee802.3-c45";
};
};
ethernet-ports {
#address-cells = <1>;
#size-cells = <0>;
ethernet-port@0 {
ethernet = <&eth0>;
phy-mode = "rgmii";
reg = <0>;
fixed-link {
full-duplex;
pause;
speed = <1000>;
};
};
ethernet-port@1 {
label = "lan1";
phy-handle = <&switch0phy1>;
reg = <1>;
};
ethernet-port@2 {
label = "lan2";
phy-handle = <&switch0phy2>;
reg = <2>;
};
ethernet-port@3 {
label = "lan3";
phy-handle = <&switch0phy3>;
reg = <3>;
};
ethernet-port@4 {
label = "lan4";
phy-handle = <&switch0phy4>;
reg = <4>;
};
ethernet-port@5 {
label = "lan5";
phy-handle = <&switch0phy5>;
reg = <5>;
};
ethernet-port@6 {
label = "lan6";
phy-handle = <&switch0phy6>;
reg = <6>;
};
ethernet-port@7 {
label = "lan7";
phy-handle = <&switch0phy7>;
reg = <7>;
};
ethernet-port@8 {
label = "lan8";
phy-handle = <&switch0phy8>;
reg = <8>;
};
ethernet-port@9 {
/* 88X3310P external phy */
label = "lan9";
phy-handle = <&phy1>;
phy-mode = "xaui";
reg = <9>;
};
ethernet-port@a {
/* 88X3310P external phy */
label = "lan10";
phy-handle = <&phy2>;
phy-mode = "xaui";
reg = <0xa>;
};
};
};
};

View File

@ -1,109 +0,0 @@
Marvell DSA Switch Device Tree Bindings
---------------------------------------
WARNING: This binding is currently unstable. Do not program it into a
FLASH never to be changed again. Once this binding is stable, this
warning will be removed.
If you need a stable binding, use the old dsa.txt binding.
Marvell Switches are MDIO devices. The following properties should be
placed as a child node of an mdio device.
The properties described here are those specific to Marvell devices.
Additional required and optional properties can be found in dsa.txt.
The compatibility string is used only to find an identification register,
which is at a different MDIO base address in different switch families.
- "marvell,mv88e6085" : Switch has base address 0x10. Use with models:
6085, 6095, 6097, 6123, 6131, 6141, 6161, 6165,
6171, 6172, 6175, 6176, 6185, 6240, 6320, 6321,
6341, 6350, 6351, 6352
- "marvell,mv88e6190" : Switch has base address 0x00. Use with models:
6190, 6190X, 6191, 6290, 6361, 6390, 6390X
- "marvell,mv88e6250" : Switch has base address 0x08 or 0x18. Use with model:
6220, 6250
Required properties:
- compatible : Should be one of "marvell,mv88e6085",
"marvell,mv88e6190" or "marvell,mv88e6250" as
indicated above
- reg : Address on the MII bus for the switch.
Optional properties:
- reset-gpios : Should be a gpio specifier for a reset line
- interrupts : Interrupt from the switch
- interrupt-controller : Indicates the switch is itself an interrupt
controller. This is used for the PHY interrupts.
#interrupt-cells = <2> : Controller uses two cells, number and flag
- eeprom-length : Set to the length of an EEPROM connected to the
switch. Must be set if the switch can not detect
the presence and/or size of a connected EEPROM,
otherwise optional.
- mdio : Container of PHY and devices on the switches MDIO
bus.
- mdio? : Container of PHYs and devices on the external MDIO
bus. The node must contains a compatible string of
"marvell,mv88e6xxx-mdio-external"
Example:
mdio {
#address-cells = <1>;
#size-cells = <0>;
interrupt-parent = <&gpio0>;
interrupts = <27 IRQ_TYPE_LEVEL_LOW>;
interrupt-controller;
#interrupt-cells = <2>;
switch0: switch@0 {
compatible = "marvell,mv88e6085";
reg = <0>;
reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
switch1phy0: switch1phy0@0 {
reg = <0>;
interrupt-parent = <&switch0>;
interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
};
};
};
};
mdio {
#address-cells = <1>;
#size-cells = <0>;
interrupt-parent = <&gpio0>;
interrupts = <27 IRQ_TYPE_LEVEL_LOW>;
interrupt-controller;
#interrupt-cells = <2>;
switch0: switch@0 {
compatible = "marvell,mv88e6190";
reg = <0>;
reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
mdio {
#address-cells = <1>;
#size-cells = <0>;
switch1phy0: switch1phy0@0 {
reg = <0>;
interrupt-parent = <&switch0>;
interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
};
};
mdio1 {
compatible = "marvell,mv88e6xxx-mdio-external";
#address-cells = <1>;
#size-cells = <0>;
switch1phy9: switch1phy0@9 {
reg = <9>;
};
};
};
};

View File

@ -11,7 +11,6 @@ maintainers:
- Woojung Huh <Woojung.Huh@microchip.com>
allOf:
- $ref: dsa.yaml#/$defs/ethernet-ports
- $ref: /schemas/spi/spi-peripheral-props.yaml#
properties:
@ -78,6 +77,39 @@ required:
- compatible
- reg
if:
not:
properties:
compatible:
enum:
- microchip,ksz8863
- microchip,ksz8873
then:
$ref: dsa.yaml#/$defs/ethernet-ports
else:
patternProperties:
"^(ethernet-)?ports$":
patternProperties:
"^(ethernet-)?port@[0-2]$":
$ref: dsa-port.yaml#
unevaluatedProperties: false
properties:
microchip,rmii-clk-internal:
$ref: /schemas/types.yaml#/definitions/flag
description:
When ksz88x3 is acting as clock provier (via REFCLKO) it
can select between internal and external RMII reference
clock. Internal reference clock means that the clock for
the RMII of ksz88x3 is provided by the ksz88x3 internally
and the REFCLKI pin is unconnected. For the external
reference clock, the clock needs to be fed back to ksz88x3
via REFCLKI.
If microchip,rmii-clk-internal is set, ksz88x3 will provide
rmii reference clock internally, otherwise reference clock
should be provided externally.
dependencies:
microchip,rmii-clk-internal: [ethernet]
unevaluatedProperties: false
examples:

View File

@ -20,9 +20,26 @@ description:
select: false
properties:
$nodename:
pattern: "^(ethernet-)?switch(@.*)?$"
allOf:
# This condition is here to satisfy the case where certain device
# nodes have to preserve non-standard names because of
# backward-compatibility with boot loaders inspecting certain
# node names.
- if:
properties:
compatible:
contains:
enum:
- marvell,turris-mox-mv88e6085
- marvell,turris-mox-mv88e6190
then:
properties:
$nodename:
pattern: "switch[0-3]@[0-3]+$"
else:
properties:
$nodename:
pattern: "^(ethernet-)?switch(@.*)?$"
patternProperties:
"^(ethernet-)?ports$":

View File

@ -0,0 +1,213 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/lantiq,pef2256.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Lantiq PEF2256
maintainers:
- Herve Codina <herve.codina@bootlin.com>
description:
The Lantiq PEF2256, also known as Infineon PEF2256 or FALC56, is a framer and
line interface component designed to fulfill all required interfacing between
an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
properties:
compatible:
items:
- const: lantiq,pef2256
reg:
maxItems: 1
clocks:
items:
- description: Master Clock
- description: System Clock Receive
- description: System Clock Transmit
clock-names:
items:
- const: mclk
- const: sclkr
- const: sclkx
interrupts:
maxItems: 1
reset-gpios:
description:
GPIO used to reset the device.
maxItems: 1
pinctrl:
$ref: /schemas/pinctrl/pinctrl.yaml#
additionalProperties: false
patternProperties:
'-pins$':
type: object
$ref: /schemas/pinctrl/pinmux-node.yaml#
additionalProperties: false
properties:
pins:
enum: [ RPA, RPB, RPC, RPD, XPA, XPB, XPC, XPD ]
function:
enum: [ SYPR, RFM, RFMB, RSIGM, RSIG, DLR, FREEZE, RFSP, LOS,
SYPX, XFMS, XSIG, TCLK, XMFB, XSIGM, DLX, XCLK, XLT,
GPI, GPOH, GPOL ]
required:
- pins
- function
lantiq,data-rate-bps:
enum: [2048000, 4096000, 8192000, 16384000]
default: 2048000
description:
Data rate (bit per seconds) on the system highway.
lantiq,clock-falling-edge:
$ref: /schemas/types.yaml#/definitions/flag
description:
Data is sent on falling edge of the clock (and received on the rising
edge). If 'clock-falling-edge' is not present, data is sent on the
rising edge (and received on the falling edge).
lantiq,channel-phase:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2, 3, 4, 5, 6, 7]
default: 0
description: |
The pef2256 delivers a full frame (32 8-bit time-slots in E1 and 24 8-bit
time-slots 8 8-bit signaling in E1/J1) every 125us. This lead to a data
rate of 2048000 bit/s. When lantiq,data-rate-bps is more than 2048000
bit/s, the data (all 32 8-bit) present in the frame are interleave with
unused time-slots. The lantiq,channel-phase property allows to set the
correct alignment of the interleave mechanism.
For instance, suppose lantiq,data-rate-bps = 8192000 (ie 4*2048000), and
lantiq,channel-phase = 2, the interleave schema with unused time-slots
(nu) and used time-slots (XX) for TSi is
nu nu XX nu nu nu XX nu nu nu XX nu
<-- TSi --> <- TSi+1 -> <- TSi+2 ->
With lantiq,data-rate-bps = 8192000, and lantiq,channel-phase = 1, the
interleave schema is
nu XX nu nu nu XX nu nu nu XX nu nu
<-- TSi --> <- TSi+1 -> <- TSi+2 ->
With lantiq,data-rate-bps = 4096000 (ie 2*2048000), and
lantiq,channel-phase = 1, the interleave schema is
nu XX nu XX nu XX
<-- TSi --> <- TSi+1 -> <- TSi+2 ->
patternProperties:
'^codec(-([0-9]|[1-2][0-9]|3[0-1]))?$':
type: object
$ref: /schemas/sound/dai-common.yaml
unevaluatedProperties: false
description:
Codec provided by the pef2256. This codec allows to use some of the PCM
system highway time-slots as audio channels to transport audio data over
the E1/T1/J1 lines.
The time-slots used by the codec must be set and so, the properties
'dai-tdm-slot-num', 'dai-tdm-slot-width', 'dai-tdm-slot-tx-mask' and
'dai-tdm-slot-rx-mask' must be present in the sound card node for
sub-nodes that involve the codec. The codec uses 8-bit time-slots.
'dai-tdm-tdm-slot-with' must be set to 8.
The tx and rx masks define the pef2256 time-slots assigned to the codec.
properties:
compatible:
const: lantiq,pef2256-codec
'#sound-dai-cells':
const: 0
required:
- compatible
- '#sound-dai-cells'
required:
- compatible
- reg
- clocks
- clock-names
- interrupts
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
pef2256: framer@2000000 {
compatible = "lantiq,pef2256";
reg = <0x2000000 0x100>;
interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
interrupt-parent = <&intc>;
clocks = <&clk_mclk>, <&clk_sclkr>, <&clk_sclkx>;
clock-names = "mclk", "sclkr", "sclkx";
reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
lantiq,data-rate-bps = <4096000>;
pinctrl {
pef2256_rpa_sypr: rpa-pins {
pins = "RPA";
function = "SYPR";
};
pef2256_xpa_sypx: xpa-pins {
pins = "XPA";
function = "SYPX";
};
};
pef2256_codec0: codec-0 {
compatible = "lantiq,pef2256-codec";
#sound-dai-cells = <0>;
sound-name-prefix = "PEF2256_0";
};
pef2256_codec1: codec-1 {
compatible = "lantiq,pef2256-codec";
#sound-dai-cells = <0>;
sound-name-prefix = "PEF2256_1";
};
};
sound {
compatible = "simple-audio-card";
#address-cells = <1>;
#size-cells = <0>;
simple-audio-card,dai-link@0 { /* CPU DAI1 - pef2256 codec 1 */
reg = <0>;
cpu {
sound-dai = <&cpu_dai1>;
};
codec {
sound-dai = <&pef2256_codec0>;
dai-tdm-slot-num = <4>;
dai-tdm-slot-width = <8>;
/* TS 1, 2, 3, 4 */
dai-tdm-slot-tx-mask = <0 1 1 1 1>;
dai-tdm-slot-rx-mask = <0 1 1 1 1>;
};
};
simple-audio-card,dai-link@1 { /* CPU DAI2 - pef2256 codec 2 */
reg = <1>;
cpu {
sound-dai = <&cpu_dai2>;
};
codec {
sound-dai = <&pef2256_codec1>;
dai-tdm-slot-num = <4>;
dai-tdm-slot-width = <8>;
/* TS 5, 6, 7, 8 */
dai-tdm-slot-tx-mask = <0 0 0 0 0 1 1 1 1>;
dai-tdm-slot-rx-mask = <0 0 0 0 0 1 1 1 1>;
};
};
};

View File

@ -0,0 +1,116 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/marvell,aquantia.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Marvell Aquantia Ethernet PHY
maintainers:
- Christian Marangi <ansuelsmth@gmail.com>
description: |
Marvell Aquantia Ethernet PHY require a firmware to be loaded to actually
work.
This can be done and is implemented by OEM in 3 different way:
- Attached SPI flash directly to the PHY with the firmware. The PHY
will self load the firmware in the presence of this configuration.
- Read from a dedicated partition on system NAND declared in an
NVMEM cell, and loaded to the PHY using its mailbox interface.
- Manually provided firmware loaded from a file in the filesystem.
allOf:
- $ref: ethernet-phy.yaml#
select:
properties:
compatible:
contains:
enum:
- ethernet-phy-id03a1.b445
- ethernet-phy-id03a1.b460
- ethernet-phy-id03a1.b4a2
- ethernet-phy-id03a1.b4d0
- ethernet-phy-id03a1.b4e0
- ethernet-phy-id03a1.b5c2
- ethernet-phy-id03a1.b4b0
- ethernet-phy-id03a1.b662
- ethernet-phy-id03a1.b712
- ethernet-phy-id31c3.1c12
required:
- compatible
properties:
reg:
maxItems: 1
firmware-name:
description: specify the name of PHY firmware to load
nvmem-cells:
description: phandle to the firmware nvmem cell
maxItems: 1
nvmem-cell-names:
const: firmware
required:
- compatible
- reg
unevaluatedProperties: false
examples:
- |
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethernet-phy@0 {
compatible = "ethernet-phy-id31c3.1c12",
"ethernet-phy-ieee802.3-c45";
reg = <0>;
firmware-name = "AQR-G4_v5.4.C-AQR_CIG_WF-1945_0x8_ID44776_VER1630.cld";
};
ethernet-phy@1 {
compatible = "ethernet-phy-id31c3.1c12",
"ethernet-phy-ieee802.3-c45";
reg = <1>;
nvmem-cells = <&aqr_fw>;
nvmem-cell-names = "firmware";
};
};
flash {
compatible = "jedec,spi-nor";
#address-cells = <1>;
#size-cells = <1>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/* ... */
partition@650000 {
compatible = "nvmem-cells";
label = "0:ethphyfw";
reg = <0x650000 0x80000>;
read-only;
#address-cells = <1>;
#size-cells = <1>;
aqr_fw: aqr_fw@0 {
reg = <0x0 0x5f42a>;
};
};
/* ... */
};
};

View File

@ -50,11 +50,14 @@ examples:
#address-cells = <1>;
#size-cells = <0>;
switch@0 {
ethernet-switch@0 {
compatible = "marvell,mv88e6190";
reg = <0x0>;
ports {
ethernet-ports {
#address-cells = <1>;
#size-cells = <0>;
/* Port definitions */
};

View File

@ -39,28 +39,6 @@ required:
allOf:
- $ref: mdio.yaml#
- if:
required:
- interrupts
then:
properties:
reg:
items:
- items:
- $ref: /schemas/types.yaml#/definitions/cell
- const: 0x84
else:
properties:
reg:
items:
- items:
- $ref: /schemas/types.yaml#/definitions/cell
- enum:
- 0x4
- 0x10
unevaluatedProperties: false
examples:

View File

@ -43,15 +43,21 @@ description:
properties:
compatible:
enum:
- qcom,msm8998-ipa
- qcom,sc7180-ipa
- qcom,sc7280-ipa
- qcom,sdm845-ipa
- qcom,sdx55-ipa
- qcom,sdx65-ipa
- qcom,sm6350-ipa
- qcom,sm8350-ipa
oneOf:
- enum:
- qcom,msm8998-ipa
- qcom,sc7180-ipa
- qcom,sc7280-ipa
- qcom,sdm845-ipa
- qcom,sdx55-ipa
- qcom,sdx65-ipa
- qcom,sm6350-ipa
- qcom,sm8350-ipa
- qcom,sm8550-ipa
- items:
- enum:
- qcom,sm8650-ipa
- const: qcom,sm8550-ipa
reg:
items:

View File

@ -55,9 +55,10 @@ properties:
- items:
- enum:
- renesas,r9a07g043-gbeth # RZ/G2UL
- renesas,r9a07g043-gbeth # RZ/G2UL and RZ/Five
- renesas,r9a07g044-gbeth # RZ/G2{L,LC}
- renesas,r9a07g054-gbeth # RZ/V2L
- renesas,r9a08g045-gbeth # RZ/G3S
- const: renesas,rzg2l-gbeth # RZ/{G2L,G2UL,V2L} family
reg: true

View File

@ -0,0 +1,133 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/renesas,ethertsn.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Renesas Ethernet TSN End-station
maintainers:
- Niklas Söderlund <niklas.soderlund@ragnatech.se>
description:
The RTSN device provides Ethernet network using a 10 Mbps, 100 Mbps, or 1
Gbps full-duplex link via MII/GMII/RMII/RGMII. Depending on the connected PHY.
allOf:
- $ref: ethernet-controller.yaml#
properties:
compatible:
items:
- enum:
- renesas,r8a779g0-ethertsn # R-Car V4H
- const: renesas,rcar-gen4-ethertsn
reg:
items:
- description: TSN End Station target
- description: generalized Precision Time Protocol target
reg-names:
items:
- const: tsnes
- const: gptp
interrupts:
items:
- description: TX data interrupt
- description: RX data interrupt
interrupt-names:
items:
- const: tx
- const: rx
clocks:
maxItems: 1
power-domains:
maxItems: 1
resets:
maxItems: 1
phy-mode:
contains:
enum:
- mii
- rgmii
phy-handle:
$ref: /schemas/types.yaml#/definitions/phandle
description:
Specifies a reference to a node representing a PHY device.
rx-internal-delay-ps:
enum: [0, 1800]
tx-internal-delay-ps:
enum: [0, 2000]
'#address-cells':
const: 1
'#size-cells':
const: 0
patternProperties:
"^ethernet-phy@[0-9a-f]$":
type: object
$ref: ethernet-phy.yaml#
unevaluatedProperties: false
required:
- compatible
- reg
- reg-names
- interrupts
- interrupt-names
- clocks
- power-domains
- resets
- phy-mode
- phy-handle
- '#address-cells'
- '#size-cells'
additionalProperties: false
examples:
- |
#include <dt-bindings/clock/r8a779g0-cpg-mssr.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/power/r8a779g0-sysc.h>
#include <dt-bindings/gpio/gpio.h>
tsn0: ethernet@e6460000 {
compatible = "renesas,r8a779g0-ethertsn", "renesas,rcar-gen4-ethertsn";
reg = <0xe6460000 0x7000>,
<0xe6449000 0x500>;
reg-names = "tsnes", "gptp";
interrupts = <GIC_SPI 429 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 430 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "tx", "rx";
clocks = <&cpg CPG_MOD 2723>;
power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>;
resets = <&cpg 2723>;
phy-mode = "rgmii";
tx-internal-delay-ps = <2000>;
phy-handle = <&phy3>;
#address-cells = <1>;
#size-cells = <0>;
phy3: ethernet-phy@3 {
compatible = "ethernet-phy-ieee802.3-c45";
reg = <0>;
interrupt-parent = <&gpio4>;
interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
reset-gpios = <&gpio1 23 GPIO_ACTIVE_LOW>;
};
};

View File

@ -122,6 +122,20 @@ properties:
and "phy-handle" should point to an external PHY if exists.
maxItems: 1
dmas:
minItems: 2
maxItems: 32
description: TX and RX DMA channel phandle
dma-names:
items:
pattern: "^[tr]x_chan([0-9]|1[0-5])$"
description:
Should be "tx_chan0", "tx_chan1" ... "tx_chan15" for DMA Tx channel
Should be "rx_chan0", "rx_chan1" ... "rx_chan15" for DMA Rx channel
minItems: 2
maxItems: 32
required:
- compatible
- interrupts
@ -143,6 +157,8 @@ examples:
clocks = <&axi_clk>, <&axi_clk>, <&pl_enet_ref_clk>, <&mgt_clk>;
phy-mode = "mii";
reg = <0x40c00000 0x40000>,<0x50c00000 0x40000>;
dmas = <&xilinx_dma 0>, <&xilinx_dma 1>;
dma-names = "tx_chan0", "rx_chan0";
xlnx,rxcsum = <0x2>;
xlnx,rxmem = <0x800>;
xlnx,txcsum = <0x2>;

View File

@ -126,8 +126,10 @@ properties:
name:
type: string
type:
description: The netlink attribute type
enum: [ u8, u16, u32, u64, s8, s16, s32, s64, string, binary ]
description: |
The netlink attribute type. Members of type 'binary' or 'pad'
must also have the 'len' property set.
enum: [ u8, u16, u32, u64, s8, s16, s32, s64, string, binary, pad ]
len:
$ref: '#/$defs/len-or-define'
byte-order:
@ -150,6 +152,14 @@ properties:
the right formatting mechanism when displaying values of this
type.
enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
if:
properties:
type:
oneOf:
- const: binary
- const: pad
then:
required: [ len ]
# End genetlink-legacy
attribute-sets:
@ -200,8 +210,10 @@ properties:
type: string
type: &attr-type
description: The netlink attribute type
enum: [ unused, pad, flag, binary, u8, u16, u32, u64, s32, s64,
string, nest, array-nest, nest-type-value ]
enum: [ unused, pad, flag, binary, bitfield32,
u8, u16, u32, u64, s8, s16, s32, s64,
string, nest, array-nest, nest-type-value,
sub-message ]
doc:
description: Documentation of the attribute.
type: string
@ -260,6 +272,17 @@ properties:
description: Name of the struct type used for the attribute.
type: string
# End genetlink-legacy
# Start netlink-raw
sub-message:
description: |
Name of the sub-message definition to use for the attribute.
type: string
selector:
description: |
Name of the attribute to use for dynamic selection of sub-message
format specifier.
type: string
# End netlink-raw
# Make sure name-prefix does not appear in subsets (subsets inherit naming)
dependencies:
@ -282,6 +305,43 @@ properties:
items:
required: [ type ]
# Start netlink-raw
sub-messages:
description: Definition of sub message attributes
type: array
items:
type: object
additionalProperties: False
required: [ name, formats ]
properties:
name:
description: Name of the sub-message definition
type: string
formats:
description: Dynamically selected format specifiers
type: array
items:
type: object
additionalProperties: False
required: [ value ]
properties:
value:
description: |
Value to match for dynamic selection of sub-message format
specifier.
type: string
fixed-header:
description: |
Name of the struct definition to use as the fixed header
for the sub message.
type: string
attribute-set:
description: |
Name of the attribute space from which to resolve attributes
in the sub message.
type: string
# End netlink-raw
operations:
description: Operations supported by the protocol.
type: object

View File

@ -75,6 +75,14 @@ definitions:
name: ipsec-crypto-bit
-
name: ipsec-packet-bit
-
type: enum
name: rate-type
entries:
-
name: leaf
-
name: node
-
type: enum
name: sb-threshold-type
@ -111,6 +119,16 @@ definitions:
name: none
-
name: basic
-
type: enum
name: dpipe-header-id
entries:
-
name: ethernet
-
name: ipv4
-
name: ipv6
-
type: enum
name: dpipe-match-type
@ -174,6 +192,16 @@ definitions:
name: trap
-
name: mirror
-
type: enum
name: trap-type
entries:
-
name: drop
-
name: exception
-
name: control
attribute-sets:
-
@ -194,27 +222,45 @@ attribute-sets:
name: port-type
type: u16
enum: port-type
# TODO: fill in the attributes in between
-
name: port-desired-type
type: u16
-
name: port-netdev-ifindex
type: u32
-
name: port-netdev-name
type: string
-
name: port-ibdev-name
type: string
-
name: port-split-count
type: u32
value: 9
# TODO: fill in the attributes in between
-
name: port-split-group
type: u32
-
name: sb-index
type: u32
value: 11
# TODO: fill in the attributes in between
-
name: sb-size
type: u32
-
name: sb-ingress-pool-count
type: u16
-
name: sb-egress-pool-count
type: u16
-
name: sb-ingress-tc-count
type: u16
-
name: sb-egress-tc-count
type: u16
-
name: sb-pool-index
type: u16
value: 17
-
name: sb-pool-type
type: u8
@ -232,16 +278,16 @@ attribute-sets:
-
name: sb-tc-index
type: u16
value: 22
# TODO: fill in the attributes in between
-
name: sb-occ-cur
type: u32
-
name: sb-occ-max
type: u32
-
name: eswitch-mode
type: u16
value: 25
enum: eswitch-mode
-
name: eswitch-inline-mode
type: u16
@ -347,6 +393,7 @@ attribute-sets:
-
name: dpipe-header-id
type: u32
enum: dpipe-header-id
-
name: dpipe-header-fields
type: nest
@ -381,7 +428,6 @@ attribute-sets:
-
name: eswitch-encap-mode
type: u8
value: 62
enum: eswitch-encap-mode
-
name: resource-list
@ -433,20 +479,25 @@ attribute-sets:
name: port-flavour
type: u16
enum: port-flavour
# TODO: fill in the attributes in between
-
name: port-number
type: u32
-
name: port-split-subport-number
type: u32
-
name: param
type: nest
nested-attributes: dl-param
-
name: param-name
type: string
value: 81
# TODO: fill in the attributes in between
-
name: param-generic
type: flag
-
name: param-type
type: u8
value: 83
# TODO: fill in the attributes in between
@ -458,20 +509,34 @@ attribute-sets:
-
name: region-name
type: string
# TODO: fill in the attributes in between
-
name: region-size
type: u64
-
name: region-snapshots
type: nest
nested-attributes: dl-region-snapshots
-
name: region-snapshot
type: nest
nested-attributes: dl-region-snapshot
-
name: region-snapshot-id
type: u32
value: 92
# TODO: fill in the attributes in between
-
name: region-chunks
type: nest
nested-attributes: dl-region-chunks
-
name: region-chunk
type: nest
nested-attributes: dl-region-chunk
-
name: region-chunk-data
type: binary
-
name: region-chunk-addr
type: u64
value: 96
-
name: region-chunk-len
type: u64
@ -502,14 +567,13 @@ attribute-sets:
-
name: info-version-value
type: string
# TODO: fill in the attributes in between
-
name: sb-pool-cell-size
type: u32
-
name: fmsg
type: nest
nested-attributes: dl-fmsg
value: 106
-
name: fmsg-obj-nest-start
type: flag
@ -525,20 +589,35 @@ attribute-sets:
-
name: fmsg-obj-name
type: string
-
name: fmsg-obj-value-type
type: u8
# TODO: fill in the attributes in between
-
name: health-reporter
type: nest
value: 114
nested-attributes: dl-health-reporter
-
name: health-reporter-name
type: string
value: 115
# TODO: fill in the attributes in between
-
name: health-reporter-state
type: u8
-
name: health-reporter-err-count
type: u64
-
name: health-reporter-recover-count
type: u64
-
name: health-reporter-dump-ts
type: u64
-
name: health-reporter-graceful-period
type: u64
value: 120
-
name: health-reporter-auto-recover
type: u8
@ -548,55 +627,64 @@ attribute-sets:
-
name: flash-update-component
type: string
# TODO: fill in the attributes in between
-
name: flash-update-status-msg
type: string
-
name: flash-update-status-done
type: u64
-
name: flash-update-status-total
type: u64
-
name: port-pci-pf-number
type: u16
value: 127
# TODO: fill in the attributes in between
-
name: port-pci-vf-number
type: u16
-
name: stats
type: nest
nested-attributes: dl-attr-stats
-
name: trap-name
type: string
value: 130
-
name: trap-action
type: u8
enum: trap-action
# TODO: fill in the attributes in between
-
name: trap-type
type: u8
enum: trap-type
-
name: trap-generic
type: flag
-
name: trap-metadata
type: nest
nested-attributes: dl-trap-metadata
-
name: trap-group-name
type: string
value: 135
-
name: reload-failed
type: u8
# TODO: fill in the attributes in between
-
name: health-reporter-dump-ts-ns
type: u64
-
name: netns-fd
type: u32
value: 138
-
name: netns-pid
type: u32
-
name: netns-id
type: u32
# TODO: fill in the attributes in between
-
name: health-reporter-auto-dump
type: u8
value: 141
-
name: trap-policer-id
type: u32
@ -610,22 +698,29 @@ attribute-sets:
name: port-function
type: nest
nested-attributes: dl-port-function
# TODO: fill in the attributes in between
-
name: info-board-serial-number
type: string
-
name: port-lanes
type: u32
-
name: port-splittable
type: u8
-
name: port-external
type: u8
-
name: port-controller-number
type: u32
value: 150
# TODO: fill in the attributes in between
-
name: flash-update-status-timeout
type: u64
-
name: flash-update-overwrite-mask
type: bitfield32
enum: flash-overwrite
enum-as-flags: True
value: 152
-
name: reload-action
type: u8
@ -673,20 +768,16 @@ attribute-sets:
type: nest
multi-attr: true
nested-attributes: dl-reload-act-stats
# TODO: fill in the attributes in between
-
name: port-pci-sf-number
type: u32
value: 164
# TODO: fill in the attributes in between
-
name: rate-type
type: u16
enum: rate-type
-
name: rate-tx-share
type: u64
value: 166
-
name: rate-tx-max
type: u64
@ -696,20 +787,22 @@ attribute-sets:
-
name: rate-parent-node-name
type: string
# TODO: fill in the attributes in between
-
name: region-max-snapshots
type: u32
-
name: linecard-index
type: u32
value: 171
# TODO: fill in the attributes in between
-
name: linecard-state
type: u8
-
name: linecard-type
type: string
value: 173
-
name: linecard-supported-types
type: nest
nested-attributes: dl-linecard-supported-types
# TODO: fill in the attributes in between
@ -736,12 +829,14 @@ attribute-sets:
name: reload-stats
-
name: remote-reload-stats
-
name: dl-reload-stats
subset-of: devlink
attributes:
-
name: reload-action-info
-
name: dl-reload-act-info
subset-of: devlink
@ -750,12 +845,14 @@ attribute-sets:
name: reload-action
-
name: reload-action-stats
-
name: dl-reload-act-stats
subset-of: devlink
attributes:
-
name: reload-stats-entry
-
name: dl-reload-stats-entry
subset-of: devlink
@ -764,6 +861,7 @@ attribute-sets:
name: reload-stats-limit
-
name: reload-stats-value
-
name: dl-info-version
subset-of: devlink
@ -772,6 +870,7 @@ attribute-sets:
name: info-version-name
-
name: info-version-value
-
name: dl-port-function
name-prefix: devlink-port-fn-attr-
@ -1005,6 +1104,49 @@ attribute-sets:
-
name: resource
-
name: dl-param
subset-of: devlink
attributes:
-
name: param-name
-
name: param-generic
-
name: param-type
# TODO: fill in the attribute param-value-list
-
name: dl-region-snapshots
subset-of: devlink
attributes:
-
name: region-snapshot
-
name: dl-region-snapshot
subset-of: devlink
attributes:
-
name: region-snapshot-id
-
name: dl-region-chunks
subset-of: devlink
attributes:
-
name: region-chunk
-
name: dl-region-chunk
subset-of: devlink
attributes:
-
name: region-chunk-data
-
name: region-chunk-addr
-
name: dl-fmsg
subset-of: devlink
@ -1020,6 +1162,62 @@ attribute-sets:
-
name: fmsg-obj-name
-
name: dl-health-reporter
subset-of: devlink
attributes:
-
name: health-reporter-name
-
name: health-reporter-state
-
name: health-reporter-err-count
-
name: health-reporter-recover-count
-
name: health-reporter-graceful-period
-
name: health-reporter-auto-recover
-
name: health-reporter-dump-ts
-
name: health-reporter-dump-ts-ns
-
name: health-reporter-auto-dump
-
name: dl-attr-stats
name-prefix: devlink-attr-
attributes:
- name: stats-rx-packets
type: u64
value: 0
-
name: stats-rx-bytes
type: u64
-
name: stats-rx-dropped
type: u64
-
name: dl-trap-metadata
name-prefix: devlink-attr-
attributes:
-
name: trap-metadata-type-in-port
type: flag
value: 0
-
name: trap-metadata-type-fa-cookie
type: flag
-
name: dl-linecard-supported-types
subset-of: devlink
attributes:
-
name: linecard-type
-
name: dl-selftest-id
name-prefix: devlink-attr-selftest-id-
@ -1077,6 +1275,7 @@ operations:
reply:
value: 3 # due to a bug, port dump returns DEVLINK_CMD_NEW
attributes: *port-id-attrs
-
name: port-set
doc: Set devlink port instances.
@ -1484,8 +1683,8 @@ operations:
dont-validate: [ strict ]
flags: [ admin-perm ]
do:
pre: devlink-nl-pre-doit
post: devlink-nl-post-doit
pre: devlink-nl-pre-doit-dev-lock
post: devlink-nl-post-doit-dev-lock
request:
attributes:
- bus-name
@ -2055,3 +2254,14 @@ operations:
- bus-name
- dev-name
- selftests
-
name: notify-filter-set
doc: Set notification messages socket filter.
attribute-set: devlink
do:
request:
attributes:
- bus-name
- dev-name
- port-index

View File

@ -296,6 +296,16 @@ attribute-sets:
-
name: phase-offset
type: s64
-
name: fractional-frequency-offset
type: sint
doc: |
The FFO (Fractional Frequency Offset) between the RX and TX
symbol rate on the media associated with the pin:
(rx_frequency-tx_frequency)/rx_frequency
Value is in PPM (parts per million).
This may be implemented for example for pin of type
PIN_TYPE_SYNCE_ETH_PORT.
-
name: pin-parent-device
subset-of: pin
@ -460,6 +470,7 @@ operations:
- phase-adjust-min
- phase-adjust-max
- phase-adjust
- fractional-frequency-offset
dump:
pre: dpll-lock-dumpit

View File

@ -908,6 +908,9 @@ attribute-sets:
-
name: hkey
type: binary
-
name: input_xfrm
type: u32
-
name: plca
attributes:
@ -1598,6 +1601,7 @@ operations:
- hfunc
- indir
- hkey
- input_xfrm
dump: *rss-get-op
-
name: plca-get-cfg

View File

@ -45,7 +45,6 @@ definitions:
-
type: flags
name: xdp-rx-metadata
render-max: true
entries:
-
name: timestamp
@ -55,6 +54,26 @@ definitions:
name: hash
doc:
Device is capable of exposing receive packet hash via bpf_xdp_metadata_rx_hash().
-
name: vlan-tag
doc:
Device is capable of exposing receive packet VLAN tag via bpf_xdp_metadata_rx_vlan_tag().
-
type: flags
name: xsk-flags
entries:
-
name: tx-timestamp
doc:
HW timestamping egress packets is supported by the driver.
-
name: tx-checksum
doc:
L3 checksum HW offload is supported by the driver.
-
name: queue-type
type: enum
entries: [ rx, tx ]
attribute-sets:
-
@ -86,6 +105,165 @@ attribute-sets:
See Documentation/networking/xdp-rx-metadata.rst for more details.
type: u64
enum: xdp-rx-metadata
-
name: xsk-features
doc: Bitmask of enabled AF_XDP features.
type: u64
enum: xsk-flags
-
name: page-pool
attributes:
-
name: id
doc: Unique ID of a Page Pool instance.
type: uint
checks:
min: 1
max: u32-max
-
name: ifindex
doc: |
ifindex of the netdev to which the pool belongs.
May be reported as 0 if the page pool was allocated for a netdev
which got destroyed already (page pools may outlast their netdevs
because they wait for all memory to be returned).
type: u32
checks:
min: 1
max: s32-max
-
name: napi-id
doc: Id of NAPI using this Page Pool instance.
type: uint
checks:
min: 1
max: u32-max
-
name: inflight
type: uint
doc: |
Number of outstanding references to this page pool (allocated
but yet to be freed pages). Allocated pages may be held in
socket receive queues, driver receive ring, page pool recycling
ring, the page pool cache, etc.
-
name: inflight-mem
type: uint
doc: |
Amount of memory held by inflight pages.
-
name: detach-time
type: uint
doc: |
Seconds in CLOCK_BOOTTIME of when Page Pool was detached by
the driver. Once detached Page Pool can no longer be used to
allocate memory.
Page Pools wait for all the memory allocated from them to be freed
before truly disappearing. "Detached" Page Pools cannot be
"re-attached", they are just waiting to disappear.
Attribute is absent if Page Pool has not been detached, and
can still be used to allocate new memory.
-
name: page-pool-info
subset-of: page-pool
attributes:
-
name: id
-
name: ifindex
-
name: page-pool-stats
doc: |
Page pool statistics, see docs for struct page_pool_stats
for information about individual statistics.
attributes:
-
name: info
doc: Page pool identifying information.
type: nest
nested-attributes: page-pool-info
-
name: alloc-fast
type: uint
value: 8 # reserve some attr ids in case we need more metadata later
-
name: alloc-slow
type: uint
-
name: alloc-slow-high-order
type: uint
-
name: alloc-empty
type: uint
-
name: alloc-refill
type: uint
-
name: alloc-waive
type: uint
-
name: recycle-cached
type: uint
-
name: recycle-cache-full
type: uint
-
name: recycle-ring
type: uint
-
name: recycle-ring-full
type: uint
-
name: recycle-released-refcnt
type: uint
-
name: napi
attributes:
-
name: ifindex
doc: ifindex of the netdevice to which NAPI instance belongs.
type: u32
checks:
min: 1
-
name: id
doc: ID of the NAPI instance.
type: u32
-
name: irq
doc: The associated interrupt vector number for the napi
type: u32
-
name: pid
doc: PID of the napi thread, if NAPI is configured to operate in
threaded mode. If NAPI is not in threaded mode (i.e. uses normal
softirq context), the attribute will be absent.
type: u32
-
name: queue
attributes:
-
name: id
doc: Queue index; most queue types are indexed like a C array, with
indexes starting at 0 and ending at queue count - 1. Queue indexes
are scoped to an interface and queue type.
type: u32
-
name: ifindex
doc: ifindex of the netdevice to which the queue belongs.
type: u32
checks:
min: 1
-
name: type
doc: Queue type as rx, tx. Each queue type defines a separate ID space.
type: u32
enum: queue-type
-
name: napi-id
doc: ID of the NAPI instance which services this queue.
type: u32
operations:
list:
@ -103,6 +281,7 @@ operations:
- xdp-features
- xdp-zc-max-segs
- xdp-rx-metadata-features
- xsk-features
dump:
reply: *dev-all
-
@ -120,8 +299,116 @@ operations:
doc: Notification about device configuration being changed.
notify: dev-get
mcgrp: mgmt
-
name: page-pool-get
doc: |
Get / dump information about Page Pools.
(Only Page Pools associated with a net_device can be listed.)
attribute-set: page-pool
do:
request:
attributes:
- id
reply: &pp-reply
attributes:
- id
- ifindex
- napi-id
- inflight
- inflight-mem
- detach-time
dump:
reply: *pp-reply
config-cond: page-pool
-
name: page-pool-add-ntf
doc: Notification about page pool appearing.
notify: page-pool-get
mcgrp: page-pool
config-cond: page-pool
-
name: page-pool-del-ntf
doc: Notification about page pool disappearing.
notify: page-pool-get
mcgrp: page-pool
config-cond: page-pool
-
name: page-pool-change-ntf
doc: Notification about page pool configuration being changed.
notify: page-pool-get
mcgrp: page-pool
config-cond: page-pool
-
name: page-pool-stats-get
doc: Get page pool statistics.
attribute-set: page-pool-stats
do:
request:
attributes:
- info
reply: &pp-stats-reply
attributes:
- info
- alloc-fast
- alloc-slow
- alloc-slow-high-order
- alloc-empty
- alloc-refill
- alloc-waive
- recycle-cached
- recycle-cache-full
- recycle-ring
- recycle-ring-full
- recycle-released-refcnt
dump:
reply: *pp-stats-reply
config-cond: page-pool-stats
-
name: queue-get
doc: Get queue information from the kernel.
Only configured queues will be reported (as opposed to all available
hardware queues).
attribute-set: queue
do:
request:
attributes:
- ifindex
- type
- id
reply: &queue-get-op
attributes:
- id
- type
- napi-id
- ifindex
dump:
request:
attributes:
- ifindex
reply: *queue-get-op
-
name: napi-get
doc: Get information about NAPI instances configured on the system.
attribute-set: napi
do:
request:
attributes:
- id
reply: &napi-get-op
attributes:
- id
- ifindex
- irq
- pid
dump:
request:
attributes:
- ifindex
reply: *napi-get-op
mcast-groups:
list:
-
name: mgmt
-
name: page-pool

View File

@ -20,6 +20,7 @@ definitions:
name: user-features
type: flags
name-prefix: ovs-dp-f-
enum-name:
entries:
-
name: unaligned
@ -142,7 +143,6 @@ operations:
do:
request:
attributes:
- dp-ifindex
- name
- upcall-pid
- user-features
@ -154,7 +154,6 @@ operations:
do:
request:
attributes:
- dp-ifindex
- name
mcast-groups:

View File

@ -124,6 +124,7 @@ definitions:
-
name: ovs-frag-type
name-prefix: ovs-frag-type-
enum-name: ovs-frag-type
type: enum
entries:
-
@ -269,6 +270,7 @@ definitions:
-
name: ovs-ufid-flags
name-prefix: ovs-ufid-f-
enum-name:
type: flags
entries:
- omit-key
@ -288,6 +290,7 @@ definitions:
doc: Basis used for computing hash.
-
name: ovs-hash-alg
enum-name: ovs-hash-alg
type: enum
doc: |
Data path hash algorithm for computing Datapath hash. The algorithm type only specifies
@ -339,6 +342,7 @@ definitions:
MPLS tunnel attributes.
-
name: ct-state-flags
enum-name:
type: flags
name-prefix: ovs-cs-f-
entries:
@ -947,13 +951,11 @@ operations:
do: &flow-get-op
request:
attributes:
- dp-ifindex
- key
- ufid
- ufid-flags
reply:
attributes:
- dp-ifindex
- key
- ufid
- mask
@ -968,7 +970,6 @@ operations:
do:
request:
attributes:
- dp-ifindex
- key
- ufid
- mask

View File

@ -135,7 +135,6 @@ operations:
- name
- type
- upcall-pid
- dp-ifindex
- ifindex
- options
-
@ -146,7 +145,6 @@ operations:
do:
request:
attributes:
- dp-ifindex
- port-no
- type
- name
@ -158,11 +156,9 @@ operations:
do: &vport-get-op
request:
attributes:
- dp-ifindex
- name
reply: &dev-all
attributes:
- dp-ifindex
- port-no
- type
- name

View File

@ -66,8 +66,9 @@ definitions:
name: ifi-family
type: u8
-
name: padding
type: u8
name: pad
type: pad
len: 1
-
name: ifi-type
type: u16
@ -82,6 +83,18 @@ definitions:
-
name: ifi-change
type: u32
-
name: ifla-bridge-id
type: struct
members:
-
name: prio
type: u16
-
name: addr
type: binary
len: 6
display-hint: mac
-
name: ifla-cacheinfo
type: struct
@ -707,11 +720,9 @@ definitions:
name: family
type: u8
-
name: pad1
type: u8
-
name: pad2
type: u16
name: pad
type: pad
len: 3
-
name: ifindex
type: u32
@ -966,8 +977,9 @@ attribute-sets:
type: string
-
name: data
type: binary
# kind specific nest, e.g. linkinfo-bridge-attrs
type: sub-message
sub-message: linkinfo-data-msg
selector: kind
-
name: xstats
type: binary
@ -976,10 +988,12 @@ attribute-sets:
type: string
-
name: slave-data
type: binary
# kind specific nest
type: sub-message
sub-message: linkinfo-member-data-msg
selector: slave-kind
-
name: linkinfo-bridge-attrs
name-prefix: ifla-br-
attributes:
-
name: forward-delay
@ -1011,9 +1025,11 @@ attribute-sets:
-
name: root-id
type: binary
struct: ifla-bridge-id
-
name: bridge-id
type: binary
struct: ifla-bridge-id
-
name: root-port
type: u16
@ -1041,6 +1057,7 @@ attribute-sets:
-
name: group-addr
type: binary
display-hint: mac
-
name: fdb-flush
type: binary
@ -1123,6 +1140,376 @@ attribute-sets:
-
name: mcast-querier-state
type: binary
-
name: linkinfo-brport-attrs
name-prefix: ifla-brport-
attributes:
-
name: state
type: u8
-
name: priority
type: u16
-
name: cost
type: u32
-
name: mode
type: flag
-
name: guard
type: flag
-
name: protect
type: flag
-
name: fast-leave
type: flag
-
name: learning
type: flag
-
name: unicast-flood
type: flag
-
name: proxyarp
type: flag
-
name: learning-sync
type: flag
-
name: proxyarp-wifi
type: flag
-
name: root-id
type: binary
struct: ifla-bridge-id
-
name: bridge-id
type: binary
struct: ifla-bridge-id
-
name: designated-port
type: u16
-
name: designated-cost
type: u16
-
name: id
type: u16
-
name: "no"
type: u16
-
name: topology-change-ack
type: u8
-
name: config-pending
type: u8
-
name: message-age-timer
type: u64
-
name: forward-delay-timer
type: u64
-
name: hold-timer
type: u64
-
name: flush
type: flag
-
name: multicast-router
type: u8
-
name: pad
type: pad
-
name: mcast-flood
type: flag
-
name: mcast-to-ucast
type: flag
-
name: vlan-tunnel
type: flag
-
name: bcast-flood
type: flag
-
name: group-fwd-mask
type: u16
-
name: neigh-suppress
type: flag
-
name: isolated
type: flag
-
name: backup-port
type: u32
-
name: mrp-ring-open
type: flag
-
name: mrp-in-open
type: flag
-
name: mcast-eht-hosts-limit
type: u32
-
name: mcast-eht-hosts-cnt
type: u32
-
name: locked
type: flag
-
name: mab
type: flag
-
name: mcast-n-groups
type: u32
-
name: mcast-max-groups
type: u32
-
name: neigh-vlan-suppress
type: flag
-
name: backup-nhid
type: u32
-
name: linkinfo-gre-attrs
name-prefix: ifla-gre-
attributes:
-
name: link
type: u32
-
name: iflags
type: u16
-
name: oflags
type: u16
-
name: ikey
type: u32
-
name: okey
type: u32
-
name: local
type: binary
display-hint: ipv4
-
name: remote
type: binary
display-hint: ipv4
-
name: ttl
type: u8
-
name: tos
type: u8
-
name: pmtudisc
type: u8
-
name: encap-limit
type: u32
-
name: flowinfo
type: u32
-
name: flags
type: u32
-
name: encap-type
type: u16
-
name: encap-flags
type: u16
-
name: encap-sport
type: u16
-
name: encap-dport
type: u16
-
name: collect-metadata
type: flag
-
name: ignore-df
type: u8
-
name: fwmark
type: u32
-
name: erspan-index
type: u32
-
name: erspan-ver
type: u8
-
name: erspan-dir
type: u8
-
name: erspan-hwid
type: u16
-
name: linkinfo-geneve-attrs
name-prefix: ifla-geneve-
attributes:
-
name: id
type: u32
-
name: remote
type: binary
display-hint: ipv4
-
name: ttl
type: u8
-
name: tos
type: u8
-
name: port
type: u16
-
name: collect-metadata
type: flag
-
name: remote6
type: binary
display-hint: ipv6
-
name: udp-csum
type: u8
-
name: udp-zero-csum6-tx
type: u8
-
name: udp-zero-csum6-rx
type: u8
-
name: label
type: u32
-
name: ttl-inherit
type: u8
-
name: df
type: u8
-
name: inner-proto-inherit
type: flag
-
name: linkinfo-iptun-attrs
name-prefix: ifla-iptun-
attributes:
-
name: link
type: u32
-
name: local
type: binary
display-hint: ipv4
-
name: remote
type: binary
display-hint: ipv4
-
name: ttl
type: u8
-
name: tos
type: u8
-
name: encap-limit
type: u8
-
name: flowinfo
type: u32
-
name: flags
type: u16
-
name: proto
type: u8
-
name: pmtudisc
type: u8
-
name: 6rd-prefix
type: binary
display-hint: ipv6
-
name: 6rd-relay-prefix
type: binary
display-hint: ipv4
-
name: 6rd-prefixlen
type: u16
-
name: 6rd-relay-prefixlen
type: u16
-
name: encap-type
type: u16
-
name: encap-flags
type: u16
-
name: encap-sport
type: u16
-
name: encap-dport
type: u16
-
name: collect-metadata
type: flag
-
name: fwmark
type: u32
-
name: linkinfo-tun-attrs
name-prefix: ifla-tun-
attributes:
-
name: owner
type: u32
-
name: group
type: u32
-
name: type
type: u8
-
name: pi
type: u8
-
name: vnet-hdr
type: u8
-
name: persist
type: u8
-
name: multi-queue
type: u8
-
name: num-queues
type: u32
-
name: num-disabled-queues
type: u32
-
name: linkinfo-vrf-attrs
name-prefix: ifla-vrf-
attributes:
-
name: table
type: u32
-
name: xdp-attrs
attributes:
@ -1241,6 +1628,46 @@ attribute-sets:
name: used
type: u8
sub-messages:
-
name: linkinfo-data-msg
formats:
-
value: bridge
attribute-set: linkinfo-bridge-attrs
-
value: erspan
attribute-set: linkinfo-gre-attrs
-
value: gre
attribute-set: linkinfo-gre-attrs
-
value: gretap
attribute-set: linkinfo-gre-attrs
-
value: geneve
attribute-set: linkinfo-geneve-attrs
-
value: ipip
attribute-set: linkinfo-iptun-attrs
-
value: sit
attribute-set: linkinfo-iptun-attrs
-
value: tun
attribute-set: linkinfo-tun-attrs
-
value: vrf
attribute-set: linkinfo-vrf-attrs
-
name: linkinfo-member-data-msg
formats:
-
value: bridge
attribute-set: linkinfo-brport-attrs
-
value: bond
operations:
enum-model: directional
list:

File diff suppressed because it is too large Load Diff

View File

@ -4,18 +4,332 @@
Ethernet Bridging
=================
In order to use the Ethernet bridging functionality, you'll need the
userspace tools.
Introduction
============
Documentation for Linux bridging is on:
https://wiki.linuxfoundation.org/networking/bridge
The IEEE 802.1Q-2022 (Bridges and Bridged Networks) standard defines the
operation of bridges in computer networks. A bridge, in the context of this
standard, is a device that connects two or more network segments and operates
at the data link layer (Layer 2) of the OSI (Open Systems Interconnection)
model. The purpose of a bridge is to filter and forward frames between
different segments based on the destination MAC (Media Access Control) address.
The bridge-utilities are maintained at:
git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/bridge-utils.git
Bridge kAPI
===========
Additionally, the iproute2 utilities can be used to configure
bridge devices.
Here are some core structures of bridge code. Note that the kAPI is *unstable*,
and can be changed at any time.
If you still have questions, don't hesitate to post to the mailing list
(more info https://lists.linux-foundation.org/mailman/listinfo/bridge).
.. kernel-doc:: net/bridge/br_private.h
:identifiers: net_bridge_vlan
Bridge uAPI
===========
Modern Linux bridge uAPI is accessed via Netlink interface. You can find
below files where the bridge and bridge port netlink attributes are defined.
Bridge netlink attributes
-------------------------
.. kernel-doc:: include/uapi/linux/if_link.h
:doc: Bridge enum definition
Bridge port netlink attributes
------------------------------
.. kernel-doc:: include/uapi/linux/if_link.h
:doc: Bridge port enum definition
Bridge sysfs
------------
The sysfs interface is deprecated and should not be extended if new
options are added.
STP
===
The STP (Spanning Tree Protocol) implementation in the Linux bridge driver
is a critical feature that helps prevent loops and broadcast storms in
Ethernet networks by identifying and disabling redundant links. In a Linux
bridge context, STP is crucial for network stability and availability.
STP is a Layer 2 protocol that operates at the Data Link Layer of the OSI
model. It was originally developed as IEEE 802.1D and has since evolved into
multiple versions, including Rapid Spanning Tree Protocol (RSTP) and
`Multiple Spanning Tree Protocol (MSTP)
<https://lore.kernel.org/netdev/20220316150857.2442916-1-tobias@waldekranz.com/>`_.
The 802.1D-2004 removed the original Spanning Tree Protocol, instead
incorporating the Rapid Spanning Tree Protocol (RSTP). By 2014, all the
functionality defined by IEEE 802.1D has been incorporated into either
IEEE 802.1Q (Bridges and Bridged Networks) or IEEE 802.1AC (MAC Service
Definition). 802.1D has been officially withdrawn in 2022.
Bridge Ports and STP States
---------------------------
In the context of STP, bridge ports can be in one of the following states:
* Blocking: The port is disabled for data traffic and only listens for
BPDUs (Bridge Protocol Data Units) from other devices to determine the
network topology.
* Listening: The port begins to participate in the STP process and listens
for BPDUs.
* Learning: The port continues to listen for BPDUs and begins to learn MAC
addresses from incoming frames but does not forward data frames.
* Forwarding: The port is fully operational and forwards both BPDUs and
data frames.
* Disabled: The port is administratively disabled and does not participate
in the STP process. The data frames forwarding are also disabled.
Root Bridge and Convergence
---------------------------
In the context of networking and Ethernet bridging in Linux, the root bridge
is a designated switch in a bridged network that serves as a reference point
for the spanning tree algorithm to create a loop-free topology.
Here's how the STP works and root bridge is chosen:
1. Bridge Priority: Each bridge running a spanning tree protocol, has a
configurable Bridge Priority value. The lower the value, the higher the
priority. By default, the Bridge Priority is set to a standard value
(e.g., 32768).
2. Bridge ID: The Bridge ID is composed of two components: Bridge Priority
and the MAC address of the bridge. It uniquely identifies each bridge
in the network. The Bridge ID is used to compare the priorities of
different bridges.
3. Bridge Election: When the network starts, all bridges initially assume
that they are the root bridge. They start advertising Bridge Protocol
Data Units (BPDU) to their neighbors, containing their Bridge ID and
other information.
4. BPDU Comparison: Bridges exchange BPDUs to determine the root bridge.
Each bridge examines the received BPDUs, including the Bridge Priority
and Bridge ID, to determine if it should adjust its own priorities.
The bridge with the lowest Bridge ID will become the root bridge.
5. Root Bridge Announcement: Once the root bridge is determined, it sends
BPDUs with information about the root bridge to all other bridges in the
network. This information is used by other bridges to calculate the
shortest path to the root bridge and, in doing so, create a loop-free
topology.
6. Forwarding Ports: After the root bridge is selected and the spanning tree
topology is established, each bridge determines which of its ports should
be in the forwarding state (used for data traffic) and which should be in
the blocking state (used to prevent loops). The root bridge's ports are
all in the forwarding state. while other bridges have some ports in the
blocking state to avoid loops.
7. Root Ports: After the root bridge is selected and the spanning tree
topology is established, each non-root bridge processes incoming
BPDUs and determines which of its ports provides the shortest path to the
root bridge based on the information in the received BPDUs. This port is
designated as the root port. And it is in the Forwarding state, allowing
it to actively forward network traffic.
8. Designated ports: A designated port is the port through which the non-root
bridge will forward traffic towards the designated segment. Designated ports
are placed in the Forwarding state. All other ports on the non-root
bridge that are not designated for specific segments are placed in the
Blocking state to prevent network loops.
STP ensures network convergence by calculating the shortest path and disabling
redundant links. When network topology changes occur (e.g., a link failure),
STP recalculates the network topology to restore connectivity while avoiding loops.
Proper configuration of STP parameters, such as the bridge priority, can
influence network performance, path selection and which bridge becomes the
Root Bridge.
User space STP helper
---------------------
The user space STP helper *bridge-stp* is a program to control whether to use
user mode spanning tree. The ``/sbin/bridge-stp <bridge> <start|stop>`` is
called by the kernel when STP is enabled/disabled on a bridge
(via ``brctl stp <bridge> <on|off>`` or ``ip link set <bridge> type bridge
stp_state <0|1>``). The kernel enables user_stp mode if that command returns
0, or enables kernel_stp mode if that command returns any other value.
VLAN
====
A LAN (Local Area Network) is a network that covers a small geographic area,
typically within a single building or a campus. LANs are used to connect
computers, servers, printers, and other networked devices within a localized
area. LANs can be wired (using Ethernet cables) or wireless (using Wi-Fi).
A VLAN (Virtual Local Area Network) is a logical segmentation of a physical
network into multiple isolated broadcast domains. VLANs are used to divide
a single physical LAN into multiple virtual LANs, allowing different groups of
devices to communicate as if they were on separate physical networks.
Typically there are two VLAN implementations, IEEE 802.1Q and IEEE 802.1ad
(also known as QinQ). IEEE 802.1Q is a standard for VLAN tagging in Ethernet
networks. It allows network administrators to create logical VLANs on a
physical network and tag Ethernet frames with VLAN information, which is
called *VLAN-tagged frames*. IEEE 802.1ad, commonly known as QinQ or Double
VLAN, is an extension of the IEEE 802.1Q standard. QinQ allows for the
stacking of multiple VLAN tags within a single Ethernet frame. The Linux
bridge supports both the IEEE 802.1Q and `802.1AD
<https://lore.kernel.org/netdev/1402401565-15423-1-git-send-email-makita.toshiaki@lab.ntt.co.jp/>`_
protocol for VLAN tagging.
`VLAN filtering <https://lore.kernel.org/netdev/1360792820-14116-1-git-send-email-vyasevic@redhat.com/>`_
on a bridge is disabled by default. After enabling VLAN filtering on a bridge,
it will start forwarding frames to appropriate destinations based on their
destination MAC address and VLAN tag (both must match).
Multicast
=========
The Linux bridge driver has multicast support allowing it to process Internet
Group Management Protocol (IGMP) or Multicast Listener Discovery (MLD)
messages, and to efficiently forward multicast data packets. The bridge
driver supports IGMPv2/IGMPv3 and MLDv1/MLDv2.
Multicast snooping
------------------
Multicast snooping is a networking technology that allows network switches
to intelligently manage multicast traffic within a local area network (LAN).
The switch maintains a multicast group table, which records the association
between multicast group addresses and the ports where hosts have joined these
groups. The group table is dynamically updated based on the IGMP/MLD messages
received. With the multicast group information gathered through snooping, the
switch optimizes the forwarding of multicast traffic. Instead of blindly
broadcasting the multicast traffic to all ports, it sends the multicast
traffic based on the destination MAC address only to ports which have
subscribed the respective destination multicast group.
When created, the Linux bridge devices have multicast snooping enabled by
default. It maintains a Multicast forwarding database (MDB) which keeps track
of port and group relationships.
IGMPv3/MLDv2 EHT support
------------------------
The Linux bridge supports IGMPv3/MLDv2 EHT (Explicit Host Tracking), which
was added by `474ddb37fa3a ("net: bridge: multicast: add EHT allow/block handling")
<https://lore.kernel.org/netdev/20210120145203.1109140-1-razor@blackwall.org/>`_
The explicit host tracking enables the device to keep track of each
individual host that is joined to a particular group or channel. The main
benefit of the explicit host tracking in IGMP is to allow minimal leave
latencies when a host leaves a multicast group or channel.
The length of time between a host wanting to leave and a device stopping
traffic forwarding is called the IGMP leave latency. A device configured
with IGMPv3 or MLDv2 and explicit tracking can immediately stop forwarding
traffic if the last host to request to receive traffic from the device
indicates that it no longer wants to receive traffic. The leave latency
is thus bound only by the packet transmission latencies in the multiaccess
network and the processing time in the device.
Other multicast features
------------------------
The Linux bridge also supports `per-VLAN multicast snooping
<https://lore.kernel.org/netdev/20210719170637.435541-1-razor@blackwall.org/>`_,
which is disabled by default but can be enabled. And `Multicast Router Discovery
<https://lore.kernel.org/netdev/20190121062628.2710-1-linus.luessing@c0d3.blue/>`_,
which help identify the location of multicast routers.
Switchdev
=========
Linux Bridge Switchdev is a feature in the Linux kernel that extends the
capabilities of the traditional Linux bridge to work more efficiently with
hardware switches that support switchdev. With Linux Bridge Switchdev, certain
networking functions like forwarding, filtering, and learning of Ethernet
frames can be offloaded to a hardware switch. This offloading reduces the
burden on the Linux kernel and CPU, leading to improved network performance
and lower latency.
To use Linux Bridge Switchdev, you need hardware switches that support the
switchdev interface. This means that the switch hardware needs to have the
necessary drivers and functionality to work in conjunction with the Linux
kernel.
Please see the :ref:`switchdev` document for more details.
Netfilter
=========
The bridge netfilter module is a legacy feature that allows to filter bridged
packets with iptables and ip6tables. Its use is discouraged. Users should
consider using nftables for packet filtering.
The older ebtables tool is more feature-limited compared to nftables, but
just like nftables it doesn't need this module either to function.
The br_netfilter module intercepts packets entering the bridge, performs
minimal sanity tests on ipv4 and ipv6 packets and then pretends that
these packets are being routed, not bridged. br_netfilter then calls
the ip and ipv6 netfilter hooks from the bridge layer, i.e. ip(6)tables
rulesets will also see these packets.
br_netfilter is also the reason for the iptables *physdev* match:
This match is the only way to reliably tell routed and bridged packets
apart in an iptables ruleset.
Note that ebtables and nftables will work fine without the br_netfilter module.
iptables/ip6tables/arptables do not work for bridged traffic because they
plug in the routing stack. nftables rules in ip/ip6/inet/arp families won't
see traffic that is forwarded by a bridge either, but that's very much how it
should be.
Historically the feature set of ebtables was very limited (it still is),
this module was added to pretend packets are routed and invoke the ipv4/ipv6
netfilter hooks from the bridge so users had access to the more feature-rich
iptables matching capabilities (including conntrack). nftables doesn't have
this limitation, pretty much all features work regardless of the protocol family.
So, br_netfilter is only needed if users, for some reason, need to use
ip(6)tables to filter packets forwarded by the bridge, or NAT bridged
traffic. For pure link layer filtering, this module isn't needed.
Other Features
==============
The Linux bridge also supports `IEEE 802.11 Proxy ARP
<https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=958501163ddd6ea22a98f94fa0e7ce6d4734e5c4>`_,
`Media Redundancy Protocol (MRP)
<https://lore.kernel.org/netdev/20200426132208.3232-1-horatiu.vultur@microchip.com/>`_,
`Media Redundancy Protocol (MRP) LC mode
<https://lore.kernel.org/r/20201124082525.273820-1-horatiu.vultur@microchip.com>`_,
`IEEE 802.1X port authentication
<https://lore.kernel.org/netdev/20220218155148.2329797-1-schultz.hans+netdev@gmail.com/>`_,
and `MAC Authentication Bypass (MAB)
<https://lore.kernel.org/netdev/20221101193922.2125323-2-idosch@nvidia.com/>`_.
FAQ
===
What does a bridge do?
----------------------
A bridge transparently forwards traffic between multiple network interfaces.
In plain English this means that a bridge connects two or more physical
Ethernet networks, to form one larger (logical) Ethernet network.
Is it L3 protocol independent?
------------------------------
Yes. The bridge sees all frames, but it *uses* only L2 headers/information.
As such, the bridging functionality is protocol independent, and there should
be no trouble forwarding IPX, NetBEUI, IP, IPv6, etc.
Contact Info
============
The code is currently maintained by Roopa Prabhu <roopa@nvidia.com> and
Nikolay Aleksandrov <razor@blackwall.org>. Bridge bugs and enhancements
are discussed on the linux-netdev mailing list netdev@vger.kernel.org and
bridge@lists.linux-foundation.org.
The list is open to anyone interested: http://vger.kernel.org/vger-lists.html#netdev
External Links
==============
The old Documentation for Linux bridging is on:
https://wiki.linuxfoundation.org/networking/bridge

View File

@ -54,6 +54,7 @@ ena_common_defs.h Common definitions for ena_com layer.
ena_regs_defs.h Definition of ENA PCI memory-mapped (MMIO) registers.
ena_netdev.[ch] Main Linux kernel driver.
ena_ethtool.c ethtool callbacks.
ena_xdp.[ch] XDP files
ena_pci_id_tbl.h Supported device IDs.
================= ======================================================

View File

@ -895,6 +895,147 @@ driver writes raw bytes by the GNSS object to the receiver through i2c. Please
refer to the hardware GNSS module documentation for configuration details.
Firmware (FW) logging
---------------------
The driver supports FW logging via the debugfs interface on PF 0 only. The FW
running on the NIC must support FW logging; if the FW doesn't support FW logging
the 'fwlog' file will not get created in the ice debugfs directory.
Module configuration
~~~~~~~~~~~~~~~~~~~~
Firmware logging is configured on a per module basis. Each module can be set to
a value independent of the other modules (unless the module 'all' is specified).
The modules will be instantiated under the 'fwlog/modules' directory.
The user can set the log level for a module by writing to the module file like
this::
# echo <log_level> > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/<module>
where
* log_level is a name as described below. Each level includes the
messages from the previous/lower level
* none
* error
* warning
* normal
* verbose
* module is a name that represents the module to receive events for. The
module names are
* general
* ctrl
* link
* link_topo
* dnl
* i2c
* sdp
* mdio
* adminq
* hdma
* lldp
* dcbx
* dcb
* xlr
* nvm
* auth
* vpd
* iosf
* parser
* sw
* scheduler
* txq
* rsvd
* post
* watchdog
* task_dispatch
* mng
* synce
* health
* tsdrv
* pfreg
* mdlver
* all
The name 'all' is special and allows the user to set all of the modules to the
specified log_level or to read the log_level of all of the modules.
Example usage to configure the modules
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To set a single module to 'verbose'::
# echo verbose > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/link
To set multiple modules then issue the command multiple times::
# echo verbose > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/link
# echo warning > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/ctrl
# echo none > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/dcb
To set all the modules to the same value::
# echo normal > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/all
To read the log_level of a specific module (e.g. module 'general')::
# cat /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/general
To read the log_level of all the modules::
# cat /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/all
Enabling FW log
~~~~~~~~~~~~~~~
Configuring the modules indicates to the FW that the configured modules should
generate events that the driver is interested in, but it **does not** send the
events to the driver until the enable message is sent to the FW. To do this
the user can write a 1 (enable) or 0 (disable) to 'fwlog/enable'. An example
is::
# echo 1 > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/enable
Retrieving FW log data
~~~~~~~~~~~~~~~~~~~~~~
The FW log data can be retrieved by reading from 'fwlog/data'. The user can
write any value to 'fwlog/data' to clear the data. The data can only be cleared
when FW logging is disabled. The FW log data is a binary file that is sent to
Intel and used to help debug user issues.
An example to read the data is::
# cat /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/data > fwlog.bin
An example to clear the data is::
# echo 0 > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/data
Changing how often the log events are sent to the driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The driver receives FW log data from the Admin Receive Queue (ARQ). The
frequency that the FW sends the ARQ events can be configured by writing to
'fwlog/nr_messages'. The range is 1-128 (1 means push every log message, 128
means push only when the max AQ command buffer is full). The suggested value is
10. The user can see what the value is configured to by reading
'fwlog/nr_messages'. An example to set the value is::
# echo 50 > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/nr_messages
Configuring the amount of memory used to store FW log data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The driver stores FW log data within the driver. The default size of the memory
used to store the data is 1MB. Some use cases may require more or less data so
the user can change the amount of memory that is allocated for FW log data.
To change the amount of memory then write to 'fwlog/log_size'. The value must be
one of: 128K, 256K, 512K, 1M, or 2M. FW logging must be disabled to change the
value. An example of changing the value is::
# echo 128K > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/log_size
Performance Optimization
========================
Driver defaults are meant to fit a wide variety of workloads, but if further

View File

@ -22,8 +22,13 @@ EndPoint NIC.
Supported Devices
=================
Currently, this driver support following devices:
* Network controller: Cavium, Inc. Device b100
* Network controller: Cavium, Inc. Device b200
* Network controller: Cavium, Inc. Device b400
* Network controller: Cavium, Inc. Device b900
* Network controller: Cavium, Inc. Device ba00
* Network controller: Cavium, Inc. Device bc00
* Network controller: Cavium, Inc. Device bd00
Interface Control
=================

View File

@ -10,7 +10,6 @@ Contents:
intel/ipw2100
intel/ipw2200
ray_cs
.. only:: subproject and html

View File

@ -1,165 +0,0 @@
.. SPDX-License-Identifier: GPL-2.0
.. include:: <isonum.txt>
=========================
Raylink wireless LAN card
=========================
September 21, 1999
Copyright |copy| 1998 Corey Thomas (corey@world.std.com)
This file is the documentation for the Raylink Wireless LAN card driver for
Linux. The Raylink wireless LAN card is a PCMCIA card which provides IEEE
802.11 compatible wireless network connectivity at 1 and 2 megabits/second.
See http://www.raytheon.com/micro/raylink/ for more information on the Raylink
card. This driver is in early development and does have bugs. See the known
bugs and limitations at the end of this document for more information.
This driver also works with WebGear's Aviator 2.4 and Aviator Pro
wireless LAN cards.
As of kernel 2.3.18, the ray_cs driver is part of the Linux kernel
source. My web page for the development of ray_cs is at
http://web.ralinktech.com/ralink/Home/Support/Linux.html
and I can be emailed at corey@world.std.com
The kernel driver is based on ray_cs-1.62.tgz
The driver at my web page is intended to be used as an add on to
David Hinds pcmcia package. All the command line parameters are
available when compiled as a module. When built into the kernel, only
the essid= string parameter is available via the kernel command line.
This will change after the method of sorting out parameters for all
the PCMCIA drivers is agreed upon. If you must have a built in driver
with nondefault parameters, they can be edited in
/usr/src/linux/drivers/net/pcmcia/ray_cs.c. Searching for module_param
will find them all.
Information on card services is available at:
http://pcmcia-cs.sourceforge.net/
Card services user programs are still required for PCMCIA devices.
pcmcia-cs-3.1.1 or greater is required for the kernel version of
the driver.
Currently, ray_cs is not part of David Hinds card services package,
so the following magic is required.
At the end of the /etc/pcmcia/config.opts file, add the line:
source ./ray_cs.opts
This will make card services read the ray_cs.opts file
when starting. Create the file /etc/pcmcia/ray_cs.opts containing the
following::
#### start of /etc/pcmcia/ray_cs.opts ###################
# Configuration options for Raylink Wireless LAN PCMCIA card
device "ray_cs"
class "network" module "misc/ray_cs"
card "RayLink PC Card WLAN Adapter"
manfid 0x01a6, 0x0000
bind "ray_cs"
module "misc/ray_cs" opts ""
#### end of /etc/pcmcia/ray_cs.opts #####################
To join an existing network with
different parameters, contact the network administrator for the
configuration information, and edit /etc/pcmcia/ray_cs.opts.
Add the parameters below between the empty quotes.
Parameters for ray_cs driver which may be specified in ray_cs.opts:
=============== =============== =============================================
bc integer 0 = normal mode (802.11 timing),
1 = slow down inter frame timing to allow
operation with older breezecom access
points.
beacon_period integer beacon period in Kilo-microseconds,
legal values = must be integer multiple
of hop dwell
default = 256
country integer 1 = USA (default),
2 = Europe,
3 = Japan,
4 = Korea,
5 = Spain,
6 = France,
7 = Israel,
8 = Australia
essid string ESS ID - network name to join
string with maximum length of 32 chars
default value = "ADHOC_ESSID"
hop_dwell integer hop dwell time in Kilo-microseconds
legal values = 16,32,64,128(default),256
irq_mask integer linux standard 16 bit value 1bit/IRQ
lsb is IRQ 0, bit 1 is IRQ 1 etc.
Used to restrict choice of IRQ's to use.
Recommended method for controlling
interrupts is in /etc/pcmcia/config.opts
net_type integer 0 (default) = adhoc network,
1 = infrastructure
phy_addr string string containing new MAC address in
hex, must start with x eg
x00008f123456
psm integer 0 = continuously active,
1 = power save mode (not useful yet)
pc_debug integer (0-5) larger values for more verbose
logging. Replaces ray_debug.
ray_debug integer Replaced with pc_debug
ray_mem_speed integer defaults to 500
sniffer integer 0 = not sniffer (default),
1 = sniffer which can be used to record all
network traffic using tcpdump or similar,
but no normal network use is allowed.
translate integer 0 = no translation (encapsulate frames),
1 = translation (RFC1042/802.1)
=============== =============== =============================================
More on sniffer mode:
tcpdump does not understand 802.11 headers, so it can't
interpret the contents, but it can record to a file. This is only
useful for debugging 802.11 lowlevel protocols that are not visible to
linux. If you want to watch ftp xfers, or do similar things, you
don't need to use sniffer mode. Also, some packet types are never
sent up by the card, so you will never see them (ack, rts, cts, probe
etc.) There is a simple program (showcap) included in the ray_cs
package which parses the 802.11 headers.
Known Problems and missing features
Does not work with non x86
Does not work with SMP
Support for defragmenting frames is not yet debugged, and in
fact is known to not work. I have never encountered a net set
up to fragment, but still, it should be fixed.
The ioctl support is incomplete. The hardware address cannot be set
using ifconfig yet. If a different hardware address is needed, it may
be set using the phy_addr parameter in ray_cs.opts. This requires
a card insertion to take effect.

View File

@ -22,8 +22,17 @@ By default ``driver_reinit`` action is selected.
* - ``driver-reinit``
- Devlink driver entities re-initialization, including applying
new values to devlink entities which are used during driver
load such as ``devlink-params`` in configuration mode
``driverinit`` or ``devlink-resources``
load which are:
* ``devlink-params`` in configuration mode ``driverinit``
* ``devlink-resources``
Other devlink entities may stay over the re-initialization:
* ``devlink-health-reporter``
* ``devlink-region``
The rest of the devlink entities have to be removed and readded.
* - ``fw_activate``
- Firmware activate. Activates new firmware if such image is stored and
pending activation. If no limitation specified this action may involve

View File

@ -38,6 +38,10 @@ The ``ice`` driver reports the following versions
- fixed
- K65390-000
- The Product Board Assembly (PBA) identifier of the board.
* - ``cgu.id``
- fixed
- 36
- The Clock Generation Unit (CGU) hardware revision identifier.
* - ``fw.mgmt``
- running
- 2.1.7
@ -104,6 +108,11 @@ The ``ice`` driver reports the following versions
- running
- 0xee16ced7
- The first 4 bytes of the hash of the netlist module contents.
* - ``fw.cgu``
- running
- 8032.16973825.6021
- The version of Clock Generation Unit (CGU). Format:
<CGU type>.<configuration version>.<firmware version>.
Flash Update
============

View File

@ -223,6 +223,9 @@ Userspace to kernel:
``ETHTOOL_MSG_PSE_SET`` set PSE parameters
``ETHTOOL_MSG_PSE_GET`` get PSE parameters
``ETHTOOL_MSG_RSS_GET`` get RSS settings
``ETHTOOL_MSG_PLCA_GET_CFG`` get PLCA RS parameters
``ETHTOOL_MSG_PLCA_SET_CFG`` set PLCA RS parameters
``ETHTOOL_MSG_PLCA_GET_STATUS`` get PLCA RS status
``ETHTOOL_MSG_MM_GET`` get MAC merge layer state
``ETHTOOL_MSG_MM_SET`` set MAC merge layer parameters
===================================== =================================
@ -267,6 +270,9 @@ Kernel to userspace:
``ETHTOOL_MSG_MODULE_GET_REPLY`` transceiver module parameters
``ETHTOOL_MSG_PSE_GET_REPLY`` PSE parameters
``ETHTOOL_MSG_RSS_GET_REPLY`` RSS settings
``ETHTOOL_MSG_PLCA_GET_CFG_REPLY`` PLCA RS parameters
``ETHTOOL_MSG_PLCA_GET_STATUS_REPLY`` PLCA RS status
``ETHTOOL_MSG_PLCA_NTF`` PLCA RS parameters
``ETHTOOL_MSG_MM_GET_REPLY`` MAC merge layer status
======================================== =================================
@ -1768,12 +1774,16 @@ Kernel response contents:
``ETHTOOL_A_RSS_HFUNC`` u32 RSS hash func
``ETHTOOL_A_RSS_INDIR`` binary Indir table bytes
``ETHTOOL_A_RSS_HKEY`` binary Hash key bytes
``ETHTOOL_A_RSS_INPUT_XFRM`` u32 RSS input data transformation
===================================== ====== ==========================
ETHTOOL_A_RSS_HFUNC attribute is bitmap indicating the hash function
being used. Current supported options are toeplitz, xor or crc32.
ETHTOOL_A_RSS_INDIR attribute returns RSS indrection table where each byte
ETHTOOL_A_RSS_INDIR attribute returns RSS indirection table where each byte
indicates queue number.
ETHTOOL_A_RSS_INPUT_XFRM attribute is a bitmap indicating the type of
transformation applied to the input protocol fields before given to the RSS
hfunc. Current supported option is symmetric-xor.
PLCA_GET_CFG
============

View File

@ -55,6 +55,7 @@ Contents:
filter
generic-hdlc
generic_netlink
netlink_spec/index
gen_stats
gtp
ila
@ -74,6 +75,7 @@ Contents:
mptcp-sysctl
multiqueue
napi
net_cachelines/index
netconsole
netdev-features
netdevices
@ -123,6 +125,7 @@ Contents:
xfrm_sync
xfrm_sysctl
xdp-rx-metadata
xsk-tx-metadata
.. only:: subproject and html

View File

@ -0,0 +1,16 @@
.. SPDX-License-Identifier: GPL-2.0
.. Copyright (C) 2023 Google LLC
===================================
Common Networking Struct Cachelines
===================================
.. toctree::
:maxdepth: 1
inet_connection_sock
inet_sock
net_device
netns_ipv4_sysctl
snmp
tcp_sock

View File

@ -0,0 +1,50 @@
.. SPDX-License-Identifier: GPL-2.0
.. Copyright (C) 2023 Google LLC
=====================================================
inet_connection_sock struct fast path usage breakdown
=====================================================
Type Name fastpath_tx_access fastpath_rx_access comment
..struct ..inet_connection_sock
struct_inet_sock icsk_inet read_mostly read_mostly tcp_init_buffer_space,tcp_init_transfer,tcp_finish_connect,tcp_connect,tcp_send_rcvq,tcp_send_syn_data
struct_request_sock_queue icsk_accept_queue - -
struct_inet_bind_bucket icsk_bind_hash read_mostly - tcp_set_state
struct_inet_bind2_bucket icsk_bind2_hash read_mostly - tcp_set_state,inet_put_port
unsigned_long icsk_timeout read_mostly - inet_csk_reset_xmit_timer,tcp_connect
struct_timer_list icsk_retransmit_timer read_mostly - inet_csk_reset_xmit_timer,tcp_connect
struct_timer_list icsk_delack_timer read_mostly - inet_csk_reset_xmit_timer,tcp_connect
u32 icsk_rto read_write - tcp_cwnd_validate,tcp_schedule_loss_probe,tcp_connect_init,tcp_connect,tcp_write_xmit,tcp_push_one
u32 icsk_rto_min - -
u32 icsk_delack_max - -
u32 icsk_pmtu_cookie read_write - tcp_sync_mss,tcp_current_mss,tcp_send_syn_data,tcp_connect_init,tcp_connect
struct_tcp_congestion_ops icsk_ca_ops read_write - tcp_cwnd_validate,tcp_tso_segs,tcp_ca_dst_init,tcp_connect_init,tcp_connect,tcp_write_xmit
struct_inet_connection_sock_af_ops icsk_af_ops read_mostly - tcp_finish_connect,tcp_send_syn_data,tcp_mtup_init,tcp_mtu_check_reprobe,tcp_mtu_probe,tcp_connect_init,tcp_connect,__tcp_transmit_skb
struct_tcp_ulp_ops* icsk_ulp_ops - -
void* icsk_ulp_data - -
u8:5 icsk_ca_state read_write - tcp_cwnd_application_limited,tcp_set_ca_state,tcp_enter_cwr,tcp_tso_should_defer,tcp_mtu_probe,tcp_schedule_loss_probe,tcp_write_xmit,__tcp_transmit_skb
u8:1 icsk_ca_initialized read_write - tcp_init_transfer,tcp_init_congestion_control,tcp_init_transfer,tcp_finish_connect,tcp_connect
u8:1 icsk_ca_setsockopt - -
u8:1 icsk_ca_dst_locked write_mostly - tcp_ca_dst_init,tcp_connect_init,tcp_connect
u8 icsk_retransmits write_mostly - tcp_connect_init,tcp_connect
u8 icsk_pending read_write - inet_csk_reset_xmit_timer,tcp_connect,tcp_check_probe_timer,__tcp_push_pending_frames,tcp_rearm_rto,tcp_event_new_data_sent,tcp_event_new_data_sent
u8 icsk_backoff write_mostly - tcp_write_queue_purge,tcp_connect_init
u8 icsk_syn_retries - -
u8 icsk_probes_out - -
u16 icsk_ext_hdr_len read_mostly - __tcp_mtu_to_mss,tcp_mtu_to_rss,tcp_mtu_probe,tcp_write_xmit,tcp_mtu_to_mss,
struct_icsk_ack_u8 pending read_write read_write inet_csk_ack_scheduled,__tcp_cleanup_rbuf,tcp_cleanup_rbuf,inet_csk_clear_xmit_timer,tcp_event_ack-sent,inet_csk_reset_xmit_timer
struct_icsk_ack_u8 quick read_write write_mostly tcp_dec_quickack_mode,tcp_event_ack_sent,__tcp_transmit_skb,__tcp_select_window,__tcp_cleanup_rbuf
struct_icsk_ack_u8 pingpong - -
struct_icsk_ack_u8 retry write_mostly read_write inet_csk_clear_xmit_timer,tcp_rearm_rto,tcp_event_new_data_sent,tcp_write_xmit,__tcp_send_ack,tcp_send_ack,
struct_icsk_ack_u8 ato read_mostly write_mostly tcp_dec_quickack_mode,tcp_event_ack_sent,__tcp_transmit_skb,__tcp_send_ack,tcp_send_ack
struct_icsk_ack_unsigned_long timeout read_write read_write inet_csk_reset_xmit_timer,tcp_connect
struct_icsk_ack_u32 lrcvtime read_write - tcp_finish_connect,tcp_connect,tcp_event_data_sent,__tcp_transmit_skb
struct_icsk_ack_u16 rcv_mss write_mostly read_mostly __tcp_select_window,__tcp_cleanup_rbuf,tcp_initialize_rcv_mss,tcp_connect_init
struct_icsk_mtup_int search_high read_write - tcp_mtup_init,tcp_sync_mss,tcp_connect_init,tcp_mtu_check_reprobe,tcp_write_xmit
struct_icsk_mtup_int search_low read_write - tcp_mtu_probe,tcp_mtu_check_reprobe,tcp_write_xmit,tcp_sync_mss,tcp_connect_init,tcp_mtup_init
struct_icsk_mtup_u32:31 probe_size read_write - tcp_mtup_init,tcp_connect_init,__tcp_transmit_skb
struct_icsk_mtup_u32:1 enabled read_write - tcp_mtup_init,tcp_sync_mss,tcp_connect_init,tcp_mtu_probe,tcp_write_xmit
struct_icsk_mtup_u32 probe_timestamp read_write - tcp_mtup_init,tcp_connect_init,tcp_mtu_check_reprobe,tcp_mtu_probe
u32 icsk_probes_tstamp - -
u32 icsk_user_timeout - -
u64[104/sizeof(u64)] icsk_ca_priv - -

View File

@ -0,0 +1,44 @@
.. SPDX-License-Identifier: GPL-2.0
.. Copyright (C) 2023 Google LLC
=====================================================
inet_connection_sock struct fast path usage breakdown
=====================================================
Type Name fastpath_tx_access fastpath_rx_access comment
..struct ..inet_sock
struct_sock sk read_mostly read_mostly tcp_init_buffer_space,tcp_init_transfer,tcp_finish_connect,tcp_connect,tcp_send_rcvq,tcp_send_syn_data
struct_ipv6_pinfo* pinet6 - -
be16 inet_sport read_mostly - __tcp_transmit_skb
be32 inet_daddr read_mostly - ip_select_ident_segs
be32 inet_rcv_saddr - -
be16 inet_dport read_mostly - __tcp_transmit_skb
u16 inet_num - -
be32 inet_saddr - -
s16 uc_ttl read_mostly - __ip_queue_xmit/ip_select_ttl
u16 cmsg_flags - -
struct_ip_options_rcu* inet_opt read_mostly - __ip_queue_xmit
u16 inet_id read_mostly - ip_select_ident_segs
u8 tos read_mostly - ip_queue_xmit
u8 min_ttl - -
u8 mc_ttl - -
u8 pmtudisc - -
u8:1 recverr - -
u8:1 is_icsk - -
u8:1 freebind - -
u8:1 hdrincl - -
u8:1 mc_loop - -
u8:1 transparent - -
u8:1 mc_all - -
u8:1 nodefrag - -
u8:1 bind_address_no_port - -
u8:1 recverr_rfc4884 - -
u8:1 defer_connect read_mostly - tcp_sendmsg_fastopen
u8 rcv_tos - -
u8 convert_csum - -
int uc_index - -
int mc_index - -
be32 mc_addr - -
struct_ip_mc_socklist* mc_list - -
struct_inet_cork_full cork read_mostly - __tcp_transmit_skb
struct local_port_range - -

View File

@ -0,0 +1,178 @@
.. SPDX-License-Identifier: GPL-2.0
.. Copyright (C) 2023 Google LLC
===========================================
net_device struct fast path usage breakdown
===========================================
Type Name fastpath_tx_access fastpath_rx_access Comments
..struct ..net_device
char name[16] - -
struct_netdev_name_node* name_node
struct_dev_ifalias* ifalias
unsigned_long mem_end
unsigned_long mem_start
unsigned_long base_addr
unsigned_long state
struct_list_head dev_list
struct_list_head napi_list
struct_list_head unreg_list
struct_list_head close_list
struct_list_head ptype_all read_mostly - dev_nit_active(tx)
struct_list_head ptype_specific read_mostly deliver_ptype_list_skb/__netif_receive_skb_core(rx)
struct adj_list
unsigned_int flags read_mostly read_mostly __dev_queue_xmit,__dev_xmit_skb,ip6_output,__ip6_finish_output(tx);ip6_rcv_core(rx)
xdp_features_t xdp_features
unsigned_long_long priv_flags read_mostly - __dev_queue_xmit(tx)
struct_net_device_ops* netdev_ops read_mostly - netdev_core_pick_tx,netdev_start_xmit(tx)
struct_xdp_metadata_ops* xdp_metadata_ops
int ifindex - read_mostly ip6_rcv_core
unsigned_short gflags
unsigned_short hard_header_len read_mostly read_mostly ip6_xmit(tx);gro_list_prepare(rx)
unsigned_int mtu read_mostly - ip_finish_output2
unsigned_short needed_headroom read_mostly - LL_RESERVED_SPACE/ip_finish_output2
unsigned_short needed_tailroom
netdev_features_t features read_mostly read_mostly HARD_TX_LOCK,netif_skb_features,sk_setup_caps(tx);netif_elide_gro(rx)
netdev_features_t hw_features
netdev_features_t wanted_features
netdev_features_t vlan_features
netdev_features_t hw_enc_features - - netif_skb_features
netdev_features_t mpls_features
netdev_features_t gso_partial_features read_mostly gso_features_check
unsigned_int min_mtu
unsigned_int max_mtu
unsigned_short type
unsigned_char min_header_len
unsigned_char name_assign_type
int group
struct_net_device_stats stats
struct_net_device_core_stats* core_stats
atomic_t carrier_up_count
atomic_t carrier_down_count
struct_iw_handler_def* wireless_handlers
struct_iw_public_data* wireless_data
struct_ethtool_ops* ethtool_ops
struct_l3mdev_ops* l3mdev_ops
struct_ndisc_ops* ndisc_ops
struct_xfrmdev_ops* xfrmdev_ops
struct_tlsdev_ops* tlsdev_ops
struct_header_ops* header_ops read_mostly - ip_finish_output2,ip6_finish_output2(tx)
unsigned_char operstate
unsigned_char link_mode
unsigned_char if_port
unsigned_char dma
unsigned_char perm_addr[32]
unsigned_char addr_assign_type
unsigned_char addr_len
unsigned_char upper_level
unsigned_char lower_level
unsigned_short neigh_priv_len
unsigned_short padded
unsigned_short dev_id
unsigned_short dev_port
spinlock_t addr_list_lock
int irq
struct_netdev_hw_addr_list uc
struct_netdev_hw_addr_list mc
struct_netdev_hw_addr_list dev_addrs
struct_kset* queues_kset
struct_list_head unlink_list
unsigned_int promiscuity
unsigned_int allmulti
bool uc_promisc
unsigned_char nested_level
struct_in_device* ip_ptr read_mostly read_mostly __in_dev_get
struct_inet6_dev* ip6_ptr read_mostly read_mostly __in6_dev_get
struct_vlan_info* vlan_info
struct_dsa_port* dsa_ptr
struct_tipc_bearer* tipc_ptr
void* atalk_ptr
void* ax25_ptr
struct_wireless_dev* ieee80211_ptr
struct_wpan_dev* ieee802154_ptr
struct_mpls_dev* mpls_ptr
struct_mctp_dev* mctp_ptr
unsigned_char* dev_addr
struct_netdev_queue* _rx read_mostly - netdev_get_rx_queue(rx)
unsigned_int num_rx_queues
unsigned_int real_num_rx_queues - read_mostly get_rps_cpu
struct_bpf_prog* xdp_prog - read_mostly netif_elide_gro()
unsigned_long gro_flush_timeout - read_mostly napi_complete_done
int napi_defer_hard_irqs - read_mostly napi_complete_done
unsigned_int gro_max_size - read_mostly skb_gro_receive
unsigned_int gro_ipv4_max_size - read_mostly skb_gro_receive
rx_handler_func_t* rx_handler read_mostly - __netif_receive_skb_core
void* rx_handler_data read_mostly -
struct_netdev_queue* ingress_queue read_mostly -
struct_bpf_mprog_entry tcx_ingress - read_mostly sch_handle_ingress
struct_nf_hook_entries* nf_hooks_ingress
unsigned_char broadcast[32]
struct_cpu_rmap* rx_cpu_rmap
struct_hlist_node index_hlist
struct_netdev_queue* _tx read_mostly - netdev_get_tx_queue(tx)
unsigned_int num_tx_queues - -
unsigned_int real_num_tx_queues read_mostly - skb_tx_hash,netdev_core_pick_tx(tx)
unsigned_int tx_queue_len
spinlock_t tx_global_lock
struct_xdp_dev_bulk_queue__percpu* xdp_bulkq
struct_xps_dev_maps* xps_maps[2] read_mostly - __netif_set_xps_queue
struct_bpf_mprog_entry tcx_egress read_mostly - sch_handle_egress
struct_nf_hook_entries* nf_hooks_egress read_mostly -
struct_hlist_head qdisc_hash[16]
struct_timer_list watchdog_timer
int watchdog_timeo
u32 proto_down_reason
struct_list_head todo_list
int__percpu* pcpu_refcnt
refcount_t dev_refcnt
struct_ref_tracker_dir refcnt_tracker
struct_list_head link_watch_list
enum:8 reg_state
bool dismantle
enum:16 rtnl_link_state
bool needs_free_netdev
void*priv_destructor struct_net_device
struct_netpoll_info* npinfo - read_mostly napi_poll/napi_poll_lock
possible_net_t nd_net - read_mostly (dev_net)napi_busy_loop,tcp_v(4/6)_rcv,ip(v6)_rcv,ip(6)_input,ip(6)_input_finish
void* ml_priv
enum_netdev_ml_priv_type ml_priv_type
struct_pcpu_lstats__percpu* lstats
struct_pcpu_sw_netstats__percpu* tstats
struct_pcpu_dstats__percpu* dstats
struct_garp_port* garp_port
struct_mrp_port* mrp_port
struct_dm_hw_stat_delta* dm_private
struct_device dev - -
struct_attribute_group* sysfs_groups[4]
struct_attribute_group* sysfs_rx_queue_group
struct_rtnl_link_ops* rtnl_link_ops
unsigned_int gso_max_size read_mostly - sk_dst_gso_max_size
unsigned_int tso_max_size
u16 gso_max_segs read_mostly - gso_max_segs
u16 tso_max_segs
unsigned_int gso_ipv4_max_size read_mostly - sk_dst_gso_max_size
struct_dcbnl_rtnl_ops* dcbnl_ops
s16 num_tc read_mostly - skb_tx_hash
struct_netdev_tc_txq tc_to_txq[16] read_mostly - skb_tx_hash
u8 prio_tc_map[16]
unsigned_int fcoe_ddp_xid
struct_netprio_map* priomap
struct_phy_device* phydev
struct_sfp_bus* sfp_bus
struct_lock_class_key* qdisc_tx_busylock
bool proto_down
unsigned:1 wol_enabled
unsigned:1 threaded - - napi_poll(napi_enable,dev_set_threaded)
struct_list_head net_notifier_list
struct_macsec_ops* macsec_ops
struct_udp_tunnel_nic_info* udp_tunnel_nic_info
struct_udp_tunnel_nic* udp_tunnel_nic
unsigned_int xdp_zc_max_segs
struct_bpf_xdp_entity xdp_state[3]
u8 dev_addr_shadow[32]
netdevice_tracker linkwatch_dev_tracker
netdevice_tracker watchdog_dev_tracker
netdevice_tracker dev_registered_tracker
struct_rtnl_hw_stats64* offload_xstats_l3
struct_devlink_port* devlink_port
struct_dpll_pin* dpll_pin

View File

@ -0,0 +1,158 @@
.. SPDX-License-Identifier: GPL-2.0
.. Copyright (C) 2023 Google LLC
===========================================
netns_ipv4 struct fast path usage breakdown
===========================================
Type Name fastpath_tx_access fastpath_rx_access comment
..struct ..netns_ipv4
struct_inet_timewait_death_row tcp_death_row
struct_udp_table* udp_table
struct_ctl_table_header* forw_hdr
struct_ctl_table_header* frags_hdr
struct_ctl_table_header* ipv4_hdr
struct_ctl_table_header* route_hdr
struct_ctl_table_header* xfrm4_hdr
struct_ipv4_devconf* devconf_all
struct_ipv4_devconf* devconf_dflt
struct_ip_ra_chain ra_chain
struct_mutex ra_mutex
struct_fib_rules_ops* rules_ops
struct_fib_table fib_main
struct_fib_table fib_default
unsigned_int fib_rules_require_fldissect
bool fib_has_custom_rules
bool fib_has_custom_local_routes
bool fib_offload_disabled
atomic_t fib_num_tclassid_users
struct_hlist_head* fib_table_hash
struct_sock* fibnl
struct_sock* mc_autojoin_sk
struct_inet_peer_base* peers
struct_fqdir* fqdir
u8 sysctl_icmp_echo_ignore_all
u8 sysctl_icmp_echo_enable_probe
u8 sysctl_icmp_echo_ignore_broadcasts
u8 sysctl_icmp_ignore_bogus_error_responses
u8 sysctl_icmp_errors_use_inbound_ifaddr
int sysctl_icmp_ratelimit
int sysctl_icmp_ratemask
u32 ip_rt_min_pmtu - -
int ip_rt_mtu_expires - -
int ip_rt_min_advmss - -
struct_local_ports ip_local_ports - -
u8 sysctl_tcp_ecn - -
u8 sysctl_tcp_ecn_fallback - -
u8 sysctl_ip_default_ttl - - ip4_dst_hoplimit/ip_select_ttl
u8 sysctl_ip_no_pmtu_disc - -
u8 sysctl_ip_fwd_use_pmtu read_mostly - ip_dst_mtu_maybe_forward/ip_skb_dst_mtu
u8 sysctl_ip_fwd_update_priority - - ip_forward
u8 sysctl_ip_nonlocal_bind - -
u8 sysctl_ip_autobind_reuse - -
u8 sysctl_ip_dynaddr - -
u8 sysctl_ip_early_demux - read_mostly ip(6)_rcv_finish_core
u8 sysctl_raw_l3mdev_accept - -
u8 sysctl_tcp_early_demux - read_mostly ip(6)_rcv_finish_core
u8 sysctl_udp_early_demux
u8 sysctl_nexthop_compat_mode - -
u8 sysctl_fwmark_reflect - -
u8 sysctl_tcp_fwmark_accept - -
u8 sysctl_tcp_l3mdev_accept - -
u8 sysctl_tcp_mtu_probing - -
int sysctl_tcp_mtu_probe_floor - -
int sysctl_tcp_base_mss - -
int sysctl_tcp_min_snd_mss read_mostly - __tcp_mtu_to_mss(tcp_write_xmit)
int sysctl_tcp_probe_threshold - - tcp_mtu_probe(tcp_write_xmit)
u32 sysctl_tcp_probe_interval - - tcp_mtu_check_reprobe(tcp_write_xmit)
int sysctl_tcp_keepalive_time - -
int sysctl_tcp_keepalive_intvl - -
u8 sysctl_tcp_keepalive_probes - -
u8 sysctl_tcp_syn_retries - -
u8 sysctl_tcp_synack_retries - -
u8 sysctl_tcp_syncookies - - generated_on_syn
u8 sysctl_tcp_migrate_req - - reuseport
u8 sysctl_tcp_comp_sack_nr - - __tcp_ack_snd_check
int sysctl_tcp_reordering - read_mostly tcp_may_raise_cwnd/tcp_cong_control
u8 sysctl_tcp_retries1 - -
u8 sysctl_tcp_retries2 - -
u8 sysctl_tcp_orphan_retries - -
u8 sysctl_tcp_tw_reuse - - timewait_sock_ops
int sysctl_tcp_fin_timeout - - TCP_LAST_ACK/tcp_rcv_state_process
unsigned_int sysctl_tcp_notsent_lowat read_mostly - tcp_notsent_lowat/tcp_stream_memory_free
u8 sysctl_tcp_sack - - tcp_syn_options
u8 sysctl_tcp_window_scaling - - tcp_syn_options,tcp_parse_options
u8 sysctl_tcp_timestamps
u8 sysctl_tcp_early_retrans read_mostly - tcp_schedule_loss_probe(tcp_write_xmit)
u8 sysctl_tcp_recovery - - tcp_fastretrans_alert
u8 sysctl_tcp_thin_linear_timeouts - - tcp_retrans_timer(on_thin_streams)
u8 sysctl_tcp_slow_start_after_idle - - unlikely(tcp_cwnd_validate-network-not-starved)
u8 sysctl_tcp_retrans_collapse - -
u8 sysctl_tcp_stdurg - - unlikely(tcp_check_urg)
u8 sysctl_tcp_rfc1337 - -
u8 sysctl_tcp_abort_on_overflow - -
u8 sysctl_tcp_fack - -
int sysctl_tcp_max_reordering - - tcp_check_sack_reordering
int sysctl_tcp_adv_win_scale - - tcp_init_buffer_space
u8 sysctl_tcp_dsack - - partial_packet_or_retrans_in_tcp_data_queue
u8 sysctl_tcp_app_win - - tcp_win_from_space
u8 sysctl_tcp_frto - - tcp_enter_loss
u8 sysctl_tcp_nometrics_save - - TCP_LAST_ACK/tcp_update_metrics
u8 sysctl_tcp_no_ssthresh_metrics_save - - TCP_LAST_ACK/tcp_(update/init)_metrics
u8 sysctl_tcp_moderate_rcvbuf read_mostly read_mostly tcp_tso_should_defer(tx);tcp_rcv_space_adjust(rx)
u8 sysctl_tcp_tso_win_divisor read_mostly - tcp_tso_should_defer(tcp_write_xmit)
u8 sysctl_tcp_workaround_signed_windows - - tcp_select_window
int sysctl_tcp_limit_output_bytes read_mostly - tcp_small_queue_check(tcp_write_xmit)
int sysctl_tcp_challenge_ack_limit - -
int sysctl_tcp_min_rtt_wlen read_mostly - tcp_ack_update_rtt
u8 sysctl_tcp_min_tso_segs - - unlikely(icsk_ca_ops-written)
u8 sysctl_tcp_tso_rtt_log read_mostly - tcp_tso_autosize
u8 sysctl_tcp_autocorking read_mostly - tcp_push/tcp_should_autocork
u8 sysctl_tcp_reflect_tos - - tcp_v(4/6)_send_synack
int sysctl_tcp_invalid_ratelimit - -
int sysctl_tcp_pacing_ss_ratio - - default_cong_cont(tcp_update_pacing_rate)
int sysctl_tcp_pacing_ca_ratio - - default_cong_cont(tcp_update_pacing_rate)
int sysctl_tcp_wmem[3] read_mostly - tcp_wmem_schedule(sendmsg/sendpage)
int sysctl_tcp_rmem[3] - read_mostly __tcp_grow_window(tx),tcp_rcv_space_adjust(rx)
unsigned_int sysctl_tcp_child_ehash_entries
unsigned_long sysctl_tcp_comp_sack_delay_ns - - __tcp_ack_snd_check
unsigned_long sysctl_tcp_comp_sack_slack_ns - - __tcp_ack_snd_check
int sysctl_max_syn_backlog - -
int sysctl_tcp_fastopen - -
struct_tcp_congestion_ops tcp_congestion_control - - init_cc
struct_tcp_fastopen_context tcp_fastopen_ctx - -
unsigned_int sysctl_tcp_fastopen_blackhole_timeout - -
atomic_t tfo_active_disable_times - -
unsigned_long tfo_active_disable_stamp - -
u32 tcp_challenge_timestamp - -
u32 tcp_challenge_count - -
u8 sysctl_tcp_plb_enabled - -
u8 sysctl_tcp_plb_idle_rehash_rounds - -
u8 sysctl_tcp_plb_rehash_rounds - -
u8 sysctl_tcp_plb_suspend_rto_sec - -
int sysctl_tcp_plb_cong_thresh - -
int sysctl_udp_wmem_min
int sysctl_udp_rmem_min
u8 sysctl_fib_notify_on_flag_change
u8 sysctl_udp_l3mdev_accept
u8 sysctl_igmp_llm_reports
int sysctl_igmp_max_memberships
int sysctl_igmp_max_msf
int sysctl_igmp_qrv
struct_ping_group_range ping_group_range
atomic_t dev_addr_genid
unsigned_int sysctl_udp_child_hash_entries
unsigned_long* sysctl_local_reserved_ports
int sysctl_ip_prot_sock
struct_mr_table* mrt
struct_list_head mr_tables
struct_fib_rules_ops* mr_rules_ops
u32 sysctl_fib_multipath_hash_fields
u8 sysctl_fib_multipath_use_neigh
u8 sysctl_fib_multipath_hash_policy
struct_fib_notifier_ops* notifier_ops
unsigned_int fib_seq
struct_fib_notifier_ops* ipmr_notifier_ops
unsigned_int ipmr_seq
atomic_t rt_genid
siphash_key_t ip_id_key

View File

@ -0,0 +1,135 @@
.. SPDX-License-Identifier: GPL-2.0
.. Copyright (C) 2023 Google LLC
===========================================
netns_ipv4 enum fast path usage breakdown
===========================================
Type Name fastpath_tx_access fastpath_rx_access comment
..enum
unsigned_long LINUX_MIB_TCPKEEPALIVE write_mostly - tcp_keepalive_timer
unsigned_long LINUX_MIB_DELAYEDACKS write_mostly - tcp_delack_timer_handler,tcp_delack_timer
unsigned_long LINUX_MIB_DELAYEDACKLOCKED write_mostly - tcp_delack_timer_handler,tcp_delack_timer
unsigned_long LINUX_MIB_TCPAUTOCORKING write_mostly - tcp_push,tcp_sendmsg_locked
unsigned_long LINUX_MIB_TCPFROMZEROWINDOWADV write_mostly - tcp_select_window,tcp_transmit-skb
unsigned_long LINUX_MIB_TCPTOZEROWINDOWADV write_mostly - tcp_select_window,tcp_transmit-skb
unsigned_long LINUX_MIB_TCPWANTZEROWINDOWADV write_mostly - tcp_select_window,tcp_transmit-skb
unsigned_long LINUX_MIB_TCPORIGDATASENT write_mostly - tcp_write_xmit
unsigned_long LINUX_MIB_TCPHPHITS - write_mostly tcp_rcv_established,tcp_v4_do_rcv,tcp_v6_do_rcv
unsigned_long LINUX_MIB_TCPRCVCOALESCE - write_mostly tcp_try_coalesce,tcp_queue_rcv,tcp_rcv_established
unsigned_long LINUX_MIB_TCPPUREACKS - write_mostly tcp_ack,tcp_rcv_established
unsigned_long LINUX_MIB_TCPHPACKS - write_mostly tcp_ack,tcp_rcv_established
unsigned_long LINUX_MIB_TCPDELIVERED - write_mostly tcp_newly_delivered,tcp_ack,tcp_rcv_established
unsigned_long LINUX_MIB_SYNCOOKIESSENT
unsigned_long LINUX_MIB_SYNCOOKIESRECV
unsigned_long LINUX_MIB_SYNCOOKIESFAILED
unsigned_long LINUX_MIB_EMBRYONICRSTS
unsigned_long LINUX_MIB_PRUNECALLED
unsigned_long LINUX_MIB_RCVPRUNED
unsigned_long LINUX_MIB_OFOPRUNED
unsigned_long LINUX_MIB_OUTOFWINDOWICMPS
unsigned_long LINUX_MIB_LOCKDROPPEDICMPS
unsigned_long LINUX_MIB_ARPFILTER
unsigned_long LINUX_MIB_TIMEWAITED
unsigned_long LINUX_MIB_TIMEWAITRECYCLED
unsigned_long LINUX_MIB_TIMEWAITKILLED
unsigned_long LINUX_MIB_PAWSACTIVEREJECTED
unsigned_long LINUX_MIB_PAWSESTABREJECTED
unsigned_long LINUX_MIB_DELAYEDACKLOST
unsigned_long LINUX_MIB_LISTENOVERFLOWS
unsigned_long LINUX_MIB_LISTENDROPS
unsigned_long LINUX_MIB_TCPRENORECOVERY
unsigned_long LINUX_MIB_TCPSACKRECOVERY
unsigned_long LINUX_MIB_TCPSACKRENEGING
unsigned_long LINUX_MIB_TCPSACKREORDER
unsigned_long LINUX_MIB_TCPRENOREORDER
unsigned_long LINUX_MIB_TCPTSREORDER
unsigned_long LINUX_MIB_TCPFULLUNDO
unsigned_long LINUX_MIB_TCPPARTIALUNDO
unsigned_long LINUX_MIB_TCPDSACKUNDO
unsigned_long LINUX_MIB_TCPLOSSUNDO
unsigned_long LINUX_MIB_TCPLOSTRETRANSMIT
unsigned_long LINUX_MIB_TCPRENOFAILURES
unsigned_long LINUX_MIB_TCPSACKFAILURES
unsigned_long LINUX_MIB_TCPLOSSFAILURES
unsigned_long LINUX_MIB_TCPFASTRETRANS
unsigned_long LINUX_MIB_TCPSLOWSTARTRETRANS
unsigned_long LINUX_MIB_TCPTIMEOUTS
unsigned_long LINUX_MIB_TCPLOSSPROBES
unsigned_long LINUX_MIB_TCPLOSSPROBERECOVERY
unsigned_long LINUX_MIB_TCPRENORECOVERYFAIL
unsigned_long LINUX_MIB_TCPSACKRECOVERYFAIL
unsigned_long LINUX_MIB_TCPRCVCOLLAPSED
unsigned_long LINUX_MIB_TCPDSACKOLDSENT
unsigned_long LINUX_MIB_TCPDSACKOFOSENT
unsigned_long LINUX_MIB_TCPDSACKRECV
unsigned_long LINUX_MIB_TCPDSACKOFORECV
unsigned_long LINUX_MIB_TCPABORTONDATA
unsigned_long LINUX_MIB_TCPABORTONCLOSE
unsigned_long LINUX_MIB_TCPABORTONMEMORY
unsigned_long LINUX_MIB_TCPABORTONTIMEOUT
unsigned_long LINUX_MIB_TCPABORTONLINGER
unsigned_long LINUX_MIB_TCPABORTFAILED
unsigned_long LINUX_MIB_TCPMEMORYPRESSURES
unsigned_long LINUX_MIB_TCPMEMORYPRESSURESCHRONO
unsigned_long LINUX_MIB_TCPSACKDISCARD
unsigned_long LINUX_MIB_TCPDSACKIGNOREDOLD
unsigned_long LINUX_MIB_TCPDSACKIGNOREDNOUNDO
unsigned_long LINUX_MIB_TCPSPURIOUSRTOS
unsigned_long LINUX_MIB_TCPMD5NOTFOUND
unsigned_long LINUX_MIB_TCPMD5UNEXPECTED
unsigned_long LINUX_MIB_TCPMD5FAILURE
unsigned_long LINUX_MIB_SACKSHIFTED
unsigned_long LINUX_MIB_SACKMERGED
unsigned_long LINUX_MIB_SACKSHIFTFALLBACK
unsigned_long LINUX_MIB_TCPBACKLOGDROP
unsigned_long LINUX_MIB_PFMEMALLOCDROP
unsigned_long LINUX_MIB_TCPMINTTLDROP
unsigned_long LINUX_MIB_TCPDEFERACCEPTDROP
unsigned_long LINUX_MIB_IPRPFILTER
unsigned_long LINUX_MIB_TCPTIMEWAITOVERFLOW
unsigned_long LINUX_MIB_TCPREQQFULLDOCOOKIES
unsigned_long LINUX_MIB_TCPREQQFULLDROP
unsigned_long LINUX_MIB_TCPRETRANSFAIL
unsigned_long LINUX_MIB_TCPBACKLOGCOALESCE
unsigned_long LINUX_MIB_TCPOFOQUEUE
unsigned_long LINUX_MIB_TCPOFODROP
unsigned_long LINUX_MIB_TCPOFOMERGE
unsigned_long LINUX_MIB_TCPCHALLENGEACK
unsigned_long LINUX_MIB_TCPSYNCHALLENGE
unsigned_long LINUX_MIB_TCPFASTOPENACTIVE
unsigned_long LINUX_MIB_TCPFASTOPENACTIVEFAIL
unsigned_long LINUX_MIB_TCPFASTOPENPASSIVE
unsigned_long LINUX_MIB_TCPFASTOPENPASSIVEFAIL
unsigned_long LINUX_MIB_TCPFASTOPENLISTENOVERFLOW
unsigned_long LINUX_MIB_TCPFASTOPENCOOKIEREQD
unsigned_long LINUX_MIB_TCPFASTOPENBLACKHOLE
unsigned_long LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES
unsigned_long LINUX_MIB_BUSYPOLLRXPACKETS
unsigned_long LINUX_MIB_TCPSYNRETRANS
unsigned_long LINUX_MIB_TCPHYSTARTTRAINDETECT
unsigned_long LINUX_MIB_TCPHYSTARTTRAINCWND
unsigned_long LINUX_MIB_TCPHYSTARTDELAYDETECT
unsigned_long LINUX_MIB_TCPHYSTARTDELAYCWND
unsigned_long LINUX_MIB_TCPACKSKIPPEDSYNRECV
unsigned_long LINUX_MIB_TCPACKSKIPPEDPAWS
unsigned_long LINUX_MIB_TCPACKSKIPPEDSEQ
unsigned_long LINUX_MIB_TCPACKSKIPPEDFINWAIT2
unsigned_long LINUX_MIB_TCPACKSKIPPEDTIMEWAIT
unsigned_long LINUX_MIB_TCPACKSKIPPEDCHALLENGE
unsigned_long LINUX_MIB_TCPWINPROBE
unsigned_long LINUX_MIB_TCPMTUPFAIL
unsigned_long LINUX_MIB_TCPMTUPSUCCESS
unsigned_long LINUX_MIB_TCPDELIVEREDCE
unsigned_long LINUX_MIB_TCPACKCOMPRESSED
unsigned_long LINUX_MIB_TCPZEROWINDOWDROP
unsigned_long LINUX_MIB_TCPRCVQDROP
unsigned_long LINUX_MIB_TCPWQUEUETOOBIG
unsigned_long LINUX_MIB_TCPFASTOPENPASSIVEALTKEY
unsigned_long LINUX_MIB_TCPTIMEOUTREHASH
unsigned_long LINUX_MIB_TCPDUPLICATEDATAREHASH
unsigned_long LINUX_MIB_TCPDSACKRECVSEGS
unsigned_long LINUX_MIB_TCPDSACKIGNOREDDUBIOUS
unsigned_long LINUX_MIB_TCPMIGRATEREQSUCCESS
unsigned_long LINUX_MIB_TCPMIGRATEREQFAILURE
unsigned_long __LINUX_MIB_MAX

View File

@ -0,0 +1,157 @@
.. SPDX-License-Identifier: GPL-2.0
.. Copyright (C) 2023 Google LLC
=========================================
tcp_sock struct fast path usage breakdown
=========================================
Type Name fastpath_tx_access fastpath_rx_access Comments
..struct ..tcp_sock
struct_inet_connection_sock inet_conn
u16 tcp_header_len read_mostly read_mostly tcp_bound_to_half_wnd,tcp_current_mss(tx);tcp_rcv_established(rx)
u16 gso_segs read_mostly - tcp_xmit_size_goal
__be32 pred_flags read_write read_mostly tcp_select_window(tx);tcp_rcv_established(rx)
u64 bytes_received - read_write tcp_rcv_nxt_update(rx)
u32 segs_in - read_write tcp_v6_rcv(rx)
u32 data_segs_in - read_write tcp_v6_rcv(rx)
u32 rcv_nxt read_mostly read_write tcp_cleanup_rbuf,tcp_send_ack,tcp_inq_hint,tcp_transmit_skb,tcp_receive_window(tx);tcp_v6_do_rcv,tcp_rcv_established,tcp_data_queue,tcp_receive_window,tcp_rcv_nxt_update(write)(rx)
u32 copied_seq - read_mostly tcp_cleanup_rbuf,tcp_rcv_space_adjust,tcp_inq_hint
u32 rcv_wup - read_write __tcp_cleanup_rbuf,tcp_receive_window,tcp_receive_established
u32 snd_nxt read_write read_mostly tcp_rate_check_app_limited,__tcp_transmit_skb,tcp_event_new_data_sent(write)(tx);tcp_rcv_established,tcp_ack,tcp_clean_rtx_queue(rx)
u32 segs_out read_write - __tcp_transmit_skb
u32 data_segs_out read_write - __tcp_transmit_skb,tcp_update_skb_after_send
u64 bytes_sent read_write - __tcp_transmit_skb
u64 bytes_acked - read_write tcp_snd_una_update/tcp_ack
u32 dsack_dups
u32 snd_una read_mostly read_write tcp_wnd_end,tcp_urg_mode,tcp_minshall_check,tcp_cwnd_validate(tx);tcp_ack,tcp_may_update_window,tcp_clean_rtx_queue(write),tcp_ack_tstamp(rx)
u32 snd_sml read_write - tcp_minshall_check,tcp_minshall_update
u32 rcv_tstamp - read_mostly tcp_ack
u32 lsndtime read_write - tcp_slow_start_after_idle_check,tcp_event_data_sent
u32 last_oow_ack_time
u32 compressed_ack_rcv_nxt
u32 tsoffset read_mostly read_mostly tcp_established_options(tx);tcp_fast_parse_options(rx)
struct_list_head tsq_node - -
struct_list_head tsorted_sent_queue read_write - tcp_update_skb_after_send
u32 snd_wl1 - read_mostly tcp_may_update_window
u32 snd_wnd read_mostly read_mostly tcp_wnd_end,tcp_tso_should_defer(tx);tcp_fast_path_on(rx)
u32 max_window read_mostly - tcp_bound_to_half_wnd,forced_push
u32 mss_cache read_mostly read_mostly tcp_rate_check_app_limited,tcp_current_mss,tcp_sync_mss,tcp_sndbuf_expand,tcp_tso_should_defer(tx);tcp_update_pacing_rate,tcp_clean_rtx_queue(rx)
u32 window_clamp read_mostly read_write tcp_rcv_space_adjust,__tcp_select_window
u32 rcv_ssthresh read_mostly - __tcp_select_window
u82 scaling_ratio
struct tcp_rack
u16 advmss - read_mostly tcp_rcv_space_adjust
u8 compressed_ack
u8:2 dup_ack_counter
u8:1 tlp_retrans
u8:1 tcp_usec_ts
u32 chrono_start read_write - tcp_chrono_start/stop(tcp_write_xmit,tcp_cwnd_validate,tcp_send_syn_data)
u32[3] chrono_stat read_write - tcp_chrono_start/stop(tcp_write_xmit,tcp_cwnd_validate,tcp_send_syn_data)
u8:2 chrono_type read_write - tcp_chrono_start/stop(tcp_write_xmit,tcp_cwnd_validate,tcp_send_syn_data)
u8:1 rate_app_limited - read_write tcp_rate_gen
u8:1 fastopen_connect
u8:1 fastopen_no_cookie
u8:1 is_sack_reneg - read_mostly tcp_skb_entail,tcp_ack
u8:2 fastopen_client_fail
u8:4 nonagle read_write - tcp_skb_entail,tcp_push_pending_frames
u8:1 thin_lto
u8:1 recvmsg_inq
u8:1 repair read_mostly - tcp_write_xmit
u8:1 frto
u8 repair_queue - -
u8:2 save_syn
u8:1 syn_data
u8:1 syn_fastopen
u8:1 syn_fastopen_exp
u8:1 syn_fastopen_ch
u8:1 syn_data_acked
u8:1 is_cwnd_limited read_mostly - tcp_cwnd_validate,tcp_is_cwnd_limited
u32 tlp_high_seq - read_mostly tcp_ack
u32 tcp_tx_delay
u64 tcp_wstamp_ns read_write - tcp_pacing_check,tcp_tso_should_defer,tcp_update_skb_after_send
u64 tcp_clock_cache read_write read_write tcp_mstamp_refresh(tcp_write_xmit/tcp_rcv_space_adjust),__tcp_transmit_skb,tcp_tso_should_defer;timer
u64 tcp_mstamp read_write read_write tcp_mstamp_refresh(tcp_write_xmit/tcp_rcv_space_adjust)(tx);tcp_rcv_space_adjust,tcp_rate_gen,tcp_clean_rtx_queue,tcp_ack_update_rtt/tcp_time_stamp(rx);timer
u32 srtt_us read_mostly read_write tcp_tso_should_defer(tx);tcp_update_pacing_rate,__tcp_set_rto,tcp_rtt_estimator(rx)
u32 mdev_us read_write - tcp_rtt_estimator
u32 mdev_max_us
u32 rttvar_us - read_mostly __tcp_set_rto
u32 rtt_seq read_write tcp_rtt_estimator
struct_minmax rtt_min - read_mostly tcp_min_rtt/tcp_rate_gen,tcp_min_rtttcp_update_rtt_min
u32 packets_out read_write read_write tcp_packets_in_flight(tx/rx);tcp_slow_start_after_idle_check,tcp_nagle_check,tcp_rate_skb_sent,tcp_event_new_data_sent,tcp_cwnd_validate,tcp_write_xmit(tx);tcp_ack,tcp_clean_rtx_queue,tcp_update_pacing_rate(rx)
u32 retrans_out - read_mostly tcp_packets_in_flight,tcp_rate_check_app_limited
u32 max_packets_out - read_write tcp_cwnd_validate
u32 cwnd_usage_seq - read_write tcp_cwnd_validate
u16 urg_data - read_mostly tcp_fast_path_check
u8 ecn_flags read_write - tcp_ecn_send
u8 keepalive_probes
u32 reordering read_mostly - tcp_sndbuf_expand
u32 reord_seen
u32 snd_up read_write read_mostly tcp_mark_urg,tcp_urg_mode,__tcp_transmit_skb(tx);tcp_clean_rtx_queue(rx)
struct_tcp_options_received rx_opt read_mostly read_write tcp_established_options(tx);tcp_fast_path_on,tcp_ack_update_window,tcp_is_sack,tcp_data_queue,tcp_rcv_established,tcp_ack_update_rtt(rx)
u32 snd_ssthresh - read_mostly tcp_update_pacing_rate
u32 snd_cwnd read_mostly read_mostly tcp_snd_cwnd,tcp_rate_check_app_limited,tcp_tso_should_defer(tx);tcp_update_pacing_rate
u32 snd_cwnd_cnt
u32 snd_cwnd_clamp
u32 snd_cwnd_used
u32 snd_cwnd_stamp
u32 prior_cwnd
u32 prr_delivered
u32 prr_out read_mostly read_mostly tcp_rate_skb_sent,tcp_newly_delivered(tx);tcp_ack,tcp_rate_gen,tcp_clean_rtx_queue(rx)
u32 delivered read_mostly read_write tcp_rate_skb_sent, tcp_newly_delivered(tx);tcp_ack, tcp_rate_gen, tcp_clean_rtx_queue (rx)
u32 delivered_ce read_mostly read_write tcp_rate_skb_sent(tx);tcp_rate_gen(rx)
u32 lost - read_mostly tcp_ack
u32 app_limited read_write read_mostly tcp_rate_check_app_limited,tcp_rate_skb_sent(tx);tcp_rate_gen(rx)
u64 first_tx_mstamp read_write - tcp_rate_skb_sent
u64 delivered_mstamp read_write - tcp_rate_skb_sent
u32 rate_delivered - read_mostly tcp_rate_gen
u32 rate_interval_us - read_mostly rate_delivered,rate_app_limited
u32 rcv_wnd read_write read_mostly tcp_select_window,tcp_receive_window,tcp_fast_path_check
u32 write_seq read_write - tcp_rate_check_app_limited,tcp_write_queue_empty,tcp_skb_entail,forced_push,tcp_mark_push
u32 notsent_lowat read_mostly - tcp_stream_memory_free
u32 pushed_seq read_write - tcp_mark_push,forced_push
u32 lost_out read_mostly read_mostly tcp_left_out(tx);tcp_packets_in_flight(tx/rx);tcp_rate_check_app_limited(rx)
u32 sacked_out read_mostly read_mostly tcp_left_out(tx);tcp_packets_in_flight(tx/rx);tcp_clean_rtx_queue(rx)
struct_hrtimer pacing_timer
struct_hrtimer compressed_ack_timer
struct_sk_buff* lost_skb_hint read_mostly tcp_clean_rtx_queue
struct_sk_buff* retransmit_skb_hint read_mostly - tcp_clean_rtx_queue
struct_rb_root out_of_order_queue - read_mostly tcp_data_queue,tcp_fast_path_check
struct_sk_buff* ooo_last_skb
struct_tcp_sack_block[1] duplicate_sack
struct_tcp_sack_block[4] selective_acks
struct_tcp_sack_block[4] recv_sack_cache
struct_sk_buff* highest_sack read_write - tcp_event_new_data_sent
int lost_cnt_hint
u32 prior_ssthresh
u32 high_seq
u32 retrans_stamp
u32 undo_marker
int undo_retrans
u64 bytes_retrans
u32 total_retrans
u32 rto_stamp
u16 total_rto
u16 total_rto_recoveries
u32 total_rto_time
u32 urg_seq - -
unsigned_int keepalive_time
unsigned_int keepalive_intvl
int linger2
u8 bpf_sock_ops_cb_flags
u8:1 bpf_chg_cc_inprogress
u16 timeout_rehash
u32 rcv_ooopack
u32 rcv_rtt_last_tsecr
struct rcv_rtt_est - read_write tcp_rcv_space_adjust,tcp_rcv_established
struct rcvq_space - read_write tcp_rcv_space_adjust
struct mtu_probe
u32 plb_rehash
u32 mtu_info
bool is_mptcp
bool smc_hs_congested
bool syn_smc
struct_tcp_sock_af_ops* af_specific
struct_tcp_md5sig_info* md5sig_info
struct_tcp_fastopen_request* fastopen_req
struct_request_sock* fastopen_rsk
struct_saved_syn* saved_syn

View File

@ -0,0 +1 @@
*.rst

View File

@ -0,0 +1,4 @@
SPDX-License-Identifier: GPL-2.0
This file is populated during the build of the documentation (htmldocs) by the
tools/net/ynl/ynl-gen-rst.py script.

View File

@ -41,6 +41,11 @@ Architecture overview
| Fast cache | | ptr-ring cache |
+-----------------+ +------------------+
Monitoring
==========
Information about page pools on the system can be accessed via the netdev
genetlink family (see Documentation/netlink/specs/netdev.yaml).
API interface
=============
The number of pools created **must** match the number of hardware queues
@ -107,8 +112,9 @@ page_pool_get_stats() and structures described below are available.
It takes a pointer to a ``struct page_pool`` and a pointer to a struct
page_pool_stats allocated by the caller.
The API will fill in the provided struct page_pool_stats with
statistics about the page_pool.
Older drivers expose page pool statistics via ethtool or debugfs.
The same statistics are accessible via the netlink netdev family
in a driver-independent fashion.
.. kernel-doc:: include/net/page_pool/types.h
:identifiers: struct page_pool_recycle_stats

View File

@ -44,6 +44,21 @@ by masking out the low order seven bits of the computed hash for the
packet (usually a Toeplitz hash), taking this number as a key into the
indirection table and reading the corresponding value.
Some NICs support symmetric RSS hashing where, if the IP (source address,
destination address) and TCP/UDP (source port, destination port) tuples
are swapped, the computed hash is the same. This is beneficial in some
applications that monitor TCP/IP flows (IDS, firewalls, ...etc) and need
both directions of the flow to land on the same Rx queue (and CPU). The
"Symmetric-XOR" is a type of RSS algorithms that achieves this hash
symmetry by XORing the input source and destination fields of the IP
and/or L4 protocols. This, however, results in reduced input entropy and
could potentially be exploited. Specifically, the algorithm XORs the input
as follows::
# (SRC_IP ^ DST_IP, SRC_IP ^ DST_IP, SRC_PORT ^ DST_PORT, SRC_PORT ^ DST_PORT)
The result is then fed to the underlying RSS algorithm.
Some advanced NICs allow steering packets to queues based on
programmable filters. For example, webserver bound TCP port 80 packets
can be directed to their own receive queue. Such “n-tuple” filters can

View File

@ -57,3 +57,17 @@ rmem - INTEGER
only allowed 512KiB for SMC-R and 1MiB for SMC-D.
Default: 64KiB
smcr_max_links_per_lgr - INTEGER
Controls the max number of links can be added to a SMC-R link group. Notice that
the actual number of the links added to a SMC-R link group depends on the number
of RDMA devices exist in the system. The acceptable value ranges from 1 to 2. Only
for SMC-R v2.1 and later.
Default: 2
smcr_max_conns_per_lgr - INTEGER
Controls the max number of connections can be added to a SMC-R link group. The
acceptable value ranges from 16 to 255. Only for SMC-R v2.1 and later.
Default: 255

View File

@ -357,7 +357,8 @@ enabling SOF_TIMESTAMPING_OPT_ID and comparing the byte offset at
send time with the value returned for each timestamp. It can prevent
the situation by always flushing the TCP stack in between requests,
for instance by enabling TCP_NODELAY and disabling TCP_CORK and
autocork.
autocork. After linux-4.7, a better way to prevent coalescing is
to use MSG_EOR flag at sendmsg() time.
These precautions ensure that the timestamp is generated only when all
bytes have passed a timestamp point, assuming that the network stack

View File

@ -1,3 +1,5 @@
.. SPDX-License-Identifier: GPL-2.0
===============
XDP RX Metadata
===============
@ -18,7 +20,13 @@ Currently, the following kfuncs are supported. In the future, as more
metadata is supported, this set will grow:
.. kernel-doc:: net/core/xdp.c
:identifiers: bpf_xdp_metadata_rx_timestamp bpf_xdp_metadata_rx_hash
:identifiers: bpf_xdp_metadata_rx_timestamp
.. kernel-doc:: net/core/xdp.c
:identifiers: bpf_xdp_metadata_rx_hash
.. kernel-doc:: net/core/xdp.c
:identifiers: bpf_xdp_metadata_rx_vlan_tag
An XDP program can use these kfuncs to read the metadata into stack
variables for its own consumption. Or, to pass the metadata on to other

View File

@ -0,0 +1,81 @@
.. SPDX-License-Identifier: GPL-2.0
==================
AF_XDP TX Metadata
==================
This document describes how to enable offloads when transmitting packets
via :doc:`af_xdp`. Refer to :doc:`xdp-rx-metadata` on how to access similar
metadata on the receive side.
General Design
==============
The headroom for the metadata is reserved via ``tx_metadata_len`` in
``struct xdp_umem_reg``. The metadata length is therefore the same for
every socket that shares the same umem. The metadata layout is a fixed UAPI,
refer to ``union xsk_tx_metadata`` in ``include/uapi/linux/if_xdp.h``.
Thus, generally, the ``tx_metadata_len`` field above should contain
``sizeof(union xsk_tx_metadata)``.
The headroom and the metadata itself should be located right before
``xdp_desc->addr`` in the umem frame. Within a frame, the metadata
layout is as follows::
tx_metadata_len
/ \
+-----------------+---------+----------------------------+
| xsk_tx_metadata | padding | payload |
+-----------------+---------+----------------------------+
^
|
xdp_desc->addr
An AF_XDP application can request headrooms larger than ``sizeof(struct
xsk_tx_metadata)``. The kernel will ignore the padding (and will still
use ``xdp_desc->addr - tx_metadata_len`` to locate
the ``xsk_tx_metadata``). For the frames that shouldn't carry
any metadata (i.e., the ones that don't have ``XDP_TX_METADATA`` option),
the metadata area is ignored by the kernel as well.
The flags field enables the particular offload:
- ``XDP_TXMD_FLAGS_TIMESTAMP``: requests the device to put transmission
timestamp into ``tx_timestamp`` field of ``union xsk_tx_metadata``.
- ``XDP_TXMD_FLAGS_CHECKSUM``: requests the device to calculate L4
checksum. ``csum_start`` specifies byte offset of where the checksumming
should start and ``csum_offset`` specifies byte offset where the
device should store the computed checksum.
Besides the flags above, in order to trigger the offloads, the first
packet's ``struct xdp_desc`` descriptor should set ``XDP_TX_METADATA``
bit in the ``options`` field. Also note that in a multi-buffer packet
only the first chunk should carry the metadata.
Software TX Checksum
====================
For development and testing purposes its possible to pass
``XDP_UMEM_TX_SW_CSUM`` flag to ``XDP_UMEM_REG`` UMEM registration call.
In this case, when running in ``XDK_COPY`` mode, the TX checksum
is calculated on the CPU. Do not enable this option in production because
it will negatively affect performance.
Querying Device Capabilities
============================
Every devices exports its offloads capabilities via netlink netdev family.
Refer to ``xsk-flags`` features bitmask in
``Documentation/netlink/specs/netdev.yaml``.
- ``tx-timestamp``: device supports ``XDP_TXMD_FLAGS_TIMESTAMP``
- ``tx-checksum``: device supports ``XDP_TXMD_FLAGS_CHECKSUM``
See ``tools/net/ynl/samples/netdev.c`` on how to query this information.
Example
=======
See ``tools/testing/selftests/bpf/xdp_hw_metadata.c`` for an example
program that handles TX metadata. Also see https://github.com/fomichev/xskgen
for a more bare-bones example.

View File

@ -1,3 +1,4 @@
# jinja2>=3.1 is not compatible with Sphinx<4.0
jinja2<3.1
Sphinx==2.4.4
pyyaml

View File

@ -16,4 +16,6 @@ Netlink documentation for users.
genetlink-legacy
netlink-raw
See also :ref:`Documentation/core-api/netlink.rst <kernel_netlink>`.
See also:
- :ref:`Documentation/core-api/netlink.rst <kernel_netlink>`
- :ref:`Documentation/networking/netlink_spec/index.rst <specs>`

View File

@ -234,6 +234,10 @@ ACK attributes may be present::
| ** optionally extended ACK |
----------------------------------------------
Note that some implementations may issue custom ``NLMSG_DONE`` messages
in reply to ``do`` action requests. In that case the payload is
implementation-specific and may also be absent.
.. _res_fam:
Resolving the Family ID

View File

@ -14,7 +14,8 @@ Specification
The netlink-raw schema extends the :doc:`genetlink-legacy <genetlink-legacy>`
schema with properties that are needed to specify the protocol numbers and
multicast IDs used by raw netlink families. See :ref:`classic_netlink` for more
information.
information. The raw netlink families also make use of type-specific
sub-messages.
Globals
-------
@ -56,3 +57,96 @@ group registration.
-
name: rtnlgrp-mctp-ifaddr
value: 34
Sub-messages
------------
Several raw netlink families such as
:doc:`rt_link<../../networking/netlink_spec/rt_link>` and
:doc:`tc<../../networking/netlink_spec/tc>` use attribute nesting as an
abstraction to carry module specific information.
Conceptually it looks as follows::
[OUTER NEST OR MESSAGE LEVEL]
[GENERIC ATTR 1]
[GENERIC ATTR 2]
[GENERIC ATTR 3]
[GENERIC ATTR - wrapper]
[MODULE SPECIFIC ATTR 1]
[MODULE SPECIFIC ATTR 2]
The ``GENERIC ATTRs`` at the outer level are defined in the core (or rt_link or
core TC), while specific drivers, TC classifiers, qdiscs etc. can carry their
own information wrapped in the ``GENERIC ATTR - wrapper``. Even though the
example above shows attributes nesting inside the wrapper, the modules generally
have full freedom to define the format of the nest. In practice the payload of
the wrapper attr has very similar characteristics to a netlink message. It may
contain a fixed header / structure, netlink attributes, or both. Because of
those shared characteristics we refer to the payload of the wrapper attribute as
a sub-message.
A sub-message attribute uses the value of another attribute as a selector key to
choose the right sub-message format. For example if the following attribute has
already been decoded:
.. code-block:: json
{ "kind": "gre" }
and we encounter the following attribute spec:
.. code-block:: yaml
-
name: data
type: sub-message
sub-message: linkinfo-data-msg
selector: kind
Then we look for a sub-message definition called ``linkinfo-data-msg`` and use
the value of the ``kind`` attribute i.e. ``gre`` as the key to choose the
correct format for the sub-message:
.. code-block:: yaml
sub-messages:
name: linkinfo-data-msg
formats:
-
value: bridge
attribute-set: linkinfo-bridge-attrs
-
value: gre
attribute-set: linkinfo-gre-attrs
-
value: geneve
attribute-set: linkinfo-geneve-attrs
This would decode the attribute value as a sub-message with the attribute-set
called ``linkinfo-gre-attrs`` as the attribute space.
A sub-message can have an optional ``fixed-header`` followed by zero or more
attributes from an ``attribute-set``. For example the following
``tc-options-msg`` sub-message defines message formats that use a mixture of
``fixed-header``, ``attribute-set`` or both together:
.. code-block:: yaml
sub-messages:
-
name: tc-options-msg
formats:
-
value: bfifo
fixed-header: tc-fifo-qopt
-
value: cake
attribute-set: tc-cake-attrs
-
value: netem
fixed-header: tc-netem-qopt
attribute-set: tc-netem-attrs
Note that a selector attribute must appear in a netlink message before any
sub-message attributes that depend on it.

View File

@ -15,7 +15,7 @@ kernel headers directly.
Internally kernel uses the YAML specs to generate:
- the C uAPI header
- documentation of the protocol as a ReST file
- documentation of the protocol as a ReST file - see :ref:`Documentation/networking/netlink_spec/index.rst <specs>`
- policy tables for input attribute validation
- operation tables

View File

@ -2394,7 +2394,6 @@ F: drivers/memory/atmel*
F: drivers/watchdog/sama5d4_wdt.c
F: include/soc/at91/
X: drivers/input/touchscreen/atmel_mxt_ts.c
X: drivers/net/wireless/atmel/
N: at91
N: atmel
@ -3073,6 +3072,14 @@ S: Maintained
F: Documentation/devicetree/bindings/net/asix,ax88796c.yaml
F: drivers/net/ethernet/asix/ax88796c_*
ASIX PHY DRIVER [RUST]
M: FUJITA Tomonori <fujita.tomonori@gmail.com>
R: Trevor Gross <tmgross@umich.edu>
L: netdev@vger.kernel.org
L: rust-for-linux@vger.kernel.org
S: Maintained
F: drivers/net/phy/ax88796b_rust.rs
ASPEED CRYPTO DRIVER
M: Neal Liu <neal_liu@aspeedtech.com>
L: linux-aspeed@lists.ozlabs.org (moderated for non-subscribers)
@ -3298,13 +3305,6 @@ T: git git://github.com/ndyer/linux.git
F: Documentation/devicetree/bindings/input/atmel,maxtouch.yaml
F: drivers/input/touchscreen/atmel_mxt_ts.c
ATMEL WIRELESS DRIVER
L: linux-wireless@vger.kernel.org
S: Orphan
W: http://www.thekelleys.org.uk/atmel
W: http://atmelwlandriver.sourceforge.net/
F: drivers/net/wireless/atmel/atmel*
ATOMIC INFRASTRUCTURE
M: Will Deacon <will@kernel.org>
M: Peter Zijlstra <peterz@infradead.org>
@ -7899,6 +7899,14 @@ F: include/uapi/linux/mdio.h
F: include/uapi/linux/mii.h
F: net/core/of_net.c
ETHERNET PHY LIBRARY [RUST]
M: FUJITA Tomonori <fujita.tomonori@gmail.com>
R: Trevor Gross <tmgross@umich.edu>
L: netdev@vger.kernel.org
L: rust-for-linux@vger.kernel.org
S: Maintained
F: rust/kernel/net/phy.rs
EXEC & BINFMT API
R: Eric Biederman <ebiederm@xmission.com>
R: Kees Cook <keescook@chromium.org>
@ -9701,11 +9709,6 @@ S: Maintained
F: Documentation/devicetree/bindings/iio/pressure/honeywell,mprls0025pa.yaml
F: drivers/iio/pressure/mprls0025pa.c
HOST AP DRIVER
L: linux-wireless@vger.kernel.org
S: Obsolete
F: drivers/net/wireless/intersil/hostap/
HP BIOSCFG DRIVER
M: Jorge Lopez <jorge.lopez2@hp.com>
L: platform-driver-x86@vger.kernel.org
@ -11008,6 +11011,7 @@ F: drivers/net/wireless/intel/iwlegacy/
INTEL WIRELESS WIFI LINK (iwlwifi)
M: Gregory Greenman <gregory.greenman@intel.com>
M: Miri Korenblit <miriam.rachel.korenblit@intel.com>
L: linux-wireless@vger.kernel.org
S: Supported
W: https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi
@ -12015,6 +12019,14 @@ S: Maintained
F: arch/mips/lantiq
F: drivers/soc/lantiq
LANTIQ PEF2256 DRIVER
M: Herve Codina <herve.codina@bootlin.com>
S: Maintained
F: Documentation/devicetree/bindings/net/lantiq,pef2256.yaml
F: drivers/net/wan/framer/pef2256/
F: drivers/pinctrl/pinctrl-pef2256.c
F: include/linux/framer/pef2256.h
LASI 53c700 driver for PARISC
M: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
L: linux-scsi@vger.kernel.org
@ -12785,7 +12797,8 @@ MARVELL 88E6XXX ETHERNET SWITCH FABRIC DRIVER
M: Andrew Lunn <andrew@lunn.ch>
L: netdev@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/net/dsa/marvell.txt
F: Documentation/devicetree/bindings/net/dsa/marvell,mv88e6060.yaml
F: Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml
F: Documentation/networking/devlink/mv88e6xxx.rst
F: drivers/net/dsa/mv88e6xxx/
F: include/linux/dsa/mv88e6xxx.h
@ -14987,6 +15000,7 @@ Q: https://patchwork.kernel.org/project/netdevbpf/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
F: Documentation/devicetree/bindings/net/
F: Documentation/networking/net_cachelines/net_device.rst
F: drivers/connector/
F: drivers/net/
F: include/dt-bindings/net/
@ -15042,6 +15056,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
F: Documentation/core-api/netlink.rst
F: Documentation/netlink/
F: Documentation/networking/
F: Documentation/networking/net_cachelines/
F: Documentation/process/maintainer-netdev.rst
F: Documentation/userspace-api/netlink/
F: include/linux/in.h
@ -15139,7 +15154,7 @@ W: https://github.com/multipath-tcp/mptcp_net-next/wiki
B: https://github.com/multipath-tcp/mptcp_net-next/issues
T: git https://github.com/multipath-tcp/mptcp_net-next.git export-net
T: git https://github.com/multipath-tcp/mptcp_net-next.git export
F: Documentation/netlink/specs/mptcp.yaml
F: Documentation/netlink/specs/mptcp_pm.yaml
F: Documentation/networking/mptcp-sysctl.rst
F: include/net/mptcp.h
F: include/trace/events/mptcp.h
@ -15152,6 +15167,7 @@ NETWORKING [TCP]
M: Eric Dumazet <edumazet@google.com>
L: netdev@vger.kernel.org
S: Maintained
F: Documentation/networking/net_cachelines/tcp_sock.rst
F: include/linux/tcp.h
F: include/net/tcp.h
F: include/trace/events/tcp.h
@ -15482,7 +15498,7 @@ NXP C45 TJA11XX PHY DRIVER
M: Andrei Botila <andrei.botila@oss.nxp.com>
L: netdev@vger.kernel.org
S: Maintained
F: drivers/net/phy/nxp-c45-tja11xx.c
F: drivers/net/phy/nxp-c45-tja11xx*
NXP FSPI DRIVER
M: Han Xu <han.xu@nxp.com>
@ -16182,7 +16198,7 @@ F: include/dt-bindings/
OPENCOMPUTE PTP CLOCK DRIVER
M: Jonathan Lemon <jonathan.lemon@gmail.com>
M: Vadim Fedorenko <vadfed@fb.com>
M: Vadim Fedorenko <vadfed@linux.dev>
L: netdev@vger.kernel.org
S: Maintained
F: drivers/ptp/ptp_ocp.c
@ -16260,13 +16276,6 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux.git
F: Documentation/filesystems/orangefs.rst
F: fs/orangefs/
ORINOCO DRIVER
L: linux-wireless@vger.kernel.org
S: Orphan
W: https://wireless.wiki.kernel.org/en/users/Drivers/orinoco
W: http://www.nongnu.org/orinoco/
F: drivers/net/wireless/intersil/orinoco/
OV2659 OMNIVISION SENSOR DRIVER
M: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
L: linux-media@vger.kernel.org
@ -18158,11 +18167,6 @@ F: drivers/ras/
F: include/linux/ras.h
F: include/ras/ras_event.h
RAYLINK/WEBGEAR 802.11 WIRELESS LAN DRIVER
L: linux-wireless@vger.kernel.org
S: Orphan
F: drivers/net/wireless/legacy/ray*
RC-CORE / LIRC FRAMEWORK
M: Sean Young <sean@mess.org>
L: linux-media@vger.kernel.org
@ -22656,11 +22660,6 @@ F: drivers/usb/gadget/function/*uvc*
F: drivers/usb/gadget/legacy/webcam.c
F: include/uapi/linux/usb/g_uvc.h
USB WIRELESS RNDIS DRIVER (rndis_wlan)
L: linux-wireless@vger.kernel.org
S: Orphan
F: drivers/net/wireless/legacy/rndis_wlan.c
USB XHCI DRIVER
M: Mathias Nyman <mathias.nyman@intel.com>
L: linux-usb@vger.kernel.org
@ -22668,12 +22667,6 @@ S: Supported
F: drivers/usb/host/pci-quirks*
F: drivers/usb/host/xhci*
USB ZD1201 DRIVER
L: linux-wireless@vger.kernel.org
S: Orphan
W: http://linux-lc100020.sourceforge.net
F: drivers/net/wireless/zydas/zd1201.*
USER DATAGRAM PROTOCOL (UDP)
M: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
S: Maintained
@ -23474,11 +23467,6 @@ M: Miloslav Trmac <mitr@volny.cz>
S: Maintained
F: drivers/input/misc/wistron_btns.c
WL3501 WIRELESS PCMCIA CARD DRIVER
L: linux-wireless@vger.kernel.org
S: Orphan
F: drivers/net/wireless/legacy/wl3501*
WMI BINARY MOF DRIVER
M: Armin Wolf <W_Armin@gmx.de>
R: Thomas Weißschuh <linux@weissschuh.net>

View File

@ -1828,7 +1828,7 @@ static void restore_args(struct jit_ctx *ctx, int args_off, int nregs)
*
*/
static int prepare_trampoline(struct jit_ctx *ctx, struct bpf_tramp_image *im,
struct bpf_tramp_links *tlinks, void *orig_call,
struct bpf_tramp_links *tlinks, void *func_addr,
int nregs, u32 flags)
{
int i;
@ -1926,7 +1926,7 @@ static int prepare_trampoline(struct jit_ctx *ctx, struct bpf_tramp_image *im,
if (flags & BPF_TRAMP_F_IP_ARG) {
/* save ip address of the traced function */
emit_addr_mov_i64(A64_R(10), (const u64)orig_call, ctx);
emit_addr_mov_i64(A64_R(10), (const u64)func_addr, ctx);
emit(A64_STR64I(A64_R(10), A64_SP, ip_off), ctx);
}
@ -2026,18 +2026,10 @@ static int prepare_trampoline(struct jit_ctx *ctx, struct bpf_tramp_image *im,
return ctx->idx;
}
int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image,
void *image_end, const struct btf_func_model *m,
u32 flags, struct bpf_tramp_links *tlinks,
void *orig_call)
static int btf_func_model_nregs(const struct btf_func_model *m)
{
int i, ret;
int nregs = m->nr_args;
int max_insns = ((long)image_end - (long)image) / AARCH64_INSN_SIZE;
struct jit_ctx ctx = {
.image = NULL,
.idx = 0,
};
int i;
/* extra registers needed for struct argument */
for (i = 0; i < MAX_BPF_FUNC_ARGS; i++) {
@ -2046,22 +2038,49 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image,
nregs += (m->arg_size[i] + 7) / 8 - 1;
}
return nregs;
}
int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,
struct bpf_tramp_links *tlinks, void *func_addr)
{
struct jit_ctx ctx = {
.image = NULL,
.idx = 0,
};
struct bpf_tramp_image im;
int nregs, ret;
nregs = btf_func_model_nregs(m);
/* the first 8 registers are used for arguments */
if (nregs > 8)
return -ENOTSUPP;
ret = prepare_trampoline(&ctx, im, tlinks, orig_call, nregs, flags);
ret = prepare_trampoline(&ctx, &im, tlinks, func_addr, nregs, flags);
if (ret < 0)
return ret;
if (ret > max_insns)
return -EFBIG;
return ret < 0 ? ret : ret * AARCH64_INSN_SIZE;
}
ctx.image = image;
ctx.idx = 0;
int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image,
void *image_end, const struct btf_func_model *m,
u32 flags, struct bpf_tramp_links *tlinks,
void *func_addr)
{
int ret, nregs;
struct jit_ctx ctx = {
.image = image,
.idx = 0,
};
nregs = btf_func_model_nregs(m);
/* the first 8 registers are used for arguments */
if (nregs > 8)
return -ENOTSUPP;
jit_fill_hole(image, (unsigned int)(image_end - image));
ret = prepare_trampoline(&ctx, im, tlinks, orig_call, nregs, flags);
ret = prepare_trampoline(&ctx, im, tlinks, func_addr, nregs, flags);
if (ret > 0 && validate_code(&ctx) < 0)
ret = -EINVAL;

View File

@ -276,7 +276,6 @@ CONFIG_BRIDGE_EBT_T_NAT=m
CONFIG_BRIDGE_EBT_ARP=m
CONFIG_BRIDGE_EBT_IP=m
CONFIG_BRIDGE_EBT_IP6=m
CONFIG_BPFILTER=y
CONFIG_IP_SCTP=m
CONFIG_RDS=y
CONFIG_L2TP=m
@ -304,7 +303,6 @@ CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_POLICE=m
CONFIG_NET_ACT_GACT=m
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_ACT_IPT=m
CONFIG_NET_ACT_NAT=m
CONFIG_NET_ACT_BPF=m
CONFIG_OPENVSWITCH=m

View File

@ -173,7 +173,6 @@ CONFIG_NET_ACT_POLICE=y
CONFIG_NET_ACT_GACT=m
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_ACT_IPT=m
CONFIG_NET_ACT_NAT=m
CONFIG_NET_ACT_PEDIT=m
CONFIG_NET_ACT_SIMP=m

View File

@ -202,7 +202,6 @@ CONFIG_NET_ACT_POLICE=y
CONFIG_NET_ACT_GACT=m
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_ACT_IPT=m
CONFIG_NET_ACT_NAT=m
CONFIG_NET_ACT_PEDIT=m
CONFIG_NET_ACT_SIMP=m

View File

@ -206,7 +206,6 @@ CONFIG_NET_ACT_POLICE=y
CONFIG_NET_ACT_GACT=m
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_ACT_IPT=m
CONFIG_NET_ACT_NAT=m
CONFIG_NET_ACT_PEDIT=m
CONFIG_NET_ACT_SIMP=m

View File

@ -203,7 +203,6 @@ CONFIG_NET_ACT_POLICE=y
CONFIG_NET_ACT_GACT=m
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_ACT_IPT=m
CONFIG_NET_ACT_NAT=m
CONFIG_NET_ACT_PEDIT=m
CONFIG_NET_ACT_SIMP=m

View File

@ -96,7 +96,6 @@ CONFIG_NET_ACT_POLICE=y
CONFIG_NET_ACT_GACT=m
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_ACT_IPT=m
CONFIG_NET_ACT_PEDIT=m
CONFIG_HAMRADIO=y
CONFIG_MTD=y

View File

@ -274,7 +274,6 @@ CONFIG_NET_ACT_POLICE=m
CONFIG_NET_ACT_GACT=m
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_ACT_IPT=m
CONFIG_NET_ACT_NAT=m
CONFIG_NET_ACT_PEDIT=m
CONFIG_NET_ACT_SIMP=m

View File

@ -7,8 +7,9 @@
*
* Copyright (C) 2023 Google LLC
*/
#include <linux/bug.h>
#include <linux/cfi.h>
struct pt_regs;
#ifdef CONFIG_CFI_CLANG
enum bug_trap_type handle_cfi_failure(struct pt_regs *regs);

View File

@ -4,7 +4,7 @@
*
* Copyright (C) 2023 Google LLC
*/
#include <asm/cfi.h>
#include <linux/cfi.h>
#include <asm/insn.h>
/*

View File

@ -1029,6 +1029,21 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
return ret;
}
int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,
struct bpf_tramp_links *tlinks, void *func_addr)
{
struct bpf_tramp_image im;
struct rv_jit_context ctx;
int ret;
ctx.ninsns = 0;
ctx.insns = NULL;
ctx.ro_insns = NULL;
ret = __arch_prepare_bpf_trampoline(&im, m, tlinks, func_addr, flags, &ctx);
return ret < 0 ? ret : ninsns_rvoff(ctx.ninsns);
}
int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image,
void *image_end, const struct btf_func_model *m,
u32 flags, struct bpf_tramp_links *tlinks,
@ -1037,16 +1052,6 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image,
int ret;
struct rv_jit_context ctx;
ctx.ninsns = 0;
ctx.insns = NULL;
ctx.ro_insns = NULL;
ret = __arch_prepare_bpf_trampoline(im, m, tlinks, func_addr, flags, &ctx);
if (ret < 0)
return ret;
if (ninsns_rvoff(ret) > (long)image_end - (long)image)
return -EFBIG;
ctx.ninsns = 0;
/*
* The bpf_int_jit_compile() uses a RW buffer (ctx.insns) to write the

View File

@ -373,7 +373,6 @@ CONFIG_NET_ACT_POLICE=m
CONFIG_NET_ACT_GACT=m
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_ACT_IPT=m
CONFIG_NET_ACT_NAT=m
CONFIG_NET_ACT_PEDIT=m
CONFIG_NET_ACT_SIMP=m

View File

@ -363,7 +363,6 @@ CONFIG_NET_ACT_POLICE=m
CONFIG_NET_ACT_GACT=m
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_ACT_IPT=m
CONFIG_NET_ACT_NAT=m
CONFIG_NET_ACT_PEDIT=m
CONFIG_NET_ACT_SIMP=m

View File

@ -779,7 +779,7 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp,
int i, bool extra_pass, u32 stack_depth)
{
struct bpf_insn *insn = &fp->insnsi[i];
s16 branch_oc_off = insn->off;
s32 branch_oc_off = insn->off;
u32 dst_reg = insn->dst_reg;
u32 src_reg = insn->src_reg;
int last, insn_count = 1;
@ -2362,7 +2362,8 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
return -ENOTSUPP;
/* Return to %r14, since func_addr and %r0 are not available. */
if (!func_addr && !(flags & BPF_TRAMP_F_ORIG_STACK))
if ((!func_addr && !(flags & BPF_TRAMP_F_ORIG_STACK)) ||
(flags & BPF_TRAMP_F_INDIRECT))
flags |= BPF_TRAMP_F_SKIP_FRAME;
/*
@ -2637,6 +2638,21 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
return 0;
}
int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,
struct bpf_tramp_links *tlinks, void *orig_call)
{
struct bpf_tramp_image im;
struct bpf_tramp_jit tjit;
int ret;
memset(&tjit, 0, sizeof(tjit));
ret = __arch_prepare_bpf_trampoline(&im, &tjit, m, flags,
tlinks, orig_call);
return ret < 0 ? ret : tjit.common.prg;
}
int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image,
void *image_end, const struct btf_func_model *m,
u32 flags, struct bpf_tramp_links *tlinks,
@ -2644,30 +2660,27 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image,
{
struct bpf_tramp_jit tjit;
int ret;
int i;
for (i = 0; i < 2; i++) {
if (i == 0) {
/* Compute offsets, check whether the code fits. */
memset(&tjit, 0, sizeof(tjit));
} else {
/* Generate the code. */
tjit.common.prg = 0;
tjit.common.prg_buf = image;
}
ret = __arch_prepare_bpf_trampoline(im, &tjit, m, flags,
tlinks, func_addr);
if (ret < 0)
return ret;
if (tjit.common.prg > (char *)image_end - (char *)image)
/*
* Use the same error code as for exceeding
* BPF_MAX_TRAMP_LINKS.
*/
return -E2BIG;
}
/* Compute offsets, check whether the code fits. */
memset(&tjit, 0, sizeof(tjit));
ret = __arch_prepare_bpf_trampoline(im, &tjit, m, flags,
tlinks, func_addr);
return tjit.common.prg;
if (ret < 0)
return ret;
if (tjit.common.prg > (char *)image_end - (char *)image)
/*
* Use the same error code as for exceeding
* BPF_MAX_TRAMP_LINKS.
*/
return -E2BIG;
tjit.common.prg = 0;
tjit.common.prg_buf = image;
ret = __arch_prepare_bpf_trampoline(im, &tjit, m, flags,
tlinks, func_addr);
return ret < 0 ? ret : tjit.common.prg;
}
bool bpf_jit_supports_subprog_tailcalls(void)

View File

@ -138,7 +138,6 @@ CONFIG_NET_ACT_POLICE=m
CONFIG_NET_ACT_GACT=m
CONFIG_GACT_PROB=y
CONFIG_NET_ACT_MIRRED=m
CONFIG_NET_ACT_IPT=m
CONFIG_NET_ACT_PEDIT=m
CONFIG_FW_LOADER=m
CONFIG_CONNECTOR=m

View File

@ -7,16 +7,140 @@
*
* Copyright (C) 2022 Google LLC
*/
#include <linux/bug.h>
#include <asm/ibt.h>
#include <linux/cfi.h>
/*
* An overview of the various calling conventions...
*
* Traditional:
*
* foo:
* ... code here ...
* ret
*
* direct caller:
* call foo
*
* indirect caller:
* lea foo(%rip), %r11
* ...
* call *%r11
*
*
* IBT:
*
* foo:
* endbr64
* ... code here ...
* ret
*
* direct caller:
* call foo / call foo+4
*
* indirect caller:
* lea foo(%rip), %r11
* ...
* call *%r11
*
*
* kCFI:
*
* __cfi_foo:
* movl $0x12345678, %eax
* # 11 nops when CONFIG_CALL_PADDING
* foo:
* endbr64 # when IBT
* ... code here ...
* ret
*
* direct call:
* call foo # / call foo+4 when IBT
*
* indirect call:
* lea foo(%rip), %r11
* ...
* movl $(-0x12345678), %r10d
* addl -4(%r11), %r10d # -15 when CONFIG_CALL_PADDING
* jz 1f
* ud2
* 1:call *%r11
*
*
* FineIBT (builds as kCFI + CALL_PADDING + IBT + RETPOLINE and runtime patches into):
*
* __cfi_foo:
* endbr64
* subl 0x12345678, %r10d
* jz foo
* ud2
* nop
* foo:
* osp nop3 # was endbr64
* ... code here ...
* ret
*
* direct caller:
* call foo / call foo+4
*
* indirect caller:
* lea foo(%rip), %r11
* ...
* movl $0x12345678, %r10d
* subl $16, %r11
* nop4
* call *%r11
*
*/
enum cfi_mode {
CFI_DEFAULT, /* FineIBT if hardware has IBT, otherwise kCFI */
CFI_OFF, /* Taditional / IBT depending on .config */
CFI_KCFI, /* Optionally CALL_PADDING, IBT, RETPOLINE */
CFI_FINEIBT, /* see arch/x86/kernel/alternative.c */
};
extern enum cfi_mode cfi_mode;
struct pt_regs;
#ifdef CONFIG_CFI_CLANG
enum bug_trap_type handle_cfi_failure(struct pt_regs *regs);
#define __bpfcall
extern u32 cfi_bpf_hash;
extern u32 cfi_bpf_subprog_hash;
static inline int cfi_get_offset(void)
{
switch (cfi_mode) {
case CFI_FINEIBT:
return 16;
case CFI_KCFI:
if (IS_ENABLED(CONFIG_CALL_PADDING))
return 16;
return 5;
default:
return 0;
}
}
#define cfi_get_offset cfi_get_offset
extern u32 cfi_get_func_hash(void *func);
#else
static inline enum bug_trap_type handle_cfi_failure(struct pt_regs *regs)
{
return BUG_TRAP_TYPE_NONE;
}
#define cfi_bpf_hash 0U
#define cfi_bpf_subprog_hash 0U
static inline u32 cfi_get_func_hash(void *func)
{
return 0;
}
#endif /* CONFIG_CFI_CLANG */
#if HAS_KERNEL_IBT == 1
#define CFI_NOSEAL(x) asm(IBT_NOSEAL(__stringify(x)))
#endif
#endif /* _ASM_X86_CFI_H */

View File

@ -30,6 +30,7 @@
#include <asm/fixmap.h>
#include <asm/paravirt.h>
#include <asm/asm-prototypes.h>
#include <asm/cfi.h>
int __read_mostly alternatives_patched;
@ -903,15 +904,82 @@ void __init_or_module apply_seal_endbr(s32 *start, s32 *end) { }
#endif /* CONFIG_X86_KERNEL_IBT */
#ifdef CONFIG_FINEIBT
#define __CFI_DEFAULT CFI_DEFAULT
#elif defined(CONFIG_CFI_CLANG)
#define __CFI_DEFAULT CFI_KCFI
#else
#define __CFI_DEFAULT CFI_OFF
#endif
enum cfi_mode {
CFI_DEFAULT,
CFI_OFF,
CFI_KCFI,
CFI_FINEIBT,
};
enum cfi_mode cfi_mode __ro_after_init = __CFI_DEFAULT;
#ifdef CONFIG_CFI_CLANG
struct bpf_insn;
/* Must match bpf_func_t / DEFINE_BPF_PROG_RUN() */
extern unsigned int __bpf_prog_runX(const void *ctx,
const struct bpf_insn *insn);
/*
* Force a reference to the external symbol so the compiler generates
* __kcfi_typid.
*/
__ADDRESSABLE(__bpf_prog_runX);
/* u32 __ro_after_init cfi_bpf_hash = __kcfi_typeid___bpf_prog_runX; */
asm (
" .pushsection .data..ro_after_init,\"aw\",@progbits \n"
" .type cfi_bpf_hash,@object \n"
" .globl cfi_bpf_hash \n"
" .p2align 2, 0x0 \n"
"cfi_bpf_hash: \n"
" .long __kcfi_typeid___bpf_prog_runX \n"
" .size cfi_bpf_hash, 4 \n"
" .popsection \n"
);
/* Must match bpf_callback_t */
extern u64 __bpf_callback_fn(u64, u64, u64, u64, u64);
__ADDRESSABLE(__bpf_callback_fn);
/* u32 __ro_after_init cfi_bpf_subprog_hash = __kcfi_typeid___bpf_callback_fn; */
asm (
" .pushsection .data..ro_after_init,\"aw\",@progbits \n"
" .type cfi_bpf_subprog_hash,@object \n"
" .globl cfi_bpf_subprog_hash \n"
" .p2align 2, 0x0 \n"
"cfi_bpf_subprog_hash: \n"
" .long __kcfi_typeid___bpf_callback_fn \n"
" .size cfi_bpf_subprog_hash, 4 \n"
" .popsection \n"
);
u32 cfi_get_func_hash(void *func)
{
u32 hash;
func -= cfi_get_offset();
switch (cfi_mode) {
case CFI_FINEIBT:
func += 7;
break;
case CFI_KCFI:
func += 1;
break;
default:
return 0;
}
if (get_kernel_nofault(hash, func))
return 0;
return hash;
}
#endif
#ifdef CONFIG_FINEIBT
static enum cfi_mode cfi_mode __ro_after_init = CFI_DEFAULT;
static bool cfi_rand __ro_after_init = true;
static u32 cfi_seed __ro_after_init;
@ -1220,8 +1288,11 @@ static void __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
goto err;
if (cfi_rand) {
if (builtin)
if (builtin) {
cfi_seed = get_random_u32();
cfi_bpf_hash = cfi_rehash(cfi_bpf_hash);
cfi_bpf_subprog_hash = cfi_rehash(cfi_bpf_subprog_hash);
}
ret = cfi_rand_preamble(start_cfi, end_cfi);
if (ret)

View File

@ -4,10 +4,10 @@
*
* Copyright (C) 2022 Google LLC
*/
#include <asm/cfi.h>
#include <linux/string.h>
#include <linux/cfi.h>
#include <asm/insn.h>
#include <asm/insn-eval.h>
#include <linux/string.h>
/*
* Returns the target address and the expected type when regs->ip points

View File

@ -17,6 +17,7 @@
#include <asm/nospec-branch.h>
#include <asm/text-patching.h>
#include <asm/unwind.h>
#include <asm/cfi.h>
static bool all_callee_regs_used[4] = {true, true, true, true};
@ -51,9 +52,11 @@ static u8 *emit_code(u8 *ptr, u32 bytes, unsigned int len)
do { EMIT4(b1, b2, b3, b4); EMIT(off, 4); } while (0)
#ifdef CONFIG_X86_KERNEL_IBT
#define EMIT_ENDBR() EMIT(gen_endbr(), 4)
#define EMIT_ENDBR() EMIT(gen_endbr(), 4)
#define EMIT_ENDBR_POISON() EMIT(gen_endbr_poison(), 4)
#else
#define EMIT_ENDBR()
#define EMIT_ENDBR_POISON()
#endif
static bool is_imm8(int value)
@ -304,6 +307,88 @@ static void pop_callee_regs(u8 **pprog, bool *callee_regs_used)
*pprog = prog;
}
static void emit_nops(u8 **pprog, int len)
{
u8 *prog = *pprog;
int i, noplen;
while (len > 0) {
noplen = len;
if (noplen > ASM_NOP_MAX)
noplen = ASM_NOP_MAX;
for (i = 0; i < noplen; i++)
EMIT1(x86_nops[noplen][i]);
len -= noplen;
}
*pprog = prog;
}
/*
* Emit the various CFI preambles, see asm/cfi.h and the comments about FineIBT
* in arch/x86/kernel/alternative.c
*/
static void emit_fineibt(u8 **pprog, u32 hash)
{
u8 *prog = *pprog;
EMIT_ENDBR();
EMIT3_off32(0x41, 0x81, 0xea, hash); /* subl $hash, %r10d */
EMIT2(0x74, 0x07); /* jz.d8 +7 */
EMIT2(0x0f, 0x0b); /* ud2 */
EMIT1(0x90); /* nop */
EMIT_ENDBR_POISON();
*pprog = prog;
}
static void emit_kcfi(u8 **pprog, u32 hash)
{
u8 *prog = *pprog;
EMIT1_off32(0xb8, hash); /* movl $hash, %eax */
#ifdef CONFIG_CALL_PADDING
EMIT1(0x90);
EMIT1(0x90);
EMIT1(0x90);
EMIT1(0x90);
EMIT1(0x90);
EMIT1(0x90);
EMIT1(0x90);
EMIT1(0x90);
EMIT1(0x90);
EMIT1(0x90);
EMIT1(0x90);
#endif
EMIT_ENDBR();
*pprog = prog;
}
static void emit_cfi(u8 **pprog, u32 hash)
{
u8 *prog = *pprog;
switch (cfi_mode) {
case CFI_FINEIBT:
emit_fineibt(&prog, hash);
break;
case CFI_KCFI:
emit_kcfi(&prog, hash);
break;
default:
EMIT_ENDBR();
break;
}
*pprog = prog;
}
/*
* Emit x86-64 prologue code for BPF program.
* bpf_tail_call helper will skip the first X86_TAIL_CALL_OFFSET bytes
@ -315,12 +400,11 @@ static void emit_prologue(u8 **pprog, u32 stack_depth, bool ebpf_from_cbpf,
{
u8 *prog = *pprog;
emit_cfi(&prog, is_subprog ? cfi_bpf_subprog_hash : cfi_bpf_hash);
/* BPF trampoline can be made to work without these nops,
* but let's waste 5 bytes for now and optimize later
*/
EMIT_ENDBR();
memcpy(prog, x86_nops[5], X86_PATCH_SIZE);
prog += X86_PATCH_SIZE;
emit_nops(&prog, X86_PATCH_SIZE);
if (!ebpf_from_cbpf) {
if (tail_call_reachable && !is_subprog)
/* When it's the entry of the whole tailcall context,
@ -626,8 +710,7 @@ static void emit_bpf_tail_call_direct(struct bpf_prog *bpf_prog,
if (stack_depth)
EMIT3_off32(0x48, 0x81, 0xC4, round_up(stack_depth, 8));
memcpy(prog, x86_nops[5], X86_PATCH_SIZE);
prog += X86_PATCH_SIZE;
emit_nops(&prog, X86_PATCH_SIZE);
/* out: */
ctx->tail_call_direct_label = prog - start;
@ -989,25 +1072,6 @@ static void detect_reg_usage(struct bpf_insn *insn, int insn_cnt,
}
}
static void emit_nops(u8 **pprog, int len)
{
u8 *prog = *pprog;
int i, noplen;
while (len > 0) {
noplen = len;
if (noplen > ASM_NOP_MAX)
noplen = ASM_NOP_MAX;
for (i = 0; i < noplen; i++)
EMIT1(x86_nops[noplen][i]);
len -= noplen;
}
*pprog = prog;
}
/* emit the 3-byte VEX prefix
*
* r: same as rex.r, extra bit for ModRM reg field
@ -2198,7 +2262,8 @@ static void restore_regs(const struct btf_func_model *m, u8 **prog,
static int invoke_bpf_prog(const struct btf_func_model *m, u8 **pprog,
struct bpf_tramp_link *l, int stack_size,
int run_ctx_off, bool save_ret)
int run_ctx_off, bool save_ret,
void *image, void *rw_image)
{
u8 *prog = *pprog;
u8 *jmp_insn;
@ -2226,7 +2291,7 @@ static int invoke_bpf_prog(const struct btf_func_model *m, u8 **pprog,
else
EMIT4(0x48, 0x8D, 0x75, -run_ctx_off);
if (emit_rsb_call(&prog, bpf_trampoline_enter(p), prog))
if (emit_rsb_call(&prog, bpf_trampoline_enter(p), image + (prog - (u8 *)rw_image)))
return -EINVAL;
/* remember prog start time returned by __bpf_prog_enter */
emit_mov_reg(&prog, true, BPF_REG_6, BPF_REG_0);
@ -2250,7 +2315,7 @@ static int invoke_bpf_prog(const struct btf_func_model *m, u8 **pprog,
(long) p->insnsi >> 32,
(u32) (long) p->insnsi);
/* call JITed bpf program or interpreter */
if (emit_rsb_call(&prog, p->bpf_func, prog))
if (emit_rsb_call(&prog, p->bpf_func, image + (prog - (u8 *)rw_image)))
return -EINVAL;
/*
@ -2277,7 +2342,7 @@ static int invoke_bpf_prog(const struct btf_func_model *m, u8 **pprog,
EMIT3_off32(0x48, 0x8D, 0x95, -run_ctx_off);
else
EMIT4(0x48, 0x8D, 0x55, -run_ctx_off);
if (emit_rsb_call(&prog, bpf_trampoline_exit(p), prog))
if (emit_rsb_call(&prog, bpf_trampoline_exit(p), image + (prog - (u8 *)rw_image)))
return -EINVAL;
*pprog = prog;
@ -2312,14 +2377,15 @@ static int emit_cond_near_jump(u8 **pprog, void *func, void *ip, u8 jmp_cond)
static int invoke_bpf(const struct btf_func_model *m, u8 **pprog,
struct bpf_tramp_links *tl, int stack_size,
int run_ctx_off, bool save_ret)
int run_ctx_off, bool save_ret,
void *image, void *rw_image)
{
int i;
u8 *prog = *pprog;
for (i = 0; i < tl->nr_links; i++) {
if (invoke_bpf_prog(m, &prog, tl->links[i], stack_size,
run_ctx_off, save_ret))
run_ctx_off, save_ret, image, rw_image))
return -EINVAL;
}
*pprog = prog;
@ -2328,7 +2394,8 @@ static int invoke_bpf(const struct btf_func_model *m, u8 **pprog,
static int invoke_bpf_mod_ret(const struct btf_func_model *m, u8 **pprog,
struct bpf_tramp_links *tl, int stack_size,
int run_ctx_off, u8 **branches)
int run_ctx_off, u8 **branches,
void *image, void *rw_image)
{
u8 *prog = *pprog;
int i;
@ -2339,7 +2406,8 @@ static int invoke_bpf_mod_ret(const struct btf_func_model *m, u8 **pprog,
emit_mov_imm32(&prog, false, BPF_REG_0, 0);
emit_stx(&prog, BPF_DW, BPF_REG_FP, BPF_REG_0, -8);
for (i = 0; i < tl->nr_links; i++) {
if (invoke_bpf_prog(m, &prog, tl->links[i], stack_size, run_ctx_off, true))
if (invoke_bpf_prog(m, &prog, tl->links[i], stack_size, run_ctx_off, true,
image, rw_image))
return -EINVAL;
/* mod_ret prog stored return value into [rbp - 8]. Emit:
@ -2422,10 +2490,11 @@ static int invoke_bpf_mod_ret(const struct btf_func_model *m, u8 **pprog,
* add rsp, 8 // skip eth_type_trans's frame
* ret // return to its caller
*/
int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *image_end,
const struct btf_func_model *m, u32 flags,
struct bpf_tramp_links *tlinks,
void *func_addr)
static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_image,
void *rw_image_end, void *image,
const struct btf_func_model *m, u32 flags,
struct bpf_tramp_links *tlinks,
void *func_addr)
{
int i, ret, nr_regs = m->nr_args, stack_size = 0;
int regs_off, nregs_off, ip_off, run_ctx_off, arg_stack_off, rbx_off;
@ -2437,10 +2506,19 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *i
u8 *prog;
bool save_ret;
/*
* F_INDIRECT is only compatible with F_RET_FENTRY_RET, it is
* explicitly incompatible with F_CALL_ORIG | F_SKIP_FRAME | F_IP_ARG
* because @func_addr.
*/
WARN_ON_ONCE((flags & BPF_TRAMP_F_INDIRECT) &&
(flags & ~(BPF_TRAMP_F_INDIRECT | BPF_TRAMP_F_RET_FENTRY_RET)));
/* extra registers for struct arguments */
for (i = 0; i < m->nr_args; i++)
for (i = 0; i < m->nr_args; i++) {
if (m->arg_flags[i] & BTF_FMODEL_STRUCT_ARG)
nr_regs += (m->arg_size[i] + 7) / 8 - 1;
}
/* x86-64 supports up to MAX_BPF_FUNC_ARGS arguments. 1-6
* are passed through regs, the remains are through stack.
@ -2521,22 +2599,29 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *i
orig_call += X86_PATCH_SIZE;
}
prog = image;
prog = rw_image;
EMIT_ENDBR();
/*
* This is the direct-call trampoline, as such it needs accounting
* for the __fentry__ call.
*/
x86_call_depth_emit_accounting(&prog, NULL);
if (flags & BPF_TRAMP_F_INDIRECT) {
/*
* Indirect call for bpf_struct_ops
*/
emit_cfi(&prog, cfi_get_func_hash(func_addr));
} else {
/*
* Direct-call fentry stub, as such it needs accounting for the
* __fentry__ call.
*/
x86_call_depth_emit_accounting(&prog, NULL);
}
EMIT1(0x55); /* push rbp */
EMIT3(0x48, 0x89, 0xE5); /* mov rbp, rsp */
if (!is_imm8(stack_size))
if (!is_imm8(stack_size)) {
/* sub rsp, stack_size */
EMIT3_off32(0x48, 0x81, 0xEC, stack_size);
else
} else {
/* sub rsp, stack_size */
EMIT4(0x48, 0x83, 0xEC, stack_size);
}
if (flags & BPF_TRAMP_F_TAIL_CALL_CTX)
EMIT1(0x50); /* push rax */
/* mov QWORD PTR [rbp - rbx_off], rbx */
@ -2563,16 +2648,18 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *i
if (flags & BPF_TRAMP_F_CALL_ORIG) {
/* arg1: mov rdi, im */
emit_mov_imm64(&prog, BPF_REG_1, (long) im >> 32, (u32) (long) im);
if (emit_rsb_call(&prog, __bpf_tramp_enter, prog)) {
if (emit_rsb_call(&prog, __bpf_tramp_enter,
image + (prog - (u8 *)rw_image))) {
ret = -EINVAL;
goto cleanup;
}
}
if (fentry->nr_links)
if (fentry->nr_links) {
if (invoke_bpf(m, &prog, fentry, regs_off, run_ctx_off,
flags & BPF_TRAMP_F_RET_FENTRY_RET))
flags & BPF_TRAMP_F_RET_FENTRY_RET, image, rw_image))
return -EINVAL;
}
if (fmod_ret->nr_links) {
branches = kcalloc(fmod_ret->nr_links, sizeof(u8 *),
@ -2581,7 +2668,7 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *i
return -ENOMEM;
if (invoke_bpf_mod_ret(m, &prog, fmod_ret, regs_off,
run_ctx_off, branches)) {
run_ctx_off, branches, image, rw_image)) {
ret = -EINVAL;
goto cleanup;
}
@ -2591,27 +2678,27 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *i
restore_regs(m, &prog, regs_off);
save_args(m, &prog, arg_stack_off, true);
if (flags & BPF_TRAMP_F_TAIL_CALL_CTX)
if (flags & BPF_TRAMP_F_TAIL_CALL_CTX) {
/* Before calling the original function, restore the
* tail_call_cnt from stack to rax.
*/
RESTORE_TAIL_CALL_CNT(stack_size);
}
if (flags & BPF_TRAMP_F_ORIG_STACK) {
emit_ldx(&prog, BPF_DW, BPF_REG_6, BPF_REG_FP, 8);
EMIT2(0xff, 0xd3); /* call *rbx */
} else {
/* call original function */
if (emit_rsb_call(&prog, orig_call, prog)) {
if (emit_rsb_call(&prog, orig_call, image + (prog - (u8 *)rw_image))) {
ret = -EINVAL;
goto cleanup;
}
}
/* remember return value in a stack for bpf prog to access */
emit_stx(&prog, BPF_DW, BPF_REG_FP, BPF_REG_0, -8);
im->ip_after_call = prog;
memcpy(prog, x86_nops[5], X86_PATCH_SIZE);
prog += X86_PATCH_SIZE;
im->ip_after_call = image + (prog - (u8 *)rw_image);
emit_nops(&prog, X86_PATCH_SIZE);
}
if (fmod_ret->nr_links) {
@ -2624,16 +2711,19 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *i
/* Update the branches saved in invoke_bpf_mod_ret with the
* aligned address of do_fexit.
*/
for (i = 0; i < fmod_ret->nr_links; i++)
emit_cond_near_jump(&branches[i], prog, branches[i],
X86_JNE);
for (i = 0; i < fmod_ret->nr_links; i++) {
emit_cond_near_jump(&branches[i], image + (prog - (u8 *)rw_image),
image + (branches[i] - (u8 *)rw_image), X86_JNE);
}
}
if (fexit->nr_links)
if (invoke_bpf(m, &prog, fexit, regs_off, run_ctx_off, false)) {
if (fexit->nr_links) {
if (invoke_bpf(m, &prog, fexit, regs_off, run_ctx_off,
false, image, rw_image)) {
ret = -EINVAL;
goto cleanup;
}
}
if (flags & BPF_TRAMP_F_RESTORE_REGS)
restore_regs(m, &prog, regs_off);
@ -2643,18 +2733,19 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *i
* restored to R0.
*/
if (flags & BPF_TRAMP_F_CALL_ORIG) {
im->ip_epilogue = prog;
im->ip_epilogue = image + (prog - (u8 *)rw_image);
/* arg1: mov rdi, im */
emit_mov_imm64(&prog, BPF_REG_1, (long) im >> 32, (u32) (long) im);
if (emit_rsb_call(&prog, __bpf_tramp_exit, prog)) {
if (emit_rsb_call(&prog, __bpf_tramp_exit, image + (prog - (u8 *)rw_image))) {
ret = -EINVAL;
goto cleanup;
}
} else if (flags & BPF_TRAMP_F_TAIL_CALL_CTX)
} else if (flags & BPF_TRAMP_F_TAIL_CALL_CTX) {
/* Before running the original function, restore the
* tail_call_cnt from stack to rax.
*/
RESTORE_TAIL_CALL_CNT(stack_size);
}
/* restore return value of orig_call or fentry prog back into RAX */
if (save_ret)
@ -2662,22 +2753,94 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *i
emit_ldx(&prog, BPF_DW, BPF_REG_6, BPF_REG_FP, -rbx_off);
EMIT1(0xC9); /* leave */
if (flags & BPF_TRAMP_F_SKIP_FRAME)
if (flags & BPF_TRAMP_F_SKIP_FRAME) {
/* skip our return address and return to parent */
EMIT4(0x48, 0x83, 0xC4, 8); /* add rsp, 8 */
emit_return(&prog, prog);
}
emit_return(&prog, image + (prog - (u8 *)rw_image));
/* Make sure the trampoline generation logic doesn't overflow */
if (WARN_ON_ONCE(prog > (u8 *)image_end - BPF_INSN_SAFETY)) {
if (WARN_ON_ONCE(prog > (u8 *)rw_image_end - BPF_INSN_SAFETY)) {
ret = -EFAULT;
goto cleanup;
}
ret = prog - (u8 *)image;
ret = prog - (u8 *)rw_image + BPF_INSN_SAFETY;
cleanup:
kfree(branches);
return ret;
}
void *arch_alloc_bpf_trampoline(unsigned int size)
{
return bpf_prog_pack_alloc(size, jit_fill_hole);
}
void arch_free_bpf_trampoline(void *image, unsigned int size)
{
bpf_prog_pack_free(image, size);
}
void arch_protect_bpf_trampoline(void *image, unsigned int size)
{
}
void arch_unprotect_bpf_trampoline(void *image, unsigned int size)
{
}
int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *image_end,
const struct btf_func_model *m, u32 flags,
struct bpf_tramp_links *tlinks,
void *func_addr)
{
void *rw_image, *tmp;
int ret;
u32 size = image_end - image;
/* rw_image doesn't need to be in module memory range, so we can
* use kvmalloc.
*/
rw_image = kvmalloc(size, GFP_KERNEL);
if (!rw_image)
return -ENOMEM;
ret = __arch_prepare_bpf_trampoline(im, rw_image, rw_image + size, image, m,
flags, tlinks, func_addr);
if (ret < 0)
goto out;
tmp = bpf_arch_text_copy(image, rw_image, size);
if (IS_ERR(tmp))
ret = PTR_ERR(tmp);
out:
kvfree(rw_image);
return ret;
}
int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,
struct bpf_tramp_links *tlinks, void *func_addr)
{
struct bpf_tramp_image im;
void *image;
int ret;
/* Allocate a temporary buffer for __arch_prepare_bpf_trampoline().
* This will NOT cause fragmentation in direct map, as we do not
* call set_memory_*() on this buffer.
*
* We cannot use kvmalloc here, because we need image to be in
* module memory range.
*/
image = bpf_jit_alloc_exec(PAGE_SIZE);
if (!image)
return -ENOMEM;
ret = __arch_prepare_bpf_trampoline(&im, image, image + PAGE_SIZE, image,
m, flags, tlinks, func_addr);
bpf_jit_free_exec(image);
return ret;
}
static int emit_bpf_dispatcher(u8 **pprog, int a, int b, s64 *progs, u8 *image, u8 *buf)
{
u8 *jg_reloc, *prog = *pprog;
@ -2935,9 +3098,16 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
jit_data->header = header;
jit_data->rw_header = rw_header;
}
prog->bpf_func = (void *)image;
/*
* ctx.prog_offset is used when CFI preambles put code *before*
* the function. See emit_cfi(). For FineIBT specifically this code
* can also be executed and bpf_prog_kallsyms_add() will
* generate an additional symbol to cover this, hence also
* decrement proglen.
*/
prog->bpf_func = (void *)image + cfi_get_offset();
prog->jited = 1;
prog->jited_len = proglen;
prog->jited_len = proglen - cfi_get_offset();
} else {
prog = orig_prog;
}
@ -2992,6 +3162,7 @@ void bpf_jit_free(struct bpf_prog *prog)
kvfree(jit_data->addrs);
kfree(jit_data);
}
prog->bpf_func = (void *)prog->bpf_func - cfi_get_offset();
hdr = bpf_jit_binary_pack_hdr(prog);
bpf_jit_binary_pack_free(hdr, NULL);
WARN_ON_ONCE(!bpf_prog_kallsyms_verify_off(prog));

View File

@ -494,6 +494,7 @@ static void __exit atmtcp_exit(void)
deregister_atm_ioctl(&atmtcp_ioctl_ops);
}
MODULE_DESCRIPTION("ATM over TCP");
MODULE_LICENSE("GPL");
module_init(atmtcp_init);
module_exit(atmtcp_exit);

View File

@ -2318,4 +2318,5 @@ static int __init eni_init(void)
module_init(eni_init);
/* @@@ since exit routine not defined, this module can not be unloaded */
MODULE_DESCRIPTION("Efficient Networks ENI155P ATM NIC driver");
MODULE_LICENSE("GPL");

View File

@ -372,4 +372,5 @@ static void __exit idt77105_exit(void)
module_exit(idt77105_exit);
MODULE_DESCRIPTION("IDT77105 PHY driver");
MODULE_LICENSE("GPL");

View File

@ -90,6 +90,7 @@ module_param(IA_RX_BUF, int, 0);
module_param(IA_RX_BUF_SZ, int, 0);
module_param(IADebugFlag, uint, 0644);
MODULE_DESCRIPTION("Driver for Interphase ATM PCI NICs");
MODULE_LICENSE("GPL");
/**************************** IA_LIB **********************************/

View File

@ -171,6 +171,7 @@ static const struct atmdev_ops atm_ops = {
static struct timer_list ns_timer;
static char *mac[NS_MAX_CARDS];
module_param_array(mac, charp, NULL, 0);
MODULE_DESCRIPTION("ATM NIC driver for IDT 77201/77211 \"NICStAR\" and Fore ForeRunnerLE.");
MODULE_LICENSE("GPL");
/* Functions */

View File

@ -387,4 +387,5 @@ int suni_init(struct atm_dev *dev)
EXPORT_SYMBOL(suni_init);
MODULE_DESCRIPTION("S/UNI PHY driver");
MODULE_LICENSE("GPL");

View File

@ -27,6 +27,7 @@ static const char * const fw_upload_err_str[] = {
[FW_UPLOAD_ERR_INVALID_SIZE] = "invalid-file-size",
[FW_UPLOAD_ERR_RW_ERROR] = "read-write-error",
[FW_UPLOAD_ERR_WEAROUT] = "flash-wearout",
[FW_UPLOAD_ERR_FW_INVALID] = "firmware-invalid",
};
static const char *fw_upload_progress(struct device *dev,

View File

@ -280,7 +280,7 @@ static u8 bcma_find_pci_capability(struct bcma_drv_pci *pc, unsigned int dev,
/* check for Header type 0 */
bcma_extpci_read_config(pc, dev, func, PCI_HEADER_TYPE, &byte_val,
sizeof(u8));
if ((byte_val & 0x7F) != PCI_HEADER_TYPE_NORMAL)
if ((byte_val & PCI_HEADER_TYPE_MASK) != PCI_HEADER_TYPE_NORMAL)
return cap_ptr;
/* check if the capability pointer field exists */

View File

@ -535,6 +535,8 @@ static int btintel_version_info_tlv(struct hci_dev *hdev,
bt_dev_info(hdev, "%s timestamp %u.%u buildtype %u build %u", variant,
2000 + (version->timestamp >> 8), version->timestamp & 0xff,
version->build_type, version->build_num);
if (version->img_type == 0x03)
bt_dev_info(hdev, "Firmware SHA1: 0x%8.8x", version->git_sha1);
return 0;
}
@ -630,6 +632,9 @@ static int btintel_parse_version_tlv(struct hci_dev *hdev,
memcpy(&version->otp_bd_addr, tlv->val,
sizeof(bdaddr_t));
break;
case INTEL_TLV_GIT_SHA1:
version->git_sha1 = get_unaligned_le32(tlv->val);
break;
default:
/* Ignore rest of information */
break;

View File

@ -41,7 +41,8 @@ enum {
INTEL_TLV_LIMITED_CCE,
INTEL_TLV_SBE_TYPE,
INTEL_TLV_OTP_BDADDR,
INTEL_TLV_UNLOCKED_STATE
INTEL_TLV_UNLOCKED_STATE,
INTEL_TLV_GIT_SHA1
};
struct intel_tlv {
@ -69,6 +70,7 @@ struct intel_version_tlv {
u8 min_fw_build_yy;
u8 limited_cce;
u8 sbe_type;
u32 git_sha1;
bdaddr_t otp_bd_addr;
};

View File

@ -336,7 +336,7 @@ mtk_stp_split(struct btmtkuart_dev *bdev, const unsigned char *data, int count,
return data;
}
static int btmtkuart_recv(struct hci_dev *hdev, const u8 *data, size_t count)
static void btmtkuart_recv(struct hci_dev *hdev, const u8 *data, size_t count)
{
struct btmtkuart_dev *bdev = hci_get_drvdata(hdev);
const unsigned char *p_left = data, *p_h4;
@ -375,25 +375,20 @@ static int btmtkuart_recv(struct hci_dev *hdev, const u8 *data, size_t count)
bt_dev_err(bdev->hdev,
"Frame reassembly failed (%d)", err);
bdev->rx_skb = NULL;
return err;
return;
}
sz_left -= sz_h4;
p_left += sz_h4;
}
return 0;
}
static int btmtkuart_receive_buf(struct serdev_device *serdev, const u8 *data,
size_t count)
{
struct btmtkuart_dev *bdev = serdev_device_get_drvdata(serdev);
int err;
err = btmtkuart_recv(bdev->hdev, data, count);
if (err < 0)
return err;
btmtkuart_recv(bdev->hdev, data, count);
bdev->hdev->stat.byte_rx += count;

View File

@ -1276,11 +1276,9 @@ static int btnxpuart_receive_buf(struct serdev_device *serdev, const u8 *data,
if (IS_ERR(nxpdev->rx_skb)) {
int err = PTR_ERR(nxpdev->rx_skb);
/* Safe to ignore out-of-sync bootloader signatures */
if (is_fw_downloading(nxpdev))
return count;
bt_dev_err(nxpdev->hdev, "Frame reassembly failed (%d)", err);
nxpdev->rx_skb = NULL;
return err;
if (!is_fw_downloading(nxpdev))
bt_dev_err(nxpdev->hdev, "Frame reassembly failed (%d)", err);
return count;
}
if (!is_fw_downloading(nxpdev))
nxpdev->hdev->stat.byte_rx += count;

View File

@ -550,6 +550,8 @@ static const struct usb_device_id quirks_table[] = {
BTUSB_WIDEBAND_SPEECH },
{ USB_DEVICE(0x13d3, 0x3571), .driver_info = BTUSB_REALTEK |
BTUSB_WIDEBAND_SPEECH },
{ USB_DEVICE(0x13d3, 0x3572), .driver_info = BTUSB_REALTEK |
BTUSB_WIDEBAND_SPEECH },
/* Realtek Bluetooth devices */
{ USB_VENDOR_AND_INTERFACE_INFO(0x0bda, 0xe0, 0x01, 0x01),
@ -4629,6 +4631,10 @@ static int btusb_suspend(struct usb_interface *intf, pm_message_t message)
BT_DBG("intf %p", intf);
/* Don't suspend if there are connections */
if (hci_conn_count(data->hdev))
return -EBUSY;
if (data->suspend_count++)
return 0;

View File

@ -1815,6 +1815,24 @@ static void hci_coredump_qca(struct hci_dev *hdev)
kfree_skb(skb);
}
static int qca_get_data_path_id(struct hci_dev *hdev, __u8 *data_path_id)
{
/* QCA uses 1 as non-HCI data path id for HFP */
*data_path_id = 1;
return 0;
}
static int qca_configure_hfp_offload(struct hci_dev *hdev)
{
bt_dev_info(hdev, "HFP non-HCI data transport is supported");
hdev->get_data_path_id = qca_get_data_path_id;
/* Do not need to send HCI_Configure_Data_Path to configure non-HCI
* data transport path for QCA controllers, so set below field as NULL.
*/
hdev->get_codec_config_data = NULL;
return 0;
}
static int qca_setup(struct hci_uart *hu)
{
struct hci_dev *hdev = hu->hdev;
@ -1969,6 +1987,10 @@ static int qca_setup(struct hci_uart *hu)
hu->hdev->set_bdaddr = qca_set_bdaddr_rome;
else
hu->hdev->set_bdaddr = qca_set_bdaddr;
if (soc_type == QCA_QCA2066)
qca_configure_hfp_offload(hdev);
qca->fw_version = le16_to_cpu(ver.patch_ver);
qca->controller_id = le16_to_cpu(ver.rom_ver);
hci_devcd_register(hdev, hci_coredump_qca, qca_dmp_hdr, NULL);
@ -2039,6 +2061,7 @@ static const struct qca_device_data qca_soc_data_wcn3998 __maybe_unused = {
static const struct qca_device_data qca_soc_data_qca2066 __maybe_unused = {
.soc_type = QCA_QCA2066,
.num_vregs = 0,
.capabilities = QCA_CAP_WIDEBAND_SPEECH | QCA_CAP_VALID_LE_STATES,
};
static const struct qca_device_data qca_soc_data_qca6390 __maybe_unused = {

View File

@ -59,9 +59,8 @@ static int cn_already_initialized;
* both, or if both are zero then the group is looked up and sent there.
*/
int cn_netlink_send_mult(struct cn_msg *msg, u16 len, u32 portid, u32 __group,
gfp_t gfp_mask,
int (*filter)(struct sock *dsk, struct sk_buff *skb, void *data),
void *filter_data)
gfp_t gfp_mask, netlink_filter_fn filter,
void *filter_data)
{
struct cn_callback_entry *__cbq;
unsigned int size;

View File

@ -22,7 +22,8 @@ DEFINE_MUTEX(dpll_lock);
DEFINE_XARRAY_FLAGS(dpll_device_xa, XA_FLAGS_ALLOC);
DEFINE_XARRAY_FLAGS(dpll_pin_xa, XA_FLAGS_ALLOC);
static u32 dpll_xa_id;
static u32 dpll_device_xa_id;
static u32 dpll_pin_xa_id;
#define ASSERT_DPLL_REGISTERED(d) \
WARN_ON_ONCE(!xa_get_mark(&dpll_device_xa, (d)->id, DPLL_REGISTERED))
@ -246,7 +247,7 @@ dpll_device_alloc(const u64 clock_id, u32 device_idx, struct module *module)
dpll->clock_id = clock_id;
dpll->module = module;
ret = xa_alloc_cyclic(&dpll_device_xa, &dpll->id, dpll, xa_limit_32b,
&dpll_xa_id, GFP_KERNEL);
&dpll_device_xa_id, GFP_KERNEL);
if (ret < 0) {
kfree(dpll);
return ERR_PTR(ret);
@ -446,7 +447,8 @@ dpll_pin_alloc(u64 clock_id, u32 pin_idx, struct module *module,
refcount_set(&pin->refcount, 1);
xa_init_flags(&pin->dpll_refs, XA_FLAGS_ALLOC);
xa_init_flags(&pin->parent_refs, XA_FLAGS_ALLOC);
ret = xa_alloc(&dpll_pin_xa, &pin->id, pin, xa_limit_16b, GFP_KERNEL);
ret = xa_alloc_cyclic(&dpll_pin_xa, &pin->id, pin, xa_limit_32b,
&dpll_pin_xa_id, GFP_KERNEL);
if (ret)
goto err;
return pin;

View File

@ -101,13 +101,17 @@ dpll_msg_add_mode_supported(struct sk_buff *msg, struct dpll_device *dpll,
{
const struct dpll_device_ops *ops = dpll_device_ops(dpll);
enum dpll_mode mode;
int ret;
if (!ops->mode_supported)
return 0;
for (mode = DPLL_MODE_MANUAL; mode <= DPLL_MODE_MAX; mode++)
if (ops->mode_supported(dpll, dpll_priv(dpll), mode, extack))
if (nla_put_u32(msg, DPLL_A_MODE_SUPPORTED, mode))
return -EMSGSIZE;
/* No mode change is supported now, so the only supported mode is the
* one obtained by mode_get().
*/
ret = ops->mode_get(dpll, dpll_priv(dpll), &mode, extack);
if (ret)
return ret;
if (nla_put_u32(msg, DPLL_A_MODE_SUPPORTED, mode))
return -EMSGSIZE;
return 0;
}
@ -259,6 +263,27 @@ dpll_msg_add_phase_offset(struct sk_buff *msg, struct dpll_pin *pin,
return 0;
}
static int dpll_msg_add_ffo(struct sk_buff *msg, struct dpll_pin *pin,
struct dpll_pin_ref *ref,
struct netlink_ext_ack *extack)
{
const struct dpll_pin_ops *ops = dpll_pin_ops(ref);
struct dpll_device *dpll = ref->dpll;
s64 ffo;
int ret;
if (!ops->ffo_get)
return 0;
ret = ops->ffo_get(pin, dpll_pin_on_dpll_priv(dpll, pin),
dpll, dpll_priv(dpll), &ffo, extack);
if (ret) {
if (ret == -ENODATA)
return 0;
return ret;
}
return nla_put_sint(msg, DPLL_A_PIN_FRACTIONAL_FREQUENCY_OFFSET, ffo);
}
static int
dpll_msg_add_pin_freq(struct sk_buff *msg, struct dpll_pin *pin,
struct dpll_pin_ref *ref, struct netlink_ext_ack *extack)
@ -436,6 +461,9 @@ dpll_cmd_pin_get_one(struct sk_buff *msg, struct dpll_pin *pin,
prop->phase_range.max))
return -EMSGSIZE;
ret = dpll_msg_add_pin_phase_adjust(msg, pin, ref, extack);
if (ret)
return ret;
ret = dpll_msg_add_ffo(msg, pin, ref, extack);
if (ret)
return ret;
if (xa_empty(&pin->parent_refs))

Some files were not shown because too many files have changed in this diff Show More