svn commit: r302384 - in head/sys/dev: e1000 ixgb ixgbe ixl
Sean Bruno
sbruno at FreeBSD.org
Thu Jul 7 03:39:20 UTC 2016
Author: sbruno
Date: Thu Jul 7 03:39:18 2016
New Revision: 302384
URL: https://svnweb.freebsd.org/changeset/base/302384
Log:
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 at stormshield.eu
Reviewed by: erj at freebsd.org
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7030
Modified:
head/sys/dev/e1000/if_em.c
head/sys/dev/e1000/if_igb.c
head/sys/dev/e1000/if_lem.c
head/sys/dev/ixgb/if_ixgb.c
head/sys/dev/ixgbe/if_ix.c
head/sys/dev/ixgbe/if_ixv.c
head/sys/dev/ixl/if_ixl.c
head/sys/dev/ixl/if_ixlv.c
Modified: head/sys/dev/e1000/if_em.c
==============================================================================
--- head/sys/dev/e1000/if_em.c Thu Jul 7 02:23:52 2016 (r302383)
+++ head/sys/dev/e1000/if_em.c Thu Jul 7 03:39:18 2016 (r302384)
@@ -1214,7 +1214,8 @@ em_ioctl(if_t ifp, u_long command, caddr
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;
}
Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c Thu Jul 7 02:23:52 2016 (r302383)
+++ head/sys/dev/e1000/if_igb.c Thu Jul 7 03:39:18 2016 (r302384)
@@ -1106,7 +1106,8 @@ igb_ioctl(struct ifnet *ifp, u_long comm
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;
}
Modified: head/sys/dev/e1000/if_lem.c
==============================================================================
--- head/sys/dev/e1000/if_lem.c Thu Jul 7 02:23:52 2016 (r302383)
+++ head/sys/dev/e1000/if_lem.c Thu Jul 7 03:39:18 2016 (r302384)
@@ -1053,7 +1053,8 @@ lem_ioctl(if_t ifp, u_long command, cadd
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;
}
Modified: head/sys/dev/ixgb/if_ixgb.c
==============================================================================
--- head/sys/dev/ixgb/if_ixgb.c Thu Jul 7 02:23:52 2016 (r302383)
+++ head/sys/dev/ixgb/if_ixgb.c Thu Jul 7 03:39:18 2016 (r302384)
@@ -539,7 +539,8 @@ ixgb_ioctl(struct ifnet * ifp, IOCTL_CMD
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;
Modified: head/sys/dev/ixgbe/if_ix.c
==============================================================================
--- head/sys/dev/ixgbe/if_ix.c Thu Jul 7 02:23:52 2016 (r302383)
+++ head/sys/dev/ixgbe/if_ix.c Thu Jul 7 03:39:18 2016 (r302384)
@@ -893,7 +893,8 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c
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
Modified: head/sys/dev/ixgbe/if_ixv.c
==============================================================================
--- head/sys/dev/ixgbe/if_ixv.c Thu Jul 7 02:23:52 2016 (r302383)
+++ head/sys/dev/ixgbe/if_ixv.c Thu Jul 7 03:39:18 2016 (r302384)
@@ -578,7 +578,8 @@ ixv_ioctl(struct ifnet * ifp, u_long com
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;
Modified: head/sys/dev/ixl/if_ixl.c
==============================================================================
--- head/sys/dev/ixl/if_ixl.c Thu Jul 7 02:23:52 2016 (r302383)
+++ head/sys/dev/ixl/if_ixl.c Thu Jul 7 03:39:18 2016 (r302384)
@@ -980,7 +980,8 @@ ixl_ioctl(struct ifnet * ifp, u_long com
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;
Modified: head/sys/dev/ixl/if_ixlv.c
==============================================================================
--- head/sys/dev/ixl/if_ixlv.c Thu Jul 7 02:23:52 2016 (r302383)
+++ head/sys/dev/ixl/if_ixlv.c Thu Jul 7 03:39:18 2016 (r302384)
@@ -676,7 +676,8 @@ ixlv_ioctl(struct ifnet *ifp, u_long com
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;
More information about the svn-src-head
mailing list