• Jacob Keller's avatar
    ice: introduce ICE_TX_TSTAMP_WORK enumeration · ae39eb42
    Jacob Keller authored
    The ice_ptp_process_ts() function and its various helper functions return a
    boolean value indicating whether any work is remaining. This use of a
    boolean has grown confusing as we have multiple helpers that pass status
    between each other. Readers must be aware of what "true" and "false" mean,
    and it is very easy to get their meaning inverted. The names of the
    functions are not standard "yes/no" questions, which is the best practice
    for boolean returns.
    
    Replace this use of an enumeration with a custom type, enum
    ice_tx_tstamp_work. This enumeration clearly indicates whether all work is
    done, or if more work is pending.
    
    To aid in readability, factor the actual list iteration and processing out
    into ice_ptp_process_tx_tstamp(), making it void. Then call this in
    ice_ptp_tx_tstamp() ensuring that we always check the Tracker list at the
    end when determining the appropriate return value.
    
    Now the return value is an explicit name instead of the true or false
    value. This is easier to follow and makes reading the resulting callers
    much simpler.
    
    In addition, this paves the way for future work to allow E822 hardware to
    process timestamps for all functions using a single interrupt on the clock
    owning PF.
    Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Tested-by: Arpana Arland <arpanax.arland@intel.com> (A Contingent worker at Intel)
    Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
    ae39eb42
ice_ptp.c 75.5 KB