i40e_ptp_save_hw_time(9)
π i40e_ptp_save_hw_time π
okay so bestie, this is straight out of the Kernel API Manual, section 9 β a little helper from the i40e driver family, and honestly she's a small function with a big job. Like, main character energy but make it a three-line C function. Let's get into it π«Ά
β¨ NAME β¨
i40e_ptp_save_hw_time β save the current PTP time as ptp_prev_hw_time
Literally what it says on the tin, no cap. The name is the whole personality: save the hw time. π
π SYNOPSIS π
void i40e_ptp_save_hw_time (struct i40e_pf *pf );
Not me writing void like she doesn't return anything β she doesn't! Nothing comes back out, she's a do the thing and dip kind of function. β
π ARGUMENTS π
pfβ board private structure. that's it. that's the whole argument list. one (1) pointer, zero (0) notes needed π¦
π« DESCRIPTION π«
okay so here's the tea π: this function reads the current PTP time and saves it into pf->ptp_prev_hw_time. That's the vibe check β read it, stash it, done.
Now when do you call her? This is the important part, so listen up: it should be called at the end of preparing to reset, just before the hardware reset actually happens. Why? Because you wanna preserve the PTP time as close as possible across resets β you're grabbing the timestamp at the last possible second so the reset doesn't eat it. π
timing is everything, bestie β too early and your saved time is stale, so she goes at the end of the prep, right before the reset hits.
π SEE ALSO π
First up, the source file, on some "go read the real thing" energy:
Kernel file ./drivers/net/ethernet/intel/i40e/i40e_ptp.c
and the whole crew of related functions β every single one, in order, no edits, no merges, no "oops that one has a typo" (we keep it exactly as shipped π):
i40e_ptp_extts0_work(9)i40e_is_ptp_pin_dev(9)i40e_can_set_pins(9)i40_ptp_reset_timing_events(9)i40e_ptp_verify(9)i40e_ptp_read(9)i40e_ptp_write(9)i40e_ptp_convert_to_hwtstamp(9)i40e_ptp_adjfine(9)i40e_ptp_set_1pps_signal_hw(9)i40e_ptp_adjtime(9)i40e_ptp_gettimex(9)i40e_ptp_settime(9)i40e_pps_configure(9)i40e_pin_state(9)i40e_ptp_enable_pin(9)i40e_ptp_feature_enable(9)i40e_ptp_get_rx_events(9)i40e_ptp_rx_hang(9)i40e_ptp_tx_hang(9)i40e_ptp_tx_hwtstamp(9)i40e_ptp_rx_hwtstamp(9)i40e_ptp_set_increment(9)i40e_ptp_hwtstamp_get(9)i40e_ptp_free_pins(9)i40e_ptp_set_pin_hw(9)i40e_ptp_set_led_hw(9)i40e_ptp_init_leds_hw(9)i40e_ptp_set_pins_hw(9)i40e_ptp_set_pins(9)i40e_ptp_alloc_pins(9)i40e_ptp_set_timestamp_mode(9)i40e_ptp_hwtstamp_set(9)i40e_init_pin_config(9)i40e_ptp_create_clock(9)i40e_ptp_restore_hw_time(9)i40e_ptp_init(9)i40e_ptp_stop(9)
like, the whole friend group showed up to the group chat πΈ and psst β clock the pairing: i40e_ptp_restore_hw_time(9) is right there next to her, because you save it and then you put it back. iykyk π₯
that's the whole read, bestie β go save that PTP time before the reset does something unhinged π
this page was served fresh from ./drivers/net/ethernet/intel/i40e, dated October 2026, section 9 of the Kernel API Manual β slay, bye! π
β¨
π¦ 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