From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 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== 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== 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 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 ; Tue, 1 Dec 2026 08:55:33 +0000 (UTC) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 375651F00897; Tue, 1 Dec 2026 08:55:32 +0000 (UTC) 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== Subject: Re: [PATCH net-next v13 6/8] hsr: Assign a socket for cloned skbs From: netdev-bot+sashiko@kernel.org To: bigeasy@linutronix.de 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 Date: Tue, 01 Dec 2026 08:55:31 +0000 Message-ID: <179611533173.3146.4166025967893388121@kernel.org> In-Reply-To: <20261130-hsr_ptp-v13-6-598326208fc5@linutronix.de> References: <20261130-hsr_ptp-v13-6-598326208fc5@linutronix.de> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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