On Sun, Jan 10, 2016 at 11:18 PM, Pravin B Shelar <pshe...@nicira.com> wrote:
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index cd72e62..c746cc2 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> +static inline unsigned long long
> +cycles_counter(void)
> +{
> +#ifdef DPDK_NETDEV
> +    return rte_get_tsc_cycles();
> +#else
> +    struct timespec tm;
> +
> +    if (clock_gettime(CLOCK_REALTIME, &tm) == -1 ) {

Actually, a couple more comments here:

I think CLOCK_MONOTONIC is a more appropriate counterpart to the TSC.
We don't want things to change if somebody resets the clock. We could
also consider just using the normal OVS timeval code.

I'm also not sure that it is really safe to use the raw TSC in all
cases. It's possible that DPDK support is compiled in but we aren't
using a DPDK port - in that case threads might not be pinned to a
particular core (even in the DPDK case we might want to allow the
threads to float in some situations).
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to