Skip to content

Commit c926252

Browse files
Subbaraya Sundeepdavem330
authored andcommitted
octeontx2-pf: Disable packet I/O for graceful exit
At the stage of enabling packet I/O in otx2_open, If mailbox timeout occurs then interface ends up in down state where as hardware packet I/O is enabled. Hence disable packet I/O also before bailing out. Fixes: 1ea0166 ("octeontx2-pf: Fix the device state on error") Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com> Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com> Signed-off-by: Sai Krishna <saikrishnag@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5eb1b72 commit c926252

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

  • drivers/net/ethernet/marvell/octeontx2/nic

drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1835,13 +1835,22 @@ int otx2_open(struct net_device *netdev)
18351835
otx2_dmacflt_reinstall_flows(pf);
18361836

18371837
err = otx2_rxtx_enable(pf, true);
1838-
if (err)
1838+
/* If a mbox communication error happens at this point then interface
1839+
* will end up in a state such that it is in down state but hardware
1840+
* mcam entries are enabled to receive the packets. Hence disable the
1841+
* packet I/O.
1842+
*/
1843+
if (err == EIO)
1844+
goto err_disable_rxtx;
1845+
else if (err)
18391846
goto err_tx_stop_queues;
18401847

18411848
otx2_do_set_rx_mode(pf);
18421849

18431850
return 0;
18441851

1852+
err_disable_rxtx:
1853+
otx2_rxtx_enable(pf, false);
18451854
err_tx_stop_queues:
18461855
netif_tx_stop_all_queues(netdev);
18471856
netif_carrier_off(netdev);

0 commit comments

Comments
 (0)