From owner-svn-src-head@freebsd.org Tue Apr 4 23:14:04 2017 Return-Path: Delivered-To: svn-src-head@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 CB53BD2FF70; Tue, 4 Apr 2017 23:14:04 +0000 (UTC) (envelope-from np@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 8232A310; Tue, 4 Apr 2017 23:14:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v34NE3cI031220; Tue, 4 Apr 2017 23:14:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v34NE3sK031219; Tue, 4 Apr 2017 23:14:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201704042314.v34NE3sK031219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 4 Apr 2017 23:14:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316506 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Tue, 04 Apr 2017 23:14:04 -0000 Author: np Date: Tue Apr 4 23:14:03 2017 New Revision: 316506 URL: https://svnweb.freebsd.org/changeset/base/316506 Log: cxgbe(4): Program the global RSS key once instead of once per ifnet. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Apr 4 21:36:13 2017 (r316505) +++ head/sys/dev/cxgbe/t4_main.c Tue Apr 4 23:14:03 2017 (r316506) @@ -4223,6 +4223,10 @@ int adapter_full_init(struct adapter *sc) { int rc, i; +#ifdef RSS + uint32_t raw_rss_key[RSS_KEYSIZE / sizeof(uint32_t)]; + uint32_t rss_key[RSS_KEYSIZE / sizeof(uint32_t)]; +#endif ASSERT_SYNCHRONIZED_OP(sc); ADAPTER_LOCK_ASSERT_NOTOWNED(sc); @@ -4248,6 +4252,14 @@ adapter_full_init(struct adapter *sc) taskqueue_start_threads(&sc->tq[i], 1, PI_NET, "%s tq%d", device_get_nameunit(sc->dev), i); } +#ifdef RSS + MPASS(RSS_KEYSIZE == 40); + rss_getkey((void *)&raw_rss_key[0]); + for (i = 0; i < nitems(rss_key); i++) { + rss_key[i] = htobe32(raw_rss_key[nitems(rss_key) - 1 - i]); + } + t4_write_rss_key(sc, &rss_key[0], -1); +#endif if (!(sc->flags & IS_VF)) t4_intr_enable(sc); @@ -4355,8 +4367,6 @@ vi_full_init(struct vi_info *vi) int nbuckets = rss_getnumbuckets(); int hashconfig = rss_gethashconfig(); int extra; - uint32_t raw_rss_key[RSS_KEYSIZE / sizeof(uint32_t)]; - uint32_t rss_key[RSS_KEYSIZE / sizeof(uint32_t)]; #endif ASSERT_SYNCHRONIZED_OP(sc); @@ -4386,17 +4396,10 @@ vi_full_init(struct vi_info *vi) vi->rss_size); } #ifdef RSS - MPASS(RSS_KEYSIZE == 40); if (vi->nrxq != nbuckets) { if_printf(ifp, "nrxq (%d) != kernel RSS buckets (%d);" "performance will be impacted.\n", vi->nrxq, nbuckets); } - - rss_getkey((void *)&raw_rss_key[0]); - for (i = 0; i < nitems(rss_key); i++) { - rss_key[i] = htobe32(raw_rss_key[nitems(rss_key) - 1 - i]); - } - t4_write_rss_key(sc, &rss_key[0], -1); #endif rss = malloc(vi->rss_size * sizeof (*rss), M_CXGBE, M_ZERO | M_WAITOK); for (i = 0; i < vi->rss_size;) {