Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/marvell We occasionally will try to set up the multi...



details:   https://anonhg.NetBSD.org/src/rev/a7220c4cbe48
branches:  trunk
changeset: 769155:a7220c4cbe48
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Thu Sep 01 14:46:23 2011 +0000

description:
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.

diffstat:

 sys/dev/marvell/if_mvgbe.c |  16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diffs (48 lines):

diff -r b3e6c433054a -r a7220c4cbe48 sys/dev/marvell/if_mvgbe.c
--- a/sys/dev/marvell/if_mvgbe.c        Thu Sep 01 14:39:03 2011 +0000
+++ b/sys/dev/marvell/if_mvgbe.c        Thu Sep 01 14:46:23 2011 +0000
@@ -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



Home | Main Index | Thread Index | Old Index