On Tue, Aug 26, 2014 at 09:11:14PM -0400, Brad Smith wrote:
> On 20/08/14 8:03 PM, David Gwynne wrote:
> >sthen@ says this is likely a bit optimistic. while most of our drivers
> >unconditionally configure their max mru, there's some stupid ones that still
> >interpret the configured mtu as a what the mru should be.
> >
> >dlg
>
> oce(4) and ix(4) need to be fixed.
this might fix ix(4). anyone able to test?
Index: if_ix.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_ix.c,v
retrieving revision 1.99
diff -u -p -r1.99 if_ix.c
--- if_ix.c 26 Aug 2014 11:01:22 -0000 1.99
+++ if_ix.c 27 Aug 2014 11:16:53 -0000
@@ -441,18 +441,6 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c
#endif
break;
- case SIOCSIFMTU:
- IOCTL_DEBUGOUT("ioctl: SIOCSIFMTU (Set Interface MTU)");
- if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ifp->if_hardmtu)
- error = EINVAL;
- else if (ifp->if_mtu != ifr->ifr_mtu) {
- ifp->if_mtu = ifr->ifr_mtu;
- sc->max_frame_size =
- ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
- ixgbe_init(sc);
- }
- break;
-
case SIOCSIFFLAGS:
IOCTL_DEBUGOUT("ioctl: SIOCSIFFLAGS (Set Interface Flags)");
if (ifp->if_flags & IFF_UP) {
@@ -690,7 +678,7 @@ ixgbe_init(void *arg)
IXGBE_WRITE_REG(&sc->hw, IXGBE_GPIE, gpie);
/* Set MTU size */
- if (ifp->if_mtu > ETHERMTU) {
+ if (ifp->if_hardmtu > ETHERMTU) {
mhadd = IXGBE_READ_REG(&sc->hw, IXGBE_MHADD);
mhadd &= ~IXGBE_MHADD_MFS_MASK;
mhadd |= sc->max_frame_size << IXGBE_MHADD_MFS_SHIFT;
@@ -1596,7 +1584,7 @@ ixgbe_setup_interface(struct ix_softc *s
ether_ifattach(ifp);
sc->max_frame_size =
- ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
+ ifp->if_hardmtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
}
void
@@ -2680,7 +2668,7 @@ ixgbe_initialize_receive_units(struct ix
/* Set for Jumbo Frames? */
hlreg = IXGBE_READ_REG(&sc->hw, IXGBE_HLREG0);
- if (ifp->if_mtu > ETHERMTU)
+ if (ifp->if_hardmtu > ETHERMTU)
hlreg |= IXGBE_HLREG0_JUMBOEN;
else
hlreg &= ~IXGBE_HLREG0_JUMBOEN;