fix to use only one soft intr for net thereby fixing bug in raw sockets
authorBill Joy <wnj@ucbvax.Berkeley.EDU>
Fri, 19 Mar 1982 17:49:13 +0000 (09:49 -0800)
committerBill Joy <wnj@ucbvax.Berkeley.EDU>
Fri, 19 Mar 1982 17:49:13 +0000 (09:49 -0800)
SCCS-vsn: sys/vax/if/if_dmc.c 4.6
SCCS-vsn: sys/vax/if/if_en.c 4.43
SCCS-vsn: sys/deprecated/netimp/if_imp.c 4.18
SCCS-vsn: sys/net/if_loop.c 4.7
SCCS-vsn: sys/netinet/in_systm.h 4.8
SCCS-vsn: sys/net/raw_usrreq.c 4.11

usr/src/sys/deprecated/netimp/if_imp.c
usr/src/sys/net/if_loop.c
usr/src/sys/net/raw_usrreq.c
usr/src/sys/netinet/in_systm.h
usr/src/sys/vax/if/if_dmc.c
usr/src/sys/vax/if/if_en.c

index 90700a2..59f5595 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_imp.c        4.17    82/03/19        */
+/*     if_imp.c        4.18    82/03/19        */
 
 #include "imp.h"
 #if NIMP > 0
 
 #include "imp.h"
 #if NIMP > 0
@@ -333,7 +333,7 @@ COUNT(IMPINPUT);
        case IMPLINK_IP:
                m->m_len -= sizeof(struct imp_leader);
                m->m_off += sizeof(struct imp_leader);
        case IMPLINK_IP:
                m->m_len -= sizeof(struct imp_leader);
                m->m_off += sizeof(struct imp_leader);
-               setipintr();
+               schednetisr(NETISR_IP);
                inq = &ipintrq;
                break;
 #endif
                inq = &ipintrq;
                break;
 #endif
index 633545d..ac8830e 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_loop.c       4.6     82/03/15        */
+/*     if_loop.c       4.7     82/03/19        */
 
 /*
  * Loopback interface driver for protocol testing and timing.
 
 /*
  * Loopback interface driver for protocol testing and timing.
@@ -54,7 +54,7 @@ looutput(ifp, m0, pf)
                        return (0);
                }
                IF_ENQUEUE(ifq, m0);
                        return (0);
                }
                IF_ENQUEUE(ifq, m0);
-               setipintr();
+               schednetisr(NETISR_IP);
                break;
 #endif
 
                break;
 #endif
 
index 6e08ffb..aee828e 100644 (file)
@@ -1,4 +1,4 @@
-/*     raw_usrreq.c    4.10    82/03/15        */
+/*     raw_usrreq.c    4.11    82/03/19        */
 
 #include "../h/param.h"
 #include "../h/mbuf.h"
 
 #include "../h/param.h"
 #include "../h/mbuf.h"
@@ -66,7 +66,7 @@ COUNT(RAW_INPUT);
        else
                IF_ENQUEUE(&rawintrq, m);
        splx(s);
        else
                IF_ENQUEUE(&rawintrq, m);
        splx(s);
-       setrawintr();
+       schednetisr(NETISR_RAW);
 }
 
 /*
 }
 
 /*
index ab7e6a9..374c3ab 100644 (file)
@@ -1,10 +1,11 @@
-/* in_systm.h 4.7 81/11/29 */
+/* in_systm.h 4.8 82/03/19 */
 
 /*
  * Miscellaneous internetwork
  * definitions for kernel.
  */
 
 
 /*
  * Miscellaneous internetwork
  * definitions for kernel.
  */
 
+#ifndef LOCORE
 /*
  * Network types.
  *
 /*
  * Network types.
  *
@@ -17,12 +18,10 @@ typedef u_short n_short;            /* short as received from the net */
 typedef u_long n_long;                 /* long as received from the net */
 
 typedef        u_long  n_time;                 /* ms since 00:00 GMT, byte rev */
 typedef u_long n_long;                 /* long as received from the net */
 
 typedef        u_long  n_time;                 /* ms since 00:00 GMT, byte rev */
+#endif
 
 /*
  * The internet code runs off software interrupts.
 
 /*
  * The internet code runs off software interrupts.
- * There is one software interrupt level for each IP layer protocol
- * (e.g. IP, PUP, etc), and each such interrupt traps to the lowest
- * level routine for that protocol.
  *
  * You can switch into the network by doing splnet() and return by splx().
  * The software interrupt level for the network is higher than the software
  *
  * You can switch into the network by doing splnet() and return by splx().
  * The software interrupt level for the network is higher than the software
@@ -30,10 +29,28 @@ typedef     u_long  n_time;                 /* ms since 00:00 GMT, byte rev */
  * at timeout time).  Splimp is an ipl high enough to block all imps.
  * While manipulating the mbuf buffer pool you have to block imps.
  */
  * at timeout time).  Splimp is an ipl high enough to block all imps.
  * While manipulating the mbuf buffer pool you have to block imps.
  */
-#define        splimp          spl5
-#define        setipintr()     mtpr(SIRR, 12)
-#define        setrawintr()    mtpr(SIRR, 13)
+
 /* splnet is defined in ../sys/asm.sed */
 /* splnet is defined in ../sys/asm.sed */
+#define        splimp          spl5
+#define        setsoftnet()    mtpr(SIRR, 12)
+
+/*
+ * Each ``pup-level-1'' input queue has a bit in a ``netisr'' status
+ * word which is used to de-multiplex a single software
+ * interrupt used for scheduling the network code to calls
+ * on the lowest level routine of each protocol.
+ */
+#define        NETISR_RAW      0               /* same as AF_UNSPEC */
+#define        NETISR_IP       2               /* same as AF_INET */
+#define        NETISR_NS       6               /* same as AF_NS */
+
+#define        schednetisr(anisr)      { netisr |= 1<<(anisr); setsoftnet(); }
+
+#ifndef LOCORE
+#ifdef KERNEL
+int    netisr;                         /* scheduling bits for network */
+#endif
+
 
 #ifdef KERNEL
 n_time iptime();
 
 #ifdef KERNEL
 n_time iptime();
@@ -46,3 +63,4 @@ int   nrcount[NCOUNTERS+1];
 #else
 #define        COUNT(i)
 #endif
 #else
 #define        COUNT(i)
 #endif
+#endif
index 9a4ed46..4d00005 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_dmc.c        4.5     82/03/15        */
+/*     if_dmc.c        4.6     82/03/19        */
 
 #include "dmc.h"
 #if NDMC > 0
 
 #include "dmc.h"
 #if NDMC > 0
@@ -314,7 +314,7 @@ dmcxint(unit)
                switch (ui->ui_flags & DMC_PF) {
 #ifdef INET
                case PF_INET:
                switch (ui->ui_flags & DMC_PF) {
 #ifdef INET
                case PF_INET:
-                       setipintr();
+                       schednetisr(NETISR_IP);
                        inq = &ipintrq;
                        break;
 #endif
                        inq = &ipintrq;
                        break;
 #endif
index f1b7d79..4df49c8 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_en.c 4.42    82/03/15        */
+/*     if_en.c 4.43    82/03/19        */
 
 #include "en.h"
 
 
 #include "en.h"
 
@@ -407,7 +407,7 @@ COUNT(ENRINT);
 
 #ifdef INET
        case ENPUP_IPTYPE:
 
 #ifdef INET
        case ENPUP_IPTYPE:
-               setipintr();
+               schednetisr(NETISR_IP);
                inq = &ipintrq;
                break;
 #endif
                inq = &ipintrq;
                break;
 #endif