From: netdev-bot+sashiko@kernel.org
To: socketcan@hartkopp.net
Cc: linux-can@vger.kernel.org, mkl@pengutronix.de, kuba@kernel.org
Subject: Re: [PATCH can-next v2 04/22] can: isotp: do not send FC.OVFLW in listen mode
Date: Mon, 30 Nov 2026 20:25:04 +0000 [thread overview]
Message-ID: <179607030408.3142.17546637288293835782@kernel.org> (raw)
In-Reply-To: <20261128-getsockopt-memcg-isotp-v2-4-034ba95e17a4@hartkopp.net>
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] This patch moves the CAN_ISOTP_LISTEN_MODE check into
isotp_send_fc() (net/can/isotp.c:297-299), so the function now returns…
--
can: isotp: do not send FC.OVFLW in listen mode
This patch moves the CAN_ISOTP_LISTEN_MODE check out of isotp_rcv_ff() and
isotp_rcv_cf() and into isotp_send_fc(). With this change a listen mode
socket sends no flow control frames at all. That includes the FC.OVFLW
frame sent when the FF_DL exceeds the receive buffer.
> diff --git a/net/can/isotp.c b/net/can/isotp.c
> index 3b83507a8c21b..650d93e84c8eb 100644
> --- a/net/can/isotp.c
> +++ b/net/can/isotp.c
> @@ -294,6 +294,10 @@ static int isotp_send_fc(struct sock *sk, int ae, u8 flowstatus)
> struct isotp_sock *so = isotp_sk(sk);
> int can_send_ret;
>
> + /* no creation of flow control frames in listen mode */
> + if (so->opt.flags & CAN_ISOTP_LISTEN_MODE)
> + return 0;
> +
> nskb = alloc_skb(so->ll.mtu, gfp_any());
> if (!nskb)
> return 1;
> @@ -643,10 +647,6 @@ static int isotp_rcv_ff(struct sock *sk, struct canfd_frame *cf, int ae)
> hrtimer_start(&so->rxtimer, ktime_set(ISOTP_FC_TIMEOUT, 0),
> HRTIMER_MODE_REL_SOFT);
>
> - /* no creation of flow control frames */
> - if (so->opt.flags & CAN_ISOTP_LISTEN_MODE)
> - return 0;
> -
> /* send our first FC frame */
> isotp_send_fc(sk, ae, ISOTP_FC_CTS);
> return 0;
[Severity: Low]
This isn't a bug, but is the comment just above this hrtimer_start() in
isotp_rcv_ff() still accurate?
/* start rx timeout, isotp_send_fc() restarts it */
hrtimer_start(&so->rxtimer, ktime_set(ISOTP_FC_TIMEOUT, 0),
HRTIMER_MODE_REL_SOFT);
In listen mode, the new early return in isotp_send_fc() skips three steps
at the end of the function:
so->rx.bs = 0;
so->lastrxcf_tstamp = ktime_set(0, 0);
hrtimer_start(&so->rxtimer, ...);
Before this patch, the listen mode exception was written out at each call
site. Now isotp_send_fc() is called in listen mode but does not restart
rxtimer, so the comment is only true some of the time.
isotp_rcv_cf() has the same comment before its isotp_send_fc() call.
Runtime behavior doesn't change at this commit, because both hrtimer_start()
calls use ktime_set(ISOTP_FC_TIMEOUT, 0). Later in the series
(bf53ca579974), isotp_send_fc() restarts the timer with
ktime_set(ISOTP_FC_TIMEOUT, so->frame_txtime) while the callers still use
0, and the comments stay the same. Someone reading the comment would then
expect a listen mode socket to get the frame_txtime extended timeout.
Could the comment be reworded, for example "isotp_send_fc() restarts it
when an FC is actually sent (not in listen mode)"?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261128-getsockopt-memcg-isotp-v2-0-034ba95e17a4%40hartkopp.net
next prev parent reply other threads:[~2026-11-30 20:25 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 17:48 [PATCH can-next v2 00/22] can: memcg accounting, CAN_ISOTP fixes and cleanups Oliver Hartkopp
2026-11-28 17:48 ` [PATCH can-next v2 01/22] can: raw: read socket options under conf_lock in raw_getsockopt() Oliver Hartkopp
2026-11-28 17:48 ` [PATCH can-next v2 02/22] can: isotp: read socket options under conf_lock in isotp_getsockopt() Oliver Hartkopp
2026-11-28 17:48 ` [PATCH can-next v2 03/22] can: enable memcg accounting for user triggered allocations Oliver Hartkopp
2026-11-30 20:25 ` netdev-bot+sashiko
2026-11-28 17:48 ` [PATCH can-next v2 04/22] can: isotp: do not send FC.OVFLW in listen mode Oliver Hartkopp
2026-11-30 20:25 ` netdev-bot+sashiko [this message]
2026-11-28 17:48 ` [PATCH can-next v2 05/22] can: isotp: check the CAN_ISOTP_OPTS values before applying them Oliver Hartkopp
2026-11-28 17:48 ` [PATCH can-next v2 06/22] can: isotp: add the frame transmission time to the CF broadcast gap Oliver Hartkopp
2026-11-30 20:25 ` netdev-bot+sashiko
2026-11-28 17:48 ` [PATCH can-next v2 07/22] can: isotp: add the frame transmission time to the protocol timeouts Oliver Hartkopp
2026-11-30 20:25 ` netdev-bot+sashiko
2026-11-28 17:49 ` [PATCH can-next v2 08/22] can: isotp: check the CAN FD tx_flags in CAN_ISOTP_LL_OPTS Oliver Hartkopp
2026-11-30 20:25 ` netdev-bot+sashiko
2026-11-28 17:49 ` [PATCH can-next v2 09/22] can: isotp: reject reserved STmin values in CAN_ISOTP_RECV_FC Oliver Hartkopp
2026-11-30 20:25 ` netdev-bot+sashiko
2026-11-28 17:49 ` [PATCH can-next v2 10/22] can: isotp: ignore CAN_ISOTP_CHK_PAD_DATA without CAN_ISOTP_RX_PADDING Oliver Hartkopp
2026-11-28 17:49 ` [PATCH can-next v2 11/22] can: isotp: drop frames without N_PCI Oliver Hartkopp
2026-11-30 20:25 ` netdev-bot+sashiko
2026-11-28 17:49 ` [PATCH can-next v2 12/22] can: isotp: drop FF frames with invalid length extension Oliver Hartkopp
2026-11-28 17:49 ` [PATCH can-next v2 13/22] can: isotp: check the minimum FF_DL Oliver Hartkopp
2026-11-28 17:49 ` [PATCH can-next v2 14/22] can: isotp: check the data length of the last CF Oliver Hartkopp
2026-11-28 17:49 ` [PATCH can-next v2 15/22] can: isotp: drop inline keyword, let the compiler decide Oliver Hartkopp
2026-11-28 17:49 ` [PATCH can-next v2 16/22] can: isotp: rename rx_lock as it has become state machine lock Oliver Hartkopp
2026-11-30 20:25 ` netdev-bot+sashiko
2026-11-28 17:49 ` [PATCH can-next v2 17/22] can: isotp: introduce isotp_invalid_canid() to verify proper CAN-IDs Oliver Hartkopp
2026-11-28 17:49 ` [PATCH can-next v2 18/22] can: isotp: rename variable for the required content length Oliver Hartkopp
2026-11-28 17:49 ` [PATCH can-next v2 19/22] can: isotp: rename checkpad functions returning bool values Oliver Hartkopp
2026-11-28 17:49 ` [PATCH can-next v2 20/22] can: isotp: change return type of functions to void Oliver Hartkopp
2026-11-28 17:49 ` [PATCH can-next v2 21/22] can: isotp: rename pointer in isotp_rcv() prototype Oliver Hartkopp
2026-11-28 17:49 ` [PATCH can-next v2 22/22] can: isotp: introduce CAN_ISOTP_MIN_TX_DL Oliver Hartkopp
2026-11-30 8:57 ` [PATCH can-next v2 00/22] can: memcg accounting, CAN_ISOTP fixes and cleanups Oliver Hartkopp
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=179607030408.3142.17546637288293835782@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=socketcan@hartkopp.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox