diff options
| author | Ben Pfaff <blp@nicira.com> | 2010-10-20 16:33:10 -0700 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2010-10-29 09:48:47 -0700 |
| commit | 5436300437bd20c5e8e006fedc55c517cb090de5 (patch) | |
| tree | 11fcad81eb9f71f5ad6aa37915796fcfa7db3a05 /lib/flow.h | |
| parent | 8054fc48f9a620aa07714a70f6ec301e0d8ec4ee (diff) | |
| download | openvswitch-5436300437bd20c5e8e006fedc55c517cb090de5.tar.gz | |
flow: Un-inline flow_wildcards functions.
These functions really seem too big to inline.
Diffstat (limited to 'lib/flow.h')
| -rw-r--r-- | lib/flow.h | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/lib/flow.h b/lib/flow.h index df16a77c6..ba376812c 100644 --- a/lib/flow.h +++ b/lib/flow.h @@ -95,28 +95,7 @@ struct flow_wildcards { ovs_be32 nw_dst_mask; /* 1-bit in each significant nw_dst bit. */ }; -/* Given the wildcard bit count in bits 'shift' through 'shift + 5' (inclusive) - * of 'wildcards', returns a 32-bit bit mask with a 1 in each bit that must - * match and a 0 in each bit that is wildcarded. - * - * The bits in 'wildcards' are in the format used in enum ofp_flow_wildcards: 0 - * is exact match, 1 ignores the LSB, 2 ignores the 2 least-significant bits, - * ..., 32 and higher wildcard the entire field. This is the *opposite* of the - * usual convention where e.g. /24 indicates that 8 bits (not 24 bits) are - * wildcarded. */ -static inline ovs_be32 -flow_nw_bits_to_mask(uint32_t wildcards, int shift) -{ - wildcards = (wildcards >> shift) & 0x3f; - return wildcards < 32 ? htonl(~((1u << wildcards) - 1)) : 0; -} - -static inline void -flow_wildcards_init(struct flow_wildcards *wc, uint32_t wildcards) -{ - wc->wildcards = wildcards & OVSFW_ALL; - wc->nw_src_mask = flow_nw_bits_to_mask(wc->wildcards, OFPFW_NW_SRC_SHIFT); - wc->nw_dst_mask = flow_nw_bits_to_mask(wc->wildcards, OFPFW_NW_DST_SHIFT); -} +ovs_be32 flow_nw_bits_to_mask(uint32_t wildcards, int shift); +void flow_wildcards_init(struct flow_wildcards *, uint32_t wildcards); #endif /* flow.h */ |
