提交 3e336261 编写于 作者: J Jon Cooper 提交者: David S. Miller

sfc: Change efx_mcdi_reset_port to use ENTITY_RESET MC command.

PORT_RESET MC command was NOP in the ef10 firmware hence we are using
ENTITY_RESET to make sure all resource allocations are reset.
Signed-off-by: NShradha Shah <sshah@solarflare.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6e6a50c2
...@@ -683,6 +683,17 @@ static int efx_ef10_init_nic(struct efx_nic *efx) ...@@ -683,6 +683,17 @@ static int efx_ef10_init_nic(struct efx_nic *efx)
return 0; return 0;
} }
static void efx_ef10_reset_mc_allocations(struct efx_nic *efx)
{
struct efx_ef10_nic_data *nic_data = efx->nic_data;
/* All our allocations have been reset */
nic_data->must_realloc_vis = true;
nic_data->must_restore_filters = true;
nic_data->must_restore_piobufs = true;
nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID;
}
static int efx_ef10_map_reset_flags(u32 *flags) static int efx_ef10_map_reset_flags(u32 *flags)
{ {
enum { enum {
...@@ -713,6 +724,19 @@ static int efx_ef10_map_reset_flags(u32 *flags) ...@@ -713,6 +724,19 @@ static int efx_ef10_map_reset_flags(u32 *flags)
return -EINVAL; return -EINVAL;
} }
static int efx_ef10_reset(struct efx_nic *efx, enum reset_type reset_type)
{
int rc = efx_mcdi_reset(efx, reset_type);
/* If it was a port reset, trigger reallocation of MC resources.
* Note that on an MC reset nothing needs to be done now because we'll
* detect the MC reset later and handle it then.
*/
if (reset_type == RESET_TYPE_ALL && !rc)
efx_ef10_reset_mc_allocations(efx);
return rc;
}
#define EF10_DMA_STAT(ext_name, mcdi_name) \ #define EF10_DMA_STAT(ext_name, mcdi_name) \
[EF10_STAT_ ## ext_name] = \ [EF10_STAT_ ## ext_name] = \
{ #ext_name, 64, 8 * MC_CMD_MAC_ ## mcdi_name } { #ext_name, 64, 8 * MC_CMD_MAC_ ## mcdi_name }
...@@ -1078,10 +1102,7 @@ static int efx_ef10_mcdi_poll_reboot(struct efx_nic *efx) ...@@ -1078,10 +1102,7 @@ static int efx_ef10_mcdi_poll_reboot(struct efx_nic *efx)
nic_data->warm_boot_count = rc; nic_data->warm_boot_count = rc;
/* All our allocations have been reset */ /* All our allocations have been reset */
nic_data->must_realloc_vis = true; efx_ef10_reset_mc_allocations(efx);
nic_data->must_restore_filters = true;
nic_data->must_restore_piobufs = true;
nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID;
/* The datapath firmware might have been changed */ /* The datapath firmware might have been changed */
nic_data->must_check_datapath_caps = true; nic_data->must_check_datapath_caps = true;
...@@ -3571,7 +3592,7 @@ const struct efx_nic_type efx_hunt_a0_nic_type = { ...@@ -3571,7 +3592,7 @@ const struct efx_nic_type efx_hunt_a0_nic_type = {
.fini = efx_port_dummy_op_void, .fini = efx_port_dummy_op_void,
.map_reset_reason = efx_mcdi_map_reset_reason, .map_reset_reason = efx_mcdi_map_reset_reason,
.map_reset_flags = efx_ef10_map_reset_flags, .map_reset_flags = efx_ef10_map_reset_flags,
.reset = efx_mcdi_reset, .reset = efx_ef10_reset,
.probe_port = efx_mcdi_port_probe, .probe_port = efx_mcdi_port_probe,
.remove_port = efx_mcdi_port_remove, .remove_port = efx_mcdi_port_remove,
.fini_dmaq = efx_ef10_fini_dmaq, .fini_dmaq = efx_ef10_fini_dmaq,
......
...@@ -1471,9 +1471,17 @@ void efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode) ...@@ -1471,9 +1471,17 @@ void efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode)
NULL, 0, NULL); NULL, 0, NULL);
} }
static int efx_mcdi_reset_port(struct efx_nic *efx) static int efx_mcdi_reset_func(struct efx_nic *efx)
{ {
return efx_mcdi_rpc(efx, MC_CMD_ENTITY_RESET, NULL, 0, NULL, 0, NULL); MCDI_DECLARE_BUF(inbuf, MC_CMD_ENTITY_RESET_IN_LEN);
int rc;
BUILD_BUG_ON(MC_CMD_ENTITY_RESET_OUT_LEN != 0);
MCDI_POPULATE_DWORD_1(inbuf, ENTITY_RESET_IN_FLAG,
ENTITY_RESET_IN_FUNCTION_RESOURCE_RESET, 1);
rc = efx_mcdi_rpc(efx, MC_CMD_ENTITY_RESET, inbuf, sizeof(inbuf),
NULL, 0, NULL);
return rc;
} }
static int efx_mcdi_reset_mc(struct efx_nic *efx) static int efx_mcdi_reset_mc(struct efx_nic *efx)
...@@ -1510,7 +1518,7 @@ int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method) ...@@ -1510,7 +1518,7 @@ int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method)
if (method == RESET_TYPE_WORLD) if (method == RESET_TYPE_WORLD)
return efx_mcdi_reset_mc(efx); return efx_mcdi_reset_mc(efx);
else else
return efx_mcdi_reset_port(efx); return efx_mcdi_reset_func(efx);
} }
static int efx_mcdi_wol_filter_set(struct efx_nic *efx, u32 type, static int efx_mcdi_wol_filter_set(struct efx_nic *efx, u32 type,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册