net/sfc/base: share macro to increment per-event type stats
authorAndrew Rybchenko <arybchenko@solarflare.com>
Thu, 7 Feb 2019 16:29:43 +0000 (16:29 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Feb 2019 10:35:41 +0000 (11:35 +0100)
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
drivers/net/sfc/base/efx_ev.c
drivers/net/sfc/base/efx_impl.h

index d2c27e0..99cae3f 100644 (file)
 
 #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.
index 7b51302..b9fc5ca 100644 (file)
 #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)
index 56d293b..f148c87 100644 (file)
@@ -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;