svn commit: r207884 - stable/8/sys/dev/msk
Pyun YongHyeon
yongari at FreeBSD.org
Mon May 10 20:01:52 UTC 2010
Author: yongari
Date: Mon May 10 20:01:51 2010
New Revision: 207884
URL: http://svn.freebsd.org/changeset/base/207884
Log:
MFC r207622-207623,207638
r207622:
Drop driver lock before exiting from interrupt handler.
r207623:
Make sure to check whether driver is running before processing
received frames. Also check driver has valid ifp pointer before
calling msk_stop() in device_shutdown handler. While I'm here
remove unnecessary accesses to interrupt mask registers in
device_shutdown handler because driver puts the controller into
reset state.
With these changes, msk(4) now survive from heavy RX traffic(1byte
UDP frame) while reboot is in progress.
r207638:
When VLAN hardware tagging is disabled, make sure to disable VLAN
checksum offloading as well as TSO over VLAN.
Modified:
stable/8/sys/dev/msk/if_msk.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
stable/8/sys/dev/xen/xenpci/ (props changed)
stable/8/sys/geom/sched/ (props changed)
Modified: stable/8/sys/dev/msk/if_msk.c
==============================================================================
--- stable/8/sys/dev/msk/if_msk.c Mon May 10 20:00:50 2010 (r207883)
+++ stable/8/sys/dev/msk/if_msk.c Mon May 10 20:01:51 2010 (r207884)
@@ -1017,7 +1017,8 @@ msk_ioctl(struct ifnet *ifp, u_long comm
(IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) {
ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING;
if ((IFCAP_VLAN_HWTAGGING & ifp->if_capenable) == 0)
- ifp->if_capenable &= ~IFCAP_VLAN_HWTSO;
+ ifp->if_capenable &=
+ ~(IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM);
msk_setvlan(sc_if, ifp);
}
if (ifp->if_mtu > ETHERMTU &&
@@ -2828,20 +2829,15 @@ mskc_shutdown(device_t dev)
sc = device_get_softc(dev);
MSK_LOCK(sc);
for (i = 0; i < sc->msk_num_port; i++) {
- if (sc->msk_if[i] != NULL)
+ if (sc->msk_if[i] != NULL && sc->msk_if[i]->msk_ifp != NULL &&
+ ((sc->msk_if[i]->msk_ifp->if_drv_flags &
+ IFF_DRV_RUNNING) != 0))
msk_stop(sc->msk_if[i]);
}
-
- /* Disable all interrupts. */
- CSR_WRITE_4(sc, B0_IMSK, 0);
- CSR_READ_4(sc, B0_IMSK);
- CSR_WRITE_4(sc, B0_HWE_IMSK, 0);
- CSR_READ_4(sc, B0_HWE_IMSK);
+ MSK_UNLOCK(sc);
/* Put hardware reset. */
CSR_WRITE_2(sc, B0_CTST, CS_RST_SET);
-
- MSK_UNLOCK(sc);
return (0);
}
@@ -3376,6 +3372,8 @@ msk_handle_events(struct msk_softc *sc)
sc_if->msk_vtag = ntohs(len);
break;
case OP_RXSTAT:
+ if (!(sc_if->msk_ifp->if_drv_flags & IFF_DRV_RUNNING))
+ break;
if (sc_if->msk_framesize >
(MCLBYTES - MSK_RX_BUF_ALIGN))
msk_jumbo_rxeof(sc_if, status, control, len);
@@ -3445,6 +3443,7 @@ msk_intr(void *xsc)
(sc->msk_pflags & MSK_FLAG_SUSPEND) != 0 ||
(status & sc->msk_intrmask) == 0) {
CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2);
+ MSK_UNLOCK(sc);
return;
}
More information about the svn-src-all
mailing list