X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fflow.h;h=7c3654b00ceb26a4ecb19a76527e56b5bf094abd;hb=5703b15fd6d35071bbf8565d972087aa30cd1cb8;hp=a0209377358f3eb7ba58ca80039c84f18a940888;hpb=4e022ec09e14ac89add74c1b4b8e3ff3873edbf0;p=sliver-openvswitch.git diff --git a/lib/flow.h b/lib/flow.h index a02093773..7c3654b00 100644 --- a/lib/flow.h +++ b/lib/flow.h @@ -213,6 +213,18 @@ u32_to_ofp11(uint32_t port) return OFP11_PORT_C(port); } +static inline uint32_t +hash_ofp_port(ofp_port_t ofp_port) +{ + return hash_int(ofp_to_u16(ofp_port), 0); +} + +static inline uint32_t +hash_odp_port(odp_port_t odp_port) +{ + return hash_int(odp_to_u32(odp_port), 0); +} + uint32_t flow_hash_in_minimask(const struct flow *, const struct minimask *, uint32_t basis); @@ -250,7 +262,8 @@ bool flow_wildcards_equal(const struct flow_wildcards *, const struct flow_wildcards *); uint32_t flow_hash_symmetric_l4(const struct flow *flow, uint32_t basis); -void flow_mask_hash_fields(struct flow_wildcards *, enum nx_hash_fields); +void flow_mask_hash_fields(const struct flow *, struct flow_wildcards *, + enum nx_hash_fields); uint32_t flow_hash_fields(const struct flow *, enum nx_hash_fields, uint16_t basis); const char *flow_hash_fields_to_str(enum nx_hash_fields);