From owner-svn-src-head@FreeBSD.ORG Mon Apr 27 22:54:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1AD01065670; Mon, 27 Apr 2009 22:54:30 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95D8F8FC1A; Mon, 27 Apr 2009 22:54:30 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3RMsUeT029755; Mon, 27 Apr 2009 22:54:30 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3RMsUwf029754; Mon, 27 Apr 2009 22:54:30 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200904272254.n3RMsUwf029754@svn.freebsd.org> From: Kip Macy Date: Mon, 27 Apr 2009 22:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191610 - head/sys/dev/cxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 27 Apr 2009 22:54:31 -0000 Author: kmacy Date: Mon Apr 27 22:54:30 2009 New Revision: 191610 URL: http://svn.freebsd.org/changeset/base/191610 Log: simplify by removing dead code Modified: head/sys/dev/cxgb/cxgb_multiq.c Modified: head/sys/dev/cxgb/cxgb_multiq.c ============================================================================== --- head/sys/dev/cxgb/cxgb_multiq.c Mon Apr 27 22:53:35 2009 (r191609) +++ head/sys/dev/cxgb/cxgb_multiq.c Mon Apr 27 22:54:30 2009 (r191610) @@ -135,29 +135,6 @@ cxgb_pcpu_enqueue_packet_(struct sge_qse return (err); } -int -cxgb_pcpu_enqueue_packet(struct ifnet *ifp, struct mbuf *m) -{ - struct port_info *pi = ifp->if_softc; - struct sge_qset *qs; - int err = 0, qidx; -#ifdef IFNET_MULTIQUEUE - int32_t calc_cookie; - - calc_cookie = m->m_pkthdr.flowid; - qidx = cxgb_pcpu_cookie_to_qidx(pi, calc_cookie); -#else - qidx = 0; -#endif - qs = &pi->adapter->sge.qs[qidx]; - if (ALTQ_IS_ENABLED(&ifp->if_snd)) { - IFQ_ENQUEUE(qs->txq[0].txq_ifq, m, err); - } else { - err = cxgb_pcpu_enqueue_packet_(qs, m); - } - return (err); -} - static int cxgb_dequeue_packet(struct sge_txq *txq, struct mbuf **m_vec) { @@ -166,20 +143,7 @@ cxgb_dequeue_packet(struct sge_txq *txq, int count, size, coalesced; struct adapter *sc; -#ifndef IFNET_MULTIQUEUE - struct port_info *pi = txq->port; - - mtx_assert(&txq->lock, MA_OWNED); - if (txq->immpkt != NULL) - panic("immediate packet set"); - - IFQ_DRV_DEQUEUE(&pi->ifp->if_snd, m); - if (m == NULL) - return (0); - - m_vec[0] = m; - return (1); -#endif +#ifdef ALTQ if (ALTQ_IS_ENABLED(txq->txq_ifq)) { IFQ_DRV_DEQUEUE(txq->txq_ifq, m); if (m == NULL) @@ -188,7 +152,7 @@ cxgb_dequeue_packet(struct sge_txq *txq, m_vec[0] = m; return (1); } - +#endif mtx_assert(&txq->lock, MA_OWNED); coalesced = count = size = 0; qs = txq_to_qset(txq, TXQ_ETH); @@ -332,20 +296,14 @@ cxgb_pcpu_start_(struct sge_qset *qs, st } stopped = isset(&qs->txq_stopped, TXQ_ETH); - flush = (( -#ifdef IFNET_MULTIQUEUE - !buf_ring_empty(txq->txq_mr) -#else - !IFQ_DRV_IS_EMPTY(&pi->ifp->if_snd) -#endif + flush = ((drbr_empty(pi->ifp, txq->txq_mr) && !stopped) || txq->immpkt); max_desc = tx_flush ? TX_ETH_Q_SIZE : TX_START_MAX_DESC; err = flush ? cxgb_tx(qs, max_desc) : 0; if ((tx_flush && flush && err == 0) && - (!buf_ring_empty(txq->txq_mr) || - !IFQ_DRV_IS_EMPTY(&pi->ifp->if_snd))) { + !drbr_empty(pi->ifp, txq->txq_mr)) { struct thread *td = curthread; if (++i > 1) { @@ -408,9 +366,6 @@ cxgb_start(struct ifnet *ifp) if (!p->link_config.link_ok) return; - if (IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - return; - cxgb_pcpu_transmit(ifp, NULL); }