Merge tag 'docs-5.11-2' of git://git.lwn.net/linux
[linux-2.6-microblaze.git] / Documentation / networking / devlink / devlink-reload.rst
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ==============
4 Devlink Reload
5 ==============
6
7 ``devlink-reload`` provides mechanism to reinit driver entities, applying
8 ``devlink-params`` and ``devlink-resources`` new values. It also provides
9 mechanism to activate firmware.
10
11 Reload Actions
12 ==============
13
14 User may select a reload action.
15 By default ``driver_reinit`` action is selected.
16
17 .. list-table:: Possible reload actions
18    :widths: 5 90
19
20    * - Name
21      - Description
22    * - ``driver-reinit``
23      - Devlink driver entities re-initialization, including applying
24        new values to devlink entities which are used during driver
25        load such as ``devlink-params`` in configuration mode
26        ``driverinit`` or ``devlink-resources``
27    * - ``fw_activate``
28      - Firmware activate. Activates new firmware if such image is stored and
29        pending activation. If no limitation specified this action may involve
30        firmware reset. If no new image pending this action will reload current
31        firmware image.
32
33 Note that even though user asks for a specific action, the driver
34 implementation might require to perform another action alongside with
35 it. For example, some driver do not support driver reinitialization
36 being performed without fw activation. Therefore, the devlink reload
37 command returns the list of actions which were actrually performed.
38
39 Reload Limits
40 =============
41
42 By default reload actions are not limited and driver implementation may
43 include reset or downtime as needed to perform the actions.
44
45 However, some drivers support action limits, which limit the action
46 implementation to specific constraints.
47
48 .. list-table:: Possible reload limits
49    :widths: 5 90
50
51    * - Name
52      - Description
53    * - ``no_reset``
54      - No reset allowed, no down time allowed, no link flap and no
55        configuration is lost.
56
57 Change Namespace
58 ================
59
60 The netns option allows user to be able to move devlink instances into
61 namespaces during devlink reload operation.
62 By default all devlink instances are created in init_net and stay there.
63
64 example usage
65 -------------
66
67 .. code:: shell
68
69     $ devlink dev reload help
70     $ devlink dev reload DEV [ netns { PID | NAME | ID } ] [ action { driver_reinit | fw_activate } ] [ limit no_reset ]
71
72     # Run reload command for devlink driver entities re-initialization:
73     $ devlink dev reload pci/0000:82:00.0 action driver_reinit
74     reload_actions_performed:
75       driver_reinit
76
77     # Run reload command to activate firmware:
78     # Note that mlx5 driver reloads the driver while activating firmware
79     $ devlink dev reload pci/0000:82:00.0 action fw_activate
80     reload_actions_performed:
81       driver_reinit fw_activate