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

ixgb: leave room for extra hardware memory usage

ixgb hardware (not ixgbe) has a problem where it might dma past the
end of a buffer in certain cases.  leave 8 bytes extra room.
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>
上级 4360386f
...@@ -560,7 +560,7 @@ ixgb_sw_init(struct ixgb_adapter *adapter) ...@@ -560,7 +560,7 @@ ixgb_sw_init(struct ixgb_adapter *adapter)
hw->subsystem_id = pdev->subsystem_device; hw->subsystem_id = pdev->subsystem_device;
hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH;
adapter->rx_buffer_len = hw->max_frame_size; adapter->rx_buffer_len = hw->max_frame_size + 8; /* + 8 for errata */
if((hw->device_id == IXGB_DEVICE_ID_82597EX) if((hw->device_id == IXGB_DEVICE_ID_82597EX)
|| (hw->device_id == IXGB_DEVICE_ID_82597EX_CX4) || (hw->device_id == IXGB_DEVICE_ID_82597EX_CX4)
...@@ -1573,7 +1573,7 @@ ixgb_change_mtu(struct net_device *netdev, int new_mtu) ...@@ -1573,7 +1573,7 @@ ixgb_change_mtu(struct net_device *netdev, int new_mtu)
return -EINVAL; return -EINVAL;
} }
adapter->rx_buffer_len = max_frame; adapter->rx_buffer_len = max_frame + 8; /* + 8 for errata */
netdev->mtu = new_mtu; netdev->mtu = new_mtu;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册