svn commit: r305454 - head/sys/dev/hyperv/netvsc
Sepherosa Ziehau
sephe at FreeBSD.org
Tue Sep 6 03:31:32 UTC 2016
Author: sephe
Date: Tue Sep 6 03:31:31 2016
New Revision: 305454
URL: https://svnweb.freebsd.org/changeset/base/305454
Log:
hyperv/hn: Fix VLAN tag setup for outgoing VLAN packets.
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7785
Modified:
head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
head/sys/dev/hyperv/netvsc/ndis.h
Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Sep 6 03:20:06 2016 (r305453)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Sep 6 03:31:31 2016 (r305454)
@@ -903,8 +903,10 @@ hn_encap(struct hn_tx_ring *txr, struct
rppi_vlan_info = (ndis_8021q_info *)((uint8_t *)rppi +
rppi->per_packet_info_offset);
- rppi_vlan_info->u1.s1.vlan_id =
- m_head->m_pkthdr.ether_vtag & 0xfff;
+ rppi_vlan_info->u1.value = NDIS_VLAN_INFO_MAKE(
+ EVL_VLANOFTAG(m_head->m_pkthdr.ether_vtag),
+ EVL_PRIOFTAG(m_head->m_pkthdr.ether_vtag),
+ EVL_CFIOFTAG(m_head->m_pkthdr.ether_vtag));
}
if (m_head->m_pkthdr.csum_flags & CSUM_TSO) {
Modified: head/sys/dev/hyperv/netvsc/ndis.h
==============================================================================
--- head/sys/dev/hyperv/netvsc/ndis.h Tue Sep 6 03:20:06 2016 (r305453)
+++ head/sys/dev/hyperv/netvsc/ndis.h Tue Sep 6 03:31:31 2016 (r305454)
@@ -213,7 +213,7 @@ struct ndis_rssprm_toeplitz {
#define NDIS_VLAN_INFO_CFI_MASK 0x0008
#define NDIS_VLAN_INFO_ID_MASK 0xfff0
#define NDIS_VLAN_INFO_MAKE(id, pri, cfi) \
- (((pri) & NVIS_VLAN_INFO_PRI_MASK) | \
+ (((pri) & NDIS_VLAN_INFO_PRI_MASK) | \
(((cfi) & 0x1) << 3) | (((id) & 0xfff) << 4))
#define NDIS_VLAN_INFO_ID(inf) (((inf) & NDIS_VLAN_INFO_ID_MASK) >> 4)
#define NDIS_VLAN_INFO_CFI(inf) (((inf) & NDIS_VLAN_INFO_CFI_MASK) >> 3)
More information about the svn-src-head
mailing list