--- old/usr/src/pkg/manifests/driver-network-vioif.mf	Thu Jul 16 14:00:31 2015
+++ new/usr/src/pkg/manifests/driver-network-vioif.mf	Thu Jul 16 14:00:31 2015
@@ -30,17 +30,17 @@
 #
 <include global_zone_only_component>
 set name=pkg.fmri value=pkg:/driver/network/vioif@$(PKGVERS)
-set name=pkg.description value="VirtIO network driver"
 set name=pkg.summary value="VirtIO network driver"
+set name=pkg.description value="VirtIO network driver"
 set name=info.classification \
     value=org.opensolaris.category.2008:Drivers/Networking
 set name=variant.arch value=i386
-dir path=kernel group=sys
-dir path=kernel/drv group=sys
-dir path=kernel/drv/$(ARCH64) group=sys
-driver name=vioif alias=pci1af4,1 perms="* 0666 root sys"
+dir  path=kernel group=sys
+dir  path=kernel/drv group=sys
+dir  path=kernel/drv/$(ARCH64) group=sys
 file path=kernel/drv/$(ARCH64)/vioif group=sys
 $(i386_ONLY)file path=kernel/drv/vioif group=sys
+driver name=vioif perms="* 0666 root sys" alias=pci1af4,1
 legacy pkg=SUNWvioif desc="VirtIO network driver" name="VirtIO network driver"
 license cr_Sun license=cr_Sun
-license lic_CDDL license=lic_CDDL
+license lic_CDDL license=lic_CDDL
--- old/usr/src/uts/common/io/vioif/vioif.c	Thu Jul 16 14:00:31 2015
+++ new/usr/src/uts/common/io/vioif/vioif.c	Thu Jul 16 14:00:31 2015
@@ -10,7 +10,7 @@
  */
 
 /*
- * Copyright 2013 Nexenta Inc.  All rights reserved.
+ * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2014, 2015 by Delphix. All rights reserved.
  */
 
@@ -259,11 +259,11 @@
 	unsigned int		sc_tx_stopped:1;
 
 	/* Feature bits. */
-	unsigned int		sc_rx_csum:1;
-	unsigned int		sc_tx_csum:1;
+	unsigned int 		sc_rx_csum:1;
+	unsigned int 		sc_tx_csum:1;
 	unsigned int		sc_tx_tso4:1;
 
-	int			sc_mtu;
+	int 			sc_mtu;
 	uint8_t			sc_mac[ETHERADDRL];
 	/*
 	 * For rx buffers, we keep a pointer array, because the buffers
@@ -310,7 +310,7 @@
 /* MTU + the ethernet header. */
 #define	MAX_PAYLOAD	65535
 #define	MAX_MTU		(MAX_PAYLOAD - ETHER_HEADER_LEN)
-#define	DEFAULT_MTU	ETHERMTU
+#define	DEFAULT_MTU 	ETHERMTU
 
 /*
  * Yeah, we spend 8M per device. Turns out, there is no point
@@ -349,7 +349,7 @@
 #define	VIOIF_TX_THRESH_MAX	640
 #define	VIOIF_RX_THRESH_MAX	640
 
-#define	CACHE_NAME_SIZE	32
+#define CACHE_NAME_SIZE	32
 
 static char vioif_txcopy_thresh[] =
 	"vioif_txcopy_thresh";
@@ -384,6 +384,7 @@
 	if (sc->sc_virtio.sc_features & VIRTIO_NET_F_STATUS) {
 		if (virtio_read_device_config_2(&sc->sc_virtio,
 		    VIRTIO_NET_CONFIG_STATUS) & VIRTIO_NET_S_LINK_UP) {
+
 			return (LINK_STATE_UP);
 		} else {
 			return (LINK_STATE_DOWN);
@@ -695,11 +696,10 @@
 
 	ve = vq_alloc_entry(sc->sc_rx_vq);
 	if (!ve) {
-		/*
-		 * Out of free descriptors - ring already full.
-		 * It would be better to update sc_norxdescavail
-		 * but MAC does not ask for this info, hence we
-		 * update sc_norecvbuf.
+		/* Out of free descriptors - ring already full.
+		 * would be better to update sc_norxdescavail
+		 * but MAC does not ask for this info
+		 * hence update sc_norecvbuf
 		 */
 		sc->sc_norecvbuf++;
 		goto exit_vq;
@@ -844,15 +844,13 @@
 
 			atomic_inc_ulong(&sc->sc_rxloan);
 			/*
-			 * Buffer loaned, we will have to allocte a new one
+			 * Buffer loanded, we will have to allocate a new one
 			 * for this slot.
 			 */
 			sc->sc_rxbufs[ve->qe_index] = NULL;
 		}
-
-		/*
-		 * virtio-net does not tell us if this packet is multicast
-		 * or broadcast, so we have to check it.
+		/* virtio-net does not provide the info if this packet
+		 * is multicast or broadcast. So we have to check it
 		 */
 		if (mp->b_rptr[0] & 0x1) {
 			if (bcmp(mp->b_rptr, vioif_broadcast, ETHERADDRL) != 0)
@@ -1316,7 +1314,6 @@
 		    pr_valsize, pr_val);
 		if (err)
 			return (err);
-		break;
 	default:
 		return (ENOTSUP);
 	}
@@ -1373,8 +1370,6 @@
     mac_prop_info_handle_t prh)
 {
 	struct vioif_softc *sc = arg;
-	char valstr[64];
-	int value;
 
 	switch (pr_num) {
 	case MAC_PROP_MTU:
@@ -1381,7 +1376,10 @@
 		mac_prop_info_set_range_uint32(prh, ETHERMIN, MAX_MTU);
 		break;
 
-	case MAC_PROP_PRIVATE:
+	case MAC_PROP_PRIVATE: {
+		char valstr[64];
+		int value;
+
 		bzero(valstr, sizeof (valstr));
 		if (strcmp(pr_name, vioif_txcopy_thresh) == 0) {
 
@@ -1393,8 +1391,7 @@
 			return;
 		}
 		(void) snprintf(valstr, sizeof (valstr), "%d", value);
-		break;
-
+	}
 	default:
 		break;
 	}
@@ -1430,7 +1427,7 @@
 }
 
 static mac_callbacks_t vioif_m_callbacks = {
-	.mc_callbacks	= (MC_GETCAPAB | MC_SETPROP | MC_GETPROP | MC_PROPINFO),
+	.mc_callbacks   = (MC_GETCAPAB | MC_SETPROP | MC_GETPROP | MC_PROPINFO),
 	.mc_getstat	= vioif_stat,
 	.mc_start	= vioif_start,
 	.mc_stop	= vioif_stop,
@@ -1454,78 +1451,8 @@
     uint32_t features)
 {
 	char buf[512];
-	char *bufp = buf;
-	char *bufend = buf + sizeof (buf);
 
-	/* LINTED E_PTRDIFF_OVERFLOW */
-	bufp += snprintf(bufp, bufend - bufp, prefix);
-
-	/* LINTED E_PTRDIFF_OVERFLOW */
-	bufp += virtio_show_features(features, bufp, bufend - bufp);
-
-	/* LINTED E_PTRDIFF_OVERFLOW */
-	bufp += snprintf(bufp, bufend - bufp, "Vioif ( ");
-
-	if (features & VIRTIO_NET_F_CSUM)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "CSUM ");
-	if (features & VIRTIO_NET_F_GUEST_CSUM)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "GUEST_CSUM ");
-	if (features & VIRTIO_NET_F_MAC)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "MAC ");
-	if (features & VIRTIO_NET_F_GSO)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "GSO ");
-	if (features & VIRTIO_NET_F_GUEST_TSO4)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "GUEST_TSO4 ");
-	if (features & VIRTIO_NET_F_GUEST_TSO6)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "GUEST_TSO6 ");
-	if (features & VIRTIO_NET_F_GUEST_ECN)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "GUEST_ECN ");
-	if (features & VIRTIO_NET_F_GUEST_UFO)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "GUEST_UFO ");
-	if (features & VIRTIO_NET_F_HOST_TSO4)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "HOST_TSO4 ");
-	if (features & VIRTIO_NET_F_HOST_TSO6)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "HOST_TSO6 ");
-	if (features & VIRTIO_NET_F_HOST_ECN)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "HOST_ECN ");
-	if (features & VIRTIO_NET_F_HOST_UFO)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "HOST_UFO ");
-	if (features & VIRTIO_NET_F_MRG_RXBUF)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "MRG_RXBUF ");
-	if (features & VIRTIO_NET_F_STATUS)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "STATUS ");
-	if (features & VIRTIO_NET_F_CTRL_VQ)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "CTRL_VQ ");
-	if (features & VIRTIO_NET_F_CTRL_RX)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "CTRL_RX ");
-	if (features & VIRTIO_NET_F_CTRL_VLAN)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "CTRL_VLAN ");
-	if (features & VIRTIO_NET_F_CTRL_RX_EXTRA)
-		/* LINTED E_PTRDIFF_OVERFLOW */
-		bufp += snprintf(bufp, bufend - bufp, "CTRL_RX_EXTRA ");
-
-	/* LINTED E_PTRDIFF_OVERFLOW */
-	bufp += snprintf(bufp, bufend - bufp, ")");
-	*bufp = '\0';
-
-	dev_err(sc->sc_dev, CE_NOTE, "%s", buf);
+	dev_err(sc->sc_dev, CE_NOTE, "%s %s Vioif (%b)", prefix, virtio_show_features(...), features, "\020\1CSUM\2GUEST_CSUM\3MAC\4GSO\5GUEST_TSO4\5GUEST_TSO6\6GUEST_ECN\7GUEST_UFO\8HOST_TSO4\9HOST_TSO6\10HOST_ECN\11HOST_UFO\12MRG_RXBUF\13STATUS\14CTRL_VQ\15CTRL_RX\16CTRL_VLAN\17CTRL_RX_EXTRA", buf);
 }
 
 /*
@@ -1547,7 +1474,7 @@
 	    VIRTIO_F_NOTIFY_ON_EMPTY);
 
 	vioif_show_features(sc, "Host features: ", host_features);
-	vioif_show_features(sc, "Negotiated features: ",
+	vioif_show_features(sc,  ",
 	    sc->sc_virtio.sc_features);
 
 	if (!(sc->sc_virtio.sc_features & VIRTIO_F_RING_INDIRECT_DESC)) {
@@ -1704,11 +1631,11 @@
 
 	case DDI_RESUME:
 	case DDI_PM_RESUME:
-		/* not supported yet */
+		dev_err(devinfo, CE_WARN, "resume not supported yet");
 		goto exit;
 
 	default:
-		/* unrecognized command */
+		dev_err(devinfo, CE_WARN, "cmd 0x%x unrecognized", cmd);
 		goto exit;
 	}
 
@@ -1887,16 +1814,16 @@
 		break;
 
 	case DDI_PM_SUSPEND:
-		/* not supported yet */
+		cmn_err(CE_WARN, "suspend not supported yet");
 		return (DDI_FAILURE);
 
 	default:
-		/* unrecognized command */
+		cmn_err(CE_WARN, "cmd 0x%x unrecognized", cmd);
 		return (DDI_FAILURE);
 	}
 
 	if (sc->sc_rxloan) {
-		cmn_err(CE_NOTE, "Some rx buffers are still upstream, "
+		cmn_err(CE_WARN, "Some rx buffers are still upstream, "
 		    "Not detaching");
 		return (DDI_FAILURE);
 	}
@@ -1952,6 +1879,7 @@
 	ret = mod_install(&modlinkage);
 	if (ret != DDI_SUCCESS) {
 		mac_fini_ops(&vioif_ops);
+		cmn_err(CE_WARN, "Unable to install the driver");
 		return (ret);
 	}
 
--- old/usr/src/uts/common/io/virtio/virtio.c	Thu Jul 16 14:00:31 2015
+++ new/usr/src/uts/common/io/virtio/virtio.c	Thu Jul 16 14:00:31 2015
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2012 Nexenta Systems, Inc.
+ * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  * Copyright 2012 Alexey Zaytsev <alexey.zaytsev@gmail.com>
  */
 
