Date: Thu, 25 Oct 2018 06:24:42 +0000 (UTC) From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339705 - head/sys/dev/cxgbe Message-ID: <201810250624.w9P6OgeY096370@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810250624.w9P6OgeY096370>