• Petr Machata's avatar
    mlxsw: spectrum_ptp: Add counters for GC events · dc4f3eb0
    Petr Machata authored
    On Spectrum-1, timestamped PTP packets and the corresponding timestamps need to
    be kept in caches until both are available, at which point they are matched up
    and packets forwarded as appropriate. However, not all packets will ever see
    their timestamp, and not all timestamps will ever see their packet. It is
    necessary to dispose of such abandoned entries, so a garbage collector was
    introduced in commit 5d23e415 ("mlxsw: spectrum: PTP: Garbage-collect
    unmatched entries").
    
    If these GC events happen often, it is a sign of a problem. However because this
    whole mechanism is taking place behind the scenes, there is no direct way to
    determine whether garbage collection took place.
    
    Therefore to fix this, on Spectrum-1 only, expose four artificial ethtool
    counters for the GC events: GCd timestamps and packets, in TX and RX directions.
    
    Cc: Richard Cochran <richardcochran@gmail.com>
    Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    dc4f3eb0
spectrum_ptp.c 31.3 KB