]> git.droids-corp.org - dpdk.git/blobdiff - drivers/net/sfc/base/ef10_tx.c
net/sfc/base: import software per-queue statistics
[dpdk.git] / drivers / net / sfc / base / ef10_tx.c
index 59343a329c594205a4e949e4fd8fea779910449c..aa19cce1edca6e73ec590dc982349a38fddd0822 100644 (file)
 
 #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
 
+#if EFSYS_OPT_QSTATS
+#define        EFX_TX_QSTAT_INCR(_etp, _stat)                                  \
+       do {                                                            \
+               (_etp)->et_stat[_stat]++;                               \
+       _NOTE(CONSTANTCONDITION)                                        \
+       } while (B_FALSE)
+#else
 #define        EFX_TX_QSTAT_INCR(_etp, _stat)
+#endif
 
 static __checkReturn   efx_rc_t
 efx_mcdi_init_txq(
@@ -680,4 +688,22 @@ ef10_tx_qenable(
        /* FIXME */
 }
 
+#if EFSYS_OPT_QSTATS
+                       void
+ef10_tx_qstats_update(
+       __in                            efx_txq_t *etp,
+       __inout_ecount(TX_NQSTATS)      efsys_stat_t *stat)
+{
+       unsigned int id;
+
+       for (id = 0; id < TX_NQSTATS; id++) {
+               efsys_stat_t *essp = &stat[id];
+
+               EFSYS_STAT_INCR(essp, etp->et_stat[id]);
+               etp->et_stat[id] = 0;
+       }
+}
+
+#endif /* EFSYS_OPT_QSTATS */
+
 #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */