summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-10-08 17:58:07 +0000
committeryongari <yongari@FreeBSD.org>2010-10-08 17:58:07 +0000
commitdceae25ac899ffb89c1b6e570d9f29541e41c60b (patch)
tree8d9b5baca9d602a20e9a396037f3fb5b55be1a34
parentb0968fd172a1b54d09600cd9ab5c96fb2cded95f (diff)
downloadFreeBSD-src-dceae25ac899ffb89c1b6e570d9f29541e41c60b.zip
FreeBSD-src-dceae25ac899ffb89c1b6e570d9f29541e41c60b.tar.gz
Do not blindly UP the interface when interface's MTU is changed. If
driver is not running there is no need to up the interface. While I'm here hold driver lock before modifying MTU as it is referenced in RX handler.
-rw-r--r--sys/dev/bge/if_bge.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index 9b2bdac..b381c09 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -4631,6 +4631,7 @@ bge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
switch (command) {
case SIOCSIFMTU:
+ BGE_LOCK(sc);
if (ifr->ifr_mtu < ETHERMIN ||
((BGE_IS_JUMBO_CAPABLE(sc)) &&
ifr->ifr_mtu > BGE_JUMBO_MTU) ||
@@ -4639,9 +4640,12 @@ bge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = EINVAL;
else if (ifp->if_mtu != ifr->ifr_mtu) {
ifp->if_mtu = ifr->ifr_mtu;
- ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
- bge_init(sc);
+ if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+ bge_init_locked(sc);
+ }
}
+ BGE_UNLOCK(sc);
break;
case SIOCSIFFLAGS:
BGE_LOCK(sc);
OpenPOWER on IntegriCloud