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 <[email protected]> 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. _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
