Subject: Re: [PATCH net-next 2/2] netdevsim: Implement basic ptp support

From: Jakub Kicinski <[email-masked]>
Date: Thu, 19 Feb 2026 12:42:22 -0800

On Thu, 19 Feb 2026 15:05:30 +0100 Maciek Machnikowski wrote:
> +	gen_tx_tstamp = skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP;
> +	if (gen_tx_tstamp) {
> +		ptp_info = mock_phc_get_ptp_info(ns->phc);
> +
> +		/* Create a copy of tx skb to keep the tx reference */
> +		skb_orig = skb;
> +		skb = skb_copy(skb_orig, GFP_ATOMIC);
> +		skb_shinfo(skb_orig)->tx_flags |= SKBTX_IN_PROGRESS;
> +
> +		/* Timestamp as late as possible */
> +		if (ptp_info)
> +			ptp_info->gettime64(ptp_info, &tx_ts);
> +	}

Like Andrew said we need a test in tree. But Vadim has been promising me
a timestamping test for a while, so adding him here. You can probably
work together (unless you already have such a test).

When you respin - note that mock_phc takes a spin lock without _bh
around its internals. It needs to be changed to _bh() if we call
it form the xmit path.