[ovs-dev] [PATCHv10] netdev-afxdp: add new netdev type for AF_XDP.

Ilya Maximets i.maximets at samsung.com
Mon Jun 3 15:26:07 UTC 2019


On 02.06.2019 16:43, William Tu wrote:
> Hi Ilya,
> 
> Thanks for your review.
> 
> On Thu, May 30, 2019 at 8:57 AM Ilya Maximets <i.maximets at samsung.com> wrote:
>>
>> On 28.05.2019 22:01, William Tu wrote:
>>> The patch introduces experimental AF_XDP support for OVS netdev.
>>> diff --git a/lib/dpif-netdev-perf.h b/lib/dpif-netdev-perf.h
>>> index 859c05613ddf..a33b9a7353ba 100644
>>> --- a/lib/dpif-netdev-perf.h
>>> +++ b/lib/dpif-netdev-perf.h
>>> @@ -21,6 +21,7 @@
>>>  #include <stddef.h>
>>>  #include <stdint.h>
>>>  #include <string.h>
>>> +#include <time.h>
>>>  #include <math.h>
>>>
>>>  #ifdef DPDK_NETDEV
>>> @@ -186,6 +187,24 @@ struct pmd_perf_stats {
>>>      char *log_reason;
>>>  };
>>>
>>> +#ifdef HAVE_AF_XDP
>>
>> I'd like to change this to "#ifdef __linux__".
>> 'clock_gettime' is posix compliant, but CLOCK_MONOTONIC_RAW is
>> Linux specific.
> 
> Yes, thanks, will do it.
> 
>>
>>> +static inline uint64_t
>>> +rdtsc_syscall(struct pmd_perf_stats *s)
>>> +{
>>> +    struct timespec val;
>>> +    uint64_t v;
>>> +
>>> +    if (clock_gettime(CLOCK_MONOTONIC_RAW, &val) != 0) {
>>> +       return s->last_tsc = 0;
>>
>> Maybe it's better to just return the value and allow caller to assign?
> 
> Do you mean just:
>        return s->last_tsc;

Yes.

> 
>> This way you'll not need to pass any arguments here.
> 
> I don't understand, I still need to pass &val, right?

I meant not passing the argument to rdtsc_syscall, i.e. rdtsc_syscall(void).

Best regards, Ilya Maximets.


More information about the dev mailing list