diff options
author | Jarod Wilson <jarod@redhat.com> | 2016-10-17 15:54:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-18 11:34:18 -0400 |
commit | 67bef942801842ce7486a23dd3940e320f217319 (patch) | |
tree | 72f6631b36ce03e0a8ea2671f511a3181ca22e3a /drivers/net/ethernet/atheros/alx | |
parent | 60d2d8dd9e1a2580541a3d28eb90d092381e2153 (diff) | |
download | op-kernel-dev-67bef942801842ce7486a23dd3940e320f217319.zip op-kernel-dev-67bef942801842ce7486a23dd3940e320f217319.tar.gz |
ethernet/atheros: use core min/max MTU checking
atl2: min_mtu 40, max_mtu 1504
- Remove a few redundant defines that already have equivalents in
if_ether.h.
atl1: min_mtu 42, max_mtu 10218
atl1e: min_mtu 42, max_mtu 8170
atl1c: min_mtu 42, max_mtu 6122/1500
- GbE hardware gets a max_mtu of 6122, slower hardware gets 1500.
alx: min_mtu 34, max_mtu 9256
- Not so sure that minimum MTU number is really what was intended, but
that's what the math actually makes it out to be, due to max_frame
manipulations and comparison in alx_change_mtu, rather than just
comparing new_mtu. (I think 68 was the intended min_mtu value).
CC: netdev@vger.kernel.org
CC: Jay Cliburn <jcliburn@gmail.com>
CC: Chris Snook <chris.snook@gmail.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/atheros/alx')
-rw-r--r-- | drivers/net/ethernet/atheros/alx/hw.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/atheros/alx/main.c | 10 |
2 files changed, 3 insertions, 8 deletions
diff --git a/drivers/net/ethernet/atheros/alx/hw.h b/drivers/net/ethernet/atheros/alx/hw.h index 0191477..e42d7e0 100644 --- a/drivers/net/ethernet/atheros/alx/hw.h +++ b/drivers/net/ethernet/atheros/alx/hw.h @@ -351,7 +351,6 @@ struct alx_rrd { #define ALX_MAX_JUMBO_PKT_SIZE (9*1024) #define ALX_MAX_TSO_PKT_SIZE (7*1024) #define ALX_MAX_FRAME_SIZE ALX_MAX_JUMBO_PKT_SIZE -#define ALX_MIN_FRAME_SIZE (ETH_ZLEN + ETH_FCS_LEN + VLAN_HLEN) #define ALX_MAX_RX_QUEUES 8 #define ALX_MAX_TX_QUEUES 4 diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c index c0f84b7..eccbacd 100644 --- a/drivers/net/ethernet/atheros/alx/main.c +++ b/drivers/net/ethernet/atheros/alx/main.c @@ -892,6 +892,9 @@ static int alx_init_sw(struct alx_priv *alx) hw->smb_timer = 400; hw->mtu = alx->dev->mtu; alx->rxbuf_size = ALX_MAX_FRAME_LEN(hw->mtu); + /* MTU range: 34 - 9256 */ + alx->dev->min_mtu = 34; + alx->dev->max_mtu = ALX_MAX_FRAME_LEN(ALX_MAX_FRAME_SIZE); alx->tx_ringsz = 256; alx->rx_ringsz = 512; hw->imt = 200; @@ -994,13 +997,6 @@ static int alx_change_mtu(struct net_device *netdev, int mtu) struct alx_priv *alx = netdev_priv(netdev); int max_frame = ALX_MAX_FRAME_LEN(mtu); - if ((max_frame < ALX_MIN_FRAME_SIZE) || - (max_frame > ALX_MAX_FRAME_SIZE)) - return -EINVAL; - - if (netdev->mtu == mtu) - return 0; - netdev->mtu = mtu; alx->hw.mtu = mtu; alx->rxbuf_size = max(max_frame, ALX_DEF_RXBUF_SIZE); |