IGbE: Fix writeback conditions for i8254x GbE in updated data sheet.
authorPritha Ghoshal <pritha9987@tamu.edu>
Thu, 10 May 2012 23:04:26 +0000 (18:04 -0500)
committerPritha Ghoshal <pritha9987@tamu.edu>
Thu, 10 May 2012 23:04:26 +0000 (18:04 -0500)
An older revision of the data sheet specified that txdctl.gran was 1 the granularity was
based on cache block and gran being 0 is based on descriptor count. The newer version of
the data sheet reverses this errata

src/dev/i8254xGBe.cc

index effc2a589deaa01e540a4770e60cbf1ebd2e81cf..29bd5adc2a92b924a5669c8547242547d723b76f 100644 (file)
@@ -1923,12 +1923,12 @@ IGbE::TxDescCache::pktComplete()
         igbe->anBegin("TXS", "Desc Writeback");
         DPRINTF(EthernetDesc, "WTHRESH == 0, writing back descriptor\n");
         writeback(0);
-    } else if (igbe->regs.txdctl.gran() && igbe->regs.txdctl.wthresh() >=
+    } else if (!igbe->regs.txdctl.gran() && igbe->regs.txdctl.wthresh() <=
                descInBlock(usedCache.size())) {
         DPRINTF(EthernetDesc, "used > WTHRESH, writing back descriptor\n");
         igbe->anBegin("TXS", "Desc Writeback");
         writeback((igbe->cacheBlockSize()-1)>>4);
-    } else if (igbe->regs.txdctl.wthresh() >= usedCache.size()) {
+    } else if (igbe->regs.txdctl.wthresh() <= usedCache.size()) {
         DPRINTF(EthernetDesc, "used > WTHRESH, writing back descriptor\n");
         igbe->anBegin("TXS", "Desc Writeback");
         writeback((igbe->cacheBlockSize()-1)>>4);