diff options
author | Ben Pfaff <blp@nicira.com> | 2011-11-17 17:11:53 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-11-17 17:11:53 -0800 |
commit | 5e9ceccdb69b7e8f519ebeb9d2825b2686810610 (patch) | |
tree | fc09641b131e6784ae74cf9b67902fe477d885ac /ofproto | |
parent | 6e9ca96c694dad9ca231fca5cbe44ce676e036e7 (diff) |
Implement a new port setting "other-config:priority-tags".
Linux hosts (and probably others) tend to ignore priority-tagged frames, so
this new setting allows Open vSwitch to suppress sending them.
Reported-by: Michael Mao <mmao@nicira.com>
Bug #8320.
Diffstat (limited to 'ofproto')
-rw-r--r-- | ofproto/ofproto-dpif.c | 15 | ||||
-rw-r--r-- | ofproto/ofproto.h | 1 |
2 files changed, 12 insertions, 4 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index e220d96b..951ed18c 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -145,6 +145,7 @@ struct ofbundle { * NULL if all VLANs are trunked. */ 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? */ /* Status. */ bool floodable; /* True if no port has OFPPC_NO_FLOOD set. */ @@ -1364,6 +1365,7 @@ bundle_set(struct ofproto *ofproto_, void *aux, bundle->vlan_mode = PORT_VLAN_TRUNK; bundle->vlan = -1; bundle->trunks = NULL; + bundle->use_priority_tags = s->use_priority_tags; bundle->lacp = NULL; bundle->bond = NULL; @@ -1422,8 +1424,10 @@ bundle_set(struct ofproto *ofproto_, void *aux, } /* Set VLAN tagging mode */ - if (s->vlan_mode != bundle->vlan_mode) { + if (s->vlan_mode != bundle->vlan_mode + || s->use_priority_tags != bundle->use_priority_tags) { bundle->vlan_mode = s->vlan_mode; + bundle->use_priority_tags = s->use_priority_tags; need_flush = true; } @@ -4497,9 +4501,12 @@ output_normal(struct action_xlate_ctx *ctx, const struct ofbundle *out_bundle, } } - tci = htons(vid) | (ctx->flow.vlan_tci & htons(VLAN_PCP_MASK)); - if (tci) { - tci |= htons(VLAN_CFI); + tci = htons(vid); + if (tci || out_bundle->use_priority_tags) { + tci |= ctx->flow.vlan_tci & htons(VLAN_PCP_MASK); + if (tci) { + tci |= htons(VLAN_CFI); + } } commit_vlan_action(ctx, tci); diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h index eed4e508..5a99d469 100644 --- a/ofproto/ofproto.h +++ b/ofproto/ofproto.h @@ -251,6 +251,7 @@ struct ofproto_bundle_settings { enum port_vlan_mode vlan_mode; /* Selects mode for vlan and trunks */ int vlan; /* VLAN VID, except for PORT_VLAN_TRUNK. */ unsigned long *trunks; /* vlan_bitmap, except for PORT_VLAN_ACCESS. */ + bool use_priority_tags; /* Use 802.1p tag for frames in VLAN 0? */ struct bond_settings *bond; /* Must be nonnull iff if n_slaves > 1. */ uint32_t *bond_stable_ids; /* Array of n_slaves elements. */ |