Skip to content

Commit 043dfe7

Browse files
etantilovNipaLocal
authored andcommitted
idpf: keep the netdev when a reset fails
During a successful reset the driver would re-allocate vport resources while keeping the netdevs intact. However, in case of an error in the init task, the netdev of the failing vport will be unregistered, effectively removing the network interface: [ 121.211076] idpf 0000:83:00.0: enabling device (0100 -> 0102) [ 121.221976] idpf 0000:83:00.0: Device HW Reset initiated [ 124.161229] idpf 0000:83:00.0 ens801f0: renamed from eth0 [ 124.163364] idpf 0000:83:00.0 ens801f0d1: renamed from eth1 [ 125.934656] idpf 0000:83:00.0 ens801f0d2: renamed from eth2 [ 128.218429] idpf 0000:83:00.0 ens801f0d3: renamed from eth3 ip -br a ens801f0 UP ens801f0d1 UP ens801f0d2 UP ens801f0d3 UP echo 1 > /sys/class/net/ens801f0/device/reset [ 145.885537] idpf 0000:83:00.0: resetting [ 145.990280] idpf 0000:83:00.0: reset done [ 146.284766] idpf 0000:83:00.0: HW reset detected [ 146.296610] idpf 0000:83:00.0: Device HW Reset initiated [ 211.556719] idpf 0000:83:00.0: Transaction timed-out (op:526 cookie:7700 vc_op:526 salt:77 timeout:60000ms) [ 272.996705] idpf 0000:83:00.0: Transaction timed-out (op:502 cookie:7800 vc_op:502 salt:78 timeout:60000ms) ip -br a ens801f0d1 DOWN ens801f0d2 DOWN ens801f0d3 DOWN Re-shuffle the logic in the error path of the init task to make sure the netdevs remain intact. This will allow the driver to attempt recovery via subsequent resets, provided the FW is still functional. The main change is to make sure that idpf_decfg_netdev() is not called should the init task fail during a reset. The error handling is consolidated under unwind_vports, as the removed labels had the same cleanup logic split depending on the point of failure. Fixes: ce1b75d ("idpf: add ptypes and MAC filter support") Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Tested-by: Samuel Salin <Samuel.salin@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Signed-off-by: NipaLocal <nipa@local>
1 parent 6269aa1 commit 043dfe7

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

drivers/net/ethernet/intel/idpf/idpf_lib.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,6 +1579,10 @@ void idpf_init_task(struct work_struct *work)
15791579
goto unwind_vports;
15801580
}
15811581

1582+
err = idpf_send_get_rx_ptype_msg(vport);
1583+
if (err)
1584+
goto unwind_vports;
1585+
15821586
index = vport->idx;
15831587
vport_config = adapter->vport_config[index];
15841588

@@ -1590,15 +1594,11 @@ void idpf_init_task(struct work_struct *work)
15901594
err = idpf_check_supported_desc_ids(vport);
15911595
if (err) {
15921596
dev_err(&pdev->dev, "failed to get required descriptor ids\n");
1593-
goto cfg_netdev_err;
1597+
goto unwind_vports;
15941598
}
15951599

15961600
if (idpf_cfg_netdev(vport))
1597-
goto cfg_netdev_err;
1598-
1599-
err = idpf_send_get_rx_ptype_msg(vport);
1600-
if (err)
1601-
goto handle_err;
1601+
goto unwind_vports;
16021602

16031603
/* Once state is put into DOWN, driver is ready for dev_open */
16041604
np = netdev_priv(vport->netdev);
@@ -1645,11 +1645,6 @@ void idpf_init_task(struct work_struct *work)
16451645

16461646
return;
16471647

1648-
handle_err:
1649-
idpf_decfg_netdev(vport);
1650-
cfg_netdev_err:
1651-
idpf_vport_rel(vport);
1652-
adapter->vports[index] = NULL;
16531648
unwind_vports:
16541649
if (default_vport) {
16551650
for (index = 0; index < adapter->max_vports; index++) {

0 commit comments

Comments
 (0)