net/sfc/base: support RxDP scatter disabled truncate counter
authorAndrew Rybchenko <arybchenko@solarflare.com>
Thu, 3 May 2018 14:41:18 +0000 (15:41 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 14 May 2018 21:31:49 +0000 (22:31 +0100)
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
drivers/net/sfc/base/ef10_mac.c

index 3a62fd0..e3adcac 100644 (file)
@@ -533,8 +533,21 @@ ef10_mac_stats_get_mask(
                        goto fail7;
        }
 
+       if (encp->enc_mac_stats_nstats >= MC_CMD_MAC_NSTATS_V4) {
+               const struct efx_mac_stats_range ef10_rxdp_sdt[] = {
+                       { EFX_MAC_RXDP_SCATTER_DISABLED_TRUNC,
+                           EFX_MAC_RXDP_SCATTER_DISABLED_TRUNC },
+               };
+
+               if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size,
+                   ef10_rxdp_sdt, EFX_ARRAY_SIZE(ef10_rxdp_sdt))) != 0)
+                       goto fail8;
+       }
+
        return (0);
 
+fail8:
+       EFSYS_PROBE(fail8);
 fail7:
        EFSYS_PROBE(fail7);
 fail6:
@@ -978,6 +991,14 @@ ef10_mac_stats_update(
        EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_CTPIO_ERASE, &value);
        EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_CTPIO_ERASE]), &value);
 
+       if (encp->enc_mac_stats_nstats < MC_CMD_MAC_NSTATS_V4)
+               goto done;
+
+       EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_SCATTER_DISABLED_TRUNC,
+           &value);
+       EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_SCATTER_DISABLED_TRUNC]),
+           &value);
+
 done:
        /* Read START generation counter */
        EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, EFSYS_MEM_SIZE(esmp));