diff options
-rw-r--r-- | net/openvswitch/flow_table.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c index 5899bf161c61..81b977d839df 100644 --- a/net/openvswitch/flow_table.c +++ b/net/openvswitch/flow_table.c | |||
@@ -585,16 +585,10 @@ static int flow_mask_insert(struct flow_table *tbl, struct sw_flow *flow, | |||
585 | } | 585 | } |
586 | 586 | ||
587 | /* Must be called with OVS mutex held. */ | 587 | /* Must be called with OVS mutex held. */ |
588 | int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow, | 588 | static void flow_key_insert(struct flow_table *table, struct sw_flow *flow) |
589 | const struct sw_flow_mask *mask) | ||
590 | { | 589 | { |
591 | struct table_instance *new_ti = NULL; | 590 | struct table_instance *new_ti = NULL; |
592 | struct table_instance *ti; | 591 | struct table_instance *ti; |
593 | int err; | ||
594 | |||
595 | err = flow_mask_insert(table, flow, mask); | ||
596 | if (err) | ||
597 | return err; | ||
598 | 592 | ||
599 | flow->hash = flow_hash(&flow->key, flow->mask->range.start, | 593 | flow->hash = flow_hash(&flow->key, flow->mask->range.start, |
600 | flow->mask->range.end); | 594 | flow->mask->range.end); |
@@ -613,6 +607,19 @@ int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow, | |||
613 | table_instance_destroy(ti, true); | 607 | table_instance_destroy(ti, true); |
614 | table->last_rehash = jiffies; | 608 | table->last_rehash = jiffies; |
615 | } | 609 | } |
610 | } | ||
611 | |||
612 | /* Must be called with OVS mutex held. */ | ||
613 | int ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow, | ||
614 | const struct sw_flow_mask *mask) | ||
615 | { | ||
616 | int err; | ||
617 | |||
618 | err = flow_mask_insert(table, flow, mask); | ||
619 | if (err) | ||
620 | return err; | ||
621 | flow_key_insert(table, flow); | ||
622 | |||
616 | return 0; | 623 | return 0; |
617 | } | 624 | } |
618 | 625 | ||