Author: sephe
Date: Sun Sep 18 08:10:40 2016
New Revision: 305925
URL: https://svnweb.freebsd.org/changeset/base/305925

Log:
  hyperv/hn: Don't mess up RSS key and indirect table after attachment.
  
  MFC after:    1 week
  Sponsored by: Microsoft
  Differential Revision:        https://reviews.freebsd.org/D7889

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Sun Sep 18 07:47:57 
2016        (r305924)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Sun Sep 18 08:10:40 
2016        (r305925)
@@ -3159,13 +3159,25 @@ hn_synth_attach(struct hn_softc *sc, int
         * are allocated.
         */
 
-       /* Setup default RSS key. */
-       memcpy(rss->rss_key, hn_rss_key_default, sizeof(rss->rss_key));
+       if (!device_is_attached(sc->hn_dev)) {
+               /*
+                * Setup default RSS key and indirect table for the
+                * attach DEVMETHOD.  They can be altered later on,
+                * so don't mess them up once this interface is attached.
+                */
+               if (bootverbose) {
+                       if_printf(sc->hn_ifp, "setup default RSS key and "
+                           "indirect table\n");
+               }
 
-       /* Setup default RSS indirect table. */
-       /* TODO: Take ndis_rss_caps.ndis_nind into account. */
-       for (i = 0; i < NDIS_HASH_INDCNT; ++i)
-               rss->rss_ind[i] = i % nchan;
+               /* Setup default RSS key. */
+               memcpy(rss->rss_key, hn_rss_key_default, sizeof(rss->rss_key));
+
+               /* Setup default RSS indirect table. */
+               /* TODO: Take ndis_rss_caps.ndis_nind into account. */
+               for (i = 0; i < NDIS_HASH_INDCNT; ++i)
+                       rss->rss_ind[i] = i % nchan;
+       }
 
        error = hn_rndis_conf_rss(sc);
        if (error) {
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to