This function doesn't need to be exported in the public OVS headers, and it had an inconsistent name compared to uuid_equals(). Rename and move.
Signed-off-by: Joe Stringer <joestrin...@nicira.com> --- include/openvswitch/types.h | 7 ------- lib/dpif-netdev.c | 2 +- lib/dpif.c | 3 ++- lib/util.h | 7 +++++++ ofproto/ofproto-dpif-upcall.c | 2 +- tests/test-hash.c | 4 ++-- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/openvswitch/types.h b/include/openvswitch/types.h index 2afb7b7..629a3e5 100644 --- a/include/openvswitch/types.h +++ b/include/openvswitch/types.h @@ -88,13 +88,6 @@ typedef union { } u64; } ovs_u128; -/* Returns non-zero if the parameters have equal value. */ -static inline int -ovs_u128_equal(const ovs_u128 *a, const ovs_u128 *b) -{ - return (a->u64.hi == b->u64.hi) && (a->u64.lo == b->u64.lo); -} - /* A 64-bit value, in network byte order, that is only aligned on a 32-bit * boundary. */ typedef struct { diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 76d1003..7916055 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -1767,7 +1767,7 @@ dp_netdev_pmd_find_flow(const struct dp_netdev_pmd_thread *pmd, if (ufidp) { CMAP_FOR_EACH_WITH_HASH (netdev_flow, node, dp_netdev_flow_hash(ufidp), &pmd->flow_table) { - if (ovs_u128_equal(&netdev_flow->ufid, ufidp)) { + if (ovs_u128_equals(&netdev_flow->ufid, ufidp)) { return netdev_flow; } } diff --git a/lib/dpif.c b/lib/dpif.c index aa5e64e..b2f973c 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -899,7 +899,8 @@ dpif_probe_feature(struct dpif *dpif, const char *name, error = dpif_flow_get(dpif, key->data, key->size, ufid, PMD_ID_NULL, &reply, &flow); if (!error - && (!ufid || (flow.ufid_present && ovs_u128_equal(ufid, &flow.ufid)))) { + && (!ufid || (flow.ufid_present + && ovs_u128_equals(ufid, &flow.ufid)))) { enable_feature = true; } diff --git a/lib/util.h b/lib/util.h index 78abfd3..d1e470a 100644 --- a/lib/util.h +++ b/lib/util.h @@ -551,6 +551,13 @@ void bitwise_put(uint64_t value, uint64_t bitwise_get(const void *src, unsigned int src_len, unsigned int src_ofs, unsigned int n_bits); +/* Returns non-zero if the parameters have equal value. */ +static inline int +ovs_u128_equals(const ovs_u128 *a, const ovs_u128 *b) +{ + return (a->u64.hi == b->u64.hi) && (a->u64.lo == b->u64.lo); +} + void xsleep(unsigned int seconds); #ifdef _WIN32 diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index 4dc1694..30909f6 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -1302,7 +1302,7 @@ ukey_lookup(struct udpif *udpif, const ovs_u128 *ufid) struct cmap *cmap = &udpif->ukeys[idx].cmap; CMAP_FOR_EACH_WITH_HASH (ukey, cmap_node, get_ufid_hash(ufid), cmap) { - if (ovs_u128_equal(&ukey->ufid, ufid)) { + if (ovs_u128_equals(&ukey->ufid, ufid)) { return ukey; } } diff --git a/tests/test-hash.c b/tests/test-hash.c index 8352156..67a1f6c 100644 --- a/tests/test-hash.c +++ b/tests/test-hash.c @@ -162,7 +162,7 @@ check_hash_bytes128(void (*hash)(const void *, size_t, uint32_t, ovs_u128 *), set_bit128(&in1, i, n_bits); hash(in0, sizeof(ovs_u128), 0, &out0); hash(&in1, sizeof(ovs_u128), 0, &out1); - if (!ovs_u128_equal(&out0, &out1)) { + if (!ovs_u128_equals(&out0, &out1)) { printf("%s hash not the same for non-64 aligned data " "%016"PRIx64"%016"PRIx64" != %016"PRIx64"%016"PRIx64"\n", name, out0.u64.lo, out0.u64.hi, out1.u64.lo, out1.u64.hi); @@ -214,7 +214,7 @@ check_256byte_hash(void (*hash)(const void *, size_t, uint32_t, ovs_u128 *), set_bit128(in1, i, n_bits); hash(in0, sizeof(ovs_u128) * 16, 0, &out0); hash(in1, sizeof(ovs_u128) * 16, 0, &out1); - if (!ovs_u128_equal(&out0, &out1)) { + if (!ovs_u128_equals(&out0, &out1)) { printf("%s hash not the same for non-64 aligned data " "%016"PRIx64"%016"PRIx64" != %016"PRIx64"%016"PRIx64"\n", name, out0.u64.lo, out0.u64.hi, out1.u64.lo, out1.u64.hi); -- 2.1.4 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev