Patchwork [dpdk-dev,38/38] net/sfc/base: share macro to increment per-event type stats

login
register
mail settings
Submitter Andrew Rybchenko
Date Feb. 7, 2019, 4:29 p.m.
Message ID <1549556983-10896-39-git-send-email-arybchenko@solarflare.com>
Download mbox | patch
Permalink /patch/720885/
State New
Headers show

Comments

Andrew Rybchenko - Feb. 7, 2019, 4:29 p.m.
Move duplicate macro to increment per-event type stats to
internal header. These stats are NIC family independent and
stored in generic event queue structure.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/ef10_ev.c  | 10 ----------
 drivers/net/sfc/base/efx_ev.c   | 10 ----------
 drivers/net/sfc/base/efx_impl.h | 10 ++++++++++
 3 files changed, 10 insertions(+), 20 deletions(-)

Patch

diff --git a/drivers/net/sfc/base/ef10_ev.c b/drivers/net/sfc/base/ef10_ev.c
index d2c27e0d2..99cae3fa3 100644
--- a/drivers/net/sfc/base/ef10_ev.c
+++ b/drivers/net/sfc/base/ef10_ev.c
@@ -12,16 +12,6 @@ 
 
 #if EFX_OPTS_EF10()
 
-#if EFSYS_OPT_QSTATS
-#define	EFX_EV_QSTAT_INCR(_eep, _stat)					\
-	do {								\
-		(_eep)->ee_stat[_stat]++;				\
-	_NOTE(CONSTANTCONDITION)					\
-	} while (B_FALSE)
-#else
-#define	EFX_EV_QSTAT_INCR(_eep, _stat)
-#endif
-
 /*
  * Non-interrupting event queue requires interrrupting event queue to
  * refer to for wake-up events even if wake ups are never used.
diff --git a/drivers/net/sfc/base/efx_ev.c b/drivers/net/sfc/base/efx_ev.c
index 7b5130291..b9fc5caae 100644
--- a/drivers/net/sfc/base/efx_ev.c
+++ b/drivers/net/sfc/base/efx_ev.c
@@ -10,16 +10,6 @@ 
 #include "mcdi_mon.h"
 #endif
 
-#if EFSYS_OPT_QSTATS
-#define	EFX_EV_QSTAT_INCR(_eep, _stat)					\
-	do {								\
-		(_eep)->ee_stat[_stat]++;				\
-	_NOTE(CONSTANTCONDITION)					\
-	} while (B_FALSE)
-#else
-#define	EFX_EV_QSTAT_INCR(_eep, _stat)
-#endif
-
 #define	EFX_EV_PRESENT(_qword)						\
 	(EFX_QWORD_FIELD((_qword), EFX_DWORD_0) != 0xffffffff &&	\
 	EFX_QWORD_FIELD((_qword), EFX_DWORD_1) != 0xffffffff)
diff --git a/drivers/net/sfc/base/efx_impl.h b/drivers/net/sfc/base/efx_impl.h
index 56d293b40..f148c870c 100644
--- a/drivers/net/sfc/base/efx_impl.h
+++ b/drivers/net/sfc/base/efx_impl.h
@@ -794,6 +794,16 @@  struct efx_evq_s {
 
 #define	EFX_EVQ_SIENA_TIMER_QUANTUM_NS	6144 /* 768 cycles */
 
+#if EFSYS_OPT_QSTATS
+#define	EFX_EV_QSTAT_INCR(_eep, _stat)					\
+	do {								\
+		(_eep)->ee_stat[_stat]++;				\
+	_NOTE(CONSTANTCONDITION)					\
+	} while (B_FALSE)
+#else
+#define	EFX_EV_QSTAT_INCR(_eep, _stat)
+#endif
+
 struct efx_rxq_s {
 	uint32_t			er_magic;
 	efx_nic_t			*er_enp;