svn commit: r305962 - head/sys/dev/hyperv/netvsc

Sepherosa Ziehau sephe at FreeBSD.org
Mon Sep 19 07:07:24 UTC 2016


Author: sephe
Date: Mon Sep 19 07:07:23 2016
New Revision: 305962
URL: https://svnweb.freebsd.org/changeset/base/305962

Log:
  hyperv/hn: Don't allow NVS and NDIS version change upon reinitailization
  
  NVS and NDIS version change would break too much assumption and static
  configuration.
  
  MFC after:	1 week
  Sponsored by:	Microsoft
  Differential Revision:	https://reviews.freebsd.org/D7919

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

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c	Mon Sep 19 06:59:17 2016	(r305961)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c	Mon Sep 19 07:07:23 2016	(r305962)
@@ -495,6 +495,22 @@ hn_nvs_init(struct hn_softc *sc)
 {
 	int i;
 
+	if (device_is_attached(sc->hn_dev)) {
+		/*
+		 * NVS version and NDIS version MUST NOT be changed.
+		 */
+		if (bootverbose) {
+			if_printf(sc->hn_ifp, "reinit NVS version 0x%x, "
+			    "NDIS version %u.%u\n", sc->hn_nvs_ver,
+			    HN_NDIS_VERSION_MAJOR(sc->hn_ndis_ver),
+			    HN_NDIS_VERSION_MINOR(sc->hn_ndis_ver));
+		}
+		return (hn_nvs_doinit(sc, sc->hn_nvs_ver));
+	}
+
+	/*
+	 * Find the supported NVS version and set NDIS version accordingly.
+	 */
 	for (i = 0; i < nitems(hn_nvs_version); ++i) {
 		int error;
 


More information about the svn-src-all mailing list