Commit 545fa3fb authored by Gatis Peisenieks's avatar Gatis Peisenieks Committed by David S. Miller
Browse files

atl1c: adjust max mtu according to Mikrotik 10/25G NIC ability



The new Mikrotik 10/25G NIC supports jumbo frames. Jumbo frames are
supported for TSO as well.

This enables the support for mtu up to 9500 bytes.

Signed-off-by: default avatarGatis Peisenieks <gatis@mikrotik.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d7ab6419
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -478,6 +478,9 @@ static void atl1c_set_rxbufsize(struct atl1c_adapter *adapter,
static netdev_features_t atl1c_fix_features(struct net_device *netdev,
	netdev_features_t features)
{
	struct atl1c_adapter *adapter = netdev_priv(netdev);
	struct atl1c_hw *hw = &adapter->hw;

	/*
	 * Since there is no support for separate rx/tx vlan accel
	 * enable/disable make sure tx flag is always in same state as rx.
@@ -487,8 +490,10 @@ static netdev_features_t atl1c_fix_features(struct net_device *netdev,
	else
		features &= ~NETIF_F_HW_VLAN_CTAG_TX;

	if (hw->nic_type != athr_mt) {
		if (netdev->mtu > MAX_TSO_FRAME_SIZE)
			features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
	}

	return features;
}
@@ -517,6 +522,9 @@ static void atl1c_set_max_mtu(struct net_device *netdev)
		netdev->max_mtu = MAX_JUMBO_FRAME_SIZE -
			(ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN);
		break;
	case athr_mt:
		netdev->max_mtu = 9500;
		break;
		/* The 10/100 devices don't support jumbo packets, max_mtu 1500 */
	default:
		netdev->max_mtu = ETH_DATA_LEN;