• Jakub Kicinski's avatar
    nfp: include all ring counters in interface stats · 29f534c4
    Jakub Kicinski authored
    We are gathering software statistics on per-ring basis.
    .ndo_get_stats64 handler adds the rings up.  Unfortunately
    we are currently only adding up active rings, which means
    that if user decreases the number of active rings the
    statistics from deactivated rings will no longer be counted
    and total interface statistics may go backwards.
    
    Always sum all possible rings, the stats are allocated
    statically for max number of rings, so we don't have to
    worry about them being removed.  We could add the stats
    up when user changes the ring count, but it seems unnecessary..
    Adding up inactive rings will be very quick since no datapath
    will be touching them.
    
    Fixes: 164d1e9e ("nfp: add support for ethtool .set_channels")
    Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
    Reviewed-by: default avatarDirk van der Merwe <dirk.vandermerwe@netronome.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    29f534c4
nfp_net_common.c 99.6 KB