All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Maciek Machnikowski <maciek@machnikowski.net>
Cc: richardcochran@gmail.com, netdev@vger.kernel.org,
	milena.olech@intel.com,
	Vadim Fedorenko <vadim.fedorenko@linux.dev>
Subject: Re: [PATCH net-next 2/2] netdevsim: Implement basic ptp support
Date: Thu, 19 Feb 2026 12:42:22 -0800	[thread overview]
Message-ID: <20260219124222.211385c5@kernel.org> (raw)
In-Reply-To: <20260219140530.2148-3-maciek@machnikowski.net>

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.


  parent reply	other threads:[~2026-02-19 20:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19 14:05 [PATCH net-next 0/2] Implement PTP support in netdevsim Maciek Machnikowski
2026-02-19 14:05 ` [PATCH net-next 1/2] ptp: Expose ptp_clock_info to external drivers Maciek Machnikowski
2026-02-19 14:05 ` [PATCH net-next 2/2] netdevsim: Implement basic ptp support Maciek Machnikowski
2026-02-19 16:16   ` Andrew Lunn
2026-02-19 20:42   ` Jakub Kicinski [this message]
2026-02-20 21:07     ` Maciek Machnikowski
2026-02-20 20:08   ` Willem de Bruijn
2026-02-20 21:06     ` Maciek Machnikowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260219124222.211385c5@kernel.org \
    --to=kuba@kernel.org \
    --cc=maciek@machnikowski.net \
    --cc=milena.olech@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=vadim.fedorenko@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.