Acked-by: Jarno Rajahalme <jrajaha...@nicira.com> > From 71d0ebf2d9b473bf0f848e3ae76223b35ffd4505 Mon Sep 17 00:00:00 2001 > From: Daniele Di Proietto <diproiet...@vmware.com> > Date: Wed, 22 Jul 2015 18:41:48 +0100 > Subject: [PATCH] lib: Introduce ovs_u128_is_zero(). > > is_all_zeros() is quite slow for u128 initialization because: > - It is not inlined > - It checks byte by byte > > This commit introduces a new function to perform this function, which > improves performance in the DPDK packet processing path for upcoming > commits that regularly check u128 values. > --- > lib/util.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/lib/util.h b/lib/util.h > index 7080a0c..eebc6e9 100644 > --- a/lib/util.h > +++ b/lib/util.h > @@ -568,6 +568,13 @@ ovs_u128_equals(const ovs_u128 *a, const ovs_u128 *b) > return (a->u64.hi == b->u64.hi) && (a->u64.lo == b->u64.lo); > } > > +/* Returns true if 'val' is 0. */ > +static inline bool > +ovs_u128_is_zero(const ovs_u128 *val) > +{ > + return !(val->u64.hi || val->u64.lo); > +} > + > void xsleep(unsigned int seconds); > > #ifdef _WIN32
_______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev