Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/hyperv hvn(4): Handle CFI field of VLAN.



details:   https://anonhg.NetBSD.org/src/rev/a67bd07b820a
branches:  trunk
changeset: 847532:a67bd07b820a
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Fri Dec 27 05:59:53 2019 +0000

description:
hvn(4): Handle CFI field of VLAN.

diffstat:

 sys/dev/hyperv/if_hvn.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r 4d4185d8a603 -r a67bd07b820a sys/dev/hyperv/if_hvn.c
--- a/sys/dev/hyperv/if_hvn.c   Fri Dec 27 05:56:42 2019 +0000
+++ b/sys/dev/hyperv/if_hvn.c   Fri Dec 27 05:59:53 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_hvn.c,v 1.14 2019/12/27 05:56:42 nonaka Exp $       */
+/*     $NetBSD: if_hvn.c,v 1.15 2019/12/27 05:59:53 nonaka Exp $       */
 /*     $OpenBSD: if_hvn.c,v 1.39 2018/03/11 14:31:34 mikeb Exp $       */
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.14 2019/12/27 05:56:42 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.15 2019/12/27 05:59:53 nonaka Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -67,6 +67,9 @@
 #ifndef EVL_PRIO_BITS
 #define EVL_PRIO_BITS  13
 #endif
+#ifndef EVL_CFI_BITS
+#define EVL_CFI_BITS   12
+#endif
 
 #define HVN_NVS_MSGSIZE                        32
 #define HVN_NVS_BUFSIZE                        PAGE_SIZE
@@ -584,7 +587,7 @@
 
                tag = vlan_get_tag(m);
                vlan = NDIS_VLAN_INFO_MAKE(EVL_VLANOFTAG(tag),
-                   EVL_PRIOFTAG(tag), 0);
+                   EVL_PRIOFTAG(tag), EVL_CFIOFTAG(tag));
                cp = hvn_rndis_pktinfo_append(pkt, HVN_RNDIS_PKT_LEN,
                    NDIS_VLAN_INFO_SIZE, NDIS_PKTINFO_TYPE_VLAN);
                memcpy(cp, &vlan, NDIS_VLAN_INFO_SIZE);
@@ -1593,6 +1596,7 @@
                        if (vlan != 0xffffffff) {
                                uint16_t t = NDIS_VLAN_INFO_ID(vlan);
                                t |= NDIS_VLAN_INFO_PRI(vlan) << EVL_PRIO_BITS;
+                               t |= NDIS_VLAN_INFO_CFI(vlan) << EVL_CFI_BITS;
                                vlan_set_tag(m, t);
                        }
                        break;



Home | Main Index | Thread Index | Old Index