summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/dev/e1000/igb_txrx.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/dev/e1000/igb_txrx.c')
-rw-r--r--freebsd/sys/dev/e1000/igb_txrx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/freebsd/sys/dev/e1000/igb_txrx.c b/freebsd/sys/dev/e1000/igb_txrx.c
index 32bab4bf..c54315f0 100644
--- a/freebsd/sys/dev/e1000/igb_txrx.c
+++ b/freebsd/sys/dev/e1000/igb_txrx.c
@@ -335,7 +335,13 @@ igb_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear)
ntxd = scctx->isc_ntxd[0];
do {
delta = (int32_t)cur - (int32_t)prev;
+ /*
+ * XXX This appears to be a hack for first-packet.
+ * A correct fix would prevent prev == cur in the first place.
+ */
MPASS(prev == 0 || delta != 0);
+ if (prev == 0 && cur == 0)
+ delta += 1;
if (delta < 0)
delta += ntxd;