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