diff options
Diffstat (limited to 'src/dev/net')
-rw-r--r-- | src/dev/net/i8254xGBe.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/dev/net/i8254xGBe.cc b/src/dev/net/i8254xGBe.cc index 3dde72ac7..3359b0d61 100644 --- a/src/dev/net/i8254xGBe.cc +++ b/src/dev/net/i8254xGBe.cc @@ -2290,14 +2290,13 @@ IGbE::rxStateMachine() int descLeft = rxDescCache.descLeft(); DPRINTF(EthernetSM, "RXS: descLeft: %d rdmts: %d rdlen: %d\n", descLeft, regs.rctl.rdmts(), regs.rdlen()); - switch (regs.rctl.rdmts()) { - case 2: if (descLeft > .125 * regs.rdlen()) break; - case 1: if (descLeft > .250 * regs.rdlen()) break; - case 0: if (descLeft > .500 * regs.rdlen()) break; + + // rdmts 2->1/8, 1->1/4, 0->1/2 + int ratio = (1ULL << (regs.rctl.rdmts() + 1)); + if (descLeft * ratio <= regs.rdlen()) { DPRINTF(Ethernet, "RXS: Interrupting (RXDMT) " "because of descriptors left\n"); postInterrupt(IT_RXDMT); - break; } if (rxFifo.empty()) |