Skip to content

Commit

Permalink
flow: Add mf_is_l3_or_higher()
Browse files Browse the repository at this point in the history
This is in preparation for using the same helper as part of support
for using recirculation in conjunction series of actions including
with MPLS actions that are currently not able to be translated.

In that scenario this helper will be used to test if load, move and
set_field actions require recirculation to occur.

Signed-off-by: Simon Horman <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
horms authored and blp committed May 2, 2014
1 parent 9bbf88b commit d4e7819
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/meta-flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ enum OVS_PACKED_ENUM mf_field_id {
MFF_MPLS_BOS, /* u8 */

/* L3. */
/* Update mf_is_l3_or_higher() if MFF_IPV4_SRC is
* no longer the first element for a field of layer 3 or higher */
MFF_IPV4_SRC, /* be32 */
MFF_IPV4_DST, /* be32 */

Expand Down Expand Up @@ -361,6 +363,12 @@ void mf_get_mask(const struct mf_field *, const struct flow_wildcards *,
bool mf_are_prereqs_ok(const struct mf_field *, const struct flow *);
void mf_mask_field_and_prereqs(const struct mf_field *, struct flow *mask);

static inline bool
mf_is_l3_or_higher(const struct mf_field *mf)
{
return mf->id >= MFF_IPV4_SRC;
}

/* Field values. */
bool mf_is_value_valid(const struct mf_field *, const union mf_value *value);

Expand Down

0 comments on commit d4e7819

Please sign in to comment.