On Mon, Jan 25, 2016 at 9:34 AM, Jesse Gross <je...@kernel.org> wrote:
> 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.
>
ok.

> 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).

This function is only used in userspace datapath. So even if DPDK is
compiled in it should not matter much unless userspace datapath is
configured.
AFAIK local timestamp is most efficient way to generate timestamp. So
handle scheduling issues, I will add cpu information along with the
timestamp to implement better timer.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to