aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/ef10.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/sfc/ef10.c')
-rw-r--r--drivers/net/ethernet/sfc/ef10.c58
1 files changed, 37 insertions, 21 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index 5f42313b4965..9f18ae984f9e 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -94,7 +94,7 @@ static unsigned int efx_ef10_mem_map_size(struct efx_nic *efx)
94 return resource_size(&efx->pci_dev->resource[EFX_MEM_BAR]); 94 return resource_size(&efx->pci_dev->resource[EFX_MEM_BAR]);
95} 95}
96 96
97static int efx_ef10_init_capabilities(struct efx_nic *efx) 97static int efx_ef10_init_datapath_caps(struct efx_nic *efx)
98{ 98{
99 MCDI_DECLARE_BUF(outbuf, MC_CMD_GET_CAPABILITIES_OUT_LEN); 99 MCDI_DECLARE_BUF(outbuf, MC_CMD_GET_CAPABILITIES_OUT_LEN);
100 struct efx_ef10_nic_data *nic_data = efx->nic_data; 100 struct efx_ef10_nic_data *nic_data = efx->nic_data;
@@ -107,16 +107,27 @@ static int efx_ef10_init_capabilities(struct efx_nic *efx)
107 outbuf, sizeof(outbuf), &outlen); 107 outbuf, sizeof(outbuf), &outlen);
108 if (rc) 108 if (rc)
109 return rc; 109 return rc;
110 if (outlen < sizeof(outbuf)) {
111 netif_err(efx, drv, efx->net_dev,
112 "unable to read datapath firmware capabilities\n");
113 return -EIO;
114 }
110 115
111 if (outlen >= sizeof(outbuf)) { 116 nic_data->datapath_caps =
112 nic_data->datapath_caps = 117 MCDI_DWORD(outbuf, GET_CAPABILITIES_OUT_FLAGS1);
113 MCDI_DWORD(outbuf, GET_CAPABILITIES_OUT_FLAGS1); 118
114 if (!(nic_data->datapath_caps & 119 if (!(nic_data->datapath_caps &
115 (1 << MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN))) { 120 (1 << MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN))) {
116 netif_err(efx, drv, efx->net_dev, 121 netif_err(efx, drv, efx->net_dev,
117 "Capabilities don't indicate TSO support.\n"); 122 "current firmware does not support TSO\n");
118 return -ENODEV; 123 return -ENODEV;
119 } 124 }
125
126 if (!(nic_data->datapath_caps &
127 (1 << MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_LBN))) {
128 netif_err(efx, probe, efx->net_dev,
129 "current firmware does not support an RX prefix\n");
130 return -ENODEV;
120 } 131 }
121 132
122 return 0; 133 return 0;
@@ -217,21 +228,13 @@ static int efx_ef10_probe(struct efx_nic *efx)
217 if (rc) 228 if (rc)
218 goto fail3; 229 goto fail3;
219 230
220 rc = efx_ef10_init_capabilities(efx); 231 rc = efx_ef10_init_datapath_caps(efx);
221 if (rc < 0) 232 if (rc < 0)
222 goto fail3; 233 goto fail3;
223 234
224 efx->rx_packet_len_offset = 235 efx->rx_packet_len_offset =
225 ES_DZ_RX_PREFIX_PKTLEN_OFST - ES_DZ_RX_PREFIX_SIZE; 236 ES_DZ_RX_PREFIX_PKTLEN_OFST - ES_DZ_RX_PREFIX_SIZE;
226 237
227 if (!(nic_data->datapath_caps &
228 (1 << MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_LBN))) {
229 netif_err(efx, probe, efx->net_dev,
230 "current firmware does not support an RX prefix\n");
231 rc = -ENODEV;
232 goto fail3;
233 }
234
235 rc = efx_mcdi_port_get_number(efx); 238 rc = efx_mcdi_port_get_number(efx);
236 if (rc < 0) 239 if (rc < 0)
237 goto fail3; 240 goto fail3;
@@ -260,8 +263,6 @@ static int efx_ef10_probe(struct efx_nic *efx)
260 if (rc) 263 if (rc)
261 goto fail3; 264 goto fail3;
262 265
263 efx_ptp_probe(efx);
264
265 return 0; 266 return 0;
266 267
267fail3: 268fail3:
@@ -342,6 +343,13 @@ static int efx_ef10_init_nic(struct efx_nic *efx)
342 struct efx_ef10_nic_data *nic_data = efx->nic_data; 343 struct efx_ef10_nic_data *nic_data = efx->nic_data;
343 int rc; 344 int rc;
344 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
345 if (nic_data->must_realloc_vis) { 353 if (nic_data->must_realloc_vis) {
346 /* We cannot let the number of VIs change now */ 354 /* We cannot let the number of VIs change now */
347 rc = efx_ef10_alloc_vis(efx, nic_data->n_allocated_vis, 355 rc = efx_ef10_alloc_vis(efx, nic_data->n_allocated_vis,
@@ -710,6 +718,14 @@ static int efx_ef10_mcdi_poll_reboot(struct efx_nic *efx)
710 nic_data->must_restore_filters = true; 718 nic_data->must_restore_filters = true;
711 nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID; 719 nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID;
712 720
721 /* The datapath firmware might have been changed */
722 nic_data->must_check_datapath_caps = true;
723
724 /* MAC statistics have been cleared on the NIC; clear the local
725 * statistic that we update with efx_update_diff_stat().
726 */
727 nic_data->stats[EF10_STAT_rx_bad_bytes] = 0;
728
713 return -EIO; 729 return -EIO;
714} 730}
715 731