Skip to content

Commit 4ff0ee1

Browse files
alicemicJeff Kirsher
authored and
Jeff Kirsher
committed
i40e: Introduce recovery mode support
This patch introduces "recovery mode" to the i40e driver. It is part of a new Any2Any idea of upgrading the firmware. In this approach, it is required for the driver to have support for "transition firmware", that is used for migrating from structured to flat firmware image. In this new, very basic mode, i40e driver must be able to handle particular IOCTL calls from the NVM Update Tool and run a small set of AQ commands. These additional AQ commands are part of the interface used by the NVMUpdate tool. The NVMUpdate tool contains all of the necessary logic to reference these new AQ commands. The end user experience remains the same, they are using the NVMUpdate tool to update the NVM contents. Signed-off-by: Alice Michael <alice.michael@intel.com> Signed-off-by: Piotr Marczak <piotr.marczak@intel.com> Tested-by: Don Buchholz <donald.buchholz@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent a121644 commit 4ff0ee1

File tree

3 files changed

+294
-31
lines changed

3 files changed

+294
-31
lines changed

Diff for: drivers/net/ethernet/intel/i40e/i40e.h

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ enum i40e_state_t {
149149
__I40E_CLIENT_L2_CHANGE,
150150
__I40E_CLIENT_RESET,
151151
__I40E_VIRTCHNL_OP_PENDING,
152+
__I40E_RECOVERY_MODE,
152153
/* This must be last as it determines the size of the BITMAP */
153154
__I40E_STATE_SIZE__,
154155
};

Diff for: drivers/net/ethernet/intel/i40e/i40e_ethtool.c

+13-1
Original file line numberDiff line numberDiff line change
@@ -5141,6 +5141,12 @@ static int i40e_get_module_eeprom(struct net_device *netdev,
51415141
return 0;
51425142
}
51435143

5144+
static const struct ethtool_ops i40e_ethtool_recovery_mode_ops = {
5145+
.set_eeprom = i40e_set_eeprom,
5146+
.get_eeprom_len = i40e_get_eeprom_len,
5147+
.get_eeprom = i40e_get_eeprom,
5148+
};
5149+
51445150
static const struct ethtool_ops i40e_ethtool_ops = {
51455151
.get_drvinfo = i40e_get_drvinfo,
51465152
.get_regs_len = i40e_get_regs_len,
@@ -5189,5 +5195,11 @@ static const struct ethtool_ops i40e_ethtool_ops = {
51895195

51905196
void i40e_set_ethtool_ops(struct net_device *netdev)
51915197
{
5192-
netdev->ethtool_ops = &i40e_ethtool_ops;
5198+
struct i40e_netdev_priv *np = netdev_priv(netdev);
5199+
struct i40e_pf *pf = np->vsi->back;
5200+
5201+
if (!test_bit(__I40E_RECOVERY_MODE, pf->state))
5202+
netdev->ethtool_ops = &i40e_ethtool_ops;
5203+
else
5204+
netdev->ethtool_ops = &i40e_ethtool_recovery_mode_ops;
51935205
}

0 commit comments

Comments
 (0)