cxgbe(4): Update the VI's default queue when netmap is enabled/disabled.

Sponsored by:	Chelsio Communications
This commit is contained in:
np 2018-10-25 06:24:42 +00:00
parent d4f6b392d7
commit ce7bd5df64
3 changed files with 14 additions and 5 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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) {