Hi,

I have a confusion in the writeback section for the transmission
descriptors.
According to the IGBE_e1000 documentation, the TX Descriptor should be
written back in 3 cases :
1. If Wthresh = 0,
2. If Used size > Wthresh . This has 2 levels of granularity:
   a) Cache line (Gran = 0)
   b) Descriptor (Gran = 1)
3. When interrupt timer expires.

 if (igbe->regs.txdctl.wthresh() == 0) {
        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() >=
               descInBlock(usedCache.size())) {
        DPRINTF(EthernetDesc, "used > WTHRESH, writing back descriptor 1
thresh:%d, size=%d cache_size\n", igbe->regs.txdctl.wthresh(),
usedCache.size(),igbe->cacheBlockSize());
        igbe->anBegin("TXS", "Desc Writeback");
        writeback((igbe->cacheBlockSize()-1)>>4);
    } else if (igbe->regs.txdctl.wthresh() >= usedCache.size()) {
        DPRINTF(EthernetDesc, "used > WTHRESH, writing back descriptor 2
thresh:%d, size=%d\n", igbe->regs.txdctl.wthresh(), (usedCache.size()));
        igbe->anBegin("TXS", "Desc Writeback");
        writeback((igbe->cacheBlockSize()-1)>>4);
    }

The following are my questions:
1. In the piece of code, it seems that the check condition is always that
Wthresh > size, not the other way around - size>Wthresh.
2. When gran = 1, the granularity should be descriptor, but when gran = 1,
it goes into the first else condition, which checks how many cache blocks
are used by the descriptor. Shouldn't this condition be in the second else
condition?
3. The timer interrupt does not seem to be there..

Am I misunderstanding something?

Thanks,
Pritha
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to