Skip to content

Commit

Permalink
net: systemport: Fix software statistics for SYSTEMPORT Lite
Browse files Browse the repository at this point in the history
With SYSTEMPORT Lite we have holes in our statistics layout that make us
skip over the hardware MIB counters, bcm_sysport_get_stats() was not
taking that into account resulting in reporting 0 for all SW-maintained
statistics, fix this by skipping accordingly.

Fixes: 44a4524 ("net: systemport: Add support for SYSTEMPORT Lite")
Signed-off-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ffainelli authored and davem330 committed Aug 10, 2017
1 parent ed43594 commit 50ddfba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/ethernet/broadcom/bcmsysport.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ static void bcm_sysport_get_stats(struct net_device *dev,
p = (char *)&dev->stats;
else
p = (char *)priv;

if (priv->is_lite && !bcm_sysport_lite_stat_valid(s->type))
continue;

p += s->stat_offset;
data[j] = *(unsigned long *)p;
j++;
Expand Down

0 comments on commit 50ddfba

Please sign in to comment.