2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-25 15:07:05 +00:00

Enhance userspace support for MPLS, for up to 3 labels.

This commit makes the userspace support for MPLS more complete.  Now
up to 3 labels are supported.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Co-authored-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Simon Horman <horms@verge.net.au>
This commit is contained in:
Ben Pfaff
2014-02-04 10:32:35 -08:00
parent 42dd41ef30
commit 8bfd0fdace
18 changed files with 743 additions and 355 deletions

View File

@@ -926,11 +926,11 @@ mf_is_all_wild(const struct mf_field *mf, const struct flow_wildcards *wc)
return !(wc->masks.vlan_tci & htons(VLAN_PCP_MASK));
case MFF_MPLS_LABEL:
return !(wc->masks.mpls_lse & htonl(MPLS_LABEL_MASK));
return !(wc->masks.mpls_lse[0] & htonl(MPLS_LABEL_MASK));
case MFF_MPLS_TC:
return !(wc->masks.mpls_lse & htonl(MPLS_TC_MASK));
return !(wc->masks.mpls_lse[1] & htonl(MPLS_TC_MASK));
case MFF_MPLS_BOS:
return !(wc->masks.mpls_lse & htonl(MPLS_BOS_MASK));
return !(wc->masks.mpls_lse[2] & htonl(MPLS_BOS_MASK));
case MFF_IPV4_SRC:
return !wc->masks.nw_src;
@@ -1302,15 +1302,16 @@ mf_get_value(const struct mf_field *mf, const struct flow *flow,
break;
case MFF_MPLS_LABEL:
value->be32 = htonl(mpls_lse_to_label(flow->mpls_lse));
value->be32 = htonl(mpls_lse_to_label(flow->mpls_lse[0]));
break;
case MFF_MPLS_TC:
value->u8 = mpls_lse_to_tc(flow->mpls_lse);
value->u8 = mpls_lse_to_tc(flow->mpls_lse[0]);
break;
case MFF_MPLS_BOS:
value->u8 = mpls_lse_to_bos(flow->mpls_lse);
value->u8 = mpls_lse_to_bos(flow->mpls_lse[0]);
break;
break;
case MFF_IPV4_SRC:
@@ -1498,15 +1499,16 @@ mf_set_value(const struct mf_field *mf,
break;
case MFF_MPLS_LABEL:
match_set_mpls_label(match, value->be32);
match_set_mpls_label(match, 0, value->be32);
break;
case MFF_MPLS_TC:
match_set_mpls_tc(match, value->u8);
match_set_mpls_tc(match, 0, value->u8);
break;
case MFF_MPLS_BOS:
match_set_mpls_bos(match, value->u8);
match_set_mpls_bos(match, 0, value->u8);
break;
break;
case MFF_IPV4_SRC:
@@ -1711,15 +1713,16 @@ mf_set_flow_value(const struct mf_field *mf,
break;
case MFF_MPLS_LABEL:
flow_set_mpls_label(flow, value->be32);
flow_set_mpls_label(flow, 0, value->be32);
break;
case MFF_MPLS_TC:
flow_set_mpls_tc(flow, value->u8);
flow_set_mpls_tc(flow, 0, value->u8);
break;
case MFF_MPLS_BOS:
flow_set_mpls_bos(flow, value->u8);
flow_set_mpls_bos(flow, 0, value->u8);
break;
break;
case MFF_IPV4_SRC:
@@ -1921,15 +1924,16 @@ mf_set_wild(const struct mf_field *mf, struct match *match)
break;
case MFF_MPLS_LABEL:
match_set_any_mpls_label(match);
match_set_any_mpls_label(match, 0);
break;
case MFF_MPLS_TC:
match_set_any_mpls_tc(match);
match_set_any_mpls_tc(match, 0);
break;
case MFF_MPLS_BOS:
match_set_any_mpls_bos(match);
match_set_any_mpls_bos(match, 0);
break;
break;
case MFF_IPV4_SRC: