From owner-svn-src-stable-11@freebsd.org Sun Jan 1 19:35:30 2017 Return-Path: Delivered-To: svn-src-stable-11@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 E7414C92BAB; Sun, 1 Jan 2017 19:35:30 +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 9C64C19B7; Sun, 1 Jan 2017 19:35:30 +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 v01JZT2X058384; Sun, 1 Jan 2017 19:35:29 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v01JZThG058383; Sun, 1 Jan 2017 19:35:29 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201701011935.v01JZThG058383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sun, 1 Jan 2017 19:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311029 - stable/11/sys/dev/sfxge X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jan 2017 19:35:31 -0000 Author: arybchik Date: Sun Jan 1 19:35:29 2017 New Revision: 311029 URL: https://svnweb.freebsd.org/changeset/base/311029 Log: MFC r310810 sfxge(4): cleanup: check deferred packet list tunables once Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/11/sys/dev/sfxge/sfxge_tx.c Sun Jan 1 19:33:12 2017 (r311028) +++ stable/11/sys/dev/sfxge/sfxge_tx.c Sun Jan 1 19:35:29 2017 (r311029) @@ -1785,26 +1785,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u (rc = tso_init(txq)) != 0) goto fail3; - if (sfxge_tx_dpl_get_max <= 0) { - log(LOG_ERR, "%s=%d must be greater than 0", - SFXGE_PARAM_TX_DPL_GET_MAX, sfxge_tx_dpl_get_max); - rc = EINVAL; - goto fail_tx_dpl_get_max; - } - if (sfxge_tx_dpl_get_non_tcp_max <= 0) { - log(LOG_ERR, "%s=%d must be greater than 0", - SFXGE_PARAM_TX_DPL_GET_NON_TCP_MAX, - sfxge_tx_dpl_get_non_tcp_max); - rc = EINVAL; - goto fail_tx_dpl_get_max; - } - if (sfxge_tx_dpl_put_max < 0) { - log(LOG_ERR, "%s=%d must be greater or equal to 0", - SFXGE_PARAM_TX_DPL_PUT_MAX, sfxge_tx_dpl_put_max); - rc = EINVAL; - goto fail_tx_dpl_put_max; - } - /* Initialize the deferred packet list. */ stdp = &txq->dpl; stdp->std_put_max = sfxge_tx_dpl_put_max; @@ -1849,8 +1829,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u fail_txq_stat_init: fail_dpl_node: -fail_tx_dpl_put_max: -fail_tx_dpl_get_max: fail3: fail_txq_node: free(txq->pend_desc, M_SFXGE); @@ -1951,6 +1929,26 @@ sfxge_tx_init(struct sfxge_softc *sc) KASSERT(intr->state == SFXGE_INTR_INITIALIZED, ("intr->state != SFXGE_INTR_INITIALIZED")); + if (sfxge_tx_dpl_get_max <= 0) { + log(LOG_ERR, "%s=%d must be greater than 0", + SFXGE_PARAM_TX_DPL_GET_MAX, sfxge_tx_dpl_get_max); + rc = EINVAL; + goto fail_tx_dpl_get_max; + } + if (sfxge_tx_dpl_get_non_tcp_max <= 0) { + log(LOG_ERR, "%s=%d must be greater than 0", + SFXGE_PARAM_TX_DPL_GET_NON_TCP_MAX, + sfxge_tx_dpl_get_non_tcp_max); + rc = EINVAL; + goto fail_tx_dpl_get_non_tcp_max; + } + if (sfxge_tx_dpl_put_max < 0) { + log(LOG_ERR, "%s=%d must be greater or equal to 0", + SFXGE_PARAM_TX_DPL_PUT_MAX, sfxge_tx_dpl_put_max); + rc = EINVAL; + goto fail_tx_dpl_put_max; + } + sc->txq_count = SFXGE_TXQ_NTYPES - 1 + sc->intr.n_alloc; sc->tso_fw_assisted = sfxge_tso_fw_assisted; @@ -2003,5 +2001,8 @@ fail2: fail: fail_txq_node: sc->txq_count = 0; +fail_tx_dpl_put_max: +fail_tx_dpl_get_non_tcp_max: +fail_tx_dpl_get_max: return (rc); }