net/sfc/base: import loopback control
[dpdk.git] / drivers / net / sfc / base / ef10_ev.c
index 46ecd42..f58ccc6 100644 (file)
 
 #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
 
+#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
@@ -731,6 +739,23 @@ fail1:
 }
 
 
+#if EFSYS_OPT_QSTATS
+                       void
+ef10_ev_qstats_update(
+       __in                            efx_evq_t *eep,
+       __inout_ecount(EV_NQSTATS)      efsys_stat_t *stat)
+{
+       unsigned int id;
+
+       for (id = 0; id < EV_NQSTATS; id++) {
+               efsys_stat_t *essp = &stat[id];
+
+               EFSYS_STAT_INCR(essp, eep->ee_stat[id]);
+               eep->ee_stat[id] = 0;
+       }
+}
+#endif /* EFSYS_OPT_QSTATS */
+
 static __checkReturn   boolean_t
 ef10_ev_rx(
        __in            efx_evq_t *eep,
@@ -1078,6 +1103,12 @@ ef10_ev_mcdi(
                break;
 
        case MCDI_EVENT_CODE_MAC_STATS_DMA:
+#if EFSYS_OPT_MAC_STATS
+               if (eecp->eec_mac_stats != NULL) {
+                       eecp->eec_mac_stats(arg,
+                           MCDI_EV_FIELD(eqp, MAC_STATS_DMA_GENERATION));
+               }
+#endif
                break;
 
        case MCDI_EVENT_CODE_FWALERT: {