Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Dec 2016 03:20:00 +0000 (UTC)
From:      Sepherosa Ziehau <sephe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r310652 - head/sys/dev/hyperv/netvsc
Message-ID:  <201612280320.uBS3K00r055781@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sephe
Date: Wed Dec 28 03:19:59 2016
New Revision: 310652
URL: https://svnweb.freebsd.org/changeset/base/310652

Log:
  hyperv/hn: Consolidate hn_{suspend,resume}
  
  MFC after:	1 week
  Sponsored by:	Microsoft
  Differential Revision:	https://reviews.freebsd.org/D8907

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

Modified: head/sys/dev/hyperv/netvsc/if_hn.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/if_hn.c	Wed Dec 28 03:07:58 2016	(r310651)
+++ head/sys/dev/hyperv/netvsc/if_hn.c	Wed Dec 28 03:19:59 2016	(r310652)
@@ -2367,9 +2367,6 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, 
 			break;
 		}
 
-		/* Disable polling. */
-		hn_polling(sc, 0);
-
 		/*
 		 * Suspend this interface before the synthetic parts
 		 * are ripped.
@@ -2415,13 +2412,6 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, 
 		 */
 		hn_resume(sc);
 
-		/*
-		 * Re-enable polling if this interface is running and
-		 * the polling is requested.
-		 */
-		if ((ifp->if_drv_flags & IFF_DRV_RUNNING) && sc->hn_pollhz > 0)
-			hn_polling(sc, sc->hn_pollhz);
-
 		HN_UNLOCK(sc);
 		break;
 
@@ -4900,6 +4890,9 @@ static void
 hn_suspend(struct hn_softc *sc)
 {
 
+	/* Disable polling. */
+	hn_polling(sc, 0);
+
 	if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING)
 		hn_suspend_data(sc);
 	hn_suspend_mgmt(sc);
@@ -4992,6 +4985,13 @@ hn_resume(struct hn_softc *sc)
 	if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING)
 		hn_resume_data(sc);
 	hn_resume_mgmt(sc);
+
+	/*
+	 * Re-enable polling if this interface is running and
+	 * the polling is requested.
+	 */
+	if ((sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) && sc->hn_pollhz > 0)
+		hn_polling(sc, sc->hn_pollhz);
 }
 
 static void 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612280320.uBS3K00r055781>