From owner-svn-src-head@freebsd.org Wed Sep 2 15:23:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 036ED9C96E9; Wed, 2 Sep 2015 15:23:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.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 E832FF02; Wed, 2 Sep 2015 15:23:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82FNq3a076527; Wed, 2 Sep 2015 15:23:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82FNqjn076524; Wed, 2 Sep 2015 15:23:52 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201509021523.t82FNqjn076524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 2 Sep 2015 15:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287399 - head/sys/dev/iwn 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, 02 Sep 2015 15:23:53 -0000 Author: glebius Date: Wed Sep 2 15:23:51 2015 New Revision: 287399 URL: https://svnweb.freebsd.org/changeset/base/287399 Log: Remove the software queue, which is a remnant of ifnet ifqueue. Reviewed by: adrian Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Wed Sep 2 14:38:16 2015 (r287398) +++ head/sys/dev/iwn/if_iwn.c Wed Sep 2 15:23:51 2015 (r287399) @@ -231,7 +231,6 @@ static void iwn_xmit_task(void *arg0, in static int iwn_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); static int iwn_transmit(struct ieee80211com *, struct mbuf *); -static void iwn_start_locked(struct iwn_softc *); static void iwn_watchdog(void *); static int iwn_ioctl(struct ieee80211com *, u_long , void *); static void iwn_parent(struct ieee80211com *); @@ -471,7 +470,6 @@ iwn_attach(device_t dev) } IWN_LOCK_INIT(sc); - mbufq_init(&sc->sc_snd, ifqmaxlen); /* Read hardware revision and attach. */ sc->hw_type = (IWN_READ(sc, IWN_HW_REV) >> IWN_HW_REV_TYPE_SHIFT) @@ -1409,8 +1407,6 @@ iwn_detach(device_t dev) ieee80211_ifdetach(&sc->sc_ic); } - mbufq_drain(&sc->sc_snd); - /* Uninstall interrupt handler. */ if (sc->irq != NULL) { bus_teardown_intr(dev, sc->irq, sc->sc_ih); @@ -3597,14 +3593,10 @@ iwn_tx_done(struct iwn_softc *sc, struct (status & IWN_TX_FAIL) != 0); sc->sc_tx_timer = 0; - if (--ring->queued < IWN_TX_RING_LOMARK) { + if (--ring->queued < IWN_TX_RING_LOMARK) sc->qfullmsk &= ~(1 << ring->qid); - if (sc->qfullmsk == 0) - iwn_start_locked(sc); - } DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); - } /* @@ -3781,14 +3773,10 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, } sc->sc_tx_timer = 0; - if (ring->queued < IWN_TX_RING_LOMARK) { + if (ring->queued < IWN_TX_RING_LOMARK) sc->qfullmsk &= ~(1 << ring->qid); - if (sc->qfullmsk == 0) - iwn_start_locked(sc); - } DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); - } /* @@ -4948,54 +4936,30 @@ iwn_raw_xmit(struct ieee80211_node *ni, static int iwn_transmit(struct ieee80211com *ic, struct mbuf *m) { - struct iwn_softc *sc; + struct iwn_softc *sc = ic->ic_softc; + struct ieee80211_node *ni; int error; - sc = ic->ic_softc; - IWN_LOCK(sc); - if ((sc->sc_flags & IWN_FLAG_RUNNING) == 0) { + if ((sc->sc_flags & IWN_FLAG_RUNNING) == 0 || sc->sc_beacon_wait) { IWN_UNLOCK(sc); return (ENXIO); } - error = mbufq_enqueue(&sc->sc_snd, m); - if (error) { - IWN_UNLOCK(sc); - return (error); - } - iwn_start_locked(sc); - IWN_UNLOCK(sc); - return (0); -} - -static void -iwn_start_locked(struct iwn_softc *sc) -{ - struct ieee80211_node *ni; - struct mbuf *m; - IWN_LOCK_ASSERT(sc); - - /* - * If we're waiting for a beacon, we can just exit out here - * and wait for the taskqueue to be kicked. - */ - if (sc->sc_beacon_wait) { - return; + if (sc->qfullmsk) { + IWN_UNLOCK(sc); + return (ENOBUFS); } - DPRINTF(sc, IWN_DEBUG_XMIT, "%s: called\n", __func__); - while (sc->qfullmsk == 0 && - (m = mbufq_dequeue(&sc->sc_snd)) != NULL) { - ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; - if (iwn_tx_data(sc, m, ni) != 0) { - if_inc_counter(ni->ni_vap->iv_ifp, - IFCOUNTER_OERRORS, 1); - ieee80211_free_node(ni); - } else - sc->sc_tx_timer = 5; - } - DPRINTF(sc, IWN_DEBUG_XMIT, "%s: done\n", __func__); + ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; + error = iwn_tx_data(sc, m, ni); + if (error) { + if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); + ieee80211_free_node(ni); + } else + sc->sc_tx_timer = 5; + IWN_UNLOCK(sc); + return (error); } static void @@ -8731,9 +8695,6 @@ iwn_panicked(void *arg0, int pending) "%s: could not move to run state\n", __func__); } - /* Only run start once the NIC is in a useful state, like associated */ - iwn_start_locked(sc); - IWN_UNLOCK(sc); } Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Wed Sep 2 14:38:16 2015 (r287398) +++ head/sys/dev/iwn/if_iwnvar.h Wed Sep 2 15:23:51 2015 (r287399) @@ -238,7 +238,6 @@ struct iwn_softc { struct cdev *sc_cdev; struct mtx sc_mtx; struct ieee80211com sc_ic; - struct mbufq sc_snd; u_int sc_flags; #define IWN_FLAG_HAS_OTPROM (1 << 1)