ethernet/broadcom: use core min/max MTU checking
tg3: min_mtu 60, max_mtu 9000/1500 bnxt: min_mtu 60, max_mtu 9000 bnx2x: min_mtu 46, max_mtu 9600 - Fix up ETH_OVREHEAD -> ETH_OVERHEAD while we're in here, remove duplicated defines from bnx2x_link.c. bnx2: min_mtu 46, max_mtu 9000 - Use more standard ETH_* defines while we're at it. bcm63xx_enet: min_mtu 46, max_mtu 2028 - compute_hw_mtu was made largely pointless, and thus merged back into bcm_enet_change_mtu. b44: min_mtu 60, max_mtu 1500 CC: netdev@vger.kernel.org CC: Michael Chan <michael.chan@broadcom.com> CC: Sony Chacko <sony.chacko@qlogic.com> CC: Ariel Elior <ariel.elior@qlogic.com> CC: Dept-HSGLinuxNICDev@qlogic.com CC: Siva Reddy Kallam <siva.kallam@broadcom.com> CC: Prashant Sreedharan <prashant@broadcom.com> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
67bef94280
commit
e1c6dccaf3
@@ -124,7 +124,7 @@ static inline void _tg3_flag_clear(enum TG3_FLAGS flag, unsigned long *bits)
|
||||
#define TG3_TX_TIMEOUT (5 * HZ)
|
||||
|
||||
/* hardware minimum and maximum for a single frame's data payload */
|
||||
#define TG3_MIN_MTU 60
|
||||
#define TG3_MIN_MTU ETH_ZLEN
|
||||
#define TG3_MAX_MTU(tp) \
|
||||
(tg3_flag(tp, JUMBO_CAPABLE) ? 9000 : 1500)
|
||||
|
||||
@@ -14199,9 +14199,6 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu)
|
||||
int err;
|
||||
bool reset_phy = false;
|
||||
|
||||
if (new_mtu < TG3_MIN_MTU || new_mtu > TG3_MAX_MTU(tp))
|
||||
return -EINVAL;
|
||||
|
||||
if (!netif_running(dev)) {
|
||||
/* We'll just catch it later when the
|
||||
* device is up'd.
|
||||
@@ -17799,6 +17796,10 @@ static int tg3_init_one(struct pci_dev *pdev,
|
||||
dev->hw_features |= features;
|
||||
dev->priv_flags |= IFF_UNICAST_FLT;
|
||||
|
||||
/* MTU range: 60 - 9000 or 1500, depending on hardware */
|
||||
dev->min_mtu = TG3_MIN_MTU;
|
||||
dev->max_mtu = TG3_MAX_MTU(tp);
|
||||
|
||||
if (tg3_chip_rev_id(tp) == CHIPREV_ID_5705_A1 &&
|
||||
!tg3_flag(tp, TSO_CAPABLE) &&
|
||||
!(tr32(TG3PCI_PCISTATE) & PCISTATE_BUS_SPEED_HIGH)) {
|
||||
|
Reference in New Issue
Block a user