diff options
| author | Navdeep Parhar <np@FreeBSD.org> | 2018-10-25 06:24:42 +0000 |
|---|---|---|
| committer | Navdeep Parhar <np@FreeBSD.org> | 2018-10-25 06:24:42 +0000 |
| commit | b77aaff9bc11576da2bebdabe50dc26b55746757 (patch) | |
| tree | c7a6559da1ce24cfb6d597cc9af85fcfa96fa8eb | |
| parent | 9083b6057b457c41daad32efeca7a464611864b0 (diff) | |
Notes
| -rw-r--r-- | sys/dev/cxgbe/adapter.h | 1 | ||||
| -rw-r--r-- | sys/dev/cxgbe/t4_main.c | 10 | ||||
| -rw-r--r-- | sys/dev/cxgbe/t4_netmap.c | 8 |
3 files changed, 14 insertions, 5 deletions
diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index a10b6ac04a02..dbebe5b0ece7 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -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; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index e292713b5461..6f87dbcaca7e 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -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); diff --git a/sys/dev/cxgbe/t4_netmap.c b/sys/dev/cxgbe/t4_netmap.c index be09f7ffda11..6836563ce44c 100644 --- a/sys/dev/cxgbe/t4_netmap.c +++ b/sys/dev/cxgbe/t4_netmap.c @@ -415,6 +415,11 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi, struct ifnet *ifp, 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 *vi, struct ifnet *ifp, 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) { |
