From owner-svn-src-stable@freebsd.org Sat Apr 30 06:35:21 2016 Return-Path: Delivered-To: svn-src-stable@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 C02FFAD986F; Sat, 30 Apr 2016 06:35:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 9B6CB1E70; Sat, 30 Apr 2016 06:35:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3U6ZKKt001577; Sat, 30 Apr 2016 06:35:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3U6ZK9t001575; Sat, 30 Apr 2016 06:35:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201604300635.u3U6ZK9t001575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 30 Apr 2016 06:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298836 - stable/10/sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 06:35:21 -0000 Author: arybchik Date: Sat Apr 30 06:35:20 2016 New Revision: 298836 URL: https://svnweb.freebsd.org/changeset/base/298836 Log: MFC r298735 sfxge(4): do not use RxQ index as label Labels are limitted by 32 on EF10. It is not sufficient on powerful hosts. Since only one RxQ is running over each EvQ, zero label may be used. Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. PR: 208267 Differential Revision: https://reviews.freebsd.org/D6121 Modified: stable/10/sys/dev/sfxge/sfxge_ev.c stable/10/sys/dev/sfxge/sfxge_rx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_ev.c Sat Apr 30 04:02:32 2016 (r298835) +++ stable/10/sys/dev/sfxge/sfxge_ev.c Sat Apr 30 06:35:20 2016 (r298836) @@ -79,6 +79,21 @@ sfxge_ev_qcomplete(struct sfxge_evq *evq sfxge_rx_qcomplete(rxq, eop); } +static struct sfxge_rxq * +sfxge_get_rxq_by_label(struct sfxge_evq *evq, uint32_t label) +{ + struct sfxge_rxq *rxq; + + KASSERT(label == 0, ("unexpected rxq label != 0")); + + rxq = evq->sc->rxq[evq->index]; + + KASSERT(rxq != NULL, ("rxq == NULL")); + KASSERT(evq->index == rxq->index, ("evq->index != rxq->index")); + + return (rxq); +} + static boolean_t sfxge_ev_rx(void *arg, uint32_t label, uint32_t id, uint32_t size, uint16_t flags) @@ -98,11 +113,7 @@ sfxge_ev_rx(void *arg, uint32_t label, u if (evq->exception) goto done; - rxq = sc->rxq[label]; - KASSERT(rxq != NULL, ("rxq == NULL")); - KASSERT(evq->index == rxq->index, - ("evq->index != rxq->index")); - + rxq = sfxge_get_rxq_by_label(evq, label); if (__predict_false(rxq->init_state != SFXGE_RXQ_STARTED)) goto done; @@ -211,7 +222,7 @@ sfxge_ev_rxq_flush_done(void *arg, uint3 evq = sc->evq[index]; - label = rxq_index; + label = 0; KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != level")); magic = SFXGE_MAGIC_RX_QFLUSH_DONE | label; @@ -245,7 +256,7 @@ sfxge_ev_rxq_flush_failed(void *arg, uin index = rxq->index; evq = sc->evq[index]; - label = rxq_index; + label = 0; KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label")); magic = SFXGE_MAGIC_RX_QFLUSH_FAILED | label; @@ -364,36 +375,18 @@ sfxge_ev_software(void *arg, uint16_t ma magic &= ~SFXGE_MAGIC_DMAQ_LABEL_MASK; switch (magic) { - case SFXGE_MAGIC_RX_QFLUSH_DONE: { - struct sfxge_rxq *rxq = sc->rxq[label]; - - KASSERT(rxq != NULL, ("rxq == NULL")); - KASSERT(evq->index == rxq->index, - ("evq->index != rxq->index")); - - sfxge_rx_qflush_done(rxq); + case SFXGE_MAGIC_RX_QFLUSH_DONE: + sfxge_rx_qflush_done(sfxge_get_rxq_by_label(evq, label)); break; - } - case SFXGE_MAGIC_RX_QFLUSH_FAILED: { - struct sfxge_rxq *rxq = sc->rxq[label]; - KASSERT(rxq != NULL, ("rxq == NULL")); - KASSERT(evq->index == rxq->index, - ("evq->index != rxq->index")); - - sfxge_rx_qflush_failed(rxq); + case SFXGE_MAGIC_RX_QFLUSH_FAILED: + sfxge_rx_qflush_failed(sfxge_get_rxq_by_label(evq, label)); break; - } - case SFXGE_MAGIC_RX_QREFILL: { - struct sfxge_rxq *rxq = sc->rxq[label]; - - KASSERT(rxq != NULL, ("rxq == NULL")); - KASSERT(evq->index == rxq->index, - ("evq->index != rxq->index")); - sfxge_rx_qrefill(rxq); + case SFXGE_MAGIC_RX_QREFILL: + sfxge_rx_qrefill(sfxge_get_rxq_by_label(evq, label)); break; - } + case SFXGE_MAGIC_TX_QFLUSH_DONE: { struct sfxge_txq *txq = sfxge_get_txq_by_label(evq, label); Modified: stable/10/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_rx.c Sat Apr 30 04:02:32 2016 (r298835) +++ stable/10/sys/dev/sfxge/sfxge_rx.c Sat Apr 30 06:35:20 2016 (r298836) @@ -1034,7 +1034,7 @@ sfxge_rx_qstart(struct sfxge_softc *sc, return (rc); /* Create the common code receive queue. */ - if ((rc = efx_rx_qcreate(sc->enp, index, index, EFX_RXQ_TYPE_DEFAULT, + if ((rc = efx_rx_qcreate(sc->enp, index, 0, EFX_RXQ_TYPE_DEFAULT, esmp, sc->rxq_entries, rxq->buf_base_id, evq->common, &rxq->common)) != 0) goto fail;