From owner-svn-src-head@FreeBSD.ORG Wed Jun 3 14:48:04 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 774028D0; Wed, 3 Jun 2015 14:48:04 +0000 (UTC) (envelope-from loos@FreeBSD.org) 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 65AB1199A; Wed, 3 Jun 2015 14:48:04 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t53Em4je090710; Wed, 3 Jun 2015 14:48:04 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t53Em4Gn090709; Wed, 3 Jun 2015 14:48:04 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201506031448.t53Em4Gn090709@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 3 Jun 2015 14:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283948 - head/sys/dev/dwc 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.20 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: Wed, 03 Jun 2015 14:48:04 -0000 Author: loos Date: Wed Jun 3 14:48:03 2015 New Revision: 283948 URL: https://svnweb.freebsd.org/changeset/base/283948 Log: Fix the OACTIVE handling on if_dwc. Previously the OACTIVE flag was being set when the tx descriptors are fully allocated but it wasn't unset anywhere. As soon as a packet is transmitted, unset the OACTIVE flag and call start routine to push any pending packets from the tx queue. This closes another race where a full tx queue would jam the tx path (tx queue is full, new packets cannot be added to queue and dwc_txstart never gets called). Modified: head/sys/dev/dwc/if_dwc.c Modified: head/sys/dev/dwc/if_dwc.c ============================================================================== --- head/sys/dev/dwc/if_dwc.c Wed Jun 3 14:07:50 2015 (r283947) +++ head/sys/dev/dwc/if_dwc.c Wed Jun 3 14:48:03 2015 (r283948) @@ -741,9 +741,11 @@ dwc_txfinish_locked(struct dwc_softc *sc { struct dwc_bufmap *bmap; struct dwc_hwdesc *desc; + struct ifnet *ifp; DWC_ASSERT_LOCKED(sc); + fp = sc->ifp; while (sc->tx_idx_tail != sc->tx_idx_head) { desc = &sc->txdesc_ring[sc->tx_idx_tail]; if ((desc->tdes0 & DDESC_TDES0_OWN) != 0) @@ -756,6 +758,7 @@ dwc_txfinish_locked(struct dwc_softc *sc bmap->mbuf = NULL; dwc_setup_txdesc(sc, sc->tx_idx_tail, 0, 0); sc->tx_idx_tail = next_txidx(sc, sc->tx_idx_tail); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } /* If there are no buffers outstanding, muzzle the watchdog. */ @@ -838,8 +841,10 @@ dwc_intr(void *arg) if (reg & DMA_STATUS_RI) dwc_rxfinish_locked(sc); - if (reg & DMA_STATUS_TI) + if (reg & DMA_STATUS_TI) { dwc_txfinish_locked(sc); + dwc_txstart_locked(sc); + } } if (reg & DMA_STATUS_AIS) {