Message ID | 20171026234636.GA18898@felix-thinkpad.cavium.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
Series | [net-next] liquidio: fix kernel panic in VF driver | expand |
From: Felix Manlunas <felix.manlunas@cavium.com> Date: Thu, 26 Oct 2017 16:46:36 -0700 > Doing ifconfig down on VF driver in the middle of receiving line rate > traffic causes a kernel panic: ... > Reason is: in the function assigned to net_device_ops->ndo_stop, the steps > for bringing down the interface are done in the wrong order. The step that > notifies the NIC firmware to stop forwarding packets to host is done too > late. Fix it by moving that step to the beginning. > > Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com> > Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com> Applied, thanks.
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c index 4c3b568..ed1f073 100644 --- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c @@ -1288,6 +1288,9 @@ static int liquidio_stop(struct net_device *netdev) struct octeon_device *oct = lio->oct_dev; struct napi_struct *napi, *n; + /* tell Octeon to stop forwarding packets to host */ + send_rx_ctrl_cmd(lio, 0); + if (oct->props[lio->ifidx].napi_enabled) { list_for_each_entry_safe(napi, n, &netdev->napi_list, dev_list) napi_disable(napi); @@ -1305,9 +1308,6 @@ static int liquidio_stop(struct net_device *netdev) netif_carrier_off(netdev); lio->link_changes++; - /* tell Octeon to stop forwarding packets to host */ - send_rx_ctrl_cmd(lio, 0); - ifstate_reset(lio, LIO_IFSTATE_RUNNING); txqs_stop(netdev);