From patchwork Tue Apr 27 05:21:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Menschel X-Patchwork-Id: 12225361 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF5BFC43461 for ; Tue, 27 Apr 2021 05:21:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BAFA66052B for ; Tue, 27 Apr 2021 05:21:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230219AbhD0FWj (ORCPT ); Tue, 27 Apr 2021 01:22:39 -0400 Received: from mout01.posteo.de ([185.67.36.65]:53155 "EHLO mout01.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbhD0FWg (ORCPT ); Tue, 27 Apr 2021 01:22:36 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 1D702240029 for ; Tue, 27 Apr 2021 07:21:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1619500912; bh=r49o/Gcq6TCorMWcYz7eb/OdEGXFuPCA/ZwX7ZH817k=; h=From:To:Subject:Date:From; b=jASVHDZY5jtu84PyQzgXYQ9SYofOzkZDhGy+zjeBE0cGCRL2WTdQM0n4OpbzomEwp LzJLVpzXqgZJpKIp+xA/0n1OYn4nKhm9sgnt+/QLCO5wehNMeUV27GFyEhgoe1PnEf waDLZDshOYV8/UvA9Lxppqo/IXSMBiKTZV2yTazPy172SlK8VBGqMwvpKFIdg4p24W c5lDdC06CnqowpubHTHO9PhdnuMQW0ydgulZE1y2NPfRT2epMzSOcYJULiyMDaNp03 x763UQxBogfuuBf2TXPvbS3NFG2FcFwnSRsDT+cxDeFpZ3KW7J0UrX71fu1+3M5UsG 0qqIostB4ASCQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FTqrH3zRrz9rxM; Tue, 27 Apr 2021 07:21:51 +0200 (CEST) From: Patrick Menschel To: Oliver Hartkopp , Marc Kleine-Budde , "David S. Miller" , Jakub Kicinski , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] can-isotp: Change error format from decimal to symbolic error names Date: Tue, 27 Apr 2021 05:21:47 +0000 Message-Id: <20210427052150.2308-2-menschel.p@posteo.de> In-Reply-To: <20210427052150.2308-1-menschel.p@posteo.de> References: <20210427052150.2308-1-menschel.p@posteo.de> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch changes the format string for errors from decimal %d to symbolic error names %pe to achieve more comprehensive log messages. Signed-off-by: Patrick Menschel --- net/can/isotp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/can/isotp.c b/net/can/isotp.c index 9f94ad3ca..2c4f84fac 100644 --- a/net/can/isotp.c +++ b/net/can/isotp.c @@ -221,8 +221,8 @@ static int isotp_send_fc(struct sock *sk, int ae, u8 flowstatus) can_send_ret = can_send(nskb, 1); if (can_send_ret) - pr_notice_once("can-isotp: %s: can_send_ret %d\n", - __func__, can_send_ret); + pr_notice_once("can-isotp: %s: can_send_ret %pe\n", + __func__, ERR_PTR(can_send_ret)); dev_put(dev); @@ -798,8 +798,8 @@ static enum hrtimer_restart isotp_tx_timer_handler(struct hrtimer *hrtimer) can_send_ret = can_send(skb, 1); if (can_send_ret) - pr_notice_once("can-isotp: %s: can_send_ret %d\n", - __func__, can_send_ret); + pr_notice_once("can-isotp: %s: can_send_ret %pe\n", + __func__, ERR_PTR(can_send_ret)); if (so->tx.idx >= so->tx.len) { /* we are done */ @@ -946,8 +946,8 @@ static int isotp_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) err = can_send(skb, 1); dev_put(dev); if (err) { - pr_notice_once("can-isotp: %s: can_send_ret %d\n", - __func__, err); + pr_notice_once("can-isotp: %s: can_send_ret %pe\n", + __func__, ERR_PTR(err)); return err; } From patchwork Tue Apr 27 05:21:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Menschel X-Patchwork-Id: 12225367 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB657C43460 for ; Tue, 27 Apr 2021 05:22:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F06B613BD for ; Tue, 27 Apr 2021 05:22:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233320AbhD0FWn (ORCPT ); Tue, 27 Apr 2021 01:22:43 -0400 Received: from mout01.posteo.de ([185.67.36.65]:57027 "EHLO mout01.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbhD0FWg (ORCPT ); Tue, 27 Apr 2021 01:22:36 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 0E3DA240028 for ; Tue, 27 Apr 2021 07:21:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1619500913; bh=8NbX+gqxbeCIGv7VCqrOFR0diq4cOe6r5151fpv3NGw=; h=From:To:Subject:Date:From; b=FQIbgFv/VNB0Gem5XxlbQyznhnupJ5TLX0Nvf43MLUNX7XaLD+ta+CVXojjfI+tAp hz1fV1TiKWX/lWA1ybUuo/TcVM0eovgbUHQ4Q1pwMXZHIAe+311DIbsPw1cenzkHUl KekaIBajGPUx6q6po6Guw6egba3rCUf+QXcHATS2RvSV2F07riZ1PwiGScGnxQuo4P J08xc/im5jDGuNzac1/9l+X9X7ZKnkONntNqAoI0rDGPI1dg6gE/41CrjtjzajpyHF Zayv2xum91aIYUgos9x0adlxfYmquTICulayJXrG6ez9RalbjbalferNbxjaQ3njss CsfxXW32ZemRw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FTqrJ1nMmz9rxG; Tue, 27 Apr 2021 07:21:52 +0200 (CEST) From: Patrick Menschel To: Oliver Hartkopp , Marc Kleine-Budde , "David S. Miller" , Jakub Kicinski , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] can-isotp: Add symbolic error message to isotp_module_init() Date: Tue, 27 Apr 2021 05:21:48 +0000 Message-Id: <20210427052150.2308-3-menschel.p@posteo.de> In-Reply-To: <20210427052150.2308-1-menschel.p@posteo.de> References: <20210427052150.2308-1-menschel.p@posteo.de> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch adds the value of err with format %pe to the already existing error message. Signed-off-by: Patrick Menschel --- net/can/isotp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/can/isotp.c b/net/can/isotp.c index 2c4f84fac..2075d8d9e 100644 --- a/net/can/isotp.c +++ b/net/can/isotp.c @@ -1433,7 +1433,7 @@ static __init int isotp_module_init(void) err = can_proto_register(&isotp_can_proto); if (err < 0) - pr_err("can: registration of isotp protocol failed\n"); + pr_err("can: registration of isotp protocol failed %pe\n", ERR_PTR(err)); return err; } From patchwork Tue Apr 27 05:21:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Menschel X-Patchwork-Id: 12225365 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 915D8C433ED for ; Tue, 27 Apr 2021 05:22:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 61D4061154 for ; Tue, 27 Apr 2021 05:22:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232166AbhD0FWm (ORCPT ); Tue, 27 Apr 2021 01:22:42 -0400 Received: from mout01.posteo.de ([185.67.36.65]:60133 "EHLO mout01.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229709AbhD0FWh (ORCPT ); Tue, 27 Apr 2021 01:22:37 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id A083924002A for ; Tue, 27 Apr 2021 07:21:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1619500913; bh=c9HwlFNkXVQClpPdN97uB7nEFbFhZBEgXsw6/gyE4Y4=; h=From:To:Subject:Date:From; b=sPGdMcPF3yZXGDUihXtW36CEMvYumSt+3EGohi5iT0bCeZtfrELCK19c1rExoFLZg M9qarxENQp5hFSiAyxrmLo6grjn5RVeBm58UXIRHpNhYSdiX/CelVoZ/58vgP1Radt 3h6qbtOtgPdNB9+y7UXJhtFGPAiJK4p1mBZcVonXdME0VFH7Drr4vDsCVsiM4foftZ Z+0HEJ1h4XBRmfzD82G+M/ENaGaORtMhGSbOl8Oks6wHbDaYkScZcZrMI1hIwASomV tg+BCHwzIK1gyr247lDuy8/t0suqrGpo6JLk1vZbnB0IHFa9uFpTRuw8COEOpD4U18 H+7y2BBKXEg0A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FTqrK04Djz9rxF; Tue, 27 Apr 2021 07:21:52 +0200 (CEST) From: Patrick Menschel To: Oliver Hartkopp , Marc Kleine-Budde , "David S. Miller" , Jakub Kicinski , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] can-isotp: Add error message if txqueuelen is too small Date: Tue, 27 Apr 2021 05:21:49 +0000 Message-Id: <20210427052150.2308-4-menschel.p@posteo.de> In-Reply-To: <20210427052150.2308-1-menschel.p@posteo.de> References: <20210427052150.2308-1-menschel.p@posteo.de> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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. Signed-off-by: Patrick Menschel --- net/can/isotp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/can/isotp.c b/net/can/isotp.c index 2075d8d9e..d08f95bfd 100644 --- a/net/can/isotp.c +++ b/net/can/isotp.c @@ -797,10 +797,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"); + } if (so->tx.idx >= so->tx.len) { /* we are done */ so->tx.state = ISOTP_IDLE;