.. | .. |
---|
1297 | 1297 | { |
---|
1298 | 1298 | struct efx_ef10_nic_data *nic_data = efx->nic_data; |
---|
1299 | 1299 | |
---|
| 1300 | + spin_lock_bh(&efx->stats_lock); |
---|
1300 | 1301 | kfree(nic_data->mc_stats); |
---|
1301 | 1302 | nic_data->mc_stats = NULL; |
---|
| 1303 | + spin_unlock_bh(&efx->stats_lock); |
---|
1302 | 1304 | } |
---|
1303 | 1305 | |
---|
1304 | 1306 | static int efx_ef10_init_nic(struct efx_nic *efx) |
---|
1305 | 1307 | { |
---|
1306 | 1308 | struct efx_ef10_nic_data *nic_data = efx->nic_data; |
---|
1307 | | - netdev_features_t hw_enc_features = 0; |
---|
| 1309 | + struct net_device *net_dev = efx->net_dev; |
---|
| 1310 | + netdev_features_t tun_feats, tso_feats; |
---|
1308 | 1311 | int rc; |
---|
1309 | 1312 | |
---|
1310 | 1313 | if (nic_data->must_check_datapath_caps) { |
---|
.. | .. |
---|
1349 | 1352 | nic_data->must_restore_piobufs = false; |
---|
1350 | 1353 | } |
---|
1351 | 1354 | |
---|
1352 | | - /* add encapsulated checksum offload features */ |
---|
| 1355 | + /* encap features might change during reset if fw variant changed */ |
---|
1353 | 1356 | if (efx_has_cap(efx, VXLAN_NVGRE) && !efx_ef10_is_vf(efx)) |
---|
1354 | | - hw_enc_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; |
---|
1355 | | - /* add encapsulated TSO features */ |
---|
| 1357 | + net_dev->hw_enc_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; |
---|
| 1358 | + else |
---|
| 1359 | + net_dev->hw_enc_features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM); |
---|
| 1360 | + |
---|
| 1361 | + tun_feats = NETIF_F_GSO_UDP_TUNNEL | NETIF_F_GSO_GRE | |
---|
| 1362 | + NETIF_F_GSO_UDP_TUNNEL_CSUM | NETIF_F_GSO_GRE_CSUM; |
---|
| 1363 | + tso_feats = NETIF_F_TSO | NETIF_F_TSO6; |
---|
| 1364 | + |
---|
1356 | 1365 | if (efx_has_cap(efx, TX_TSO_V2_ENCAP)) { |
---|
1357 | | - netdev_features_t encap_tso_features; |
---|
1358 | | - |
---|
1359 | | - encap_tso_features = NETIF_F_GSO_UDP_TUNNEL | NETIF_F_GSO_GRE | |
---|
1360 | | - NETIF_F_GSO_UDP_TUNNEL_CSUM | NETIF_F_GSO_GRE_CSUM; |
---|
1361 | | - |
---|
1362 | | - hw_enc_features |= encap_tso_features | NETIF_F_TSO; |
---|
1363 | | - efx->net_dev->features |= encap_tso_features; |
---|
| 1366 | + /* If this is first nic_init, or if it is a reset and a new fw |
---|
| 1367 | + * variant has added new features, enable them by default. |
---|
| 1368 | + * If the features are not new, maintain their current value. |
---|
| 1369 | + */ |
---|
| 1370 | + if (!(net_dev->hw_features & tun_feats)) |
---|
| 1371 | + net_dev->features |= tun_feats; |
---|
| 1372 | + net_dev->hw_enc_features |= tun_feats | tso_feats; |
---|
| 1373 | + net_dev->hw_features |= tun_feats; |
---|
| 1374 | + } else { |
---|
| 1375 | + net_dev->hw_enc_features &= ~(tun_feats | tso_feats); |
---|
| 1376 | + net_dev->hw_features &= ~tun_feats; |
---|
| 1377 | + net_dev->features &= ~tun_feats; |
---|
1364 | 1378 | } |
---|
1365 | | - efx->net_dev->hw_enc_features = hw_enc_features; |
---|
1366 | 1379 | |
---|
1367 | 1380 | /* don't fail init if RSS setup doesn't work */ |
---|
1368 | 1381 | rc = efx->type->rx_push_rss_config(efx, false, |
---|
.. | .. |
---|
1825 | 1838 | |
---|
1826 | 1839 | efx_ef10_get_stat_mask(efx, mask); |
---|
1827 | 1840 | |
---|
1828 | | - efx_nic_copy_stats(efx, nic_data->mc_stats); |
---|
1829 | | - efx_nic_update_stats(efx_ef10_stat_desc, EF10_STAT_COUNT, |
---|
1830 | | - mask, stats, nic_data->mc_stats, false); |
---|
| 1841 | + /* If NIC was fini'd (probably resetting), then we can't read |
---|
| 1842 | + * updated stats right now. |
---|
| 1843 | + */ |
---|
| 1844 | + if (nic_data->mc_stats) { |
---|
| 1845 | + efx_nic_copy_stats(efx, nic_data->mc_stats); |
---|
| 1846 | + efx_nic_update_stats(efx_ef10_stat_desc, EF10_STAT_COUNT, |
---|
| 1847 | + mask, stats, nic_data->mc_stats, false); |
---|
| 1848 | + } |
---|
1831 | 1849 | |
---|
1832 | 1850 | /* Update derived statistics */ |
---|
1833 | 1851 | efx_nic_fix_nodesc_drop_stat(efx, |
---|
.. | .. |
---|
3977 | 3995 | NETIF_F_HW_VLAN_CTAG_FILTER | \ |
---|
3978 | 3996 | NETIF_F_IPV6_CSUM | \ |
---|
3979 | 3997 | NETIF_F_RXHASH | \ |
---|
3980 | | - NETIF_F_NTUPLE) |
---|
| 3998 | + NETIF_F_NTUPLE | \ |
---|
| 3999 | + NETIF_F_SG | \ |
---|
| 4000 | + NETIF_F_RXCSUM | \ |
---|
| 4001 | + NETIF_F_RXALL) |
---|
3981 | 4002 | |
---|
3982 | 4003 | const struct efx_nic_type efx_hunt_a0_vf_nic_type = { |
---|
3983 | 4004 | .is_vf = true, |
---|