summaryrefslogtreecommitdiffstats
path: root/src/vnet/ethernet/packet.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ethernet/packet.h')
-rw-r--r--src/vnet/ethernet/packet.h9
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