diff options
author | Ilya Maximets <i.maximets@samsung.com> | 2019-07-05 08:43:15 -0400 |
---|---|---|
committer | Ilya Maximets <i.maximets@samsung.com> | 2019-09-06 11:45:39 +0300 |
commit | 1276e3db89bdb4db3dad21b1d03f982d0d186586 (patch) | |
tree | f1a17ae148c1562fd5100b241d4b0c27d7c813a0 /lib/dpif-netdev-perf.h | |
parent | 42db85f3441e3cfb774b49f0ac87b41d43834f2b (diff) | |
download | openvswitch-1276e3db89bdb4db3dad21b1d03f982d0d186586.tar.gz |
dpif-netdev-perf: Fix TSC frequency for non-DPDK case.
Unlike 'rte_get_tsc_cycles()' which doesn't need any specific
initialization, 'rte_get_tsc_hz()' could be used only after successfull
call to 'rte_eal_init()'. 'rte_eal_init()' estimates the TSC frequency
for later use by 'rte_get_tsc_hz()'. Fairly said, we're not allowed
to use 'rte_get_tsc_cycles()' before initializing DPDK too, but it
works this way for now and provides correct results.
This patch provides TSC frequency estimation code that will be used
in two cases:
* DPDK is not compiled in, i.e. DPDK_NETDEV not defined.
* DPDK compiled in but not initialized,
i.e. other_config:dpdk-init=false
This change is mostly useful for AF_XDP netdev support, i.e. allows
to use dpif-netdev/pmd-perf-show command and various PMD perf metrics.
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: William Tu <u9012063@gmail.com>
Diffstat (limited to 'lib/dpif-netdev-perf.h')
-rw-r--r-- | lib/dpif-netdev-perf.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/dpif-netdev-perf.h b/lib/dpif-netdev-perf.h index 244813ffe..ce369375b 100644 --- a/lib/dpif-netdev-perf.h +++ b/lib/dpif-netdev-perf.h @@ -233,6 +233,8 @@ cycles_counter_get(struct pmd_perf_stats *s) return s->last_tsc; } +void pmd_perf_estimate_tsc_frequency(void); + /* A nestable timer for measuring execution time in TSC cycles. * * Usage: |