From owner-svn-src-all@freebsd.org Thu Oct 25 06:24:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A7A7FEE2B0; Thu, 25 Oct 2018 06:24:43 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0119472DB3; Thu, 25 Oct 2018 06:24:43 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F01DC608B; Thu, 25 Oct 2018 06:24:42 +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 w9P6Og5h096372; Thu, 25 Oct 2018 06:24:42 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9P6OgeY096370; Thu, 25 Oct 2018 06:24:42 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810250624.w9P6OgeY096370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 25 Oct 2018 06:24:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339705 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 339705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2018 06:24:43 -0000 Author: np Date: Thu Oct 25 06:24:42 2018 New Revision: 339705 URL: https://svnweb.freebsd.org/changeset/base/339705 Log: cxgbe(4): Update the VI's default queue when netmap is enabled/disabled. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Oct 25 05:18:25 2018 (r339704) +++ head/sys/dev/cxgbe/adapter.h Thu Oct 25 06:24:42 2018 (r339705) @@ -194,6 +194,7 @@ struct vi_info { int16_t xact_addr_filt;/* index of exact MAC address filter */ uint16_t rss_size; /* size of VI's RSS table slice */ uint16_t rss_base; /* start of VI's RSS table slice */ + int hashen; int nintr; int first_intr; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Oct 25 05:18:25 2018 (r339704) +++ head/sys/dev/cxgbe/t4_main.c Thu Oct 25 06:24:42 2018 (r339705) @@ -5152,7 +5152,7 @@ vi_full_init(struct vi_info *vi) struct ifnet *ifp = vi->ifp; uint16_t *rss; struct sge_rxq *rxq; - int rc, i, j, hashen; + int rc, i, j; #ifdef RSS int nbuckets = rss_getnumbuckets(); int hashconfig = rss_gethashconfig(); @@ -5216,14 +5216,14 @@ vi_full_init(struct vi_info *vi) } #ifdef RSS - hashen = hashconfig_to_hashen(hashconfig); + vi->hashen = hashconfig_to_hashen(hashconfig); /* * We may have had to enable some hashes even though the global config * wants them disabled. This is a potential problem that must be * reported to the user. */ - extra = hashen_to_hashconfig(hashen) ^ hashconfig; + extra = hashen_to_hashconfig(vi->hashen) ^ hashconfig; /* * If we consider only the supported hash types, then the enabled hashes @@ -5252,12 +5252,12 @@ vi_full_init(struct vi_info *vi) if (extra & RSS_HASHTYPE_RSS_UDP_IPV6) if_printf(ifp, "UDP/IPv6 4-tuple hashing forced on.\n"); #else - hashen = F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN | + vi->hashen = F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN | F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN | F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN | F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN | F_FW_RSS_VI_CONFIG_CMD_UDPEN; #endif - rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, hashen, rss[0], 0, 0); + rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, rss[0], 0, 0); if (rc != 0) { free(rss, M_CXGBE); if_printf(ifp, "rss hash/defaultq config failed: %d\n", rc); Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Thu Oct 25 05:18:25 2018 (r339704) +++ head/sys/dev/cxgbe/t4_netmap.c Thu Oct 25 06:24:42 2018 (r339705) @@ -415,6 +415,11 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi if (rc != 0) if_printf(ifp, "netmap rss_config failed: %d\n", rc); + rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, + vi->nm_rss[0], 0, 0); + if (rc != 0) + if_printf(ifp, "netmap rss hash/defaultq config failed: %d\n", rc); + return (rc); } @@ -436,6 +441,9 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v vi->rss, vi->rss_size); if (rc != 0) if_printf(ifp, "failed to restore RSS config: %d\n", rc); + rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, vi->hashen, vi->rss[0], 0, 0); + if (rc != 0) + if_printf(ifp, "failed to restore RSS hash/defaultq: %d\n", rc); nm_clear_native_flags(na); for_each_nm_txq(vi, i, nm_txq) {