提交 27392e57 编写于 作者: P Paweł Jabłoński 提交者: Jeff Kirsher

i40evf: Fix a hardware reset support in VF driver

This patch fixes a hardware reset support in VF driver.
It is needed because when a hardware reset is detected
adapter->state is in __I40EVF_RESETTING state before
i40evf_reset_task is called. Without this patch
unloading VF driver after a hardware reset ends
with a system crash.
Signed-off-by: NPaweł Jabłoński <pawel.jablonski@intel.com>
Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 c79756cb
...@@ -2840,6 +2840,23 @@ static int i40e_vlan_rx_add_vid(struct net_device *netdev, ...@@ -2840,6 +2840,23 @@ static int i40e_vlan_rx_add_vid(struct net_device *netdev,
return ret; return ret;
} }
/**
* i40e_vlan_rx_add_vid_up - Add a vlan id filter to HW offload in UP path
* @netdev: network interface to be adjusted
* @proto: unused protocol value
* @vid: vlan id to be added
**/
static void i40e_vlan_rx_add_vid_up(struct net_device *netdev,
__always_unused __be16 proto, u16 vid)
{
struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_vsi *vsi = np->vsi;
if (vid >= VLAN_N_VID)
return;
set_bit(vid, vsi->active_vlans);
}
/** /**
* i40e_vlan_rx_kill_vid - Remove a vlan id filter from HW offload * i40e_vlan_rx_kill_vid - Remove a vlan id filter from HW offload
* @netdev: network interface to be adjusted * @netdev: network interface to be adjusted
...@@ -2882,8 +2899,8 @@ static void i40e_restore_vlan(struct i40e_vsi *vsi) ...@@ -2882,8 +2899,8 @@ static void i40e_restore_vlan(struct i40e_vsi *vsi)
i40e_vlan_stripping_disable(vsi); i40e_vlan_stripping_disable(vsi);
for_each_set_bit(vid, vsi->active_vlans, VLAN_N_VID) for_each_set_bit(vid, vsi->active_vlans, VLAN_N_VID)
i40e_vlan_rx_add_vid(vsi->netdev, htons(ETH_P_8021Q), i40e_vlan_rx_add_vid_up(vsi->netdev, htons(ETH_P_8021Q),
vid); vid);
} }
/** /**
......
...@@ -1925,7 +1925,8 @@ static void i40evf_reset_task(struct work_struct *work) ...@@ -1925,7 +1925,8 @@ static void i40evf_reset_task(struct work_struct *work)
* ndo_open() returning, so we can't assume it means all our open * ndo_open() returning, so we can't assume it means all our open
* tasks have finished, since we're not holding the rtnl_lock here. * tasks have finished, since we're not holding the rtnl_lock here.
*/ */
running = (adapter->state == __I40EVF_RUNNING); running = ((adapter->state == __I40EVF_RUNNING) ||
(adapter->state == __I40EVF_RESETTING));
if (running) { if (running) {
netif_carrier_off(netdev); netif_carrier_off(netdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册