• Krzysztof Czurylo's avatar
    RDMA/irdma: Refactor HW statistics · 5a711e58
    Krzysztof Czurylo authored
    Refactor HW statistics which,
    
    - Unifies HW statistics support for all HW generations.
    
    - Unifies support of 32- and 64-bit counters.
    
    - Removes duplicated code and simplifies implementation.
    
    - Fixes roll-over handling.
    
    - Removes unneeded last_hw_stats.
    
    With new implementation, there is no separate handling and no separate
    arrays for 32- and 64-bit counters (offsets, regs, values). Instead,
    there is a HW stats map array for each HW revision, which defines
    HW-specific width and location of each counter in the statistics buffer.
    
    Once the statistics are gathered (either via CQP op, or by reading HW
    registers), counter values are extracted from the statistics buffer using
    the stats map and the delta between the last and new values is computed.
    Finally, the counter values in rdma_hw_stats are incremented by those
    deltas.
    
    From the OS perspective, all the counters are 64-bit and their order in
    rdma_hw_stats->value[] array, as well as in irdma_hw_stat_names[], is the
    same for all HW gens.  New statistics should always be added at the end.
    Signed-off-by: default avatarKrzysztof Czurylo <krzysztof.czurylo@intel.com>
    Signed-off-by: default avatarYouvaraj Sagar <youvaraj.sagar@intel.com>
    Signed-off-by: default avatarShiraz Saleem <shiraz.saleem@intel.com>
    Link: https://lore.kernel.org/r/20230315145305.955-2-shiraz.saleem@intel.comSigned-off-by: default avatarLeon Romanovsky <leon@kernel.org>
    5a711e58
defs.h 41.1 KB