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
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to