Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) .. SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) Devlink Trap
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) Background
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) ==========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) Devices capable of offloading the kernel's datapath and perform functions such
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) as bridging and routing must also be able to send specific packets to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) kernel (i.e., the CPU) for processing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) For example, a device acting as a multicast-aware bridge must be able to send
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) IGMP membership reports to the kernel for processing by the bridge module.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) Without processing such packets, the bridge module could never populate its
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) MDB.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) As another example, consider a device acting as router which has received an IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) packet with a TTL of 1. Upon routing the packet the device must send it to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) kernel so that it will route it as well and generate an ICMP Time Exceeded
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) error datagram. Without letting the kernel route such packets itself, utilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) such as ``traceroute`` could never work.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) The fundamental ability of sending certain packets to the kernel for processing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) is called "packet trapping".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) Overview
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) The ``devlink-trap`` mechanism allows capable device drivers to register their
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) supported packet traps with ``devlink`` and report trapped packets to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) ``devlink`` for further analysis.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) Upon receiving trapped packets, ``devlink`` will perform a per-trap packets and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) bytes accounting and potentially report the packet to user space via a netlink
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) event along with all the provided metadata (e.g., trap reason, timestamp, input
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) port). This is especially useful for drop traps (see :ref:`Trap-Types`)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) as it allows users to obtain further visibility into packet drops that would
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) otherwise be invisible.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) The following diagram provides a general overview of ``devlink-trap``::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)                                     Netlink event: Packet w/ metadata
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)                                                    Or a summary of recent drops
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46)                                   ^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47)                                   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48)          Userspace                |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49)         +---------------------------------------------------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50)          Kernel                   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51)                                   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52)                           +-------+--------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53)                           |                |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54)                           |  drop_monitor  |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55)                           |                |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56)                           +-------^--------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57)                                   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58)                                   | Non-control traps
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59)                                   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60)                              +----+----+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61)                              |         |      Kernel's Rx path
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62)                              | devlink |      (non-drop traps)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63)                              |         |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64)                              +----^----+      ^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65)                                   |           |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66)                                   +-----------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67)                                   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68)                           +-------+-------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69)                           |               |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70)                           | Device driver |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71)                           |               |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72)                           +-------^-------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73)          Kernel                   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74)         +---------------------------------------------------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75)          Hardware                 |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76)                                   | Trapped packet
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77)                                   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78)                                +--+---+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79)                                |      |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80)                                | ASIC |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)                                |      |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82)                                +------+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) .. _Trap-Types:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) Trap Types
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) ==========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) The ``devlink-trap`` mechanism supports the following packet trap types:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91)   * ``drop``: Trapped packets were dropped by the underlying device. Packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92)     are only processed by ``devlink`` and not injected to the kernel's Rx path.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93)     The trap action (see :ref:`Trap-Actions`) can be changed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)   * ``exception``: Trapped packets were not forwarded as intended by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)     underlying device due to an exception (e.g., TTL error, missing neighbour
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)     entry) and trapped to the control plane for resolution. Packets are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)     processed by ``devlink`` and injected to the kernel's Rx path. Changing the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)     action of such traps is not allowed, as it can easily break the control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)     plane.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)   * ``control``: Trapped packets were trapped by the device because these are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)     control packets required for the correct functioning of the control plane.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)     For example, ARP request and IGMP query packets. Packets are injected to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)     the kernel's Rx path, but not reported to the kernel's drop monitor.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)     Changing the action of such traps is not allowed, as it can easily break
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)     the control plane.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) .. _Trap-Actions:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) Trap Actions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) The ``devlink-trap`` mechanism supports the following packet trap actions:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)   * ``trap``: The sole copy of the packet is sent to the CPU.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)   * ``drop``: The packet is dropped by the underlying device and a copy is not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)     sent to the CPU.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)   * ``mirror``: The packet is forwarded by the underlying device and a copy is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)     sent to the CPU.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) Generic Packet Traps
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) ====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) Generic packet traps are used to describe traps that trap well-defined packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) or packets that are trapped due to well-defined conditions (e.g., TTL error).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) Such traps can be shared by multiple device drivers and their description must
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) be added to the following table:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) .. list-table:: List of Generic Packet Traps
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)    :widths: 5 5 90
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)    * - Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)      - Type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)      - Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)    * - ``source_mac_is_multicast``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)      - Traps incoming packets that the device decided to drop because of a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)        multicast source MAC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)    * - ``vlan_tag_mismatch``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)      - Traps incoming packets that the device decided to drop in case of VLAN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)        tag mismatch: The ingress bridge port is not configured with a PVID and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)        the packet is untagged or prio-tagged
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)    * - ``ingress_vlan_filter``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)      - Traps incoming packets that the device decided to drop in case they are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)        tagged with a VLAN that is not configured on the ingress bridge port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)    * - ``ingress_spanning_tree_filter``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)      - Traps incoming packets that the device decided to drop in case the STP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)        state of the ingress bridge port is not "forwarding"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)    * - ``port_list_is_empty``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)      - Traps packets that the device decided to drop in case they need to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)        flooded (e.g., unknown unicast, unregistered multicast) and there are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)        no ports the packets should be flooded to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)    * - ``port_loopback_filter``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)      - Traps packets that the device decided to drop in case after layer 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)        forwarding the only port from which they should be transmitted through
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)        is the port from which they were received
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)    * - ``blackhole_route``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)      - Traps packets that the device decided to drop in case they hit a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)        blackhole route
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)    * - ``ttl_value_is_too_small``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)      - ``exception``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)      - Traps unicast packets that should be forwarded by the device whose TTL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)        was decremented to 0 or less
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)    * - ``tail_drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)      - Traps packets that the device decided to drop because they could not be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)        enqueued to a transmission queue which is full
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)    * - ``non_ip``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)      - Traps packets that the device decided to drop because they need to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)        undergo a layer 3 lookup, but are not IP or MPLS packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)    * - ``uc_dip_over_mc_dmac``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)      - Traps packets that the device decided to drop because they need to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)        routed and they have a unicast destination IP and a multicast destination
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)        MAC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)    * - ``dip_is_loopback_address``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)      - Traps packets that the device decided to drop because they need to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)        routed and their destination IP is the loopback address (i.e., 127.0.0.0/8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)        and ::1/128)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)    * - ``sip_is_mc``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)      - Traps packets that the device decided to drop because they need to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)        routed and their source IP is multicast (i.e., 224.0.0.0/8 and ff::/8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)    * - ``sip_is_loopback_address``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193)      - Traps packets that the device decided to drop because they need to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194)        routed and their source IP is the loopback address (i.e., 127.0.0.0/8 and ::1/128)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)    * - ``ip_header_corrupted``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)      - Traps packets that the device decided to drop because they need to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)        routed and their IP header is corrupted: wrong checksum, wrong IP version
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)        or too short Internet Header Length (IHL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)    * - ``ipv4_sip_is_limited_bc``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)      - Traps packets that the device decided to drop because they need to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)        routed and their source IP is limited broadcast (i.e., 255.255.255.255/32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)    * - ``ipv6_mc_dip_reserved_scope``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)      - Traps IPv6 packets that the device decided to drop because they need to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)        be routed and their IPv6 multicast destination IP has a reserved scope
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)        (i.e., ffx0::/16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)    * - ``ipv6_mc_dip_interface_local_scope``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)      - Traps IPv6 packets that the device decided to drop because they need to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)        be routed and their IPv6 multicast destination IP has an interface-local scope
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)        (i.e., ffx1::/16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)    * - ``mtu_value_is_too_small``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)      - ``exception``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)      - Traps packets that should have been routed by the device, but were bigger
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)        than the MTU of the egress interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)    * - ``unresolved_neigh``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)      - ``exception``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)      - Traps packets that did not have a matching IP neighbour after routing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)    * - ``mc_reverse_path_forwarding``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)      - ``exception``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)      - Traps multicast IP packets that failed reverse-path forwarding (RPF)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)        check during multicast routing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)    * - ``reject_route``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226)      - ``exception``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)      - Traps packets that hit reject routes (i.e., "unreachable", "prohibit")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)    * - ``ipv4_lpm_miss``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)      - ``exception``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)      - Traps unicast IPv4 packets that did not match any route
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)    * - ``ipv6_lpm_miss``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)      - ``exception``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)      - Traps unicast IPv6 packets that did not match any route
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)    * - ``non_routable_packet``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236)      - Traps packets that the device decided to drop because they are not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)        supposed to be routed. For example, IGMP queries can be flooded by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238)        device in layer 2 and reach the router. Such packets should not be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239)        routed and instead dropped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240)    * - ``decap_error``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)      - ``exception``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242)      - Traps NVE and IPinIP packets that the device decided to drop because of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243)        failure during decapsulation (e.g., packet being too short, reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)        bits set in VXLAN header)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)    * - ``overlay_smac_is_mc``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)      - Traps NVE packets that the device decided to drop because their overlay
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248)        source MAC is multicast
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249)    * - ``ingress_flow_action_drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251)      - Traps packets dropped during processing of ingress flow action drop
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252)    * - ``egress_flow_action_drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254)      - Traps packets dropped during processing of egress flow action drop
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)    * - ``stp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257)      - Traps STP packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258)    * - ``lacp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260)      - Traps LACP packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261)    * - ``lldp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263)      - Traps LLDP packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)    * - ``igmp_query``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266)      - Traps IGMP Membership Query packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)    * - ``igmp_v1_report``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)      - Traps IGMP Version 1 Membership Report packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270)    * - ``igmp_v2_report``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)      - Traps IGMP Version 2 Membership Report packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273)    * - ``igmp_v3_report``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275)      - Traps IGMP Version 3 Membership Report packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276)    * - ``igmp_v2_leave``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278)      - Traps IGMP Version 2 Leave Group packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279)    * - ``mld_query``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281)      - Traps MLD Multicast Listener Query packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282)    * - ``mld_v1_report``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284)      - Traps MLD Version 1 Multicast Listener Report packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285)    * - ``mld_v2_report``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287)      - Traps MLD Version 2 Multicast Listener Report packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288)    * - ``mld_v1_done``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290)      - Traps MLD Version 1 Multicast Listener Done packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291)    * - ``ipv4_dhcp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293)      - Traps IPv4 DHCP packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294)    * - ``ipv6_dhcp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296)      - Traps IPv6 DHCP packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297)    * - ``arp_request``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299)      - Traps ARP request packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300)    * - ``arp_response``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302)      - Traps ARP response packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303)    * - ``arp_overlay``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305)      - Traps NVE-decapsulated ARP packets that reached the overlay network.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306)        This is required, for example, when the address that needs to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307)        resolved is a local address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308)    * - ``ipv6_neigh_solicit``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310)      - Traps IPv6 Neighbour Solicitation packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311)    * - ``ipv6_neigh_advert``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313)      - Traps IPv6 Neighbour Advertisement packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314)    * - ``ipv4_bfd``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316)      - Traps IPv4 BFD packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317)    * - ``ipv6_bfd``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319)      - Traps IPv6 BFD packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320)    * - ``ipv4_ospf``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322)      - Traps IPv4 OSPF packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323)    * - ``ipv6_ospf``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325)      - Traps IPv6 OSPF packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326)    * - ``ipv4_bgp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328)      - Traps IPv4 BGP packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329)    * - ``ipv6_bgp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331)      - Traps IPv6 BGP packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332)    * - ``ipv4_vrrp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334)      - Traps IPv4 VRRP packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335)    * - ``ipv6_vrrp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337)      - Traps IPv6 VRRP packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338)    * - ``ipv4_pim``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340)      - Traps IPv4 PIM packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341)    * - ``ipv6_pim``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343)      - Traps IPv6 PIM packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344)    * - ``uc_loopback``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346)      - Traps unicast packets that need to be routed through the same layer 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347)        interface from which they were received. Such packets are routed by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348)        kernel, but also cause it to potentially generate ICMP redirect packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349)    * - ``local_route``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351)      - Traps unicast packets that hit a local route and need to be locally
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352)        delivered
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353)    * - ``external_route``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355)      - Traps packets that should be routed through an external interface (e.g.,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356)        management interface) that does not belong to the same device (e.g.,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357)        switch ASIC) as the ingress interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358)    * - ``ipv6_uc_dip_link_local_scope``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360)      - Traps unicast IPv6 packets that need to be routed and have a destination
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361)        IP address with a link-local scope (i.e., fe80::/10). The trap allows
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362)        device drivers to avoid programming link-local routes, but still receive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363)        packets for local delivery
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364)    * - ``ipv6_dip_all_nodes``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366)      - Traps IPv6 packets that their destination IP address is the "All Nodes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367)        Address" (i.e., ff02::1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368)    * - ``ipv6_dip_all_routers``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370)      - Traps IPv6 packets that their destination IP address is the "All Routers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371)        Address" (i.e., ff02::2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372)    * - ``ipv6_router_solicit``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374)      - Traps IPv6 Router Solicitation packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375)    * - ``ipv6_router_advert``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377)      - Traps IPv6 Router Advertisement packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378)    * - ``ipv6_redirect``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380)      - Traps IPv6 Redirect Message packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381)    * - ``ipv4_router_alert``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383)      - Traps IPv4 packets that need to be routed and include the Router Alert
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384)        option. Such packets need to be locally delivered to raw sockets that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385)        have the IP_ROUTER_ALERT socket option set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386)    * - ``ipv6_router_alert``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388)      - Traps IPv6 packets that need to be routed and include the Router Alert
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389)        option in their Hop-by-Hop extension header. Such packets need to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390)        locally delivered to raw sockets that have the IPV6_ROUTER_ALERT socket
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391)        option set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392)    * - ``ptp_event``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394)      - Traps PTP time-critical event messages (Sync, Delay_req, Pdelay_Req and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395)        Pdelay_Resp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396)    * - ``ptp_general``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398)      - Traps PTP general messages (Announce, Follow_Up, Delay_Resp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399)        Pdelay_Resp_Follow_Up, management and signaling)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400)    * - ``flow_action_sample``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402)      - Traps packets sampled during processing of flow action sample (e.g., via
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403)        tc's sample action)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404)    * - ``flow_action_trap``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405)      - ``control``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406)      - Traps packets logged during processing of flow action trap (e.g., via
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407)        tc's trap action)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408)    * - ``early_drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410)      - Traps packets dropped due to the RED (Random Early Detection) algorithm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411)        (i.e., early drops)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412)    * - ``vxlan_parsing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414)      - Traps packets dropped due to an error in the VXLAN header parsing which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415)        might be because of packet truncation or the I flag is not set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416)    * - ``llc_snap_parsing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418)      - Traps packets dropped due to an error in the LLC+SNAP header parsing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419)    * - ``vlan_parsing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421)      - Traps packets dropped due to an error in the VLAN header parsing. Could
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422)        include unexpected packet truncation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423)    * - ``pppoe_ppp_parsing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425)      - Traps packets dropped due to an error in the PPPoE+PPP header parsing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426)        This could include finding a session ID of 0xFFFF (which is reserved and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427)        not for use), a PPPoE length which is larger than the frame received or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428)        any common error on this type of header
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429)    * - ``mpls_parsing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431)      - Traps packets dropped due to an error in the MPLS header parsing which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432)        could include unexpected header truncation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433)    * - ``arp_parsing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435)      - Traps packets dropped due to an error in the ARP header parsing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436)    * - ``ip_1_parsing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438)      - Traps packets dropped due to an error in the first IP header parsing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439)        This packet trap could include packets which do not pass an IP checksum
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440)        check, a header length check (a minimum of 20 bytes), which might suffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441)        from packet truncation thus the total length field exceeds the received
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442)        packet length etc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443)    * - ``ip_n_parsing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445)      - Traps packets dropped due to an error in the parsing of the last IP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446)        header (the inner one in case of an IP over IP tunnel). The same common
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447)        error checking is performed here as for the ip_1_parsing trap
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448)    * - ``gre_parsing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450)      - Traps packets dropped due to an error in the GRE header parsing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451)    * - ``udp_parsing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453)      - Traps packets dropped due to an error in the UDP header parsing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454)        This packet trap could include checksum errorrs, an improper UDP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455)        length detected (smaller than 8 bytes) or detection of header
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456)        truncation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457)    * - ``tcp_parsing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459)      - Traps packets dropped due to an error in the TCP header parsing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460)        This could include TCP checksum errors, improper combination of SYN, FIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461)        and/or RESET etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462)    * - ``ipsec_parsing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464)      - Traps packets dropped due to an error in the IPSEC header parsing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465)    * - ``sctp_parsing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467)      - Traps packets dropped due to an error in the SCTP header parsing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468)        This would mean that port number 0 was used or that the header is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469)        truncated.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470)    * - ``dccp_parsing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472)      - Traps packets dropped due to an error in the DCCP header parsing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473)    * - ``gtp_parsing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475)      - Traps packets dropped due to an error in the GTP header parsing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476)    * - ``esp_parsing``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477)      - ``drop``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478)      - Traps packets dropped due to an error in the ESP header parsing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) Driver-specific Packet Traps
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) ============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) Device drivers can register driver-specific packet traps, but these must be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) clearly documented. Such traps can correspond to device-specific exceptions and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) help debug packet drops caused by these exceptions. The following list includes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) links to the description of driver-specific traps registered by various device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) drivers:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489)   * :doc:`netdevsim`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490)   * :doc:`mlxsw`
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) .. _Generic-Packet-Trap-Groups:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) Generic Packet Trap Groups
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) ==========================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) Generic packet trap groups are used to aggregate logically related packet
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) traps. These groups allow the user to batch operations such as setting the trap
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) action of all member traps. In addition, ``devlink-trap`` can report aggregated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) per-group packets and bytes statistics, in case per-trap statistics are too
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) narrow. The description of these groups must be added to the following table:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) .. list-table:: List of Generic Packet Trap Groups
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504)    :widths: 10 90
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506)    * - Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507)      - Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508)    * - ``l2_drops``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509)      - Contains packet traps for packets that were dropped by the device during
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510)        layer 2 forwarding (i.e., bridge)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511)    * - ``l3_drops``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512)      - Contains packet traps for packets that were dropped by the device during
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513)        layer 3 forwarding
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514)    * - ``l3_exceptions``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515)      - Contains packet traps for packets that hit an exception (e.g., TTL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516)        error) during layer 3 forwarding
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517)    * - ``buffer_drops``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518)      - Contains packet traps for packets that were dropped by the device due to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519)        an enqueue decision
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520)    * - ``tunnel_drops``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521)      - Contains packet traps for packets that were dropped by the device during
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522)        tunnel encapsulation / decapsulation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523)    * - ``acl_drops``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524)      - Contains packet traps for packets that were dropped by the device during
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525)        ACL processing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526)    * - ``stp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527)      - Contains packet traps for STP packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528)    * - ``lacp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529)      - Contains packet traps for LACP packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530)    * - ``lldp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531)      - Contains packet traps for LLDP packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532)    * - ``mc_snooping``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533)      - Contains packet traps for IGMP and MLD packets required for multicast
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534)        snooping
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535)    * - ``dhcp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536)      - Contains packet traps for DHCP packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537)    * - ``neigh_discovery``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538)      - Contains packet traps for neighbour discovery packets (e.g., ARP, IPv6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539)        ND)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540)    * - ``bfd``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541)      - Contains packet traps for BFD packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542)    * - ``ospf``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543)      - Contains packet traps for OSPF packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544)    * - ``bgp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545)      - Contains packet traps for BGP packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546)    * - ``vrrp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547)      - Contains packet traps for VRRP packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548)    * - ``pim``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549)      - Contains packet traps for PIM packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550)    * - ``uc_loopback``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551)      - Contains a packet trap for unicast loopback packets (i.e.,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552)        ``uc_loopback``). This trap is singled-out because in cases such as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553)        one-armed router it will be constantly triggered. To limit the impact on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554)        the CPU usage, a packet trap policer with a low rate can be bound to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555)        group without affecting other traps
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556)    * - ``local_delivery``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557)      - Contains packet traps for packets that should be locally delivered after
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558)        routing, but do not match more specific packet traps (e.g.,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559)        ``ipv4_bgp``)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560)    * - ``external_delivery``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561)      - Contains packet traps for packets that should be routed through an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562)        external interface (e.g., management interface) that does not belong to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563)        the same device (e.g., switch ASIC) as the ingress interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564)    * - ``ipv6``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565)      - Contains packet traps for various IPv6 control packets (e.g., Router
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566)        Advertisements)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567)    * - ``ptp_event``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568)      - Contains packet traps for PTP time-critical event messages (Sync,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569)        Delay_req, Pdelay_Req and Pdelay_Resp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570)    * - ``ptp_general``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571)      - Contains packet traps for PTP general messages (Announce, Follow_Up,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572)        Delay_Resp, Pdelay_Resp_Follow_Up, management and signaling)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573)    * - ``acl_sample``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574)      - Contains packet traps for packets that were sampled by the device during
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575)        ACL processing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576)    * - ``acl_trap``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577)      - Contains packet traps for packets that were trapped (logged) by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578)        device during ACL processing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579)    * - ``parser_error_drops``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580)      - Contains packet traps for packets that were marked by the device during
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581)        parsing as erroneous
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) Packet Trap Policers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584) ====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) As previously explained, the underlying device can trap certain packets to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) CPU for processing. In most cases, the underlying device is capable of handling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) packet rates that are several orders of magnitude higher compared to those that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) can be handled by the CPU.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) Therefore, in order to prevent the underlying device from overwhelming the CPU,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592) devices usually include packet trap policers that are able to police the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) trapped packets to rates that can be handled by the CPU.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) The ``devlink-trap`` mechanism allows capable device drivers to register their
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) supported packet trap policers with ``devlink``. The device driver can choose
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597) to associate these policers with supported packet trap groups (see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598) :ref:`Generic-Packet-Trap-Groups`) during its initialization, thereby exposing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) its default control plane policy to user space.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601) Device drivers should allow user space to change the parameters of the policers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602) (e.g., rate, burst size) as well as the association between the policers and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) trap groups by implementing the relevant callbacks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605) If possible, device drivers should implement a callback that allows user space
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606) to retrieve the number of packets that were dropped by the policer because its
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607) configured policy was violated.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609) Testing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) =======
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) See ``tools/testing/selftests/drivers/net/netdevsim/devlink_trap.sh`` for a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613) test covering the core infrastructure. Test cases should be added for any new
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614) functionality.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616) Device drivers should focus their tests on device-specific functionality, such
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617) as the triggering of supported packet traps.