summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchuck <chuck@cvs.openbsd.org>1996-06-29 23:22:36 +0000
committerchuck <chuck@cvs.openbsd.org>1996-06-29 23:22:36 +0000
commit0b45702665ab1a9c4aae1138c52e0f00f022e7e1 (patch)
treef92c1407f8b808a7a044ac7caa4f871bb2d2d316
parent422b9f4754b2de04629bdbf5ecd1b40c8866f6f6 (diff)
new: add a raw_threshold for raw mode. this basically tells the driver
to ignore inbound data sizes less than the threshold. otherwise, when connected to a video aal0 input the driver gives us a massive stream of 56 byte mbufs each with one aal0 cell in it and the system just can't keep up with it, especially if the socket buffer size is large [it hangs until you turn off the video source]. fixes: when turning off a vc, try and check the freshest copy of the mode when seeing if we need to enter the "drain" state. also, don't panic if we get unexpected rx interrupt on a VCI (instead make sure the VC is off, print a warning, and move on!).
-rw-r--r--sys/dev/ic/midway.c28
-rw-r--r--sys/dev/ic/midwayvar.h3
2 files changed, 21 insertions, 10 deletions
diff --git a/sys/dev/ic/midway.c b/sys/dev/ic/midway.c
index c35a6fabfa3..152218367e4 100644
--- a/sys/dev/ic/midway.c
+++ b/sys/dev/ic/midway.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: midway.c,v 1.6 1996/06/29 19:59:40 chuck Exp $ */
-/* (sync'd to midway.c 1.55) */
+/* $OpenBSD: midway.c,v 1.7 1996/06/29 23:22:31 chuck Exp $ */
+/* (sync'd to midway.c 1.56) */
/*
*
@@ -896,10 +896,15 @@ caddr_t data;
error = EINVAL;
break;
}
- if (ario->rawvalue)
+ if (ario->rawvalue > EN_RXSZ*1024)
+ ario->rawvalue = EN_RXSZ*1024;
+ if (ario->rawvalue) {
sc->rxslot[slot].oth_flags |= ENOTHER_RAW;
- else
+ sc->rxslot[slot].raw_threshold = ario->rawvalue;
+ } else {
sc->rxslot[slot].oth_flags &= (~ENOTHER_RAW);
+ sc->rxslot[slot].raw_threshold = 0;
+ }
#ifdef EN_DEBUG
printf("%s: rxvci%d: turn %s raw (boodi) mode\n",
sc->sc_dev.dv_xname, ario->npcb->npcb_vci,
@@ -1033,7 +1038,7 @@ int on;
/* if stuff is still going on we are going to have to drain it out */
if (sc->rxslot[slot].indma.ifq_head ||
sc->rxslot[slot].q.ifq_head ||
- (oldmode & MIDV_INSERVICE) != 0 ||
+ (EN_READ(sc, MID_VC(vci)) & MIDV_INSERVICE) != 0 ||
(sc->rxslot[slot].oth_flags & ENOTHER_SWSL) != 0) {
sc->rxslot[slot].oth_flags |= ENOTHER_DRAIN;
} else {
@@ -2085,14 +2090,15 @@ void *arg;
/* fetch and remove it from hardware service list */
vci = EN_READ(sc, sc->hwslistp);
+ EN_WRAPADD(MID_SLOFF, MID_SLEND, sc->hwslistp, 4);/* advance hw ptr */
slot = sc->rxvc2slot[vci];
if (slot == RX_NONE) {
- printf("%s: unexpected rx interrupt on VCI %d\n", sc->sc_dev.dv_xname,
- EN_READ(sc, sc->hwslistp));
- panic("enintr: service");
+ printf("%s: unexpected rx interrupt on VCI %d\n",
+ sc->sc_dev.dv_xname, vci);
+ EN_WRITE(sc, MID_VC(vci), MIDV_TRASH); /* rx off, damn it! */
+ continue; /* next */
}
EN_WRITE(sc, MID_VC(vci), sc->rxslot[slot].mode); /* remove from hwsl */
- EN_WRAPADD(MID_SLOFF, MID_SLEND, sc->hwslistp, 4);/* advance hw ptr */
EN_COUNT(sc->hwpull);
#ifdef EN_DEBUG
@@ -2207,6 +2213,7 @@ same_vci:
/* check to see if there is any data at all */
if (dstart == cur) {
+defer: /* defer processing */
EN_WRAPADD(0, MID_SL_N, sc->swsl_head, 1);
sc->rxslot[slot].oth_flags &= ~ENOTHER_SWSL;
sc->swsl_size--;
@@ -2232,6 +2239,9 @@ same_vci:
else
mlen = (dstart + (EN_RXSZ*1024)) - cur;
+ if (mlen < sc->rxslot[slot].raw_threshold)
+ goto defer; /* too little data to deal with */
+
} else {
/* normal mode */
diff --git a/sys/dev/ic/midwayvar.h b/sys/dev/ic/midwayvar.h
index 32d7e0c7071..f83b62f42ac 100644
--- a/sys/dev/ic/midwayvar.h
+++ b/sys/dev/ic/midwayvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: midwayvar.h,v 1.4 1996/06/29 19:59:39 chuck Exp $ */
+/* $OpenBSD: midwayvar.h,v 1.5 1996/06/29 23:22:35 chuck Exp $ */
/*
*
@@ -120,6 +120,7 @@ struct en_softc {
u_int16_t atm_vci; /* backpointer to VCI */
u_int8_t atm_flags; /* copy of atm_flags from atm_ph */
u_int8_t oth_flags; /* other flags */
+ u_int32_t raw_threshold; /* for raw mode */
struct ifqueue indma; /* mbufs being dma'd now */
struct ifqueue q; /* mbufs waiting for dma now */
} rxslot[EN_MAXNRX]; /* recv info */