^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) netdevsim devlink support
^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) This document describes the ``devlink`` features supported by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) ``netdevsim`` device driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) ==========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) .. list-table:: Generic parameters implemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * - Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) - Mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * - ``max_macs``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) - driverinit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) The ``netdevsim`` driver also implements the following driver-specific
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) parameters.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) .. list-table:: Driver-specific parameters implemented
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) :widths: 5 5 5 85
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) * - Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) - Type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) - Mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) - Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * - ``test1``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) - Boolean
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) - driverinit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) - Test parameter used to show how a driver-specific devlink parameter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) can be implemented.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) The ``netdevsim`` driver supports reloading via ``DEVLINK_CMD_RELOAD``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) Regions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) =======
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) The ``netdevsim`` driver exposes a ``dummy`` region as an example of how the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) devlink-region interfaces work. A snapshot is taken whenever the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) ``take_snapshot`` debugfs file is written to.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) Resources
^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) The ``netdevsim`` driver exposes resources to control the number of FIB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) entries and FIB rule entries that the driver will allow.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) .. code:: shell
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) $ devlink resource set netdevsim/netdevsim0 path /IPv4/fib size 96
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) $ devlink resource set netdevsim/netdevsim0 path /IPv4/fib-rules size 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) $ devlink resource set netdevsim/netdevsim0 path /IPv6/fib size 64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) $ devlink resource set netdevsim/netdevsim0 path /IPv6/fib-rules size 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) $ devlink dev reload netdevsim/netdevsim0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) Driver-specific Traps
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) =====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) .. list-table:: List of Driver-specific Traps Registered by ``netdevsim``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) :widths: 5 5 90
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) * - Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) - Type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) - Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) * - ``fid_miss``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) - ``exception``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) - When a packet enters the device it is classified to a filtering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) indentifier (FID) based on the ingress port and VLAN. This trap is used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) to trap packets for which a FID could not be found