svn commit: r345592 - stable/12/sys/dev/cxgbe

Navdeep Parhar np at FreeBSD.org
Wed Mar 27 19:25:27 UTC 2019


Author: np
Date: Wed Mar 27 19:24:37 2019
New Revision: 345592
URL: https://svnweb.freebsd.org/changeset/base/345592

Log:
  MFC r339705:
  
  cxgbe(4): Update the VI's default queue when netmap is enabled/disabled.
  
  Sponsored by:	Chelsio Communications

Modified:
  stable/12/sys/dev/cxgbe/adapter.h
  stable/12/sys/dev/cxgbe/t4_main.c
  stable/12/sys/dev/cxgbe/t4_netmap.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/adapter.h
==============================================================================
--- stable/12/sys/dev/cxgbe/adapter.h	Wed Mar 27 19:18:10 2019	(r345591)
+++ stable/12/sys/dev/cxgbe/adapter.h	Wed Mar 27 19:24:37 2019	(r345592)
@@ -197,6 +197,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: stable/12/sys/dev/cxgbe/t4_main.c
==============================================================================
--- stable/12/sys/dev/cxgbe/t4_main.c	Wed Mar 27 19:18:10 2019	(r345591)
+++ stable/12/sys/dev/cxgbe/t4_main.c	Wed Mar 27 19:24:37 2019	(r345592)
@@ -5282,7 +5282,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();
@@ -5346,14 +5346,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
@@ -5382,12 +5382,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: stable/12/sys/dev/cxgbe/t4_netmap.c
==============================================================================
--- stable/12/sys/dev/cxgbe/t4_netmap.c	Wed Mar 27 19:18:10 2019	(r345591)
+++ stable/12/sys/dev/cxgbe/t4_netmap.c	Wed Mar 27 19:24:37 2019	(r345592)
@@ -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) {


More information about the svn-src-all mailing list