Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Nov 2018 17:37:18 +0000 (UTC)
From:      Stephen Hurd <shurd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r341156 - in head/sys/dev: ixgbe ixl
Message-ID:  <201811281737.wASHbIOQ015130@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: shurd
Date: Wed Nov 28 17:37:17 2018
New Revision: 341156
URL: https://svnweb.freebsd.org/changeset/base/341156

Log:
  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

Modified:
  head/sys/dev/ixgbe/ix_txrx.c
  head/sys/dev/ixl/ixl_txrx.c

Modified: head/sys/dev/ixgbe/ix_txrx.c
==============================================================================
--- head/sys/dev/ixgbe/ix_txrx.c	Wed Nov 28 17:31:34 2018	(r341155)
+++ head/sys/dev/ixgbe/ix_txrx.c	Wed Nov 28 17:37:17 2018	(r341156)
@@ -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: head/sys/dev/ixl/ixl_txrx.c
==============================================================================
--- head/sys/dev/ixl/ixl_txrx.c	Wed Nov 28 17:31:34 2018	(r341155)
+++ head/sys/dev/ixl/ixl_txrx.c	Wed Nov 28 17:37:17 2018	(r341156)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811281737.wASHbIOQ015130>