Module Name: src Committed By: jakllsch Date: Thu Sep 1 14:46:23 UTC 2011
Modified Files: src/sys/dev/marvell: if_mvgbe.c Log Message: We occasionally will try to set up the multicast filter in a context that kmem(9) is unusable (such as transmit timeout). Thus, put the filter table on the stack instead, all 528 bytes of it. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/dev/marvell/if_mvgbe.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/marvell/if_mvgbe.c diff -u src/sys/dev/marvell/if_mvgbe.c:1.11 src/sys/dev/marvell/if_mvgbe.c:1.12 --- src/sys/dev/marvell/if_mvgbe.c:1.11 Thu Sep 1 14:39:03 2011 +++ src/sys/dev/marvell/if_mvgbe.c Thu Sep 1 14:46:23 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: if_mvgbe.c,v 1.11 2011/09/01 14:39:03 jakllsch Exp $ */ +/* $NetBSD: if_mvgbe.c,v 1.12 2011/09/01 14:46:23 jakllsch Exp $ */ /* * Copyright (c) 2007, 2008 KIYOHARA Takashi * All rights reserved. @@ -25,7 +25,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.11 2011/09/01 14:39:03 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.12 2011/09/01 14:46:23 jakllsch Exp $"); #include "rnd.h" @@ -1842,14 +1842,14 @@ struct ifnet *ifp= &sc->sc_ethercom.ec_if; struct ether_multi *enm; struct ether_multistep step; - uint32_t *dfut, *dfsmt, *dfomt; + uint32_t dfut[MVGBE_NDFUT], dfsmt[MVGBE_NDFSMT], dfomt[MVGBE_NDFOMT]; uint32_t pxc; int i; const uint8_t special[ETHER_ADDR_LEN] = {0x01,0x00,0x5e,0x00,0x00,0x00}; - dfut = kmem_zalloc(sizeof(*dfut) * MVGBE_NDFUT, KM_SLEEP); - dfsmt = kmem_zalloc(sizeof(*dfsmt) * MVGBE_NDFSMT, KM_SLEEP); - dfomt = kmem_zalloc(sizeof(*dfomt) * MVGBE_NDFOMT, KM_SLEEP); + memset(dfut, 0, sizeof(dfut)); + memset(dfsmt, 0, sizeof(dfsmt)); + memset(dfomt, 0, sizeof(dfomt)); if (ifp->if_flags & (IFF_ALLMULTI|IFF_PROMISC)) { goto allmulti; @@ -1907,10 +1907,6 @@ /* Set Destination Address Filter Multicast Tables */ MVGBE_WRITE_FILTER(sc, MVGBE_DFSMT, dfsmt, MVGBE_NDFSMT); MVGBE_WRITE_FILTER(sc, MVGBE_DFOMT, dfomt, MVGBE_NDFOMT); - - kmem_free(dfut, sizeof(dfut[0]) * MVGBE_NDFUT); - kmem_free(dfsmt, sizeof(dfsmt[0]) * MVGBE_NDFSMT); - kmem_free(dfomt, sizeof(dfsmt[0]) * MVGBE_NDFOMT); } #ifdef MVGBE_DEBUG