From: Andrew Rybchenko Date: Thu, 7 Feb 2019 16:29:43 +0000 (+0000) Subject: net/sfc/base: share macro to increment per-event type stats X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e5ed1e5f382fc7d75e46988a39b764555dd6d849;p=dpdk.git net/sfc/base: share macro to increment per-event type stats 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 --- diff --git a/drivers/net/sfc/base/ef10_ev.c b/drivers/net/sfc/base/ef10_ev.c index d2c27e0d21..99cae3fa3b 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 7b5130291d..b9fc5caae9 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 56d293b40a..f148c870ce 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;