From owner-svn-src-head@FreeBSD.ORG Fri Jun 20 20:28:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 700C1882; Fri, 20 Jun 2014 20:28:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D76027E2; Fri, 20 Jun 2014 20:28:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5KKSlEV011633; Fri, 20 Jun 2014 20:28:47 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5KKSlHW011632; Fri, 20 Jun 2014 20:28:47 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201406202028.s5KKSlHW011632@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 20 Jun 2014 20:28:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267689 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2014 20:28:47 -0000 Author: np Date: Fri Jun 20 20:28:46 2014 New Revision: 267689 URL: http://svnweb.freebsd.org/changeset/base/267689 Log: 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. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Jun 20 20:17:39 2014 (r267688) +++ head/sys/dev/cxgbe/t4_sge.c Fri Jun 20 20:28:46 2014 (r267689) @@ -1771,7 +1771,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++; @@ -1892,7 +1892,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); } @@ -2066,7 +2066,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