'Unreasonably long poll interval's are reasonable for PMD threads. Also reporting of high CPU usage is not necessary.
Signed-off-by: Ilya Maximets <i.maxim...@samsung.com> --- lib/ovs-thread.c | 9 +++++++++ lib/ovs-thread.h | 1 + lib/poll-loop.c | 4 +++- lib/timeval.c | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c index 2f6bc58..7855b3a 100644 --- a/lib/ovs-thread.c +++ b/lib/ovs-thread.c @@ -584,6 +584,15 @@ count_cpu_cores(void) return n_cores > 0 ? n_cores : 0; } + +/* Returns 'true' if current thread is PMD thread. */ +bool +thread_is_pmd(void) +{ + const char *name = get_subprogram_name(); + return !strncmp(name, "pmd", 3); +} + /* ovsthread_key. */ diff --git a/lib/ovs-thread.h b/lib/ovs-thread.h index 26b2ccd..55e51a4 100644 --- a/lib/ovs-thread.h +++ b/lib/ovs-thread.h @@ -523,5 +523,6 @@ bool may_fork(void); /* Useful functions related to threading. */ int count_cpu_cores(void); +bool thread_is_pmd(void); #endif /* ovs-thread.h */ diff --git a/lib/poll-loop.c b/lib/poll-loop.c index 60e1f6e..e83d989 100644 --- a/lib/poll-loop.c +++ b/lib/poll-loop.c @@ -253,7 +253,9 @@ log_wakeup(const char *where, const struct pollfd *pollfd, int timeout) cpu_usage = get_cpu_usage(); if (VLOG_IS_DBG_ENABLED()) { level = VLL_DBG; - } else if (cpu_usage > 50 && !VLOG_DROP_INFO(&rl)) { + } else if (cpu_usage > 50 + && !thread_is_pmd() + && !VLOG_DROP_INFO(&rl)) { level = VLL_INFO; } else { return; diff --git a/lib/timeval.c b/lib/timeval.c index 8f1c97f..d390df1 100644 --- a/lib/timeval.c +++ b/lib/timeval.c @@ -270,7 +270,7 @@ time_poll(struct pollfd *pollfds, int n_pollfds, HANDLE *handles OVS_UNUSED, time_init(); coverage_clear(); coverage_run(); - if (*last_wakeup) { + if (*last_wakeup && !thread_is_pmd()) { log_poll_interval(*last_wakeup); } start = time_msec(); -- 2.1.4 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev