Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci - only get the vtag if we have it like the other...



details:   https://anonhg.NetBSD.org/src/rev/f556fe8b7001
branches:  trunk
changeset: 826773:f556fe8b7001
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Sep 28 16:24:39 2017 +0000

description:
- only get the vtag if we have it like the other drivers
- mask the hardware vlan tag

diffstat:

 sys/dev/pci/if_bge.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 07211446af87 -r f556fe8b7001 sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c      Thu Sep 28 16:23:57 2017 +0000
+++ b/sys/dev/pci/if_bge.c      Thu Sep 28 16:24:39 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bge.c,v 1.311 2017/09/26 07:42:06 knakahara Exp $   */
+/*     $NetBSD: if_bge.c,v 1.312 2017/09/28 16:24:39 christos Exp $    */
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.311 2017/09/26 07:42:06 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.312 2017/09/28 16:24:39 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -4607,7 +4607,7 @@
                 * to vlan_input() instead of ether_input().
                 */
                if (cur_rx->bge_flags & BGE_RXBDFLAG_VLAN_TAG) {
-                       vlan_set_tag(m, cur_rx->bge_vlan_tag);
+                       vlan_set_tag(m, cur_rx->bge_vlan_tag & ETHER_VLAN_MASK);
                }
 
                if_percpuq_enqueue(ifp->if_percpuq, m);
@@ -5332,7 +5332,8 @@
        }
 
        have_vtag = vlan_has_tag(m_head);
-       vtag = vlan_get_tag(m_head);
+       if (have_vtag)
+               vtag = vlan_get_tag(m_head);
 
        /* Iterate over dmap-map fragments. */
        for (i = 0; i < dmamap->dm_nsegs; i++) {



Home | Main Index | Thread Index | Old Index