[PATCH] can-isotp: Add error message if txqueuelen is too small.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch adds a comprehensive error message in
case that txqueuelen is too small and the isotp
driver encounters ENOBUFS (105), e.g.
"no buffer space available" while it does
enqueue its generated frames.

Signed-off-by: Patrick Menschel <menschel.p@xxxxxxxxx>
---
 net/can/isotp.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/net/can/isotp.c b/net/can/isotp.c
index 9f94ad3ca..c50e238b0 100644
--- a/net/can/isotp.c
+++ b/net/can/isotp.c
@@ -946,8 +946,17 @@ 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);
+		if (err == -ENOBUFS) {
+			/* if txqueuelen is not of sufficient length
+			 * for this transfer
+			 */
+			pr_notice_once("can-isotp: %s: can_send_ret %d : No buffer space available in tx queue\n",
+				       __func__, err);
+		} else {
+			/* general error */
+			pr_notice_once("can-isotp: %s: can_send_ret %d\n",
+				       __func__, err);
+		}
 		return err;
 	}
 
-- 
2.17.1




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux