Drivers should not have global variables that could conflict with EAL. Rename rte_tsc_freq to nthw_tsc_freq.
Signed-off-by: Serhii Iliushyk <[email protected]> --- drivers/net/ntnic/include/stream_binary_flow_api.h | 2 +- drivers/net/ntnic/ntnic_ethdev.c | 4 ++-- drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ntnic/include/stream_binary_flow_api.h b/drivers/net/ntnic/include/stream_binary_flow_api.h index 3c6de8899b..0678b284d4 100644 --- a/drivers/net/ntnic/include/stream_binary_flow_api.h +++ b/drivers/net/ntnic/include/stream_binary_flow_api.h @@ -46,7 +46,7 @@ #define RAW_ENCAP_DECAP_ELEMS_MAX 16 -extern uint64_t rte_tsc_freq; +extern uint64_t nthw_tsc_freq; extern rte_spinlock_t nthw_lock; /* diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c index 3d52889ad2..4190cfab33 100644 --- a/drivers/net/ntnic/ntnic_ethdev.c +++ b/drivers/net/ntnic/ntnic_ethdev.c @@ -67,7 +67,7 @@ #define MTUINITVAL 1500 -uint64_t rte_tsc_freq; +uint64_t nthw_tsc_freq; #define ETH_DEV_NTNIC_HELP_ARG "help" @@ -2723,7 +2723,7 @@ nthw_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, */ uint64_t now_rtc = rte_get_tsc_cycles(); nthw_os_wait_usec(10 * 1000); - rte_tsc_freq = 100 * (rte_get_tsc_cycles() - now_rtc); + nthw_tsc_freq = 100 * (rte_get_tsc_cycles() - now_rtc); NT_LOG_DBGX(DBG, NTNIC, "leave: ret=%d", ret); return ret; diff --git a/drivers/net/ntnic/ntnic_filter/ntnic_filter.c b/drivers/net/ntnic/ntnic_filter/ntnic_filter.c index fc5f5f8d2f..f1c7fe22e0 100644 --- a/drivers/net/ntnic/ntnic_filter/ntnic_filter.c +++ b/drivers/net/ntnic/ntnic_filter/ntnic_filter.c @@ -1213,7 +1213,7 @@ static int poll_statistics(struct pmd_internals *internals) if (!p_nt4ga_stat || n_intf_no < 0 || n_intf_no >= NUM_ADAPTER_PORTS_MAX) return -1; - RTE_ASSERT(rte_tsc_freq > 0); + RTE_ASSERT(nthw_tsc_freq > 0); rte_spinlock_lock(&nthw_lock); @@ -1223,7 +1223,7 @@ static int poll_statistics(struct pmd_internals *internals) * Check per port max once a second * if more than a second since last stat read, do a new one */ - if ((now_rtc - internals->last_stat_rtc) < rte_tsc_freq) { + if ((now_rtc - internals->last_stat_rtc) < nthw_tsc_freq) { rte_spinlock_unlock(&nthw_lock); return 0; } @@ -1269,7 +1269,7 @@ static int poll_statistics(struct pmd_internals *internals) } /* Globally only once a second */ - if ((now_rtc - last_stat_rtc) < rte_tsc_freq) { + if ((now_rtc - last_stat_rtc) < nthw_tsc_freq) { rte_spinlock_unlock(&nthw_lock); rte_spinlock_unlock(&p_nt_drv->stat_lck); return 0; -- 2.45.0

