@@ -149,7 +149,8 @@ struct xbundle {
* NULL if all VLANs are trunked. */
unsigned long *cvlans; /* Bitmap of allowed customer vlans,
* NULL if all VLANs are allowed */
- bool use_priority_tags; /* Use 802.1p tag for frames in VLAN 0? */
+ enum port_priority_tags_mode use_priority_tags;
+ /* Use 802.1p tag for frames in VLAN 0? */
bool floodable; /* No port has OFPUTIL_PC_NO_FLOOD set? */
bool protected; /* Protected port mode */
};
@@ -604,7 +605,7 @@ static void xlate_xbundle_set(struct xbundle *xbundle,
enum port_vlan_mode vlan_mode,
uint16_t qinq_ethtype, int vlan,
unsigned long *trunks, unsigned long *cvlans,
- bool use_priority_tags,
+ enum port_priority_tags_mode use_priority_tags,
const struct bond *bond, const struct lacp *lacp,
bool floodable, bool protected);
static void xlate_xport_set(struct xport *xport, odp_port_t odp_port,
@@ -999,7 +1000,7 @@ static void
xlate_xbundle_set(struct xbundle *xbundle,
enum port_vlan_mode vlan_mode, uint16_t qinq_ethtype,
int vlan, unsigned long *trunks, unsigned long *cvlans,
- bool use_priority_tags,
+ enum port_priority_tags_mode use_priority_tags,
const struct bond *bond, const struct lacp *lacp,
bool floodable, bool protected)
{
@@ -1316,7 +1317,7 @@ xlate_bundle_set(struct ofproto_dpif *ofproto, struct ofbundle *ofbundle,
const char *name, enum port_vlan_mode vlan_mode,
uint16_t qinq_ethtype, int vlan,
unsigned long *trunks, unsigned long *cvlans,
- bool use_priority_tags,
+ enum port_priority_tags_mode use_priority_tags,
const struct bond *bond, const struct lacp *lacp,
bool floodable, bool protected)
{
@@ -181,7 +181,7 @@ void xlate_bundle_set(struct ofproto_dpif *, struct ofbundle *,
const char *name, enum port_vlan_mode,
uint16_t qinq_ethtype, int vlan,
unsigned long *trunks, unsigned long *cvlans,
- bool use_priority_tags,
+ enum port_priority_tags_mode use_priority_tags,
const struct bond *, const struct lacp *,
bool floodable, bool protected);
void xlate_bundle_remove(struct ofbundle *);
@@ -101,7 +101,8 @@ struct ofbundle {
unsigned long *cvlans;
struct lacp *lacp; /* LACP if LACP is enabled, otherwise NULL. */
struct bond *bond; /* Nonnull iff more than one port. */
- bool use_priority_tags; /* Use 802.1p tag for frames in VLAN 0? */
+ enum port_priority_tags_mode use_priority_tags;
+ /* Use 802.1p tag for frames in VLAN 0? */
bool protected; /* Protected port mode */
@@ -416,6 +416,13 @@ enum port_vlan_mode {
PORT_VLAN_DOT1Q_TUNNEL
};
+/* The behaviour of the port regarding priority tags */
+enum port_priority_tags_mode {
+ PORT_PRIORITY_TAGS_OMIT = 0,
+ PORT_PRIORITY_TAGS_INCLUDE_NON_ZERO,
+};
+
+/* The behaviour of the port regarding priority tags */
/* Configuration of bundles. */
struct ofproto_bundle_settings {
char *name; /* For use in log messages. */
@@ -428,7 +435,8 @@ struct ofproto_bundle_settings {
int vlan; /* VLAN VID, except for PORT_VLAN_TRUNK. */
unsigned long *trunks; /* vlan_bitmap, except for PORT_VLAN_ACCESS. */
unsigned long *cvlans;
- bool use_priority_tags; /* Use 802.1p tag for frames in VLAN 0? */
+ enum port_priority_tags_mode use_priority_tags;
+ /* Use 802.1p tag for frames in VLAN 0? */
struct bond_settings *bond; /* Must be nonnull iff if n_slaves > 1. */
@@ -3467,18 +3467,18 @@ OVS_VSWITCHD_START(
add-port br0 p1 trunks=10,12 -- \
add-port br0 p2 tag=10 -- \
add-port br0 p3 tag=12 \
- other-config:priority-tags=true -- \
+ other-config:priority-tags=include-non-zero -- \
add-port br0 p4 tag=12 -- \
add-port br0 p5 vlan_mode=native-tagged tag=10 -- \
add-port br0 p6 vlan_mode=native-tagged tag=10 trunks=10,12 -- \
add-port br0 p7 vlan_mode=native-untagged tag=12 -- \
add-port br0 p8 vlan_mode=native-untagged tag=12 trunks=10,12 \
- other-config:priority-tags=true -- \
+ other-config:priority-tags=include-non-zero -- \
add-port br0 p9 vlan_mode=dot1q-tunnel tag=10 other-config:qinq-ethtype=802.1q -- \
add-port br0 p10 vlan_mode=dot1q-tunnel tag=10 cvlans=10,12 other-config:qinq-ethtype=802.1q -- \
add-port br0 p11 vlan_mode=dot1q-tunnel tag=12 other-config:qinq-ethtype=802.1q -- \
add-port br0 p12 vlan_mode=dot1q-tunnel tag=12 other-config:qinq-ethtype=802.1q \
- other-config:priority-tags=true -- \
+ other-config:priority-tags=include-non-zero -- \
set Interface p1 type=dummy -- \
set Interface p2 type=dummy -- \
set Interface p3 type=dummy -- \
@@ -1023,8 +1023,12 @@ port_configure(struct port *port)
? ETH_TYPE_VLAN_8021Q
: ETH_TYPE_VLAN_8021AD);
- s.use_priority_tags = smap_get_bool(&cfg->other_config, "priority-tags",
- false);
+ const char *pt = smap_get_def(&cfg->other_config, "priority-tags", "");
+ if (!strcmp(pt, "include-non-zero") || !strcmp(pt, "true")) {
+ s.use_priority_tags = PORT_PRIORITY_TAGS_INCLUDE_NON_ZERO;
+ } else {
+ s.use_priority_tags = PORT_PRIORITY_TAGS_OMIT;
+ }
/* Get LACP settings. */
s.lacp = port_configure_lacp(port, &lacp_settings);
@@ -1860,7 +1860,7 @@
</column>
<column name="other_config" key="priority-tags"
- type='{"type": "boolean"}'>
+ type='{"type": "string", "enum": ["set", ["omit", "include-non-zero"]]}'>
<p>
An 802.1Q header contains two important pieces of information: a VLAN
ID and a priority. A frame with a zero VLAN ID, called a
@@ -1873,7 +1873,7 @@
header at all, even when the VLAN ID is zero. Therefore, by default
Open vSwitch does not output priority-tagged frames, instead omitting
the 802.1Q header entirely if the VLAN ID is zero. Set this key to
- <code>true</code> to enable priority-tagged frames on a port.
+ <code>include-non-zero</code> to enable priority-tagged frames on a port.
</p>
<p>