Do not initialize the adapter on MTU change when adapter status is down.

This fixes long-standing problems when changing settings of the adapter.

Discussed in:
https://lists.freebsd.org/pipermail/freebsd-net/2016-June/045509.html

Submitted by:	arnaud.ysmal@stormshield.eu
Reviewed by:	erj@freebsd.org
Approved by:	re (gjb)
Differential Revision:	https://reviews.freebsd.org/D7030
This commit is contained in:
Sean Bruno 2016-07-07 03:39:18 +00:00
parent ae8420ed72
commit 761e526185
8 changed files with 16 additions and 8 deletions

View File

@ -1214,7 +1214,8 @@ em_ioctl(if_t ifp, u_long command, caddr_t data)
if_setmtu(ifp, ifr->ifr_mtu);
adapter->hw.mac.max_frame_size =
if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN;
em_init_locked(adapter);
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
em_init_locked(adapter);
EM_CORE_UNLOCK(adapter);
break;
}

View File

@ -1106,7 +1106,8 @@ igb_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
igb_init_locked(adapter);
if ((ifp->if_drv_flags & IFF_DRV_RUNNING))
igb_init_locked(adapter);
IGB_CORE_UNLOCK(adapter);
break;
}

View File

@ -1053,7 +1053,8 @@ lem_ioctl(if_t ifp, u_long command, caddr_t data)
if_setmtu(ifp, ifr->ifr_mtu);
adapter->max_frame_size =
if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN;
lem_init_locked(adapter);
if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING))
lem_init_locked(adapter);
EM_CORE_UNLOCK(adapter);
break;
}

View File

@ -539,7 +539,8 @@ ixgb_ioctl(struct ifnet * ifp, IOCTL_CMD_TYPE command, caddr_t data)
adapter->hw.max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
ixgb_init_locked(adapter);
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
ixgb_init_locked(adapter);
IXGB_UNLOCK(adapter);
}
break;

View File

@ -893,7 +893,8 @@ ixgbe_ioctl(struct ifnet * ifp, u_long command, caddr_t data)
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =
ifp->if_mtu + IXGBE_MTU_HDR;
ixgbe_init_locked(adapter);
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
ixgbe_init_locked(adapter);
#ifdef PCI_IOV
ixgbe_recalculate_max_frame(adapter);
#endif

View File

@ -578,7 +578,8 @@ ixv_ioctl(struct ifnet * ifp, u_long command, caddr_t data)
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =
ifp->if_mtu + IXGBE_MTU_HDR;
ixv_init_locked(adapter);
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
ixv_init_locked(adapter);
IXGBE_CORE_UNLOCK(adapter);
}
break;

View File

@ -980,7 +980,8 @@ ixl_ioctl(struct ifnet * ifp, u_long command, caddr_t data)
vsi->max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN
+ ETHER_VLAN_ENCAP_LEN;
ixl_init_locked(pf);
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
ixl_init_locked(pf);
IXL_PF_UNLOCK(pf);
}
break;

View File

@ -676,7 +676,8 @@ ixlv_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
vsi->max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN
+ ETHER_VLAN_ENCAP_LEN;
ixlv_init_locked(sc);
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
ixlv_init_locked(sc);
}
mtx_unlock(&sc->mtx);
break;