🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #13176

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

#13176
From: Vadim Fedorenko
Date: Mon, 09 Nov 2026 12:42
25 lines
9590 bytes
On 08/11/2026 20:15, Maciek Machnikowski wrote:
> Add support for virtual timestamping inside the netdevsim driver.
> The implementation uses two attached ptp_mock clocks, reads the timestamps
> of the ones attached either to the netdevsim or its peer and returns
> timestamps using standard timestamps APIs.
> 
> This implementation enables running ptp4l on netdevsim adapters and
> introduces a new ptp selftest.
> 
> skb_hwtstamps(skb)->hwtstamp aliases with skb_shinfo(skb)->xsk_meta in
> the skb_shared_info union. For an AF_XDP generic-xmit skb forwarded to
> a peer with RX timestamping enabled, writing the RX timestamp into
> that union turns xsk_meta.tx_timestamp into a PHC-derived value that
> the AF_XDP destructor (xsk_destruct_skb()) later dereferences as a
> pointer, corrupting memory. Orphan the skb before writing the RX
> timestamp so any pending destructor (e.g. the AF_XDP completion) runs
> against the original, unmodified union contents first.
> 
> Co-developed-by: Milena Olech <milena.olech@intel.com>
> Signed-off-by: Milena Olech <milena.olech@intel.com>
> Reviewed-by: Mina Almasry <almasrymina@google.com>
> Signed-off-by: Maciek Machnikowski <maciek@machnikowski.net>

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Technical Details
Message-ID: <15481cbc-79d9-420d-821d-6ad559dc246d@linux.dev>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359276-linux-kernel-netdev=dewy.ru
References: <20261108201503.85000-1-maciek@machnikowski.net> <20261108201503.85000-3-maciek@machnikowski.net>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359276-linux-kernel-netdev=dewy.ru
From: vadim.fedorenko@linux.dev (Vadim Fedorenko)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v12 net-next 2/3] netdevsim: Implement basic ptp support
Date: Mon, 9 Nov 2026 12:42:05 +0000
Organization: Usenet Network
Message-ID: <15481cbc-79d9-420d-821d-6ad559dc246d@linux.dev>
References: <20261108201503.85000-1-maciek@machnikowski.net>
 <20261108201503.85000-3-maciek@machnikowski.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="356912"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:FqnaWRkieUAqdMShNFWnMNWAwr4= sha256:ImxeXjQNHRAGs6VuHo8uvxCkfc+GG/Vf015PwGswado=
	sha1:dVc5Dl37NsXfCmuBitnY9+a5/94= sha256:fFuzfBV4aewnkifTToLiy4wnl5YeOn8qz2IbEyrvzZ0=
Content-Language: en-US
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id E39141137DA; Mon,  9 Nov 2026 15:55:16 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=linux.dev
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id HUBP2YA8ld_0;
	Mon,  9 Nov 2026 15:55:13 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-359276-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 15241113780; Mon,  9 Nov 2026 15:55:05 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 25374335F8; Mon,  9 Nov 2026 12:42:12 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794228129;
	b=vs5ucRJXtM6tMnta83k4NQx3IBNB34EnNznx+XOHHbLCMhzayftPrL95j6ArgMjuP8dZ
	 t0cq+Mky0zIw0V8PGEFn4qSCPS+6U8CV7qu2r6lfQN7SY/n9uLI5yG035aBTlrjEIffDW
	 RUS9Pj8ZblxDHvw2QBRx7z5Pn4WkISagdHz9MvJUehSLpQnsx1oz36XUxy4w1XmvVCLpo
	 h/Wl8t2ZeLjfpI77Re1fv2wwPmv/1DsPj58c2lO/0TcCTPNRgLVsWTP3nq9pfD1fN5JnF
	 QgAsXsN8OSjcg2jP9ZamftmBTziY1D1b6jn5A5HS8fQKN8LdxwhOZXQZVTH4gXo5Sbw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794228129;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
	 Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=DrzURu2hMkOt5wV2KmTwMR0vxjunx4pWdrNMPocltYw=;
	b=ck7ZB9v6G3RuXRMMzWSTqzeD5hJDbfnUfvyebzxB8luzVM+86IDozUFCZFwWA7cDu3Td
	 +Tcesx5htxd5B2ZrPTXf9m1l7NUTr51ghSb65bTZUXnkaEuxEz1bDmjEo7WOJuUgWSd82
	 XT+R/8t+cj+7V/T9KkDdZIPWzkoekCr+NxTfy2llcPmDi2PJMTFi8VAhCsLg8B1u9nKsU
	 MeGeG7Dn2/1wHs2uzJlzgXKcSl913SkJc9PPjQGsBdh0elYDfu1XrBdhPVrSZs7ecBk/s
	 LjqJUGNK7ARl/87KjswmoqcLO/vijTHIjTjZok7Ln7nSjgl+QN2QFBB76eTxbGrsTOw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=ubC5f0Ba;
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E02D606A326;
	Mon,  9 Nov 2026 12:42:09 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=ubC5f0Ba
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.111
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794228128;
	b=fiHpbmDPueerFOcWtdSwysYIPU/0jg508NzeW/mxrv6EiXNFFrs04sEmjKE9vISQlYEN
	 uRq4XhF8ICRH3yV2uPT9QHlceobu4OxRdNmekd4Y2IweQVCJ0BCbjR/7yExxDKgHrS3Uj
	 06+te6BPlihYVz6Hc93ze7sUw5FlKUGi9E3ATcmoYSKojmgx6goiSbOE78ZvXmFBIZHMO
	 qMvya0Xn/+cEcDr23+gGqiMFbgmB8I2H7wDbEElDR+tn7h1aJz24dqnoN0UmOYojAA4MD
	 Tjc4rIPGNhuGUZH6oEGif40B5+4BjRLfBzZvBmwW+YtSP3/mfT7lEPbjdZU/4+P5rxg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794228128;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent:
	 Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=DrzURu2hMkOt5wV2KmTwMR0vxjunx4pWdrNMPocltYw=;
	b=CwOFvcEUhTlHVwGo4A6X4bDNG7WbSWgrf0uW/7QuJDD+601QGI09IJANLRLCkxOKBHpu
	 Pbh2gwgg/bx3g2iTJfopVmOKusWdzhA2hoGbs/bao690iVB2ByqMPZFnCJM5ogFFZxfeA
	 1ZVZgP66IEqHFuUpDOAzFQ5wJXLe+k4zF3DmMbNXWDJGvsGlc1z9fn1riTConfnj0Fv24
	 4rdUbSTXRifv4gGMnj2UBVlbtBVua7qjjnWceMAXB6cnZQvtSNnDl6VdhuyJwCazx2tSB
	 Nri/K5nmx51pHQw1dmnHhP97xI/zPdyIYnLLyoOH+Q9v/Cn1v7RhtAqZM4SDHsWG1kw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=ubC5f0Ba;
	arc=none smtp.remote-ip=95.215.58.111
X-Received: from mta1.migadu.com (out-111.mta1.migadu.com [95.215.58.111])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10218606A321
	for <netdev@vger.kernel.org>; Mon,  9 Nov 2026 12:42:07 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 10218606A321
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-DKIM-Signature: a=rsa-sha256; bh=5+J6yPtxySZ9py737kBbAvcdrUciAK2XoEQbohvbbN4=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1794228125; v=1; x=1794832925;
 b=ubC5f0Ba7K0KgYyw2dR1OSX4NfJo3kenDI+A3eDJizPU/xr99NLqWFD/65ubtDkY7axsZmvc
 FOu1go96elsXEbA9Hy2zjeSyuM38cBBSvv4VcvfYIrRC8GYvyJ7o3yj9aqeWMN3gua+MWA4AEun
 Sr0xeI9IUKd70XALh507MeoA=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by smtp.migadu.com with ESMTPS id 35c9b1b43f44f0ab;
	Mon, 09 Nov 2026 12:42:05 +0000
X-Mizu-Trace-ID: 35c9b1b43f44f0ab
X-Migadu-Flow: FLOW_OUT
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-User-Agent: Mozilla Thunderbird
X-Cc: kuba@kernel.org, richardcochran@gmail.com, milena.olech@intel.com,
 willemdebruijn.kernel@gmail.com, andrew@lunn.ch, horms@kernel.org,
 almasrymina@google.com
X-In-Reply-To: <20261108201503.85000-3-maciek@machnikowski.net>