2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

odp-util: Pass down flow netlink attributes when translating masks.

Sometimes we need to look at flow fields to understand how to parse
an attribute. However, masks don't have this information - just the
mask on the field. We already use the translated flow structure for
this purpose but this isn't always enough since sometimes we actually
need the raw netlink information. Fortunately, that is also readily
available so this passes it down from the appropriate callers.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Jesse Gross
2015-06-19 13:54:13 -07:00
parent 4531547f4a
commit ec1f6f327e
6 changed files with 53 additions and 21 deletions

View File

@@ -178,7 +178,13 @@ struct odp_flow_key_parms {
bool recirc;
/* Only used for mask translation: */
size_t max_mpls_depth;
/* The netlink formatted version of the flow. It is used in cases where
* the mask cannot be constructed from the OVS internal representation
* and needs to see the original form. */
const struct ofpbuf *key_buf;
};
void odp_flow_key_from_flow(const struct odp_flow_key_parms *, struct ofpbuf *);
@@ -207,7 +213,10 @@ enum odp_key_fitness {
};
enum odp_key_fitness odp_flow_key_to_flow(const struct nlattr *, size_t,
struct flow *);
enum odp_key_fitness odp_flow_key_to_mask(const struct nlattr *key, size_t len,
enum odp_key_fitness odp_flow_key_to_mask(const struct nlattr *mask_key,
size_t mask_key_len,
const struct nlattr *flow_key,
size_t flow_key_len,
struct flow *mask,
const struct flow *flow);
const char *odp_key_fitness_to_string(enum odp_key_fitness);