diff options
author | Jon Cooper <jcooper@solarflare.com> | 2014-01-17 14:48:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-21 17:46:12 -0500 |
commit | 3e336261f88c3fb7a9789b1e3d0259eb0c8036fd (patch) | |
tree | 362b6e1419c3eb220681534088534c8dbaa5a459 /drivers/net/ethernet/sfc | |
parent | 6e6a50c254220acb19bd338ce433b1770e4a7a3c (diff) |
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: Shradha Shah <sshah@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc')
-rw-r--r-- | drivers/net/ethernet/sfc/ef10.c | 31 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/mcdi.c | 14 |
2 files changed, 37 insertions, 8 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index 4dfc2296600d..174a92f5fe51 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c | |||
@@ -683,6 +683,17 @@ static int efx_ef10_init_nic(struct efx_nic *efx) | |||
683 | return 0; | 683 | return 0; |
684 | } | 684 | } |
685 | 685 | ||
686 | static void efx_ef10_reset_mc_allocations(struct efx_nic *efx) | ||
687 | { | ||
688 | struct efx_ef10_nic_data *nic_data = efx->nic_data; | ||
689 | |||
690 | /* All our allocations have been reset */ | ||
691 | nic_data->must_realloc_vis = true; | ||
692 | nic_data->must_restore_filters = true; | ||
693 | nic_data->must_restore_piobufs = true; | ||
694 | nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID; | ||
695 | } | ||
696 | |||
686 | static int efx_ef10_map_reset_flags(u32 *flags) | 697 | static int efx_ef10_map_reset_flags(u32 *flags) |
687 | { | 698 | { |
688 | enum { | 699 | enum { |
@@ -713,6 +724,19 @@ static int efx_ef10_map_reset_flags(u32 *flags) | |||
713 | return -EINVAL; | 724 | return -EINVAL; |
714 | } | 725 | } |
715 | 726 | ||
727 | static int efx_ef10_reset(struct efx_nic *efx, enum reset_type reset_type) | ||
728 | { | ||
729 | int rc = efx_mcdi_reset(efx, reset_type); | ||
730 | |||
731 | /* If it was a port reset, trigger reallocation of MC resources. | ||
732 | * Note that on an MC reset nothing needs to be done now because we'll | ||
733 | * detect the MC reset later and handle it then. | ||
734 | */ | ||
735 | if (reset_type == RESET_TYPE_ALL && !rc) | ||
736 | efx_ef10_reset_mc_allocations(efx); | ||
737 | return rc; | ||
738 | } | ||
739 | |||
716 | #define EF10_DMA_STAT(ext_name, mcdi_name) \ | 740 | #define EF10_DMA_STAT(ext_name, mcdi_name) \ |
717 | [EF10_STAT_ ## ext_name] = \ | 741 | [EF10_STAT_ ## ext_name] = \ |
718 | { #ext_name, 64, 8 * MC_CMD_MAC_ ## mcdi_name } | 742 | { #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 | nic_data->warm_boot_count = rc; | 1102 | nic_data->warm_boot_count = rc; |
1079 | 1103 | ||
1080 | /* All our allocations have been reset */ | 1104 | /* All our allocations have been reset */ |
1081 | nic_data->must_realloc_vis = true; | 1105 | efx_ef10_reset_mc_allocations(efx); |
1082 | nic_data->must_restore_filters = true; | ||
1083 | nic_data->must_restore_piobufs = true; | ||
1084 | nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID; | ||
1085 | 1106 | ||
1086 | /* The datapath firmware might have been changed */ | 1107 | /* The datapath firmware might have been changed */ |
1087 | nic_data->must_check_datapath_caps = true; | 1108 | nic_data->must_check_datapath_caps = true; |
@@ -3571,7 +3592,7 @@ const struct efx_nic_type efx_hunt_a0_nic_type = { | |||
3571 | .fini = efx_port_dummy_op_void, | 3592 | .fini = efx_port_dummy_op_void, |
3572 | .map_reset_reason = efx_mcdi_map_reset_reason, | 3593 | .map_reset_reason = efx_mcdi_map_reset_reason, |
3573 | .map_reset_flags = efx_ef10_map_reset_flags, | 3594 | .map_reset_flags = efx_ef10_map_reset_flags, |
3574 | .reset = efx_mcdi_reset, | 3595 | .reset = efx_ef10_reset, |
3575 | .probe_port = efx_mcdi_port_probe, | 3596 | .probe_port = efx_mcdi_port_probe, |
3576 | .remove_port = efx_mcdi_port_remove, | 3597 | .remove_port = efx_mcdi_port_remove, |
3577 | .fini_dmaq = efx_ef10_fini_dmaq, | 3598 | .fini_dmaq = efx_ef10_fini_dmaq, |
diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c index 0d5d7b5325e8..eb59abb57e85 100644 --- a/drivers/net/ethernet/sfc/mcdi.c +++ b/drivers/net/ethernet/sfc/mcdi.c | |||
@@ -1471,9 +1471,17 @@ void efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode) | |||
1471 | NULL, 0, NULL); | 1471 | NULL, 0, NULL); |
1472 | } | 1472 | } |
1473 | 1473 | ||
1474 | static int efx_mcdi_reset_port(struct efx_nic *efx) | 1474 | static int efx_mcdi_reset_func(struct efx_nic *efx) |
1475 | { | 1475 | { |
1476 | return efx_mcdi_rpc(efx, MC_CMD_ENTITY_RESET, NULL, 0, NULL, 0, NULL); | 1476 | MCDI_DECLARE_BUF(inbuf, MC_CMD_ENTITY_RESET_IN_LEN); |
1477 | int rc; | ||
1478 | |||
1479 | BUILD_BUG_ON(MC_CMD_ENTITY_RESET_OUT_LEN != 0); | ||
1480 | MCDI_POPULATE_DWORD_1(inbuf, ENTITY_RESET_IN_FLAG, | ||
1481 | ENTITY_RESET_IN_FUNCTION_RESOURCE_RESET, 1); | ||
1482 | rc = efx_mcdi_rpc(efx, MC_CMD_ENTITY_RESET, inbuf, sizeof(inbuf), | ||
1483 | NULL, 0, NULL); | ||
1484 | return rc; | ||
1477 | } | 1485 | } |
1478 | 1486 | ||
1479 | static int efx_mcdi_reset_mc(struct efx_nic *efx) | 1487 | 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 | if (method == RESET_TYPE_WORLD) | 1518 | if (method == RESET_TYPE_WORLD) |
1511 | return efx_mcdi_reset_mc(efx); | 1519 | return efx_mcdi_reset_mc(efx); |
1512 | else | 1520 | else |
1513 | return efx_mcdi_reset_port(efx); | 1521 | return efx_mcdi_reset_func(efx); |
1514 | } | 1522 | } |
1515 | 1523 | ||
1516 | static int efx_mcdi_wol_filter_set(struct efx_nic *efx, u32 type, | 1524 | static int efx_mcdi_wol_filter_set(struct efx_nic *efx, u32 type, |