mirror of
https://github.com/openvswitch/ovs
synced 2025-10-25 15:07:05 +00:00
lib/flow: add dp_hash and recirc_id to struct flow
Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
32
lib/match.c
32
lib/match.c
@@ -164,6 +164,26 @@ match_zero_wildcarded_fields(struct match *match)
|
||||
flow_zero_wildcards(&match->flow, &match->wc);
|
||||
}
|
||||
|
||||
void
|
||||
match_set_dp_hash(struct match *match, uint32_t value)
|
||||
{
|
||||
match_set_dp_hash_masked(match, value, UINT32_MAX);
|
||||
}
|
||||
|
||||
void
|
||||
match_set_dp_hash_masked(struct match *match, uint32_t value, uint32_t mask)
|
||||
{
|
||||
match->wc.masks.dp_hash = mask;
|
||||
match->flow.dp_hash = value & mask;
|
||||
}
|
||||
|
||||
void
|
||||
match_set_recirc_id(struct match *match, uint32_t value)
|
||||
{
|
||||
match->flow.recirc_id = value;
|
||||
match->wc.masks.recirc_id = UINT32_MAX;
|
||||
}
|
||||
|
||||
void
|
||||
match_set_reg(struct match *match, unsigned int reg_idx, uint32_t value)
|
||||
{
|
||||
@@ -895,7 +915,7 @@ match_format(const struct match *match, struct ds *s, unsigned int priority)
|
||||
|
||||
int i;
|
||||
|
||||
BUILD_ASSERT_DECL(FLOW_WC_SEQ == 24);
|
||||
BUILD_ASSERT_DECL(FLOW_WC_SEQ == 25);
|
||||
|
||||
if (priority != OFP_DEFAULT_PRIORITY) {
|
||||
ds_put_format(s, "priority=%u,", priority);
|
||||
@@ -903,6 +923,16 @@ match_format(const struct match *match, struct ds *s, unsigned int priority)
|
||||
|
||||
format_uint32_masked(s, "pkt_mark", f->pkt_mark, wc->masks.pkt_mark);
|
||||
|
||||
if (wc->masks.recirc_id) {
|
||||
format_uint32_masked(s, "recirc_id", f->recirc_id,
|
||||
wc->masks.recirc_id);
|
||||
}
|
||||
|
||||
if (f->dp_hash && wc->masks.dp_hash) {
|
||||
format_uint32_masked(s, "dp_hash", f->dp_hash,
|
||||
wc->masks.dp_hash);
|
||||
}
|
||||
|
||||
if (wc->masks.skb_priority) {
|
||||
ds_put_format(s, "skb_priority=%#"PRIx32",", f->skb_priority);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user