Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sfc: Change entity reset on MC reboot to a new datapath-only reset.

Currently we do an entity reset when we detect an MC reboot.
This messes up SRIOV because it leaves VFs orphaned. The extra
reset is rather redundant anyway, since the MC reboot will have
basically reset everything.

This change replaces the entity reset after MC reboot with a
simpler datapath reset that reallocates resources but doesn't
perform the entity reset.

Signed-off-by: Shradha Shah <sshah@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jon Cooper and committed by
David S. Miller
087e9025 b9af9049

+21 -5
+10 -2
drivers/net/ethernet/sfc/ef10.c
··· 866 866 nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID; 867 867 } 868 868 869 + static enum reset_type efx_ef10_map_reset_reason(enum reset_type reason) 870 + { 871 + if (reason == RESET_TYPE_MC_FAILURE) 872 + return RESET_TYPE_DATAPATH; 873 + 874 + return efx_mcdi_map_reset_reason(reason); 875 + } 876 + 869 877 static int efx_ef10_map_reset_flags(u32 *flags) 870 878 { 871 879 enum { ··· 3948 3940 .dimension_resources = efx_ef10_dimension_resources, 3949 3941 .init = efx_ef10_init_nic, 3950 3942 .fini = efx_port_dummy_op_void, 3951 - .map_reset_reason = efx_mcdi_map_reset_reason, 3943 + .map_reset_reason = efx_ef10_map_reset_reason, 3952 3944 .map_reset_flags = efx_ef10_map_reset_flags, 3953 3945 .reset = efx_ef10_reset, 3954 3946 .probe_port = efx_mcdi_port_probe, ··· 4048 4040 .dimension_resources = efx_ef10_dimension_resources, 4049 4041 .init = efx_ef10_init_nic, 4050 4042 .fini = efx_port_dummy_op_void, 4051 - .map_reset_reason = efx_mcdi_map_reset_reason, 4043 + .map_reset_reason = efx_ef10_map_reset_reason, 4052 4044 .map_reset_flags = efx_ef10_map_reset_flags, 4053 4045 .reset = efx_ef10_reset, 4054 4046 .probe_port = efx_mcdi_port_probe,
+6 -2
drivers/net/ethernet/sfc/efx.c
··· 77 77 [RESET_TYPE_RECOVER_OR_ALL] = "RECOVER_OR_ALL", 78 78 [RESET_TYPE_WORLD] = "WORLD", 79 79 [RESET_TYPE_RECOVER_OR_DISABLE] = "RECOVER_OR_DISABLE", 80 + [RESET_TYPE_DATAPATH] = "DATAPATH", 80 81 [RESET_TYPE_MC_BIST] = "MC_BIST", 81 82 [RESET_TYPE_DISABLE] = "DISABLE", 82 83 [RESET_TYPE_TX_WATCHDOG] = "TX_WATCHDOG", ··· 2431 2430 efx_disable_interrupts(efx); 2432 2431 2433 2432 mutex_lock(&efx->mac_lock); 2434 - if (efx->port_initialized && method != RESET_TYPE_INVISIBLE) 2433 + if (efx->port_initialized && method != RESET_TYPE_INVISIBLE && 2434 + method != RESET_TYPE_DATAPATH) 2435 2435 efx->phy_op->fini(efx); 2436 2436 efx->type->fini(efx); 2437 2437 } ··· 2461 2459 if (!ok) 2462 2460 goto fail; 2463 2461 2464 - if (efx->port_initialized && method != RESET_TYPE_INVISIBLE) { 2462 + if (efx->port_initialized && method != RESET_TYPE_INVISIBLE && 2463 + method != RESET_TYPE_DATAPATH) { 2465 2464 rc = efx->phy_op->init(efx); 2466 2465 if (rc) 2467 2466 goto fail; ··· 2658 2655 case RESET_TYPE_WORLD: 2659 2656 case RESET_TYPE_DISABLE: 2660 2657 case RESET_TYPE_RECOVER_OR_DISABLE: 2658 + case RESET_TYPE_DATAPATH: 2661 2659 case RESET_TYPE_MC_BIST: 2662 2660 case RESET_TYPE_MCDI_TIMEOUT: 2663 2661 method = type;
+2
drivers/net/ethernet/sfc/enum.h
··· 143 143 * @RESET_TYPE_WORLD: Reset as much as possible 144 144 * @RESET_TYPE_RECOVER_OR_DISABLE: Try to recover. Apply RESET_TYPE_DISABLE if 145 145 * unsuccessful. 146 + * @RESET_TYPE_DATAPATH: Reset datapath only. 146 147 * @RESET_TYPE_MC_BIST: MC entering BIST mode. 147 148 * @RESET_TYPE_DISABLE: Reset datapath, MAC and PHY; leave NIC disabled 148 149 * @RESET_TYPE_TX_WATCHDOG: reset due to TX watchdog ··· 160 159 RESET_TYPE_ALL, 161 160 RESET_TYPE_WORLD, 162 161 RESET_TYPE_RECOVER_OR_DISABLE, 162 + RESET_TYPE_DATAPATH, 163 163 RESET_TYPE_MC_BIST, 164 164 RESET_TYPE_DISABLE, 165 165 RESET_TYPE_MAX_METHOD,
+3 -1
drivers/net/ethernet/sfc/mcdi.c
··· 1558 1558 if (rc) 1559 1559 return rc; 1560 1560 1561 - if (method == RESET_TYPE_WORLD) 1561 + if (method == RESET_TYPE_DATAPATH) 1562 + return 0; 1563 + else if (method == RESET_TYPE_WORLD) 1562 1564 return efx_mcdi_reset_mc(efx); 1563 1565 else 1564 1566 return efx_mcdi_reset_func(efx);