Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jun 2014 05:39:10 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r267764 - stable/10/sys/dev/cxgbe
Message-ID:  <201406230539.s5N5dAWn013530@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Mon Jun 23 05:39:10 2014
New Revision: 267764
URL: http://svnweb.freebsd.org/changeset/base/267764

Log:
  MFC r267689:
  
  Consider the total number of descriptors available (and not just those
  that are ready to be reclaimed) when deciding whether to resume tx after
  a stall.

Modified:
  stable/10/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- stable/10/sys/dev/cxgbe/t4_sge.c	Mon Jun 23 05:17:39 2014	(r267763)
+++ stable/10/sys/dev/cxgbe/t4_sge.c	Mon Jun 23 05:39:10 2014	(r267764)
@@ -1708,7 +1708,7 @@ t4_wrq_tx_locked(struct adapter *sc, str
 
 	can_reclaim = reclaimable(eq);
 	if (__predict_false(eq->flags & EQ_STALLED)) {
-		if (can_reclaim < tx_resume_threshold(eq))
+		if (eq->avail + can_reclaim < tx_resume_threshold(eq))
 			return;
 		eq->flags &= ~EQ_STALLED;
 		eq->unstalled++;
@@ -1829,7 +1829,7 @@ t4_eth_tx(struct ifnet *ifp, struct sge_
 
 	can_reclaim = reclaimable(eq);
 	if (__predict_false(eq->flags & EQ_STALLED)) {
-		if (can_reclaim < tx_resume_threshold(eq)) {
+		if (eq->avail + can_reclaim < tx_resume_threshold(eq)) {
 			txq->m = m;
 			return (0);
 		}
@@ -2003,7 +2003,8 @@ t4_update_fl_bufsize(struct ifnet *ifp)
 int
 can_resume_tx(struct sge_eq *eq)
 {
-	return (reclaimable(eq) >= tx_resume_threshold(eq));
+
+	return (eq->avail + reclaimable(eq) >= tx_resume_threshold(eq));
 }
 
 static inline void



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