0001 .. SPDX-License-Identifier: GPL-2.0
0002
0003 =========================
0004 netdevsim devlink support
0005 =========================
0006
0007 This document describes the ``devlink`` features supported by the
0008 ``netdevsim`` device driver.
0009
0010 Parameters
0011 ==========
0012
0013 .. list-table:: Generic parameters implemented
0014
0015 * - Name
0016 - Mode
0017 * - ``max_macs``
0018 - driverinit
0019
0020 The ``netdevsim`` driver also implements the following driver-specific
0021 parameters.
0022
0023 .. list-table:: Driver-specific parameters implemented
0024 :widths: 5 5 5 85
0025
0026 * - Name
0027 - Type
0028 - Mode
0029 - Description
0030 * - ``test1``
0031 - Boolean
0032 - driverinit
0033 - Test parameter used to show how a driver-specific devlink parameter
0034 can be implemented.
0035
0036 The ``netdevsim`` driver supports reloading via ``DEVLINK_CMD_RELOAD``
0037
0038 Regions
0039 =======
0040
0041 The ``netdevsim`` driver exposes a ``dummy`` region as an example of how the
0042 devlink-region interfaces work. A snapshot is taken whenever the
0043 ``take_snapshot`` debugfs file is written to.
0044
0045 Resources
0046 =========
0047
0048 The ``netdevsim`` driver exposes resources to control the number of FIB
0049 entries, FIB rule entries and nexthops that the driver will allow.
0050
0051 .. code:: shell
0052
0053 $ devlink resource set netdevsim/netdevsim0 path /IPv4/fib size 96
0054 $ devlink resource set netdevsim/netdevsim0 path /IPv4/fib-rules size 16
0055 $ devlink resource set netdevsim/netdevsim0 path /IPv6/fib size 64
0056 $ devlink resource set netdevsim/netdevsim0 path /IPv6/fib-rules size 16
0057 $ devlink resource set netdevsim/netdevsim0 path /nexthops size 16
0058 $ devlink dev reload netdevsim/netdevsim0
0059
0060 Rate objects
0061 ============
0062
0063 The ``netdevsim`` driver supports rate objects management, which includes:
0064
0065 - registerging/unregistering leaf rate objects per VF devlink port;
0066 - creation/deletion node rate objects;
0067 - setting tx_share and tx_max rate values for any rate object type;
0068 - setting parent node for any rate object type.
0069
0070 Rate nodes and their parameters are exposed in ``netdevsim`` debugfs in RO mode.
0071 For example created rate node with name ``some_group``:
0072
0073 .. code:: shell
0074
0075 $ ls /sys/kernel/debug/netdevsim/netdevsim0/rate_groups/some_group
0076 rate_parent tx_max tx_share
0077
0078 Same parameters are exposed for leaf objects in corresponding ports directories.
0079 For ex.:
0080
0081 .. code:: shell
0082
0083 $ ls /sys/kernel/debug/netdevsim/netdevsim0/ports/1
0084 dev ethtool rate_parent tx_max tx_share
0085
0086 Driver-specific Traps
0087 =====================
0088
0089 .. list-table:: List of Driver-specific Traps Registered by ``netdevsim``
0090 :widths: 5 5 90
0091
0092 * - Name
0093 - Type
0094 - Description
0095 * - ``fid_miss``
0096 - ``exception``
0097 - When a packet enters the device it is classified to a filtering
0098 indentifier (FID) based on the ingress port and VLAN. This trap is used
0099 to trap packets for which a FID could not be found