const struct recirc_id_node *recirc_id_node_find(uint32_t recirc_id);
+static inline struct recirc_id_node *
+recirc_id_node_from_state(const struct recirc_state *state)
+{
+ return CONTAINER_OF(state, struct recirc_id_node, state);
+}
+
static inline bool recirc_id_node_try_ref_rcu(const struct recirc_id_node *n_)
{
struct recirc_id_node *node = CONST_CAST(struct recirc_id_node *, n_);
* upcalls using recirculation ID for which no context can be
* found). We may still execute the flow's actions even if we
* don't install the flow. */
- upcall->recirc = xin.recirc;
- upcall->have_recirc_ref = recirc_id_node_try_ref_rcu(xin.recirc);
+ upcall->recirc = recirc_id_node_from_state(xin.recirc);
+ upcall->have_recirc_ref = recirc_id_node_try_ref_rcu(upcall->recirc);
}
} else {
/* For non-miss upcalls, we are either executing actions (one of which
xin->odp_actions = odp_actions;
/* Do recirc lookup. */
- xin->recirc = flow->recirc_id
- ? recirc_id_node_find(flow->recirc_id)
- : NULL;
+ xin->recirc = NULL;
+ if (flow->recirc_id) {
+ const struct recirc_id_node *node
+ = recirc_id_node_find(flow->recirc_id);
+ if (node) {
+ xin->recirc = &node->state;
+ }
+ }
}
void
COVERAGE_INC(xlate_actions);
if (xin->recirc) {
- const struct recirc_state *state = &xin->recirc->state;
+ const struct recirc_state *state = xin->recirc;
xlate_report(&ctx, "Restoring state post-recirculation:");
/* The recirculation context related to this translation, as returned by
* xlate_lookup. */
- const struct recirc_id_node *recirc;
+ const struct recirc_state *recirc;
};
void xlate_ofproto_set(struct ofproto_dpif *, const char *name, struct dpif *,