Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Sep 2004 04:08:30 -0000
From:      Dennis Berger <db@nipsi.de>
To:        pf4freebsd@freelists.org, Max Laier <max@love2party.net>
Subject:   [pf4freebsd] de driver
Message-ID:  <40DED5A1.8070507@nipsi.de>

next in thread | raw e-mail | index | archive | help
This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_nipsi.home.net-46973-1088345529-0001-2
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I've tested the de driver, it paniced immediately after enabling pf and 
starting nertperf.
I created a diff to the original driver and attach it.
this one works well.
greets,
-db

--------------PATCH-------------
--- if_de.c.orig        Sat Jun 19 04:50:16 2004
+++ if_de.c     Sun Jun 27 15:56:16 2004
@@ -4619,15 +4619,17 @@
        if ((sc->tulip_flags & (TULIP_WANTSETUP|TULIP_TXPROBE_ACTIVE)) 
== TULIP_
WANTSETUP)
            tulip_txput_setup(sc);
 
-       while (sc->tulip_if.if_snd.ifq_head != NULL) {
+       while (!IFQ_DRV_IS_EMPTY(&sc->tulip_if.if_snd)) {
            struct mbuf *m;
-           IF_DEQUEUE(&sc->tulip_if.if_snd, m);
+           IFQ_DRV_DEQUEUE(&sc->tulip_if.if_snd, m);
+           if(m == NULL)
+               break;
            if ((m = tulip_txput(sc, m)) != NULL) {
-               IF_PREPEND(&sc->tulip_if.if_snd, m);
+               IFQ_DRV_PREPEND(&sc->tulip_if.if_snd, m);
                break;
            }
        }
-       if (sc->tulip_if.if_snd.ifq_head == NULL)
+       if (IFQ_DRV_IS_EMPTY(&sc->tulip_if.if_snd))
            sc->tulip_if.if_start = tulip_ifstart_one;
     }
 
@@ -4642,11 +4644,12 @@
     tulip_softc_t * const sc = (tulip_softc_t *)ifp->if_softc;
 
     if ((sc->tulip_if.if_flags & IFF_RUNNING)
-           && sc->tulip_if.if_snd.ifq_head != NULL) {
+           && !IFQ_DRV_IS_EMPTY(&sc->tulip_if.if_snd)) {
        struct mbuf *m;
-       IF_DEQUEUE(&sc->tulip_if.if_snd, m);
-       if ((m = tulip_txput(sc, m)) != NULL)
-           IF_PREPEND(&sc->tulip_if.if_snd, m);
+       IFQ_DRV_DEQUEUE(&sc->tulip_if.if_snd, m);
+       if(m == NULL);
+       else if((m = tulip_txput(sc, m)) != NULL)
+           IFQ_DRV_PREPEND(&sc->tulip_if.if_snd, m);
     }
     TULIP_PERFEND(ifstart_one);
 }
@@ -4788,7 +4791,9 @@
     tulip_reset(sc);
 
     ether_ifattach(&(sc)->tulip_if, sc->tulip_enaddr);
-    ifp->if_snd.ifq_maxlen = ifqmaxlen;
+    IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+    ifp->if_snd.ifq_drv_maxlen = ifqmaxlen;
+    IFQ_SET_READY(&ifp->if_snd);
 }
 

 #if defined(TULIP_BUS_DMA)


-------------END PATCH-----------

-- 
Dennis Berger
BSD Systems
Baumkamp 24
22299 Hamburg
work:+494054001817
  mobile:+401791231509
mail: db@BSDsystems.de

spamtrap/trapuser@nipsi.de


--=_nipsi.home.net-46973-1088345529-0001-2
Content-Type: text/plain; name=de-patch; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="de-patch"

--- if_de.c.orig	Sat Jun 19 04:50:16 2004
+++ if_de.c	Sun Jun 27 15:56:16 2004
@@ -4619,15 +4619,17 @@
 	if ((sc->tulip_flags & (TULIP_WANTSETUP|TULIP_TXPROBE_ACTIVE)) == TULIP_WANTSETUP)
 	    tulip_txput_setup(sc);
 
-	while (sc->tulip_if.if_snd.ifq_head != NULL) {
+	while (!IFQ_DRV_IS_EMPTY(&sc->tulip_if.if_snd)) {
 	    struct mbuf *m;
-	    IF_DEQUEUE(&sc->tulip_if.if_snd, m);
+	    IFQ_DRV_DEQUEUE(&sc->tulip_if.if_snd, m);
+	    if(m == NULL)
+		break;
 	    if ((m = tulip_txput(sc, m)) != NULL) {
-		IF_PREPEND(&sc->tulip_if.if_snd, m);
+		IFQ_DRV_PREPEND(&sc->tulip_if.if_snd, m);
 		break;
 	    }
 	}
-	if (sc->tulip_if.if_snd.ifq_head == NULL)
+	if (IFQ_DRV_IS_EMPTY(&sc->tulip_if.if_snd))
 	    sc->tulip_if.if_start = tulip_ifstart_one;
     }
 
@@ -4642,11 +4644,12 @@
     tulip_softc_t * const sc = (tulip_softc_t *)ifp->if_softc;
 
     if ((sc->tulip_if.if_flags & IFF_RUNNING)
-	    && sc->tulip_if.if_snd.ifq_head != NULL) {
+	    && !IFQ_DRV_IS_EMPTY(&sc->tulip_if.if_snd)) {
 	struct mbuf *m;
-	IF_DEQUEUE(&sc->tulip_if.if_snd, m);
-	if ((m = tulip_txput(sc, m)) != NULL)
-	    IF_PREPEND(&sc->tulip_if.if_snd, m);
+	IFQ_DRV_DEQUEUE(&sc->tulip_if.if_snd, m);
+	if(m == NULL);
+	else if((m = tulip_txput(sc, m)) != NULL)
+	    IFQ_DRV_PREPEND(&sc->tulip_if.if_snd, m);
     }
     TULIP_PERFEND(ifstart_one);
 }
@@ -4788,7 +4791,9 @@
     tulip_reset(sc);
 
     ether_ifattach(&(sc)->tulip_if, sc->tulip_enaddr);
-    ifp->if_snd.ifq_maxlen = ifqmaxlen;
+    IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+    ifp->if_snd.ifq_drv_maxlen = ifqmaxlen;
+    IFQ_SET_READY(&ifp->if_snd);
 }
 
 #if defined(TULIP_BUS_DMA)

--=_nipsi.home.net-46973-1088345529-0001-2--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40DED5A1.8070507>