Details
- Reviewers
kib - Group Reviewers
network - Commits
- rS337932: Add the ability to look up the 3b PCP of a VLAN interface. Use it in
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
This is modeled after VLAN_TAG (which is mislabeled and just returns the
vid instead of the entire tag). I'm ok with changing the behavior of
VLAN_TAG to return the full tag including pcp but I went with a separate
VLAN_PCP to avoid surprising existing users of VLAN_TAG.
I am fine with that, but I am not quite sure why do you want VLAN_PCP() at all. if_pcp can be directly accessed and used when it is != IFNET_PCP_NONE.
sys/net/if_vlan.c | ||
---|---|---|
768 ↗ | (On Diff #46792) | Do you want this to be safe across vlan interface removal? If so you need to have locked access here. |
I decided to grab the PCP from the ifvlan (like VLAN_TAG does). I believe ifconfig ... vlanpcp <foo> updates this field.
ifconfig ... pcp <foo> updates the if_pcp field but I don't see any code that attempts to keep the ifvlan's pcp
and the ifnet's pcp in sync when the ifnet is a vlan ifnet.
sys/net/if_vlan.c | ||
---|---|---|
768 ↗ | (On Diff #46792) | I want this to be as similar as possible to the vlan_tag a few lines above :-) |