From owner-svn-src-stable@freebsd.org Fri Dec 30 17:26:20 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 C70B0C97655; Fri, 30 Dec 2016 17:26:20 +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 87CFC19BA; Fri, 30 Dec 2016 17:26:20 +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 uBUHQJ4G001390; Fri, 30 Dec 2016 17:26:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUHQJro001387; Fri, 30 Dec 2016 17:26:19 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301726.uBUHQJro001387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 17:26:19 +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: r310831 - 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@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 30 Dec 2016 17:26:20 -0000 Author: arybchik Date: Fri Dec 30 17:26:19 2016 New Revision: 310831 URL: https://svnweb.freebsd.org/changeset/base/310831 Log: MFC r310627 sfxge(4): do not limit driver RSS table to RSS channels max Specification of entire RSS table in the driver allows to spread traffic more equally across CPUs/RSS channels if number of RSS channels is not power of 2. Sponsored by: Solarflare Communications, Inc. Modified: stable/11/sys/dev/sfxge/sfxge.h stable/11/sys/dev/sfxge/sfxge_rx.c stable/11/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/11/sys/dev/sfxge/sfxge.h Fri Dec 30 17:24:28 2016 (r310830) +++ stable/11/sys/dev/sfxge/sfxge.h Fri Dec 30 17:26:19 2016 (r310831) @@ -301,7 +301,7 @@ struct sfxge_softc { unsigned int max_rss_channels; uma_zone_t rxq_cache; struct sfxge_rxq *rxq[SFXGE_RX_SCALE_MAX]; - unsigned int rx_indir_table[SFXGE_RX_SCALE_MAX]; + unsigned int rx_indir_table[EFX_RSS_TBL_SIZE]; struct sfxge_txq *txq[SFXGE_TXQ_NTYPES + SFXGE_RX_SCALE_MAX]; Modified: stable/11/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- stable/11/sys/dev/sfxge/sfxge_rx.c Fri Dec 30 17:24:28 2016 (r310830) +++ stable/11/sys/dev/sfxge/sfxge_rx.c Fri Dec 30 17:26:19 2016 (r310831) @@ -1128,7 +1128,7 @@ sfxge_rx_start(struct sfxge_softc *sc) /* * Set up the scale table. Enable all hash types and hash insertion. */ - for (index = 0; index < SFXGE_RX_SCALE_MAX; index++) + for (index = 0; index < nitems(sc->rx_indir_table); index++) #ifdef RSS sc->rx_indir_table[index] = rss_get_indirection_to_bucket(index) % sc->rxq_count; @@ -1136,7 +1136,7 @@ sfxge_rx_start(struct sfxge_softc *sc) sc->rx_indir_table[index] = index % sc->rxq_count; #endif if ((rc = efx_rx_scale_tbl_set(sc->enp, sc->rx_indir_table, - SFXGE_RX_SCALE_MAX)) != 0) + nitems(sc->rx_indir_table))) != 0) goto fail; (void)efx_rx_scale_mode_set(sc->enp, EFX_RX_HASHALG_TOEPLITZ, (1 << EFX_RX_HASH_IPV4) | (1 << EFX_RX_HASH_TCPIPV4) | Modified: stable/11/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/11/sys/dev/sfxge/sfxge_tx.c Fri Dec 30 17:24:28 2016 (r310830) +++ stable/11/sys/dev/sfxge/sfxge_tx.c Fri Dec 30 17:26:19 2016 (r310831) @@ -838,8 +838,9 @@ sfxge_if_transmit(struct ifnet *ifp, str /* check if flowid is set */ if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { uint32_t hash = m->m_pkthdr.flowid; + uint32_t idx = hash % nitems(sc->rx_indir_table); - index = sc->rx_indir_table[hash % SFXGE_RX_SCALE_MAX]; + index = sc->rx_indir_table[idx]; } #endif #if SFXGE_TX_PARSE_EARLY