Skip to content

Commit d9f0d66

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== 100GbE Intel Wired LAN Driver Updates 2020-05-28 This series contains updates to the ice driver only. Anirudh (Ani) adds a poll for reset completion before proceeding with driver initialization when the DDP package fails to load and the firmware issues a core reset. Jake cleans up unnecessary code, since ice_set_dflt_vsi_ctx() performs a memset to clear the info from the context structures. Fixed a potential double free during probe unrolling after a failure. Also fixed a potential NULL pointer dereference upon register_netdev() failure. Tony makes two functions static which are not called outside of their file. Brett refactors the ice_ena_vf_mappings(), which was doing the VF's MSIx and queue mapping in one function which was hard to digest. So create a new function to handle the enabling MSIx mappings and another function to handle the enabling of queue mappings. Simplify the code flow in ice_sriov_configure(). Created a helper function for clearing VPGEN_VFRTRIG register, as this needs to be done on reset to notify the VF that we are done resetting it. Fixed the initialization/creation and reset flows, which was unnecessarily complicated, so separate the two flows into their own functions. Renamed VF initialization functions to make it more clear what they do and why. Added functionality to set the VF trust mode bit on reset. Added helper functions to rebuild the VLAN and MAC configurations when resetting a VF. Refactored how the VF reset is handled to prevent VF reset timeouts. Paul cleaned up code not needed during a CORER/GLOBR reset. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 370c63f + 3726cce commit d9f0d66

File tree

5 files changed

+507
-296
lines changed

5 files changed

+507
-296
lines changed

drivers/net/ethernet/intel/ice/ice_lib.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,6 @@ static int ice_vsi_init(struct ice_vsi *vsi, bool init_vsi)
938938
if (!ctxt)
939939
return -ENOMEM;
940940

941-
ctxt->info = vsi->info;
942941
switch (vsi->type) {
943942
case ICE_VSI_CTRL:
944943
case ICE_VSI_LB:

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2428,7 +2428,7 @@ static int ice_cfg_netdev(struct ice_vsi *vsi)
24282428

24292429
err = register_netdev(vsi->netdev);
24302430
if (err)
2431-
goto err_destroy_devlink_port;
2431+
goto err_free_netdev;
24322432

24332433
devlink_port_type_eth_set(&pf->devlink_port, vsi->netdev);
24342434

@@ -2439,9 +2439,11 @@ static int ice_cfg_netdev(struct ice_vsi *vsi)
24392439

24402440
return 0;
24412441

2442+
err_free_netdev:
2443+
free_netdev(vsi->netdev);
2444+
vsi->netdev = NULL;
24422445
err_destroy_devlink_port:
24432446
ice_devlink_destroy_port(pf);
2444-
24452447
return err;
24462448
}
24472449

@@ -3086,6 +3088,9 @@ ice_log_pkg_init(struct ice_hw *hw, enum ice_status *status)
30863088
case ICE_AQ_RC_EBADMAN:
30873089
case ICE_AQ_RC_EBADBUF:
30883090
dev_err(dev, "An error occurred on the device while loading the DDP package. The device will be reset.\n");
3091+
/* poll for reset to complete */
3092+
if (ice_check_reset(hw))
3093+
dev_err(dev, "Error resetting device. Please reload the driver\n");
30893094
return;
30903095
default:
30913096
break;
@@ -3415,7 +3420,7 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)
34153420
if (err) {
34163421
dev_err(dev, "ice_init_interrupt_scheme failed: %d\n", err);
34173422
err = -EIO;
3418-
goto err_init_interrupt_unroll;
3423+
goto err_init_vsi_unroll;
34193424
}
34203425

34213426
/* In case of MSIX we are going to setup the misc vector right here
@@ -3508,6 +3513,7 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)
35083513
ice_free_irq_msix_misc(pf);
35093514
err_init_interrupt_unroll:
35103515
ice_clear_interrupt_scheme(pf);
3516+
err_init_vsi_unroll:
35113517
devm_kfree(dev, pf->vsi);
35123518
err_init_pf_unroll:
35133519
ice_deinit_pf(pf);
@@ -4891,6 +4897,11 @@ static void ice_update_pf_netdev_link(struct ice_pf *pf)
48914897
* ice_rebuild - rebuild after reset
48924898
* @pf: PF to rebuild
48934899
* @reset_type: type of reset
4900+
*
4901+
* Do not rebuild VF VSI in this flow because that is already handled via
4902+
* ice_reset_all_vfs(). This is because requirements for resetting a VF after a
4903+
* PFR/CORER/GLOBER/etc. are different than the normal flow. Also, we don't want
4904+
* to reset/rebuild all the VF VSI twice.
48944905
*/
48954906
static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)
48964907
{
@@ -4988,14 +4999,6 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)
49884999
goto err_vsi_rebuild;
49895000
}
49905001

4991-
if (test_bit(ICE_FLAG_SRIOV_ENA, pf->flags)) {
4992-
err = ice_vsi_rebuild_by_type(pf, ICE_VSI_VF);
4993-
if (err) {
4994-
dev_err(dev, "VF VSI rebuild failed: %d\n", err);
4995-
goto err_vsi_rebuild;
4996-
}
4997-
}
4998-
49995002
/* If Flow Director is active */
50005003
if (test_bit(ICE_FLAG_FD_ENA, pf->flags)) {
50015004
err = ice_vsi_rebuild_by_type(pf, ICE_VSI_CTRL);

drivers/net/ethernet/intel/ice/ice_nvm.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ void ice_release_nvm(struct ice_hw *hw)
172172
*
173173
* Reads one 16 bit word from the Shadow RAM using the ice_read_sr_word_aq.
174174
*/
175-
enum ice_status ice_read_sr_word(struct ice_hw *hw, u16 offset, u16 *data)
175+
static enum ice_status
176+
ice_read_sr_word(struct ice_hw *hw, u16 offset, u16 *data)
176177
{
177178
enum ice_status status;
178179

@@ -196,7 +197,7 @@ enum ice_status ice_read_sr_word(struct ice_hw *hw, u16 offset, u16 *data)
196197
* Area (PFA) and returns the TLV pointer and length. The caller can
197198
* use these to read the variable length TLV value.
198199
*/
199-
enum ice_status
200+
static enum ice_status
200201
ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len,
201202
u16 module_type)
202203
{

drivers/net/ethernet/intel/ice/ice_nvm.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ enum ice_status
1111
ice_read_flat_nvm(struct ice_hw *hw, u32 offset, u32 *length, u8 *data,
1212
bool read_shadow_ram);
1313
enum ice_status
14-
ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len,
15-
u16 module_type);
16-
enum ice_status
1714
ice_read_pba_string(struct ice_hw *hw, u8 *pba_num, u32 pba_num_size);
1815
enum ice_status ice_init_nvm(struct ice_hw *hw);
19-
enum ice_status ice_read_sr_word(struct ice_hw *hw, u16 offset, u16 *data);
2016
#endif /* _ICE_NVM_H_ */

0 commit comments

Comments
 (0)