aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2013-09-05 17:51:55 -0400
committerBen Hutchings <bhutchings@solarflare.com>2013-09-11 10:29:53 -0400
commita915ccc9f2c80aa4c329262d89f93ea16d8792c9 (patch)
tree8a19eba0de4f51b43af6a4e746b30ce2913d3157 /drivers/net
parente5a2538a48309b9aac12e517782e1fa514a0f9b3 (diff)
sfc: Reinitialise and re-validate datapath caps after MC reboot
After an MC reboot, the datapath may be running a different firmware variant and have different capabilities. It is critical that we know the current capabilities so that we can pass valid flags to MC_CMD_INIT_EVQ. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/sfc/ef10.c10
-rw-r--r--drivers/net/ethernet/sfc/nic.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index a4956b86d145..9f18ae984f9e 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -343,6 +343,13 @@ static int efx_ef10_init_nic(struct efx_nic *efx)
343 struct efx_ef10_nic_data *nic_data = efx->nic_data; 343 struct efx_ef10_nic_data *nic_data = efx->nic_data;
344 int rc; 344 int rc;
345 345
346 if (nic_data->must_check_datapath_caps) {
347 rc = efx_ef10_init_datapath_caps(efx);
348 if (rc)
349 return rc;
350 nic_data->must_check_datapath_caps = false;
351 }
352
346 if (nic_data->must_realloc_vis) { 353 if (nic_data->must_realloc_vis) {
347 /* We cannot let the number of VIs change now */ 354 /* We cannot let the number of VIs change now */
348 rc = efx_ef10_alloc_vis(efx, nic_data->n_allocated_vis, 355 rc = efx_ef10_alloc_vis(efx, nic_data->n_allocated_vis,
@@ -711,6 +718,9 @@ static int efx_ef10_mcdi_poll_reboot(struct efx_nic *efx)
711 nic_data->must_restore_filters = true; 718 nic_data->must_restore_filters = true;
712 nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID; 719 nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID;
713 720
721 /* The datapath firmware might have been changed */
722 nic_data->must_check_datapath_caps = true;
723
714 /* MAC statistics have been cleared on the NIC; clear the local 724 /* MAC statistics have been cleared on the NIC; clear the local
715 * statistic that we update with efx_update_diff_stat(). 725 * statistic that we update with efx_update_diff_stat().
716 */ 726 */
diff --git a/drivers/net/ethernet/sfc/nic.h b/drivers/net/ethernet/sfc/nic.h
index 4b1e188f7a2f..fda29d39032f 100644
--- a/drivers/net/ethernet/sfc/nic.h
+++ b/drivers/net/ethernet/sfc/nic.h
@@ -400,6 +400,8 @@ enum {
400 * @rx_rss_context: Firmware handle for our RSS context 400 * @rx_rss_context: Firmware handle for our RSS context
401 * @stats: Hardware statistics 401 * @stats: Hardware statistics
402 * @workaround_35388: Flag: firmware supports workaround for bug 35388 402 * @workaround_35388: Flag: firmware supports workaround for bug 35388
403 * @must_check_datapath_caps: Flag: @datapath_caps needs to be revalidated
404 * after MC reboot
403 * @datapath_caps: Capabilities of datapath firmware (FLAGS1 field of 405 * @datapath_caps: Capabilities of datapath firmware (FLAGS1 field of
404 * %MC_CMD_GET_CAPABILITIES response) 406 * %MC_CMD_GET_CAPABILITIES response)
405 */ 407 */
@@ -413,6 +415,7 @@ struct efx_ef10_nic_data {
413 u32 rx_rss_context; 415 u32 rx_rss_context;
414 u64 stats[EF10_STAT_COUNT]; 416 u64 stats[EF10_STAT_COUNT];
415 bool workaround_35388; 417 bool workaround_35388;
418 bool must_check_datapath_caps;
416 u32 datapath_caps; 419 u32 datapath_caps;
417}; 420};
418 421