aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ixl/ixl_txrx.c
diff options
context:
space:
mode:
authorStephen Hurd <shurd@FreeBSD.org>2018-11-28 17:37:17 +0000
committerStephen Hurd <shurd@FreeBSD.org>2018-11-28 17:37:17 +0000
commite8e0ecb9698d4bb7b25fe7e85436e978ae7fba3f (patch)
treea22813f4445d053df222227bb398e2d8af2de15b /sys/dev/ixl/ixl_txrx.c
parent8f69e36d87c720d1f5c52a5751a23388d3219da5 (diff)
downloadsrc-e8e0ecb9698d4bb7b25fe7e85436e978ae7fba3f.tar.gz
src-e8e0ecb9698d4bb7b25fe7e85436e978ae7fba3f.zip
Fix first-packet completion
The first packet after the ring is initialized was never completed as isc_txd_credits_update() would not include it in the count of completed packets. This caused netmap to never complete a batch. See PR 233022 for more details. This is the same fix as the r340310 for e1000 PR: 233607 Reported by: lev Reviewed by: lev MFC after: 3 days Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D18368
Notes
Notes: svn path=/head/; revision=341156
Diffstat (limited to 'sys/dev/ixl/ixl_txrx.c')
-rw-r--r--sys/dev/ixl/ixl_txrx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/ixl/ixl_txrx.c b/sys/dev/ixl/ixl_txrx.c
index ec14ab14ee8f..ea215f272d9f 100644
--- a/sys/dev/ixl/ixl_txrx.c
+++ b/sys/dev/ixl/ixl_txrx.c
@@ -516,7 +516,13 @@ ixl_isc_txd_credits_update_dwb(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;
#if 0