Article View: linux.kernel.netdev
Article #25100Re: [PATCH net-next v13 6/8] hsr: Assign a socket for cloned skbs
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 08:55
Date: Tue, 01 Dec 2026 08:55
86 lines
11014 bytes
11014 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message is broader than the code.
--
hsr: Assign a socket for cloned skbs
skb_clone() clears skb->sk, and the original skb is freed in
hsr_forward_skb(), so a TX timestamp requested by the sender is lost.
This patch gives the clones created in hsr_create_tagged_frame() and
in the has_hsr_header branch of hsr_forward_do() the socket of the
original skb, by calling skb_set_owner_w(). That lets skb_tstamp_tx()
pass the timestamp back to user space.
> hsr: Assign a socket for cloned skbs
[ ... ]
> Assign the socket of the original skb to the clone so the timestamp is
> forwarded to the user.
> diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
> index 1d1d75ed8cd06..9cb3297a8640a 100644
> --- a/net/hsr/hsr_forward.c
> +++ b/net/hsr/hsr_forward.c
[ ... ]
> @@ -347,6 +348,9 @@ struct sk_buff *hsr_create_tagged_frame(struct hsr_frame_info *frame,
> if (!skb)
> return NULL;
>
> + if (frame->req_tx_port != HSR_PT_NONE && frame->skb_std->sk)
> + skb_set_owner_w(skb, frame->skb_std->sk);
> +
[Severity: Low]
This isn't a bug, but the commit message reads more broadly than the
code. Should it say which frames are covered?
The subject and the line "Assign the socket of the original skb to the
clone so the timestamp is forwarded to the user" suggest that every HSR
TX clone gets the sender's socket. Here, though, skb_set_owner_w() only
runs when frame->req_tx_port != HSR_PT_NONE.
req_tx_port (and has_hsr_header, which gates the second hunk below) is
only set from the inline header, in hsr_dev_xmit():
net/hsr/hsr_device.c:hsr_dev_xmit() {
...
if (skb->protocol == htons(ETH_P_1588) &&
hsr_ptp_parse_header(skb, &has_hsr_header, &req_tx_port))
goto drop;
...
}
Every other frame sent through the HSR master is duplicated to both
slaves with req_tx_port == HSR_PT_NONE. That includes ordinary frames
from a socket with SO_TIMESTAMPING. For those frames the clones still
have no socket, so the timestamp is still dropped.
Skipping the duplicated case is probably intentional, for example to
avoid two timestamps and charging sk_wmem_alloc twice for the two
clones. Could the commit message, or a comment on this check, say that
only the single-port, inline-header PTP path is handled, and why?
> if (port->dev->features & NETIF_F_HW_HSR_TAG_INS)
> return skb;
>
> @@ -582,6 +586,8 @@ static void hsr_forward_do(struct hsr_frame_info *frame)
> */
> if (frame->has_hsr_header && frame->skb_std) {
> skb = skb_clone(frame->skb_std, GFP_ATOMIC);
> + if (skb && frame->skb_std->sk)
> + skb_set_owner_w(skb, frame->skb_std->sk);
> goto inject_into_stack;
> }
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-hsr_ptp-v13-0-598326208fc5%40linutronix.de
Technical Details
Message-ID:
<179611533173.3146.4166025967893388121@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374867-linux-kernel-netdev=dewy.ruReferences:
<20261130-hsr_ptp-v13-6-598326208fc5@linutronix.de>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374867-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v13 6/8] hsr: Assign a socket for cloned skbs Date: Tue, 01 Dec 2026 08:55:31 +0000 Organization: Usenet Network Message-ID: <179611533173.3146.4166025967893388121@kernel.org> References: <20261130-hsr_ptp-v13-6-598326208fc5@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1666038"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:r3IGDxYNhkjq/tJYuiioyIyP+EU= sha256:eCvNSewl65faHsh6nCMz7pLqEI6bRBPezWDxI5hE5sk= sha1:gL2d5nfAWwV6bZqb6547BCd4rmU= sha256:2vmMH5z1YMBIKevOfgz2ik7bzHqj9SGzBq9muBI+7u0= 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 5FA9E1172E0; Tue, 1 Dec 2026 11:55:52 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org 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 Saob8_yGB0hy; Tue, 1 Dec 2026 11:55:49 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374867-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id C32211172D9; Tue, 1 Dec 2026 11:55:39 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 5E01B2F058; Tue, 1 Dec 2026 08:55:35 +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=1796115334; b=LfgaKOAHc6FlqtWIQwlGw4fdc5gSTsJti4QJTEzZtxa/jS2UMUBkpvVBm4nVZvIx3k1E T+ZAk6HHx/rKzImCFvjnWTn0vozr1fmsOaOhVljafeqdmUF5EF5FHAOjrChb/s1gsbbRI TgIQ8WyhiuWxaTNWwskFvSywGvph9llfGDLjkrC2JqHkMQmZ0WDY3WoFP4yUeSVRU4YRD BaKJn2UGdrWNcMvakEJM/XcoJIxVrSi2WzBBOdxySTOrw6pbnc9uozNjAewhWEdxUPiLN MXV5xSGlipYEbUJRBMEqyIZceagjfUs401VAiNoWzbGbf84zrdXNGroja8ERvZzAXZg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796115334; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=Ut9tQ9ttvwjV74sp8Z9w20afdaYuLzrbsQAAFCNXqkw=; b=xV4vH89vsTZttft2mi0c5wFnAcE6E0rPCJCSiMY7NTdpjaIEAtt7Ojz1Kfp9lcOy7SbG rPUCo2olEpRZM7J6jso0hKqoMw/iVDa+n58nL0CvKHBwxD4mbmGFP1uIKnh47b+uBRAEJ 8yomv76WBh6vJD577/aCwDr0rAHn06b8FvdrQjHqRzQj3CmZ/b5Ou6O/dRC+79owhFsNc Ar3STaSaIhDHmnUK1UDt0GhaI3X6D6/lqth+ZfpsSZ41if2BqHj3KlZyVbIDgVuDwxX9m VXUoNSPEOH08Ic62gKuVX2bVNRNBsnNx0jdl39tkwfKaScfJx7qAY63OpisZYNkz4tQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=LLwgNDo9; 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 B1F5B606A327; Tue, 1 Dec 2026 08:55:34 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=LLwgNDo9 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796115333; b=qibJsROKDf0V8jCxHFk7t0R3Ji5SUb8v9+S69yMXIxBFw3W9JIF05/RMekezIgTr0q2U bEJyS/M6bC4oNr/mvlzh82YdOBcLsZ9TZfv6bU23LzPIHvnWIf3zFGpZPnPgBT1g3uC3t 7e/HrSqt+yVEP0i06a0x3ycQK1OOhGc1RuWjtc01AOPWxF5Ig3AsNvm5B/4GAOsXISqKb TqHNm8GT6FmpVYUq/pt7YGZjsjVcJ0OdnXddRjmO1uYz7t0/FrvjuOgRIkU24q8c0jJzh Chlv4/Rih4bkEE9I4NOG/+VtQek6OGHKLavBhCBP4sUufbatgjMc6Y5MKEtWBVbm79A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796115333; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=Ut9tQ9ttvwjV74sp8Z9w20afdaYuLzrbsQAAFCNXqkw=; b=KupAtyWLoQzX2z/7UN1j29IxNNeMZQmmsSfS5Diswnq9TzxLDu4/ZWC99vEfvsSrEIGY cfPMwOnwbNirQMUuK438zL7Tjx41zG+NHlo7cyz8UFKVBJ03cNzYdRO65wPEaV/MQxBmc YeFTgXVdWHrnMbyPA4sXUNESDFqemqoiy7FL6rCpSWiMVaXn+Zon+cDXLP4ZE1thYMtL2 qOBnLneEpHGcCYIXW13KhDhy7O6VgSYDnOkwaGLbyyLXJ6je42VF+j9sc13UWDar189fI KWHcW1X5CKyVaUyKxyrfXs2Pn58zk6pBNTUXjHQzY12QlmTWfcKnBVinWlRqEQvExfg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=LLwgNDo9; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCB3E606A31A for <netdev@vger.kernel.org>; Tue, 1 Dec 2026 08:55:33 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 375651F00897; Tue, 1 Dec 2026 08:55:32 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796115333; bh=Ut9tQ9ttvwjV74sp8Z9w20afdaYuLzrbsQAAFCNXqkw=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=LLwgNDo9lUM0rgDjvLRKThJfGB1VwyZazcD2XIXfFzBePpFSJa+ZHLMrvnQ9obk4Y wt77LBz3r32ePTmsPZuDSvBe/OV5vRqC3BuxJR5rNVm87rzOE5Amb79fPIXHeea9EY zFV8YYKQmnUs50VXbF8DM8bMbHwJQfWhpdLzRHmicZq3vMw3S7taJAtJSIvjwFwPvM ZotZktg+HPUhA84pYSjQ3yebcpL8j8kb7rjNmmFnERU4B1QWW/om9jD79IOSRSIOTF RM1pfV/DG18MMRf8uoumUhsx4EENbLMgr57P6ve+pOsZlhGPyzsiwJvRDK4haW+lTz GykJZvygfq6pg== X-Cc: netdev@vger.kernel.org, j-rameshbabu@ti.com, andrew+netdev@lunn.ch, danishanwar@ti.com, d-qiu@ti.com, davem@davemloft.net, fmaurer@redhat.com, kuba@kernel.org, neelima@ti.com, pabeni@redhat.com, praneeth@ti.com, pratheesh@ti.com, richardcochran@gmail.com, horms@kernel.org, vigneshr@ti.com, willemdebruijn.kernel@gmail.com, daniel.machon@microchip.com, edumazet@kernel.org X-In-Reply-To: <20261130-hsr_ptp-v13-6-598326208fc5@linutronix.de> X-sashiko-severity: Low 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