Functionally this has little change, but it allows the following patch
to refactor the translation code with less changes.
Strictly speaking the odp_flow_key_to_flow() and xlate_lookup() error
cases should free the ukey->xcache, since it's empty and was never
initialised via the later call to xlate_actions(). However, if one of
these error conditions is hit during a flow dump, then there's no way
that it will ever succeed on a subsequent revalidate/delete. Rather, the
later revalidate/delete would do no stats translation - the same result
as keeping the empty xcache here.
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
goto exit;
}
+ if (need_revalidate) {
+ xlate_cache_clear(ukey->xcache);
+ }
+ if (!ukey->xcache) {
+ ukey->xcache = xlate_cache_new();
+ }
+
if (odp_flow_key_to_flow(ukey->key, ukey->key_len, &flow)
== ODP_FIT_ERROR) {
goto exit;
goto exit;
}
- if (need_revalidate) {
- xlate_cache_clear(ukey->xcache);
- }
- if (!ukey->xcache) {
- ukey->xcache = xlate_cache_new();
- }
-
xlate_in_init(&xin, ofproto, ofproto_dpif_get_tables_version(ofproto),
&flow, ofp_in_port, NULL, push.tcp_flags,
NULL, need_revalidate ? &wc : NULL, odp_actions);