linux/drivers/net/ethernet
Jacob Keller 399e27dbbd ice: support immediate firmware activation via devlink reload
The ice hardware contains an embedded chip with firmware which can be
updated using devlink flash. The firmware which runs on this chip is
referred to as the Embedded Management Processor firmware (EMP
firmware).

Activating the new firmware image currently requires that the system be
rebooted. This is not ideal as rebooting the system can cause unwanted
downtime.

In practical terms, activating the firmware does not always require a
full system reboot. In many cases it is possible to activate the EMP
firmware immediately. There are a couple of different scenarios to
cover.

 * The EMP firmware itself can be reloaded by issuing a special update
   to the device called an Embedded Management Processor reset (EMP
   reset). This reset causes the device to reset and reload the EMP
   firmware.

 * PCI configuration changes are only reloaded after a cold PCIe reset.
   Unfortunately there is no generic way to trigger this for a PCIe
   device without a system reboot.

When performing a flash update, firmware is capable of responding with
some information about the specific update requirements.

The driver updates the flash by programming a secondary inactive bank
with the contents of the new image, and then issuing a command to
request to switch the active bank starting from the next load.

The response to the final command for updating the inactive NVM flash
bank includes an indication of the minimum reset required to fully
update the device. This can be one of the following:

 * A full power on is required
 * A cold PCIe reset is required
 * An EMP reset is required

The response to the command to switch flash banks includes an indication
of whether or not the firmware will allow an EMP reset request.

For most updates, an EMP reset is sufficient to load the new EMP
firmware without issues. In some cases, this reset is not sufficient
because the PCI configuration space has changed. When this could cause
incompatibility with the new EMP image, the firmware is capable of
rejecting the EMP reset request.

Add logic to ice_fw_update.c to handle the response data flash update
AdminQ commands.

For the reset level, issue a devlink status notification informing the
user of how to complete the update with a simple suggestion like
"Activate new firmware by rebooting the system".

Cache the status of whether or not firmware will restrict the EMP reset
for use in implementing devlink reload.

Implement support for devlink reload with the "fw_activate" flag. This
allows user space to request the firmware be activated immediately.

For the .reload_down handler, we will issue a request for the EMP reset
using the appropriate firmware AdminQ command. If we know that the
firmware will not allow an EMP reset, simply exit with a suitable
netlink extended ACK message indicating that the EMP reset is not
available.

For the .reload_up handler, simply wait until the driver has finished
resetting. Logic to handle processing of an EMP reset already exists in
the driver as part of its reset and rebuild flows.

Implement support for the devlink reload interface with the
"fw_activate" action. This allows userspace to request activation of
firmware without a reboot.

Note that support for indicating the required reset and EMP reset
restriction is not supported on old versions of firmware. The driver can
determine if the two features are supported by checking the device
capabilities report. I confirmed support has existed since at least
version 5.5.2 as reported by the 'fw.mgmt' version. Support to issue the
EMP reset request has existed in all version of the EMP firmware for the
ice hardware.

Check the device capabilities report to determine whether or not the
indications are reported by the running firmware. If the reset
requirement indication is not supported, always assume a full power on
is necessary. If the reset restriction capability is not supported,
always assume the EMP reset is available.

Users can verify if the EMP reset has activated the firmware by using
the devlink info report to check that the 'running' firmware version has
updated. For example a user might do the following:

 # Check current version
 $ devlink dev info

 # Update the device
 $ devlink dev flash pci/0000:af:00.0 file firmware.bin

 # Confirm stored version updated
 $ devlink dev info

 # Reload to activate new firmware
 $ devlink dev reload pci/0000:af:00.0 action fw_activate

 # Confirm running version updated
 $ devlink dev info

Finally, this change does *not* implement basic driver-only reload
support. I did look into trying to do this. However, it requires
significant refactor of how the ice driver probes and loads everything.
The ice driver probe and allocation flows were not designed with such
a reload in mind. Refactoring the flow to support this is beyond the
scope of this change.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2021-12-15 08:40:38 -08:00
..
3com ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
8390 8390: wd: use eth_hw_addr_set() 2021-11-19 11:05:21 +00:00
actions ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
adaptec ethernet: adaptec: use eth_hw_addr_set() 2021-10-16 08:53:45 +01:00
aeroflex ethernet: aeroflex: use eth_hw_addr_set() 2021-10-16 08:53:45 +01:00
agere
alacritech ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
allwinner sun4i-emac.c: remove unnecessary branch 2021-12-15 10:29:03 +00:00
alteon ethernet: alteon: use eth_hw_addr_set() 2021-10-16 08:53:46 +01:00
altera net: altera: set a couple error code in probe() 2021-12-03 14:23:11 +00:00
amazon ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
amd net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
apm net: annotate accesses to queue->trans_start 2021-11-17 14:56:16 +00:00
apple apple: macmace: use eth_hw_addr_set() 2021-11-19 11:05:21 +00:00
aquantia net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
arc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-14 16:50:14 -07:00
asix Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-11-26 13:45:19 -08:00
atheros net: ag71xx: remove unnecessary legacy methods 2021-12-09 11:21:04 -08:00
broadcom net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
brocade net: bna: Update supported link modes 2021-12-10 19:50:40 -08:00
cadence net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
calxeda ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
cavium net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
chelsio net: cxgb: fix a typo in kernel doc 2021-11-30 12:18:08 +00:00
cirrus cirrus: mac89x0: use eth_hw_addr_set() 2021-11-19 11:05:21 +00:00
cisco ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
cortina ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
davicom ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
dec net: ethernet: dec: tulip: de4x5: fix possible array overflows in type3_infoblock() 2021-11-18 12:03:17 +00:00
dlink ethernet: replace netdev->dev_addr 16bit writes 2021-10-14 09:22:27 -07:00
emulex ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
engleder net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
ezchip ethernet: use of_get_ethdev_address() 2021-10-07 13:39:51 +01:00
faraday ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
freescale net: fec: fix system hang during suspend/resume 2021-12-15 10:30:25 +00:00
fujitsu ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
google Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-09 13:23:02 -08:00
hisilicon net: hns3: Fix spelling mistake "faile" -> "failed" 2021-12-07 21:35:12 -08:00
huawei Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-09 13:23:02 -08:00
i825xx 82596: use eth_hw_addr_set() 2021-11-20 12:25:56 +00:00
ibm ibmvnic: remove unused defines 2021-12-14 12:58:02 +00:00
intel ice: support immediate firmware activation via devlink reload 2021-12-15 08:40:38 -08:00
litex litex_liteeth: Fix a double free in the remove function 2021-11-07 21:51:17 +00:00
marvell net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
mediatek net: mtk_eth: add COMPILE_TEST support 2021-12-13 15:07:40 +00:00
mellanox mlxsw: Add support for VxLAN with IPv6 underlay 2021-12-15 15:05:44 +00:00
micrel ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
microchip net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
microsoft Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-09 13:23:02 -08:00
moxa ethernet: use eth_hw_addr_set() for dev->addr_len cases 2021-10-05 13:16:48 +01:00
mscc net: ocelot: add support to get port mac from device-tree 2021-12-15 10:29:41 +00:00
myricom ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
natsemi Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-02 11:44:56 -08:00
neterion net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
netronome Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-09 13:23:02 -08:00
ni nixge: fix mac address error handling again 2021-11-22 15:05:48 +00:00
nvidia ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
nxp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-28 10:43:58 -07:00
oki-semi net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
packetengines ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
pasemi ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
pensando ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
qlogic net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
qualcomm ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
rdc ethernet: replace netdev->dev_addr 16bit writes 2021-10-14 09:22:27 -07:00
realtek Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-11-26 13:45:19 -08:00
renesas net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
rocker net: remove .ndo_change_proto_down 2021-11-23 12:18:48 +00:00
samsung ethernet: sxgbe: use eth_hw_addr_set() 2021-10-19 12:41:48 +01:00
seeq ethernet: use eth_hw_addr_set() for dev->addr_len cases 2021-10-05 13:16:48 +01:00
sfc net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
sgi ethernet: use eth_hw_addr_set() for dev->addr_len cases 2021-10-05 13:16:48 +01:00
silan ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
sis ethernet: sis900: fix indentation 2021-11-12 20:13:28 -08:00
smsc smc9194: use eth_hw_addr_set() 2021-11-19 11:05:21 +00:00
socionext ethernet: netsec: use eth_hw_addr_set() 2021-10-20 11:41:01 +01:00
stmicro net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
sun ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
synopsys ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
tehuti ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
ti net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
toshiba net: spider_net: Use non-atomic bitmap API when applicable 2021-12-01 18:45:46 -08:00
tundra
vertexcom net: vertexcom: Add MSE102x SPI support 2021-12-13 14:15:41 +00:00
via ethernet: via-velocity: use eth_hw_addr_set() 2021-10-20 11:41:01 +01:00
wiznet net: w5100: Make w5100_remove() return void 2021-10-18 12:59:12 +01:00
xilinx net: axienet: mark as a legacy_pre_march2020 driver 2021-12-13 14:07:09 +00:00
xircom ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
xscale net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX 2021-12-14 12:28:24 +00:00
dnet.c ethernet: manually convert memcpy(dev_addr,..., sizeof(addr)) 2021-10-14 09:22:19 -07:00
dnet.h
ec_bhf.c ethernet: ec_bhf: use eth_hw_addr_set() 2021-10-16 08:53:46 +01:00
ethoc.c ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
fealnx.c ethernet: use eth_hw_addr_set() in unmaintained drivers 2021-10-18 13:20:38 +01:00
jme.c ethernet: use eth_hw_addr_set() for dev->addr_len cases 2021-10-05 13:16:48 +01:00
jme.h
Kconfig net: vertexcom: Add MSE102x SPI support 2021-12-13 14:15:41 +00:00
korina.c ethernet: use of_get_ethdev_address() 2021-10-07 13:39:51 +01:00
lantiq_etop.c net: lantiq: fix missing free_netdev() on error in ltq_etop_probe() 2021-11-30 12:11:27 +00:00
lantiq_xrx200.c net: lantiq_xrx200: Hardcode the burst length value 2021-10-29 12:15:35 +01:00
Makefile net: vertexcom: Add MSE102x SPI support 2021-12-13 14:15:41 +00:00