From 816b3438af5706fc40d6932a1cc1e70c9216e58f Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Wed, 5 Oct 2011 22:54:49 -0700 Subject: [PATCH] minor optimizations --- drivers/net/mmnif.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/mmnif.c b/drivers/net/mmnif.c index 6b4f1c25..3ceabfb2 100644 --- a/drivers/net/mmnif.c +++ b/drivers/net/mmnif.c @@ -667,7 +667,7 @@ static err_t mmnif_tx(struct netif *netif, struct pbuf *p) uint32_t i; struct pbuf *q; /* interator */ uint32_t dest_ip = mmnif_get_destination(netif, p); - int8_t chances = 40; + int32_t chances = 4000; /* check for over/underflow */ if (BUILTIN_EXPECT((p->tot_len < 20 /* IP header size */) || (p->tot_len > 1536), 0)) { @@ -682,12 +682,13 @@ realloc: { //DEBUGPRINTF("mmnif_tx(): concurrency"); - //if (chances <= 0) - // goto drop_packet; + if (chances <= 0) + goto drop_packet; - //chances--; + chances--; //mmnif_trigger_irq(dest_ip); //NOP8;NOP8;NOP8;NOP8;NOP8;NOP8;NOP8;NOP8; + udelay(10); goto realloc; } @@ -1088,7 +1089,6 @@ err_t mmnif_init(struct netif *netif) #if MMNIF_FAST_SOCKET_BLOCK sem_init(&mmnif_hashtable[i].sem, 0); - #endif }