All global variables in driver should use common prefix.
Rename hwlock to nthw_lock.

Signed-off-by: Serhii Iliushyk <[email protected]>
---
 drivers/net/ntnic/include/stream_binary_flow_api.h |  2 +-
 drivers/net/ntnic/ntnic_ethdev.c                   | 14 +++++++-------
 drivers/net/ntnic/ntnic_filter/ntnic_filter.c      |  8 ++++----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ntnic/include/stream_binary_flow_api.h 
b/drivers/net/ntnic/include/stream_binary_flow_api.h
index 4ce1561033..3c6de8899b 100644
--- a/drivers/net/ntnic/include/stream_binary_flow_api.h
+++ b/drivers/net/ntnic/include/stream_binary_flow_api.h
@@ -47,7 +47,7 @@
 #define RAW_ENCAP_DECAP_ELEMS_MAX 16
 
 extern uint64_t rte_tsc_freq;
-extern rte_spinlock_t hwlock;
+extern rte_spinlock_t nthw_lock;
 
 /*
  * Flow eth dev profile determines how the FPGA module resources are
diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c
index 29508888a3..dc9202cdc0 100644
--- a/drivers/net/ntnic/ntnic_ethdev.c
+++ b/drivers/net/ntnic/ntnic_ethdev.c
@@ -95,7 +95,7 @@ static const struct rte_pci_id nthw_pci_id_map[] = {
 
 static const struct sg_ops_s *sg_ops;
 
-rte_spinlock_t hwlock = RTE_SPINLOCK_INITIALIZER;
+rte_spinlock_t nthw_lock = RTE_SPINLOCK_INITIALIZER;
 
 /*
  * Store and get adapter info
@@ -127,9 +127,9 @@ store_pdrv(struct drv_s *p_drv)
                        PCIIDENT_TO_FUNCNR(p_drv->ntdrv.pciident));
        }
 
-       rte_spinlock_lock(&hwlock);
+       rte_spinlock_lock(&nthw_lock);
        _g_p_drv[p_drv->adapter_no] = p_drv;
-       rte_spinlock_unlock(&hwlock);
+       rte_spinlock_unlock(&nthw_lock);
 }
 
 static void clear_pdrv(struct drv_s *p_drv)
@@ -137,9 +137,9 @@ static void clear_pdrv(struct drv_s *p_drv)
        if (p_drv->adapter_no >= NUM_ADAPTER_MAX)
                return;
 
-       rte_spinlock_lock(&hwlock);
+       rte_spinlock_lock(&nthw_lock);
        _g_p_drv[p_drv->adapter_no] = NULL;
-       rte_spinlock_unlock(&hwlock);
+       rte_spinlock_unlock(&nthw_lock);
 }
 
 static struct drv_s *
@@ -147,7 +147,7 @@ get_pdrv_from_pci(struct rte_pci_addr addr)
 {
        int i;
        struct drv_s *p_drv = NULL;
-       rte_spinlock_lock(&hwlock);
+       rte_spinlock_lock(&nthw_lock);
 
        for (i = 0; i < NUM_ADAPTER_MAX; i++) {
                if (_g_p_drv[i]) {
@@ -159,7 +159,7 @@ get_pdrv_from_pci(struct rte_pci_addr addr)
                }
        }
 
-       rte_spinlock_unlock(&hwlock);
+       rte_spinlock_unlock(&nthw_lock);
        return p_drv;
 }
 
diff --git a/drivers/net/ntnic/ntnic_filter/ntnic_filter.c 
b/drivers/net/ntnic/ntnic_filter/ntnic_filter.c
index c1a05255ee..fc5f5f8d2f 100644
--- a/drivers/net/ntnic/ntnic_filter/ntnic_filter.c
+++ b/drivers/net/ntnic/ntnic_filter/ntnic_filter.c
@@ -1215,7 +1215,7 @@ static int poll_statistics(struct pmd_internals 
*internals)
 
        RTE_ASSERT(rte_tsc_freq > 0);
 
-       rte_spinlock_lock(&hwlock);
+       rte_spinlock_lock(&nthw_lock);
 
        uint64_t now_rtc = rte_get_tsc_cycles();
 
@@ -1224,7 +1224,7 @@ static int poll_statistics(struct pmd_internals 
*internals)
         * if more than a second since last stat read, do a new one
         */
        if ((now_rtc - internals->last_stat_rtc) < rte_tsc_freq) {
-               rte_spinlock_unlock(&hwlock);
+               rte_spinlock_unlock(&nthw_lock);
                return 0;
        }
 
@@ -1270,7 +1270,7 @@ static int poll_statistics(struct pmd_internals 
*internals)
 
        /* Globally only once a second */
        if ((now_rtc - last_stat_rtc) < rte_tsc_freq) {
-               rte_spinlock_unlock(&hwlock);
+               rte_spinlock_unlock(&nthw_lock);
                rte_spinlock_unlock(&p_nt_drv->stat_lck);
                return 0;
        }
@@ -1307,7 +1307,7 @@ static int poll_statistics(struct pmd_internals 
*internals)
                }
        }
 
-       rte_spinlock_unlock(&hwlock);
+       rte_spinlock_unlock(&nthw_lock);
        rte_spinlock_unlock(&p_nt_drv->stat_lck);
 
        return 0;
-- 
2.45.0

Reply via email to