From 1b0dc8dacf043d49eff7cdd9f6272e446304ad68 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 11 Jul 1995 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1995-07-11 --- pc/devether.c | 3 ++- port/netif.c | 3 ++- port/netif.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pc/devether.c b/pc/devether.c index daf31a8cc5f5aba2fcccffd58f27c71e293dfc7d..c39812da6c26952b2afcc5d14c0486945d8fe951 100644 --- a/pc/devether.c +++ b/pc/devether.c @@ -110,7 +110,8 @@ etherrloop(Ether *ctlr, Etherpkt *pkt, long len, int tome) ep = &ctlr->f[Ntypes]; for(fp = ctlr->f; fp < ep; fp++){ if((f = *fp) && ((tome && f->type==type) || f->type < 0)) - qproduce(f->in, pkt->d, len); + if(qproduce(f->in, pkt->d, len) < 0) + ctlr->soverflows++; } } diff --git a/port/netif.c b/port/netif.c index 9761a0a162b955d60cee0a6032506eebf970f3aa..ad580dc9ce9f6d206338fbd588e7b7d1f90421cf 100644 --- a/port/netif.c +++ b/port/netif.c @@ -159,7 +159,7 @@ netifread(Netif *nif, Chan *c, void *a, long n, ulong offset) { int i, j; Netfile *f; - char buf[512]; + char buf[1024]; if(c->qid.path&CHDIR) return devdirread(c, a, n, (Dirtab*)nif, 0, netifgen); @@ -175,6 +175,7 @@ netifread(Netif *nif, Chan *c, void *a, long n, ulong offset) j += sprint(buf+j, "out: %d\n", nif->outpackets); j += sprint(buf+j, "crc errs: %d\n", nif->crcs); j += sprint(buf+j, "overflows: %d\n", nif->overflows); + j += sprint(buf+j, "soft overflows: %d\n", nif->soverflows); j += sprint(buf+j, "framing errs: %d\n", nif->frames); j += sprint(buf+j, "buffer errs: %d\n", nif->buffs); j += sprint(buf+j, "output errs: %d\n", nif->oerrs); diff --git a/port/netif.h b/port/netif.h index 77e9e22b45a2874a21550164a945d55e389569ce..12260064bd7b503509930a3e660cbed88298721c 100644 --- a/port/netif.h +++ b/port/netif.h @@ -69,6 +69,7 @@ struct Netif int frames; /* framing errors */ int overflows; /* packet overflows */ int buffs; /* buffering errors */ + int soverflows; /* software overflow */ /* routines for touching the hardware */ void *arg;