This is an proposed enhancement to "Implement OpenFlow support for MPLS, for up to 3 labels."
It is in preparation for not adding flows to the datapath which have more MPLS LSEs than the datapath supports. Signed-off-by: Simon Horman <ho...@verge.net.au> --- ofproto/ofproto-dpif-xlate.c | 8 +++++++- ofproto/ofproto-dpif-xlate.h | 3 ++- ofproto/ofproto-dpif.c | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index c3c5b17..9cc7dad 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -92,6 +92,10 @@ struct xbridge { * OVS_USERSPACE_ATTR_USERDATA in OVS_ACTION_ATTR_USERSPACE actions. * False if the datapath supports only 8-byte (or shorter) userdata. */ bool variable_length_userdata; + + /* Number of MPLS label stack entries that the datapath supports + * in matches. */ + size_t max_mpls_depth; }; struct xbundle { @@ -248,7 +252,8 @@ xlate_ofproto_set(struct ofproto_dpif *ofproto, const char *name, const struct dpif_ipfix *ipfix, const struct netflow *netflow, enum ofp_config_flags frag, bool forward_bpdu, bool has_in_band, - bool variable_length_userdata) + bool variable_length_userdata, + size_t max_mpls_depth) { struct xbridge *xbridge = xbridge_lookup(ofproto); @@ -301,6 +306,7 @@ xlate_ofproto_set(struct ofproto_dpif *ofproto, const char *name, xbridge->miss_rule = miss_rule; xbridge->no_packet_in_rule = no_packet_in_rule; xbridge->variable_length_userdata = variable_length_userdata; + xbridge->max_mpls_depth = max_mpls_depth; } void diff --git a/ofproto/ofproto-dpif-xlate.h b/ofproto/ofproto-dpif-xlate.h index 982f1a4..49e554d 100644 --- a/ofproto/ofproto-dpif-xlate.h +++ b/ofproto/ofproto-dpif-xlate.h @@ -129,7 +129,8 @@ void xlate_ofproto_set(struct ofproto_dpif *, const char *name, const struct mbridge *, const struct dpif_sflow *, const struct dpif_ipfix *, const struct netflow *, enum ofp_config_flags, bool forward_bpdu, - bool has_in_band, bool variable_length_userdata) + bool has_in_band, bool variable_length_userdata, + size_t mpls_label_stack_length) OVS_REQ_WRLOCK(xlate_rwlock); void xlate_remove_ofproto(struct ofproto_dpif *) OVS_REQ_WRLOCK(xlate_rwlock); diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 6da8e5c..ee93db2 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -562,7 +562,8 @@ type_run(const char *type) ofproto->netflow, ofproto->up.frag_handling, ofproto->up.forward_bpdu, connmgr_has_in_band(ofproto->up.connmgr), - ofproto->backer->variable_length_userdata); + ofproto->backer->variable_length_userdata, + ofproto->backer->max_mpls_depth); HMAP_FOR_EACH (bundle, hmap_node, &ofproto->bundles) { xlate_bundle_set(ofproto, bundle, bundle->name, -- 1.8.4 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev