Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Dec 2016 11:49:38 +0000 (UTC)
From:      Andrew Rybchenko <arybchik@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r310810 - head/sys/dev/sfxge
Message-ID:  <201612301149.uBUBncWm059703@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arybchik
Date: Fri Dec 30 11:49:37 2016
New Revision: 310810
URL: https://svnweb.freebsd.org/changeset/base/310810

Log:
  sfxge(4): cleanup: check deferred packet list tunables once
  
  Reviewed by:    gnn
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:      2 days
  Differential Revision:  https://reviews.freebsd.org/D8973

Modified:
  head/sys/dev/sfxge/sfxge_tx.c

Modified: head/sys/dev/sfxge/sfxge_tx.c
==============================================================================
--- head/sys/dev/sfxge/sfxge_tx.c	Fri Dec 30 11:02:16 2016	(r310809)
+++ head/sys/dev/sfxge/sfxge_tx.c	Fri Dec 30 11:49:37 2016	(r310810)
@@ -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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612301149.uBUBncWm059703>