[pf4freebsd] de driver

Dennis Berger db at nipsi.de
Wed Sep 15 21:08:30 PDT 2004


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 at BSDsystems.de

spamtrap/trapuser at nipsi.de

-------------- next part --------------
--- 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)


More information about the freebsd-pf mailing list