aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Bruno <sbruno@FreeBSD.org>2016-07-07 03:39:18 +0000
committerSean Bruno <sbruno@FreeBSD.org>2016-07-07 03:39:18 +0000
commit761e52618557a81decca704074edcf3330da8359 (patch)
tree1ccf4588eb797c23b2e9dd19874d8016035d8493
parentae8420ed726fa03874c1042e701b3517105daa4a (diff)
downloadsrc-761e52618557a81decca704074edcf3330da8359.tar.gz
src-761e52618557a81decca704074edcf3330da8359.zip
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
Notes
Notes: svn path=/head/; revision=302384
-rw-r--r--sys/dev/e1000/if_em.c3
-rw-r--r--sys/dev/e1000/if_igb.c3
-rw-r--r--sys/dev/e1000/if_lem.c3
-rw-r--r--sys/dev/ixgb/if_ixgb.c3
-rw-r--r--sys/dev/ixgbe/if_ix.c3
-rw-r--r--sys/dev/ixgbe/if_ixv.c3
-rw-r--r--sys/dev/ixl/if_ixl.c3
-rw-r--r--sys/dev/ixl/if_ixlv.c3
8 files changed, 16 insertions, 8 deletions
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index 14f5463b2ab5..ddd651d82d18 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -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;
}
diff --git a/sys/dev/e1000/if_igb.c b/sys/dev/e1000/if_igb.c
index 83e1e83be395..ef5256fdf1a0 100644
--- a/sys/dev/e1000/if_igb.c
+++ b/sys/dev/e1000/if_igb.c
@@ -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;
}
diff --git a/sys/dev/e1000/if_lem.c b/sys/dev/e1000/if_lem.c
index 50b2cb0fad38..55b83109d160 100644
--- a/sys/dev/e1000/if_lem.c
+++ b/sys/dev/e1000/if_lem.c
@@ -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;
}
diff --git a/sys/dev/ixgb/if_ixgb.c b/sys/dev/ixgb/if_ixgb.c
index 4ef4929253bc..4db272c90f31 100644
--- a/sys/dev/ixgb/if_ixgb.c
+++ b/sys/dev/ixgb/if_ixgb.c
@@ -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;
diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c
index ddee69927a8a..cf2231dc8fc8 100644
--- a/sys/dev/ixgbe/if_ix.c
+++ b/sys/dev/ixgbe/if_ix.c
@@ -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
diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c
index 13c2bef873d2..80fb1b34be31 100644
--- a/sys/dev/ixgbe/if_ixv.c
+++ b/sys/dev/ixgbe/if_ixv.c
@@ -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;
diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c
index d759cfde1980..8e9ba80987ae 100644
--- a/sys/dev/ixl/if_ixl.c
+++ b/sys/dev/ixl/if_ixl.c
@@ -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;
diff --git a/sys/dev/ixl/if_ixlv.c b/sys/dev/ixl/if_ixlv.c
index 9e5242ce4774..9be8a36e8816 100644
--- a/sys/dev/ixl/if_ixlv.c
+++ b/sys/dev/ixl/if_ixlv.c
@@ -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;