svn commit: r341427 - in stable/12/sys/dev: ixgbe ixl
Stephen Hurd
shurd at FreeBSD.org
Mon Dec 3 15:18:36 UTC 2018
Author: shurd
Date: Mon Dec 3 15:18:35 2018
New Revision: 341427
URL: https://svnweb.freebsd.org/changeset/base/341427
Log:
MFC r341156:
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
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D18368
Modified:
stable/12/sys/dev/ixgbe/ix_txrx.c
stable/12/sys/dev/ixl/ixl_txrx.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/dev/ixgbe/ix_txrx.c
==============================================================================
--- stable/12/sys/dev/ixgbe/ix_txrx.c Mon Dec 3 15:14:40 2018 (r341426)
+++ stable/12/sys/dev/ixgbe/ix_txrx.c Mon Dec 3 15:18:35 2018 (r341427)
@@ -297,6 +297,8 @@ ixgbe_isc_txd_credits_update(void *arg, uint16_t txqid
ntxd = scctx->isc_ntxd[0];
do {
delta = (int32_t)cur - (int32_t)prev;
+ if (prev == 0 && cur == 0)
+ delta += 1;
if (delta < 0)
delta += ntxd;
Modified: stable/12/sys/dev/ixl/ixl_txrx.c
==============================================================================
--- stable/12/sys/dev/ixl/ixl_txrx.c Mon Dec 3 15:14:40 2018 (r341426)
+++ stable/12/sys/dev/ixl/ixl_txrx.c Mon Dec 3 15:18:35 2018 (r341427)
@@ -516,7 +516,13 @@ ixl_isc_txd_credits_update_dwb(void *arg, uint16_t txq
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
More information about the svn-src-all
mailing list