Skip to content

Commit

Permalink
can: isotp: Add error message if txqueuelen is too small
Browse files Browse the repository at this point in the history
stable inclusion
from stable-vundefined
commit 7adbc048d84b54aaa2faf466d888e436fb83f70b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9CSYQ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7adbc048d84b54aaa2faf466d888e436fb83f70b

--------------------------------

commit c69d190 upstream

This patch adds an additional error message in case that txqueuelen is
set too small and advices the user to increase txqueuelen.

This is likely to happen even with small transfers if txqueuelen is at
default value 10 frames.

Link: https://lore.kernel.org/r/20210427052150.2308-4-menschel.p@posteo.de
Signed-off-by: Patrick Menschel <menschel.p@posteo.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: sanglipeng <sanglipeng1@jd.com>
  • Loading branch information
menschel authored and sanglipeng1 committed Apr 1, 2024
1 parent 090821e commit 7513c1d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/can/isotp.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,10 +813,12 @@ static enum hrtimer_restart isotp_tx_timer_handler(struct hrtimer *hrtimer)
can_skb_set_owner(skb, sk);

can_send_ret = can_send(skb, 1);
if (can_send_ret)
if (can_send_ret) {
pr_notice_once("can-isotp: %s: can_send_ret %pe\n",
__func__, ERR_PTR(can_send_ret));

if (can_send_ret == -ENOBUFS)
pr_notice_once("can-isotp: tx queue is full, increasing txqueuelen may prevent this error\n");
}
if (so->tx.idx >= so->tx.len) {
/* we are done */
so->tx.state = ISOTP_IDLE;
Expand Down

0 comments on commit 7513c1d

Please sign in to comment.