X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fofproto-dpif-xlate.h;h=18137d5d5e7a8fb99234d5e27aa353158859e2f3;hb=003ce655b7116d18c86a74c50391e54990346931;hp=8b53e10d3fcfb04933dac97818b9e50cb8854bc4;hpb=adcf00ba35a0ce9cf2f1a84bce44559eab1f83a1;p=sliver-openvswitch.git diff --git a/ofproto/ofproto-dpif-xlate.h b/ofproto/ofproto-dpif-xlate.h index 8b53e10d3..18137d5d5 100644 --- a/ofproto/ofproto-dpif-xlate.h +++ b/ofproto/ofproto-dpif-xlate.h @@ -31,11 +31,12 @@ struct lacp; struct dpif_ipfix; struct dpif_sflow; struct mac_learning; +struct xlate_cache; struct xlate_recirc { uint32_t recirc_id; /* !0 Use recirculation instead of output. */ uint8_t hash_alg; /* !0 Compute hash for recirc before. */ - uint32_t hash_bias; /* Compute hash for recirc before. */ + uint32_t hash_basis; /* Compute hash for recirc before. */ }; struct xlate_out { @@ -127,6 +128,15 @@ struct xlate_in { * This is normally null so the client has to set it manually after * calling xlate_in_init(). */ const struct dpif_flow_stats *resubmit_stats; + + /* If nonnull, flow translation populates this cache with references to all + * modules that are affected by translation. This 'xlate_cache' may be + * passed to xlate_push_stats() to perform the same function as + * xlate_actions() without the full cost of translation. + * + * This is normally null so the client has to set it manually after + * calling xlate_in_init(). */ + struct xlate_cache *xcache; }; extern struct ovs_rwlock xlate_rwlock; @@ -179,4 +189,10 @@ void xlate_out_copy(struct xlate_out *dst, const struct xlate_out *src); int xlate_send_packet(const struct ofport_dpif *, struct ofpbuf *); +struct xlate_cache *xlate_cache_new(void); +void xlate_push_stats(struct xlate_cache *, bool may_learn, + const struct dpif_flow_stats *); +void xlate_cache_clear(struct xlate_cache *); +void xlate_cache_delete(struct xlate_cache *); + #endif /* ofproto-dpif-xlate.h */