aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2018-03-27 15:29:32 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2018-03-27 15:29:32 +0000
commitf137973487f6170f8cb3285ec58aed46e9e3e6f9 (patch)
tree0e49cab197670acd9d1f9ac782edc2d33ab60c17 /sys/net/if.c
parent34a77b974108eecc559c97b3ef170e3f18ffb644 (diff)
downloadsrc-f137973487f6170f8cb3285ec58aed46e9e3e6f9.tar.gz
src-f137973487f6170f8cb3285ec58aed46e9e3e6f9.zip
Allow to specify PCP on packets not belonging to any VLAN.
According to 802.1Q-2014, VLAN tagged packets with VLAN id 0 should be considered as untagged, and only PCP and DEI values from the VLAN tag are meaningful. See for instance https://www.cisco.com/c/en/us/td/docs/switches/connectedgrid/cg-switch-sw-master/software/configuration/guide/vlan0/b_vlan_0.html. Make it possible to specify PCP value for outgoing packets on an ethernet interface. When PCP is supplied, the tag is appended, VLAN id set to 0, and PCP is filled by the supplied value. The code to do VLAN tag encapsulation is refactored from the if_vlan.c and moved into if_ethersubr.c. Drivers might have issues with filtering VID 0 packets on receive. This bug should be fixed for each driver. Reviewed by: ae (previous version), hselasky, melifaro Sponsored by: Mellanox Technologies MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D14702
Notes
Notes: svn path=/head/; revision=331622
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 03cb6a713cd4..c40d4db94c48 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -485,6 +485,7 @@ if_alloc(u_char type)
for (int i = 0; i < IFCOUNTERS; i++)
ifp->if_counters[i] = counter_u64_alloc(M_WAITOK);
ifp->if_get_counter = if_get_counter_default;
+ ifp->if_pcp = IFNET_PCP_NONE;
ifnet_setbyindex(ifp->if_index, ifp);
return (ifp);
}