提交 b5ca88eb 编写于 作者: J Jesse Brandeburg 提交者: Jeff Garzik

ixgb: fix race on rx_buffer_len in mtu change

some random coverage testing found that when changing mtu
under heavy traffic load, NAPI would use the rx_buffer_len variable
after it had been changed by change_mtu.

Similar to e1000 bugs found long ago.
Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
上级 34336635
......@@ -1573,14 +1573,18 @@ ixgb_change_mtu(struct net_device *netdev, int new_mtu)
return -EINVAL;
}
if (old_max_frame == max_frame)
return 0;
if (netif_running(netdev))
ixgb_down(adapter, true);
adapter->rx_buffer_len = max_frame + 8; /* + 8 for errata */
netdev->mtu = new_mtu;
if ((old_max_frame != max_frame) && netif_running(netdev)) {
ixgb_down(adapter, true);
if (netif_running(netdev))
ixgb_up(adapter);
}
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册