From owner-svn-src-stable-8@FreeBSD.ORG Mon Apr 18 18:18:07 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D63851065670; Mon, 18 Apr 2011 18:18:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3AFA8FC0C; Mon, 18 Apr 2011 18:18:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p3III7Lw080250; Mon, 18 Apr 2011 18:18:07 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p3III7D0080245; Mon, 18 Apr 2011 18:18:07 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201104181818.p3III7D0080245@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 18 Apr 2011 18:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220795 - stable/8/sys/dev/cxgbe X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2011 18:18:08 -0000 Author: np Date: Mon Apr 18 18:18:07 2011 New Revision: 220795 URL: http://svn.freebsd.org/changeset/base/220795 Log: MFC r220643: There is no need to request a tx credit flush if such a request is already pending. Modified: stable/8/sys/dev/cxgbe/adapter.h stable/8/sys/dev/cxgbe/t4_main.c stable/8/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/8/sys/dev/cxgbe/adapter.h Mon Apr 18 17:43:16 2011 (r220794) +++ stable/8/sys/dev/cxgbe/adapter.h Mon Apr 18 18:18:07 2011 (r220795) @@ -260,7 +260,7 @@ enum { /* eq flags */ EQ_ALLOCATED = (1 << 1), /* firmware resources allocated */ EQ_STARTED = (1 << 2), /* started */ - EQ_STALLED = (1 << 3), /* currently stalled */ + EQ_CRFLUSHED = (1 << 3), /* expecting an update from SGE */ }; /* Modified: stable/8/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/8/sys/dev/cxgbe/t4_main.c Mon Apr 18 17:43:16 2011 (r220794) +++ stable/8/sys/dev/cxgbe/t4_main.c Mon Apr 18 18:18:07 2011 (r220795) @@ -2673,6 +2673,7 @@ cxgbe_txq_start(void *arg, int count) struct sge_txq *txq = arg; TXQ_LOCK(txq); + txq->eq.flags &= ~EQ_CRFLUSHED; txq_start(txq->ifp, txq); TXQ_UNLOCK(txq); } Modified: stable/8/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/8/sys/dev/cxgbe/t4_sge.c Mon Apr 18 17:43:16 2011 (r220794) +++ stable/8/sys/dev/cxgbe/t4_sge.c Mon Apr 18 18:18:07 2011 (r220795) @@ -876,7 +876,7 @@ doorbell: * WR that reduced it to 0 so we don't need another flush (we don't have * any descriptor for a flush WR anyway, duh). */ - if (m && eq->avail > 0) + if (m && eq->avail > 0 && !(eq->flags & EQ_CRFLUSHED)) write_eqflush_wr(eq); txq->m = m; @@ -1882,8 +1882,11 @@ write_txpkt_wr(struct port_info *pi, str wr->op_immdlen = htobe32(V_FW_WR_OP(FW_ETH_TX_PKT_WR) | V_FW_WR_IMMDLEN(ctrl)); ctrl = V_FW_WR_LEN16(howmany(nflits, 2)); - if (eq->avail == ndesc) + if (eq->avail == ndesc && !(eq->flags & EQ_CRFLUSHED)) { ctrl |= F_FW_WR_EQUEQ | F_FW_WR_EQUIQ; + eq->flags |= EQ_CRFLUSHED; + } + wr->equiq_to_len16 = htobe32(ctrl); wr->r3 = 0; @@ -2071,8 +2074,10 @@ write_txpkts_wr(struct sge_txq *txq, str wr->op_immdlen = htobe32(V_FW_WR_OP(FW_ETH_TX_PKTS_WR) | V_FW_WR_IMMDLEN(0)); /* immdlen does not matter in this WR */ ctrl = V_FW_WR_LEN16(howmany(txpkts->nflits, 2)); - if (eq->avail == ndesc) + if (eq->avail == ndesc && !(eq->flags & EQ_CRFLUSHED)) { ctrl |= F_FW_WR_EQUEQ | F_FW_WR_EQUIQ; + eq->flags |= EQ_CRFLUSHED; + } wr->equiq_to_len16 = htobe32(ctrl); wr->plen = htobe16(txpkts->plen); wr->npkt = txpkts->npkt; @@ -2083,7 +2088,7 @@ write_txpkts_wr(struct sge_txq *txq, str txsd = &eq->sdesc[eq->pidx]; txsd->desc_used = ndesc; - KASSERT(eq->avail >= ndesc, ("%s: out ouf descriptors", __func__)); + KASSERT(eq->avail >= ndesc, ("%s: out of descriptors", __func__)); eq->pending += ndesc; eq->avail -= ndesc; @@ -2384,6 +2389,7 @@ write_eqflush_wr(struct sge_eq *eq) txsd->desc_used = 1; txsd->map_used = 0; + eq->flags |= EQ_CRFLUSHED; eq->pending++; eq->avail--; if (++eq->pidx == eq->cap) @@ -2438,6 +2444,10 @@ handle_sge_egr_update(struct adapter *sc struct port_info *pi; txq = (void *)s->eqmap[qid - s->eq_start]; + + KASSERT(txq->eq.flags & EQ_CRFLUSHED, + ("%s: tx queue %p not expecting an update.", __func__, txq)); + pi = txq->ifp->if_softc; taskqueue_enqueue(pi->tq, &txq->resume_tx); txq->egr_update++;