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=1796434041; b=OfatKZIs9AHH/xutx7XI/wIcLXG8EGsM0QcA+8PlIDmYrGOTLuZ4K6DE/9diWOocApTL gUzGf7SenT42EYQYn8+luul5s5NoTBVfgi11cgkM/3gBfN0lVrFalNIwI3DPTMpSVKIs1 b4PE8fYeEr10mhMCIWWLfWxOfSbbxQ57nXHSH3vRVvuR75TQGVBXWqCVKNRw4BbnPp4LK 1H6MB7dFDjcDKOjjip/7lisIw2Z70oLTK4F+VzZ/92CxKak+z/jki9yJbhWPbb0Isdeot eTjODJMd/Wm4U0ynjyZ7dLdNCfVypGNKsWrmhyx3XKVnJ448JcLvEidEcp7GKAO3JGA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796434041; 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=yGn4psZyYEuEhnThVaJyaYip15k6Ij0A2W04OsHVW5U=; b=ZqDVh45w09Fa9tvJztukKethAlug8zcg6dHT7ca0NOh5M4hh/iEA8t+ZGlharmdU6FC8 rWMcdngJWuOk6kkM2Eieb/d9kgRf/BjzHNrrRGvPoqTq/ws8thDA/yOv1DHkQKNZtTqdv KVjFCXQtakeko9KKZLOUZH9nITCSc7U0PeHsgbYvsiPTICCb7qssSGGALRPOVf9yJl92+ 3MR8bJCZT+19W0Z2YWGulM6hK6lJYEiQx8/HuTEIf1sTYdchMI55HJ2WCUt1F/eLWOG1r UsjlK8I/x2dkEY8BzBsWsZfmBLMOyFIwPInEYMhkFxjLrvPVJmXJgaXLK6MaYl8f+tQ== 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=Ifru6MEM; 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 5EA4F606A322 for ; Sat, 5 Dec 2026 01:27:21 +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=Ifru6MEM Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0FDD1F0092B; Sat, 5 Dec 2026 01:27:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796434041; bh=yGn4psZyYEuEhnThVaJyaYip15k6Ij0A2W04OsHVW5U=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Ifru6MEMZSnxq+4GzEAQMoOL2/B3cQ1IoARvzUummXtP4IDcaRf4prjFwQDLwTA1d 4wCwUrvR32acu5eDkzk2yf2wPHesqraQgDlAhvPV9S/AXnPlGk9smLCZkLFFNKxssi iARI1OP2+oc2bpLhCKzM2k6XwhrPGhR+JtBB6p+ckyyXFhHtee8c1OGsg1Nk2jBO+P +qWDwsh78ZgYMCR5N1BEk6fc24WUnpSscKuGyqV6PB/qBbczNRysWHZcpoTl/WcCpQ iA97FkgHwTNQeShAKbsjfF+nKUvxXpPl6MKlXC5kz7vQ8cuSxhdqNZ8TSBMJKB3RdB Pk4bGogE4V/ag== Subject: Re: [PATCH can-next v5 08/24] can: isotp: add N_As timeout monitoring for SF/FF/CF From: netdev-bot+sashiko@kernel.org To: socketcan@hartkopp.net Cc: linux-can@vger.kernel.org, mkl@pengutronix.de, kuba@kernel.org Date: Sat, 05 Dec 2026 01:27:20 +0000 Message-ID: <179643404050.3142.8094561093795801558@kernel.org> In-Reply-To: <20261203-getsockopt-memcg-isotp-v5-8-bbe89b3d3b71@hartkopp.net> References: <20261203-getsockopt-memcg-isotp-v5-8-bbe89b3d3b71@hartkopp.net> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-can@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 fixes a reported protocol timing defect but has no Fixes: tag and no Cc: stable or explicit no-backport statement. - [Low] The commit message only says ECOMM 'may be reported earlier' because the echo timeout drops from 2 s to 1 s. - [Low] Several comments in net/can/isotp.c still describe the old behaviour after this patch made the local echo and so->echotimer… -- can: isotp: add N_As timeout monitoring for SF/FF/CF This commit uses the local echo to supervise the transmission of all SF, FF and CF frames with the ISO 15765-2 N_As timeout of 1 s. The FC timeout (N_Bs) now starts only after the FF transmission is confirmed, either by its local echo or by an early FC. ISOTP_FC_TIMEOUT and ISOTP_ECHO_TIMEOUT are replaced by a single ISOTP_TIMEOUT of 1 s. Closes: https://lore.kernel.org/linux-can/eb5e9618-3dbf-42cb-a635-752ff9fbcb99@hartkopp.net/ > The FF with flow control was not supervised at all and the FC timeout > was started with the transmission request of the FF, so that a delayed > transmission of the FF shortened the time for the FC of the receiver. [ ... ] > Reported-by: Wentian Ye > Closes: https://lore.kernel.org/linux-can/eb5e9618-3dbf-42cb-a635-752ff9fbcb99@hartkopp.net/ [Severity: Low] The commit message describes a reported defect, but the patch has no Fixes: tag. It also has no Cc: stable and no note saying it should not be backported. Should one of these be added? In the baseline isotp_sendmsg(), the FC timer armed at FF request time comes from: hrtimer_sec = ISOTP_FC_TIMEOUT; (866337865f37) tx_hrt = &so->txtimer; (cf070fe33bfb) The surrounding send logic goes back to e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol"). Other patches in this series either carry Fixes:/Cc: stable (for example "can: isotp: do not send FC.OVFLW in listen mode") or explain why they don't (for example "can: isotp: check the minimum FF_DL"). This patch also changes user-visible timing, since the SF/CF echo timeout drops from 2 s to 1 s. The follow-up "can: isotp: add N_Ar timeout monitoring for FC" does not add a Fixes: tag for this either. > diff --git a/net/can/isotp.c b/net/can/isotp.c > index 2ef4cbc9962ea..368e50bd82fd7 100644 > --- a/net/can/isotp.c > +++ b/net/can/isotp.c [ ... ] > @@ -1007,9 +1015,16 @@ static void isotp_rcv_echo(struct sk_buff *skb, void *data) > /* cancel local echo timeout */ > hrtimer_cancel(&so->echotimer); > > - /* local echo skb with consecutive frame has been consumed */ > + /* local echo skb has been consumed */ > WRITE_ONCE(so->cfecho, 0); > > + /* the FF has been sent => start the FC timeout (N_Bs) */ > + if (READ_ONCE(so->tx.state) == ISOTP_WAIT_FIRST_FC) { > + hrtimer_start(&so->txtimer, ktime_set(ISOTP_TIMEOUT, 0), > + HRTIMER_MODE_REL_SOFT); > + goto out_unlock; > + } > + [Severity: Low] The commit message says: As the transmission is now supervised with the N_As timeout of 1 s instead of the former local echo timeout of 2 s, the ECOMM error may be reported earlier. For a standard FF (ISOTP_WAIT_FIRST_FC), isn't the ECOMM for a missing FC now reported later rather than earlier? Before this patch, isotp_sendmsg() armed so->txtimer for ISOTP_FC_TIMEOUT (1 s) at the FF send request. With a silent peer, ECOMM came about 1 s after write(). Now isotp_sendmsg() arms so->echotimer for 1 s. Only when the FF echo arrives does isotp_rcv_echo() arm so->txtimer for another 1 s. So the time to ECOMM is the FF echo latency plus 1 s, which can reach about 2 s under bus load. This matches ISO 15765-2, but CAN_ISOTP_WAIT_TX_DONE users and applications watching SO_ERROR will see the difference. Could the commit message mention this case too? The follow-up "can: isotp: add N_Ar timeout monitoring for FC" does describe the matching RX side change ("a delayed transmission of the FC may lead to a later ETIMEDOUT error"). [ ... ] > @@ -1308,12 +1321,8 @@ static int isotp_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) > /* standard flow control check */ > new_state = ISOTP_WAIT_FIRST_FC; > > - /* start timeout for FC */ > - hrtimer_sec = ISOTP_FC_TIMEOUT; > - tx_hrt = &so->txtimer; > - > - /* no CF echo tag for isotp_rcv_echo() (FF-mode) */ > - WRITE_ONCE(so->cfecho, 0); > + /* set FF echo tag to start the FC timeout (FF-mode) */ > + WRITE_ONCE(so->cfecho, csx->can_skb_uid); > } > } [Severity: Low] This isn't a bug, but so->cfecho and so->echotimer now also cover the SF and FF, and a few comments in net/can/isotp.c weren't updated. struct isotp_sock still says: u32 cfecho; /* consecutive frame echo tag */ The comment above isotp_echo_timer_handler() still says: /* so->echotimer: fires when a sent CF/SF's local echo does not arrive */ However, isotp_sendmsg() now arms this timer for the standard FF too, and isotp_rcv_fc() cancels it in ISOTP_WAIT_FIRST_FC. The invariant comments in isotp_send_cframe() and isotp_sendmsg() are: /* zero'ed by init/isotp_rcv_echo(); reached lock-free via /* cfecho should have been zero'ed by init / former isotp_rcv_echo() */ Neither mentions that isotp_rcv_fc() now also clears cfecho: if (READ_ONCE(so->tx.state) == ISOTP_WAIT_FIRST_FC) { hrtimer_cancel(&so->echotimer); WRITE_ONCE(so->cfecho, 0); } These comments are still unchanged at the end of the series ("can: isotp: introduce CAN_ISOTP_MIN_TX_DL"). -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203-getsockopt-memcg-isotp-v5-0-bbe89b3d3b71%40hartkopp.net