--- old/usr/src/pkg/manifests/driver-network-vioif.mf	Tue Jul 21 11:05:08 2015
+++ new/usr/src/pkg/manifests/driver-network-vioif.mf	Tue Jul 21 11:05:08 2015
@@ -1,26 +1,20 @@
 #
 # CDDL HEADER START
 #
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
 #
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
+# A full copy of the text of the CDDL should have accompanied this
+# source.  A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
 #
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
 # CDDL HEADER END
 #
 
 #
-# Copyright (c) 2013, Nexenta Systems. All rights reserved.
+# Copyright (c) 2013, Nexenta Systems Inc. All rights reserved.
 #
 
 #
--- old/usr/src/uts/common/io/vioif/vioif.c	Tue Jul 21 11:05:08 2015
+++ new/usr/src/uts/common/io/vioif/vioif.c	Tue Jul 21 11:05:08 2015
@@ -55,9 +55,8 @@
 #include <sys/debug.h>
 #include <sys/pci.h>
 #include <sys/ethernet.h>
+#include <sys/vlan.h>
 
-#define	VLAN_TAGSZ 4
-
 #include <sys/dlpi.h>
 #include <sys/taskq.h>
 #include <sys/cyclic.h>
@@ -76,10 +75,6 @@
 #include "virtiovar.h"
 #include "virtioreg.h"
 
-#if !defined(__packed)
-#define	__packed __attribute__((packed))
-#endif /* __packed */
-
 /* Configuration registers */
 #define	VIRTIO_NET_CONFIG_MAC		0 /* 8bit x 6byte */
 #define	VIRTIO_NET_CONFIG_STATUS	6 /* 16bit */
@@ -104,9 +99,31 @@
 #define	VIRTIO_NET_F_CTRL_VLAN	(1 << 19) /* Control channel VLAN filtering */
 #define	VIRTIO_NET_F_CTRL_RX_EXTRA (1 << 20) /* Extra RX mode control support */
 
+#define VIRTIO_NET_FEATURE_BITS \
+	"\020" \
+	"\1CSUM" \
+	"\2GUEST_CSUM" \
+	"\6MAC" \
+	"\7GSO" \
+	"\10GUEST_TSO4" \
+	"\11GUEST_TSO6" \
+	"\12GUEST_ECN" \
+	"\13GUEST_UFO" \
+	"\14HOST_TSO4" \
+	"\15HOST_TSO6" \
+	"\16HOST_ECN" \
+	"\17HOST_UFO" \
+	"\20MRG_RXBUF" \
+	"\21STATUS" \
+	"\22CTRL_VQ" \
+	"\23CTRL_RX" \
+	"\24CTRL_VLAN" \
+	"\25CTRL_RX_EXTRA"
+
 /* Status */
 #define	VIRTIO_NET_S_LINK_UP	1
 
+#pragma pack(1)
 /* Packet header structure */
 struct virtio_net_hdr {
 	uint8_t		flags;
@@ -116,6 +133,7 @@
 	uint16_t	csum_start;
 	uint16_t	csum_offset;
 };
+#pragma pack()
 
 #define	VIRTIO_NET_HDR_F_NEEDS_CSUM	1 /* flags */
 #define	VIRTIO_NET_HDR_GSO_NONE		0 /* gso_type */
@@ -126,10 +144,12 @@
 
 
 /* Control virtqueue */
+#pragma pack(1)
 struct virtio_net_ctrl_cmd {
 	uint8_t	class;
 	uint8_t	command;
-} __packed;
+};
+#pragma pack()
 
 #define	VIRTIO_NET_CTRL_RX		0
 #define	VIRTIO_NET_CTRL_RX_PROMISC	0
@@ -142,22 +162,24 @@
 #define	VIRTIO_NET_CTRL_VLAN_ADD	0
 #define	VIRTIO_NET_CTRL_VLAN_DEL	1
 
+#pragma pack(1)
 struct virtio_net_ctrl_status {
 	uint8_t	ack;
-} __packed;
+};
 
 struct virtio_net_ctrl_rx {
 	uint8_t	onoff;
-} __packed;
+};
 
 struct virtio_net_ctrl_mac_tbl {
 	uint32_t nentries;
 	uint8_t macs[][ETHERADDRL];
-} __packed;
+};
 
 struct virtio_net_ctrl_vlan {
 	uint16_t id;
-} __packed;
+};
+#pragma pack()
 
 static int vioif_quiesce(dev_info_t *);
 static int vioif_attach(dev_info_t *, ddi_attach_cmd_t);
@@ -844,7 +866,7 @@
 
 			atomic_inc_ulong(&sc->sc_rxloan);
 			/*
-			 * Buffer loaned, we will have to allocte a new one
+			 * Buffer loaned, we will have to allocate a new one
 			 * for this slot.
 			 */
 			sc->sc_rxbufs[ve->qe_index] = NULL;
@@ -1075,9 +1097,7 @@
 	(void) memset(buf->tb_inline_mapping.vbm_buf, 0,
 	    sizeof (struct virtio_net_hdr));
 
-	/* LINTED E_BAD_PTR_CAST_ALIGN */
-	net_header = (struct virtio_net_hdr *)
-	    buf->tb_inline_mapping.vbm_buf;
+	net_header = (struct virtio_net_hdr *)buf->tb_inline_mapping.vbm_buf;
 
 	mac_hcksum_get(mp, &csum_start, &csum_stuff, NULL,
 	    NULL, &csum_flags);
@@ -1459,73 +1479,14 @@
 
 	/* 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);
+
+	/* Using '!' to only CE_NOTE this to the system log. */
+	dev_err(sc->sc_dev, CE_NOTE, "!%s Vioif (%b)", buf, features,
+	    VIRTIO_NET_FEATURE_BITS);
 }
 
 /*
@@ -1704,11 +1665,10 @@
 
 	case DDI_RESUME:
 	case DDI_PM_RESUME:
-		/* not supported yet */
+		/* We do not support suspend/resume for vioif. */
 		goto exit;
 
 	default:
-		/* unrecognized command */
 		goto exit;
 	}
 
@@ -1887,17 +1847,16 @@
 		break;
 
 	case DDI_PM_SUSPEND:
-		/* not supported yet */
+		/* We do not support suspend/resume for vioif. */
 		return (DDI_FAILURE);
 
 	default:
-		/* unrecognized command */
 		return (DDI_FAILURE);
 	}
 
 	if (sc->sc_rxloan) {
-		cmn_err(CE_NOTE, "Some rx buffers are still upstream, "
-		    "Not detaching");
+		dev_err(devinfo, CE_WARN, "!Some rx buffers are still upstream,"
+		    " not detaching.");
 		return (DDI_FAILURE);
 	}
 
--- old/usr/src/uts/common/io/virtio/virtio.c	Tue Jul 21 11:05:08 2015
+++ new/usr/src/uts/common/io/virtio/virtio.c	Tue Jul 21 11:05:08 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>
  */
 
