From ea6fea596b67dea542e7a1994b10473228118400 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 16 Dec 2013 19:19:15 +0100 Subject: devether: remove qfull prints and fix loopback packet handling of etheroq() dont spam the console with qfull warnings. this makes things worse. handle loopback packets as stated in the comment. we call etheriq() with fromwire=1 for loopback packets so etheriq() can pass the packet on (without copying) or free it. dont inhibit interrupts while calling etheriq(). etheriq() can safely be called from process and interrupt context. it is unclear what this was supposed to fix and testing didnt seem to have any odd effects. --- sys/src/9/ppc/devether.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'sys/src/9/ppc') diff --git a/sys/src/9/ppc/devether.c b/sys/src/9/ppc/devether.c index 2f8553932..112a581b4 100644 --- a/sys/src/9/ppc/devether.c +++ b/sys/src/9/ppc/devether.c @@ -205,10 +205,11 @@ etheriq(Ether* ether, Block* bp, int fromwire) static int etheroq(Ether* ether, Block* bp) { - int len, loopback, s; + int len, loopback; Etherpkt *pkt; ether->outpackets++; + /* * Check if the packet has to be placed back onto the input queue, * i.e. if it's a loopback or broadcast packet or the interface is @@ -221,18 +222,13 @@ etheroq(Ether* ether, Block* bp) pkt = (Etherpkt*)bp->rp; len = BLEN(bp); loopback = memcmp(pkt->d, ether->ea, sizeof(pkt->d)) == 0; - if(loopback || memcmp(pkt->d, ether->bcast, sizeof(pkt->d)) == 0 || ether->prom){ - s = splhi(); - etheriq(ether, bp, 0); - splx(s); - } + if(loopback || memcmp(pkt->d, ether->bcast, sizeof(pkt->d)) == 0 || ether->prom) + if(etheriq(ether, bp, loopback) == 0) + return len; - if(!loopback){ - qbwrite(ether->oq, bp); + qbwrite(ether->oq, bp); + if(ether->transmit != nil) ether->transmit(ether); - } else - freeb(bp); - return len; } -- cgit v1.2.3