diff options
author | Neale Ranns <nranns@cisco.com> | 2018-02-27 03:45:38 -0800 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2018-03-16 20:28:50 +0000 |
commit | 039cbfe254be998f7311bc4638bb262b44efac19 (patch) | |
tree | cc75e6130f3fdbdd1dbfe48669e6c17534240e11 /src/vnet/ethernet | |
parent | 0d65d11053395bde7bd8c36439e9025e50ea8028 (diff) |
QoS recording and marking
Change-Id: Ie5a50def4ec1e4a3b3404a8b6ab9ec248bc16744
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ethernet')
-rw-r--r-- | src/vnet/ethernet/packet.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vnet/ethernet/packet.h b/src/vnet/ethernet/packet.h index 964cf638101..09f5e7f3d0b 100644 --- a/src/vnet/ethernet/packet.h +++ b/src/vnet/ethernet/packet.h @@ -91,6 +91,15 @@ typedef struct u16 type; } ethernet_vlan_header_t; +always_inline void +ethernet_vlan_header_set_priority_net_order (ethernet_vlan_header_t * h, + u8 prio) +{ + u8 *bytes = (u8 *) (&h->priority_cfi_and_id); + + bytes[0] &= 0x1f; + bytes[0] |= (prio & 0x7) << 5; +} /* VLAN with ethertype first and vlan id second */ typedef struct |