ice_ptp_process_tx_tstamp(9)
๐ ice_ptp_process_tx_tstamp(9) ๐
okay bestie, welcome to the Kernel API Manual โ this is the page for ice_ptp_process_tx_tstamp, and it's genuinely a little baddie for Tx timestamps. ๐ซถโจ
๐ธ NAME ๐ธ
ice_ptp_process_tx_tstamp - Process Tx timestamps for a port ๐
๐ SYNOPSIS ๐
void ice_ptp_process_tx_tstamp (struct ice_ptp_tx *tx );
๐ฆ ARGUMENTS ๐ฆ
txโ the PTP Tx timestamp tracker, aka the main character of this function ๐ฏ
โจ DESCRIPTION โจ
So this function processes the timestamps captured by the PHY that's associated with this port. The way it does that? It loops over each index that has a waiting skb. ๐
If a given index has a valid timestamp, it does these seven steps, in order:
- check that the timestamp request is not stale ๐ต
- check that a timestamp is ready and available in the PHY memory bank ๐ฆ
- read and copy the timestamp out of the PHY register ๐
- unlock the index by clearing the associated
in_usebit ๐ - check if the timestamp is stale, and discard it if so ๐
- extend the 40 bit timestamp value to get a 64 bit timestamp value ๐งฎ
- send this 64 bit timestamp to the stack ๐ค
important note bestie: we do not hold the tracking lock while reading the Tx timestamp. Why? because reading the timestamp requires taking a mutex that might sleep ๐ด.
The only place where in_use gets set is when a new timestamp is initiated with a slot index. That only happens in the hard xmit routine when an SKB has a request flag set. The only places where this bit gets cleared are this function, or during teardown when the Tx timestamp tracker is being removed. A timestamp index will never be re-used until the in_use bit for that index is cleared. ๐ซ๐
If a Tx thread starts a new timestamp, we might not begin processing it right away, but we will notice it at the end when we re-queue the task. โณ
If a Tx thread starts a new timestamp just after this function exits, the interrupt for that timestamp should re-trigger this function once a timestamp is ready. โก
In cases where the PTP hardware clock was directly adjusted, some timestamps may not be able to safely use the timestamp extension math. In that case, software will set the stale bit for any outstanding Tx timestamps when the clock is adjusted. Then this function will discard those captured timestamps instead of sending them to the stack. ๐ฐ๏ธ๐
If a Tx packet has been waiting for more than 2 seconds, it is not possible to correctly extend the timestamp using the cached PHC time. It is extremely unlikely that a packet will ever take this long to timestamp. If we detect a Tx timestamp request that has waited for this long, we assume the packet will never be sent by hardware and discard it without reading the timestamp register. โฑ๏ธ๐ โโ๏ธ
๐ SEE ALSO ๐
Kernel file: ./drivers/net/ethernet/intel/ice/ice_ptp.c โ the source bestie, go read it if you're nosy ๐๐
ice_ptp_find_pin_idx(9)ice_ptp_cfg_tx_interrupt(9)ice_set_rx_tstamp(9)ice_ptp_disable_timestamp_mode(9)ice_ptp_restore_timestamp_mode(9)ice_ptp_read_src_clk_reg(9)ice_ptp_extend_32b_ts(9)ice_ptp_extend_40b_ts(9)ice_ptp_is_tx_tracker_up(9)ice_ptp_req_tx_single_tstamp(9)ice_ptp_complete_tx_single_tstamp(9)ice_ptp_alloc_tx_tracker(9)ice_ptp_flush_tx_tracker(9)ice_ptp_mark_tx_tracker_stale(9)ice_ptp_flush_all_tx_tracker(9)ice_ptp_release_tx_tracker(9)ice_ptp_init_tx_e82x(9)ice_ptp_init_tx(9)ice_ptp_update_cached_phctime(9)ice_ptp_reset_cached_phctime(9)ice_ptp_write_init(9)ice_ptp_write_adj(9)ice_base_incval(9)ice_ptp_check_tx_fifo(9)ice_ptp_wait_for_offsets(9)ice_ptp_port_phy_stop(9)ice_ptp_port_phy_restart(9)ice_ptp_link_change(9)ice_ptp_cfg_phy_interrupt(9)ice_ptp_reset_phy_timestamping(9)ice_ptp_restart_all_phy(9)ice_ptp_adjfine(9)ice_ptp_extts_event(9)ice_ptp_cfg_extts(9)ice_ptp_disable_all_extts(9)ice_ptp_enable_all_extts(9)ice_ptp_write_perout(9)ice_ptp_cfg_perout(9)ice_ptp_disable_all_perout(9)ice_ptp_enable_all_perout(9)ice_verify_pin(9)ice_ptp_gpio_enable(9)ice_ptp_gettimex64(9)ice_ptp_settime64(9)ice_ptp_adjtime_nonatomic(9)ice_ptp_adjtime(9)struct ice_crosststamp_cfg(9)struct ice_crosststamp_ctx(9)ice_capture_crosststamp(9)ice_ptp_getcrosststamp(9)ice_ptp_hwtstamp_get(9)ice_ptp_set_timestamp_mode(9)ice_ptp_hwtstamp_set(9)ice_ptp_get_rx_hwts(9)ice_ptp_setup_pin_cfg(9)ice_ptp_disable_pins(9)ice_ptp_parse_sdp_entries(9)ice_ptp_set_funcs_e82x(9)ice_ptp_set_funcs_e810(9)ice_ptp_set_funcs_e830(9)ice_ptp_set_caps(9)ice_ptp_create_clock(9)ice_ptp_request_ts(9)ice_ptp_ts_irq(9)ice_ptp_maybe_trigger_tx_interrupt(9)ice_ptp_queue_work(9)ice_ptp_prepare_rebuild_sec(9)ice_ptp_prepare_for_reset(9)ice_ptp_rebuild_owner(9)ice_ptp_rebuild(9)ice_ptp_clock_index(9)ice_ptp_init_owner(9)ice_ptp_init_work(9)ice_ptp_init_port(9)ice_ptp_init_tx_interrupt_mode(9)ice_ptp_init(9)ice_ptp_release(9)
mwah ๐ source/version: ./drivers/net/ethernet/intel/ice; date: October 2026; and yes bestie, this is still ice_ptp_process_tx_tstamp(9) saying byeeeee ๐ซถโจ
๐ฆ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms