STRUCT EFX_PTP_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, this is the manual page for struct efx_ptp_data(9) from the Kernel API Manual β€” literally the Precision Time Protocol (PTP) state struct. It is giving β€œthe whole PTP situation in one struct” energy. πŸ’…


✨ SYNOPSIS ✨

       struct efx_ptp_data {
           struct efx_nic *efx;
           struct efx_channel *channel;
           bool rx_ts_inline;
           struct sk_buff_head rxq;
           struct sk_buff_head txq;
           struct list_head evt_list;
           struct list_head evt_free_list;
           spinlock_t evt_lock;
           struct efx_ptp_event_rx rx_evts[MAX_RECEIVE_EVENTS];
           struct workqueue_struct *workwq;
           struct work_struct work;
           bool reset_required;
           u32 rxfilter_event;
           u32 rxfilter_general;
           bool rxfilter_installed;
           struct kernel_hwtstamp_config config;
           bool enabled;
           unsigned int mode;
           void (*ns_to_nic_time)(s64 ns, u32 *nic_major, u32 *nic_minor);
           ktime_t (*nic_to_kernel_time)(u32 nic_major, u32 nic_minor, s32
       correction);
           struct {
             u32 minor_max;
             u32 sync_event_diff_min;
             u32 sync_event_diff_max;
             unsigned int sync_event_minor_shift;
           } nic_time;
           unsigned int min_synchronisation_ns;
           unsigned int capabilities;
           struct {
             s32 ptp_tx;
             s32 ptp_rx;
             s32 pps_out;
             s32 pps_in;
             s32 general_tx;
             s32 general_rx;
           } ts_corrections;
           efx_qword_t evt_frags[MAX_EVENT_FRAGS];
           int evt_frag_idx;
           int evt_code;
           struct efx_buffer start;
           struct pps_event_time host_time_pps;
           unsigned int adjfreq_ppb_shift;
           s64 current_adjfreq;
           struct ptp_clock *phc_clock;
           struct ptp_clock_info phc_clock_info;
           struct work_struct pps_work;
           struct workqueue_struct *pps_workwq;
           bool nic_ts_enabled;
           efx_dword_t txbuf[MCDI_TX_BUF_LEN(MC_CMD_PTP_IN_TRANSMIT_LENMAX)];
           unsigned int good_syncs;
           unsigned int fast_syncs;
           unsigned int bad_syncs;
           unsigned int sync_timeouts;
           unsigned int no_time_syncs;
           unsigned int invalid_sync_windows;
           unsigned int undersize_sync_windows;
           unsigned int oversize_sync_windows;
           unsigned int rx_no_timestamp;
           struct efx_ptp_timeset
       timeset[MC_CMD_PTP_OUT_SYNCHRONIZE_TIMESET_MAXNUM];
           void (*xmit_skb)(struct efx_nic *efx, struct sk_buff *skb);
        };

πŸ‘‘ Members πŸ‘‘

  • efx β€” The NIC context. the main character pointer, fr.
  • channel β€” The PTP channel. Siena only, bestie.
  • rx_ts_inline β€” Flag for whether RX timestamps are inline; if not, they are separate events. it's giving β€œtimestamp delivery strategy” πŸ’…
  • rxq β€” Receive SKB queue, awaiting timestamps.
  • txq β€” Transmit SKB queue.
  • evt_list β€” List of MC receive events awaiting packets.
  • evt_free_list β€” List of free events.
  • evt_lock β€” Lock for manipulating evt_list and evt_free_list.
  • rx_evts β€” Instantiated events, hanging out on evt_list and evt_free_list.
  • workwq β€” Work queue for processing pending PTP operations.
  • work β€” Work task.
  • reset_required β€” A serious error has occurred and the PTP task needs to be reset (disable, enable). not a cute vibe, but important 😭
  • rxfilter_event β€” Receive filter when operating.
  • rxfilter_general β€” Receive filter when operating.
  • rxfilter_installed β€” Receive filter installed.
  • config β€” Current timestamp configuration.
  • enabled β€” PTP operation enabled.
  • mode β€” Mode in which PTP operating (PTP version).
  • ns_to_nic_time β€” Function to convert from scalar nanoseconds to NIC time.
  • nic_to_kernel_time β€” Function to convert from NIC to kernel time.
  • nic_time β€” contains time details. nested details below, keep scrolling bestie 🫢
    • nic_time.minor_max β€” Wrap point for NIC minor times.
    • nic_time.sync_event_diff_min β€” Minimum acceptable difference between time in packet prefix and last MCDI time sync event i.e. how much earlier than the last sync event time a packet timestamp can be.
    • nic_time.sync_event_diff_max β€” Maximum acceptable difference between time in packet prefix and last MCDI time sync event i.e. how much later than the last sync event time a packet timestamp can be.
    • nic_time.sync_event_minor_shift β€” Shift required to make minor time from field in MCDI time sync event.
  • min_synchronisation_ns β€” Minimum acceptable corrected sync window.
  • capabilities β€” Capabilities flags from the NIC.
  • ts_corrections β€” contains corrections details. correction era ✨
    • ts_corrections.ptp_tx β€” Required driver correction of PTP packet transmit timestamps.
    • ts_corrections.ptp_rx β€” Required driver correction of PTP packet receive timestamps.
    • ts_corrections.pps_out β€” PPS output error (information only).
    • ts_corrections.pps_in β€” Required driver correction of PPS input timestamps.
    • ts_corrections.general_tx β€” Required driver correction of general packet transmit timestamps.
    • ts_corrections.general_rx β€” Required driver correction of general packet receive timestamps.
  • evt_frags β€” Partly assembled PTP events.
  • evt_frag_idx β€” Current fragment number.
  • evt_code β€” Last event code.
  • start β€” Address at which MC indicates ready for synchronisation.
  • host_time_pps β€” Host time at last PPS.
  • adjfreq_ppb_shift β€” Shift required to convert scaled parts-per-billion frequency adjustment into a fixed point fractional nanosecond format.
  • current_adjfreq β€” Current ppb adjustment.
  • phc_clock β€” Pointer to registered phc device (if primary function).
  • phc_clock_info β€” Registration structure for phc device.
  • pps_work β€” pps work task for handling pps events.
  • pps_workwq β€” pps work queue.
  • nic_ts_enabled β€” Flag indicating if NIC generated TS events are handled.
  • txbuf β€” Buffer for use when transmitting (PTP) packets to MC (avoids allocations in main data path).
  • good_syncs β€” Number of successful synchronisations.
  • fast_syncs β€” Number of synchronisations requiring short delay.
  • bad_syncs β€” Number of failed synchronisations.
  • sync_timeouts β€” Number of synchronisation timeouts.
  • no_time_syncs β€” Number of synchronisations with no good times.
  • invalid_sync_windows β€” Number of sync windows with bad durations.
  • undersize_sync_windows β€” Number of corrected sync windows that are too small.
  • oversize_sync_windows β€” Number of corrected sync windows that are too large.
  • rx_no_timestamp β€” Number of packets received without a timestamp.
  • timeset β€” Last set of synchronisation statistics.
  • xmit_skb β€” Transmit SKB function.

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/net/ethernet/sfc/siena/ptp.c
  • struct efx_ptp_match(9)
  • struct efx_ptp_event_rx(9)
  • struct efx_ptp_timeset(9)

mwah πŸ’‹ this one lives in ./drivers/net/ethernet/sfc/siena, with version/date October 2026, and it is so struct efx_ptp_data(9) coded. bye bestie, go read the kernel 🫢✨

πŸ“¦ where this page comes from