diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-07-27 12:39:34 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-07-27 12:39:34 +0200 |
commit | c23715d2686823cc6821b218eb9e12691d9506fd (patch) | |
tree | 64e110a922748b545d2c2e5b87e8ebfa39f5e6a0 /sys/src/9/pc/etherigbe.c | |
parent | 95b774541964aec1fcffa010ca6e50d37e5baa56 (diff) |
ether82598, etherigbe: remove receive buffer pool optimization
Diffstat (limited to 'sys/src/9/pc/etherigbe.c')
-rw-r--r-- | sys/src/9/pc/etherigbe.c | 56 |
1 files changed, 3 insertions, 53 deletions
diff --git a/sys/src/9/pc/etherigbe.c b/sys/src/9/pc/etherigbe.c index 8375e9663..0b82aad14 100644 --- a/sys/src/9/pc/etherigbe.c +++ b/sys/src/9/pc/etherigbe.c @@ -466,7 +466,6 @@ typedef struct Ctlr { void* alloc; /* receive/transmit descriptors */ int nrd; int ntd; - int nrb; /* how many this Ctlr has in the pool */ int* nic; Lock imlock; @@ -521,9 +520,6 @@ typedef struct Ctlr { static Ctlr* igbectlrhead; static Ctlr* igbectlrtail; -static Lock igberblock; /* free receive Blocks */ -static Block* igberbpool; /* receive Blocks for all igbe controllers */ - static char* statistics[Nstatistics] = { "CRC Error", "Alignment Error", @@ -761,35 +757,6 @@ igbemulticast(void* arg, uchar* addr, int add) csr32w(ctlr, Mta+x*4, ctlr->mta[x]); } -static Block* -igberballoc(void) -{ - Block *bp; - - ilock(&igberblock); - if((bp = igberbpool) != nil){ - igberbpool = bp->next; - bp->next = nil; - _xinc(&bp->ref); /* prevent bp from being freed */ - } - iunlock(&igberblock); - - return bp; -} - -static void -igberbfree(Block* bp) -{ - bp->rp = bp->lim - Rbsz; - bp->wp = bp->rp; - bp->flag &= ~(Bipck | Budpck | Btcpck | Bpktck); - - ilock(&igberblock); - bp->next = igberbpool; - igberbpool = bp; - iunlock(&igberblock); -} - static void igbeim(Ctlr* ctlr, int im) { @@ -1036,12 +1003,9 @@ igbereplenish(Ctlr* ctlr) while(NEXT(rdt, ctlr->nrd) != ctlr->rdh){ rd = &ctlr->rdba[rdt]; if(ctlr->rb[rdt] == nil){ - bp = igberballoc(); - if(bp == nil){ - iprint("#l%d: igbereplenish: no available buffers\n", - ctlr->edev->ctlrno); - break; - } + bp = allocb(Rbsz); + bp->rp = bp->lim - Rbsz; + bp->wp = bp->rp; ctlr->rb[rdt] = bp; rd->addr[0] = PCIWADDR(bp->rp); rd->addr[1] = 0; @@ -1195,7 +1159,6 @@ igberproc(void* arg) static void igbeattach(Ether* edev) { - Block *bp; Ctlr *ctlr; char name[KNAMELEN]; @@ -1227,12 +1190,6 @@ igbeattach(Ether* edev) } if(waserror()){ - while(ctlr->nrb > 0){ - bp = igberballoc(); - bp->free = nil; - freeb(bp); - ctlr->nrb--; - } free(ctlr->tb); ctlr->tb = nil; free(ctlr->rb); @@ -1243,13 +1200,6 @@ igbeattach(Ether* edev) nexterror(); } - for(ctlr->nrb = 0; ctlr->nrb < Nrb; ctlr->nrb++){ - if((bp = allocb(Rbsz)) == nil) - break; - bp->free = igberbfree; - freeb(bp); - } - snprint(name, KNAMELEN, "#l%dlproc", edev->ctlrno); kproc(name, igbelproc, edev); |