mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chaosheng Qu <quchaosheng000406@163.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: netdev-bot+sashiko@kernel.org,
	Robin van der Gracht <robin@protonic.nl>,
	Oliver Hartkopp <socketcan@hartkopp.net>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	kernel@pengutronix.de, linux-can@vger.kernel.org,
	linux-kernel@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH net v7 3/4] can: j1939: drop the message when the reassembled skb is gone
Date: Fri, 13 Nov 2026 16:54:28 +0800	[thread overview]
Message-ID: <179456006880.149752.3451373615421898441@163.com> (raw)
In-Reply-To: <ava7hRQ7lxXckkPL@pengutronix.de>

Hi Oleksij,

No, a stack trace adds nothing here, so netdev_err_once() it is.

The branch is defense in depth: with the EDPO bound in place it should be
unreachable, and if it ever does fire, what I need is the session state, not
the call stack. Whoever reads the log wants to know which offset missed and
what the queue looked like, and a backtrace of j1939_session_completed()
tells them neither. So I would put that state in the message:

	if (se_skb) {
		j1939_sk_recv(session->priv, se_skb);
		consume_skb(se_skb);
	} else {
		netdev_err_once(session->priv->ndev,
				"%s: 0x%p: no skb at dpo %u, total %u, rx %u, queue %u\n",
				__func__, session, session->pkt.dpo,
				session->pkt.total, session->pkt.rx,
				skb_queue_len(&session->skb_queue));
		session->err = EBADMSG;
	}

One correction to what I wrote yesterday, since it is the same line:
session->err = -EBADMSG has the wrong sign. __j1939_sk_errqueue() assigns
session->err straight into serr->ee.ee_errno, which is a __u32 that user
space reads as a positive errno; the TX_ACK case right above it stores
ENOMSG, and j1939_xtp_abort_to_errno() returns positive values as well. A
negative value would reach user space as 4294967222 instead of EBADMSG. It
should be plain EBADMSG.

That also means the two existing negative assignments, -ENETUNREACH in the
tx retry-limit path and -ETIME in the simple-tx timeout path, already deliver
a wrapped value through TX_ABORT. Pre-existing and not this series; I mention
it only because it sits on the line I am touching, and I would rather not
copy the wrong convention into a new one.

Thanks,
Chaosheng


  reply	other threads:[~2026-11-13  8:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08  1:34 [PATCH net v7 0/4] can: j1939: fix the abort timer and bound EDPO Chaosheng Qu
2026-11-08  1:34 ` [PATCH net v7 2/4] can: j1939: validate the EDPO packet number Chaosheng Qu
2026-11-12 21:49   ` netdev-bot+sashiko
2026-11-13  3:11     ` Chaosheng Qu
2026-11-08  1:34 ` [PATCH net v7 3/4] can: j1939: drop the message when the reassembled skb is gone Chaosheng Qu
2026-11-12 21:49   ` netdev-bot+sashiko
2026-11-13  3:11     ` Chaosheng Qu
2026-11-13  7:25       ` Oleksij Rempel
2026-11-13  8:54         ` Chaosheng Qu [this message]
2026-11-08  1:34 ` [PATCH net v7 1/4] can: j1939: arm the abort timer under the session list lock Chaosheng Qu
2026-11-12 21:49   ` netdev-bot+sashiko
2026-11-13  3:11     ` Chaosheng Qu
2026-11-08  1:34 ` [PATCH net v7 4/4] can: j1939: reject a CTS that names more packets than the message has Chaosheng Qu
2026-11-12 21:49   ` netdev-bot+sashiko
2026-11-13  3:11     ` Chaosheng Qu

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=179456006880.149752.3451373615421898441@163.com \
    --to=quchaosheng000406@163.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=robin@protonic.nl \
    --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

all inboxes | Powered by JetHome®