From c1be48214543c4e5267c43d2c00ac2d9bb671381 Mon Sep 17 00:00:00 2001 From: Edward Cree Date: Thu, 21 Dec 2017 09:00:26 +0000 Subject: sfc: support variable number of MAC stats Medford2 NICs support more than MC_CMD_MAC_NSTATS stats, and report the new count in a field of MC_CMD_GET_CAPABILITIES_V4. This also means that the end generation count moves (it is, as before, the last 64 bits of the DMA buffer, but that is no longer MC_CMD_MAC_GENERATION_END). So read num_mac_stats from the GET_CAPABILITIES response, if present; otherwise assume MC_CMD_MAC_NSTATS; and always use num_mac_stats - 1 rather than MC_CMD_MAC_GENERATION_END. Signed-off-by: Edward Cree Signed-off-by: Bert Kenward Signed-off-by: David S. Miller --- drivers/net/ethernet/sfc/siena.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/ethernet/sfc/siena.c') diff --git a/drivers/net/ethernet/sfc/siena.c b/drivers/net/ethernet/sfc/siena.c index 22d49ebb347c..ae8645ae4492 100644 --- a/drivers/net/ethernet/sfc/siena.c +++ b/drivers/net/ethernet/sfc/siena.c @@ -555,7 +555,7 @@ static int siena_try_update_nic_stats(struct efx_nic *efx) dma_stats = efx->stats_buffer.addr; - generation_end = dma_stats[MC_CMD_MAC_GENERATION_END]; + generation_end = dma_stats[efx->num_mac_stats - 1]; if (generation_end == EFX_MC_STATS_GENERATION_INVALID) return 0; rmb(); -- cgit v1.2.3-55-g7522