1 .. SPDX-License-Identifier: GPL-2.0
3 =========================
4 netdevsim devlink support
5 =========================
7 This document describes the ``devlink`` features supported by the
8 ``netdevsim`` device driver.
13 .. list-table:: Generic parameters implemented
20 The ``netdevsim`` driver also implements the following driver-specific
23 .. list-table:: Driver-specific parameters implemented
33 - Test parameter used to show how a driver-specific devlink parameter
36 The ``netdevsim`` driver supports reloading via ``DEVLINK_CMD_RELOAD``
41 The ``netdevsim`` driver exposes a ``dummy`` region as an example of how the
42 devlink-region interfaces work. A snapshot is taken whenever the
43 ``take_snapshot`` debugfs file is written to.
48 The ``netdevsim`` driver exposes resources to control the number of FIB
49 entries, FIB rule entries and nexthops that the driver will allow.
53 $ devlink resource set netdevsim/netdevsim0 path /IPv4/fib size 96
54 $ devlink resource set netdevsim/netdevsim0 path /IPv4/fib-rules size 16
55 $ devlink resource set netdevsim/netdevsim0 path /IPv6/fib size 64
56 $ devlink resource set netdevsim/netdevsim0 path /IPv6/fib-rules size 16
57 $ devlink resource set netdevsim/netdevsim0 path /nexthops size 16
58 $ devlink dev reload netdevsim/netdevsim0
63 The ``netdevsim`` driver supports rate objects management, which includes:
65 - registerging/unregistering leaf rate objects per VF devlink port;
66 - creation/deletion node rate objects;
67 - setting tx_share and tx_max rate values for any rate object type;
68 - setting parent node for any rate object type.
70 Rate nodes and their parameters are exposed in ``netdevsim`` debugfs in RO mode.
71 For example created rate node with name ``some_group``:
75 $ ls /sys/kernel/debug/netdevsim/netdevsim0/rate_groups/some_group
76 rate_parent tx_max tx_share
78 Same parameters are exposed for leaf objects in corresponding ports directories.
83 $ ls /sys/kernel/debug/netdevsim/netdevsim0/ports/1
84 dev ethtool rate_parent tx_max tx_share
89 .. list-table:: List of Driver-specific Traps Registered by ``netdevsim``
97 - When a packet enters the device it is classified to a filtering
98 identifier (FID) based on the ingress port and VLAN. This trap is used
99 to trap packets for which a FID could not be found