Page MenuHomeFreeBSD

D7716.diff
No OneTemporary

D7716.diff

Index: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
===================================================================
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
@@ -1412,8 +1412,11 @@
}
}
skip:
- if (info->vlan_info != NULL) {
- m_new->m_pkthdr.ether_vtag = info->vlan_info->u1.s1.vlan_id;
+ if (info->vlan_info != HN_NDIS_VLAN_INFO_INVALID) {
+ m_new->m_pkthdr.ether_vtag = EVL_MAKETAG(
+ NDIS_VLAN_INFO_ID(info->vlan_info),
+ NDIS_VLAN_INFO_PRI(info->vlan_info),
+ NDIS_VLAN_INFO_CFI(info->vlan_info));
m_new->m_flags |= M_VLANTAG;
}
Index: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
===================================================================
--- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
+++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
@@ -156,7 +156,7 @@
const struct rndis_pktinfo *pi;
uint32_t mask = 0, len;
- info->vlan_info = NULL;
+ info->vlan_info = HN_NDIS_VLAN_INFO_INVALID;
info->csum_info = NULL;
info->hash_info = NULL;
info->hash_value = NULL;
@@ -193,9 +193,9 @@
switch (pi->rm_type) {
case ieee_8021q_info:
- if (__predict_false(dlen < sizeof(ndis_8021q_info)))
+ if (__predict_false(dlen < NDIS_VLAN_INFO_SIZE))
return (EINVAL);
- info->vlan_info = data;
+ info->vlan_info = *((const uint32_t *)data);
mask |= HV_RF_RECVINFO_VLAN;
break;
Index: head/sys/dev/hyperv/netvsc/if_hnvar.h
===================================================================
--- head/sys/dev/hyperv/netvsc/if_hnvar.h
+++ head/sys/dev/hyperv/netvsc/if_hnvar.h
@@ -55,8 +55,10 @@
struct ndis_8021q_info_;
struct rndis_tcp_ip_csum_info_;
+#define HN_NDIS_VLAN_INFO_INVALID 0xffffffff
+
struct hn_recvinfo {
- const struct ndis_8021q_info_ *vlan_info;
+ uint32_t vlan_info;
const struct rndis_tcp_ip_csum_info_ *csum_info;
const struct rndis_hash_info *hash_info;
const struct rndis_hash_value *hash_value;
Index: head/sys/dev/hyperv/netvsc/ndis.h
===================================================================
--- head/sys/dev/hyperv/netvsc/ndis.h
+++ head/sys/dev/hyperv/netvsc/ndis.h
@@ -203,4 +203,20 @@
uint32_t rss_ind[NDIS_HASH_INDCNT];
};
+/*
+ * Per-packet-info
+ */
+
+/* VLAN */
+#define NDIS_VLAN_INFO_SIZE sizeof(uint32_t)
+#define NDIS_VLAN_INFO_PRI_MASK 0x0007
+#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) | \
+ (((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)
+#define NDIS_VLAN_INFO_PRI(inf) ((inf) & NDIS_VLAN_INFO_PRI_MASK)
+
#endif /* !_NET_NDIS_H_ */

File Metadata

Mime Type
text/plain
Expires
Tue, Apr 21, 6:30 PM (5 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31925872
Default Alt Text
D7716.diff (2 KB)

Event Timeline