ethernet/realtek: use core min/max MTU checking

8139cp: min_mtu 60, max_mtu 4096

8139too: min_mtu 68, max_mtu 1770

r8169: min_mtu 60, max_mtu depends on chipset, 1500 to 9k-ish

CC: netdev@vger.kernel.org
CC: Realtek linux nic maintainers <nic_swsd@realtek.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jarod Wilson
2016-10-17 15:54:09 -04:00
committed by David S. Miller
parent caff2a87f6
commit c7315a95c2
3 changed files with 12 additions and 17 deletions

View File

@@ -6673,10 +6673,6 @@ static int rtl8169_change_mtu(struct net_device *dev, int new_mtu)
{
struct rtl8169_private *tp = netdev_priv(dev);
if (new_mtu < ETH_ZLEN ||
new_mtu > rtl_chip_infos[tp->mac_version].jumbo_max)
return -EINVAL;
if (new_mtu > ETH_DATA_LEN)
rtl_hw_jumbo_enable(tp);
else
@@ -8430,6 +8426,10 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
dev->hw_features |= NETIF_F_RXALL;
dev->hw_features |= NETIF_F_RXFCS;
/* MTU range: 60 - hw-specific max */
dev->min_mtu = ETH_ZLEN;
dev->max_mtu = rtl_chip_infos[chipset].jumbo_max;
tp->hw_start = cfg->hw_start;
tp->event_slow = cfg->event_slow;