[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250206-pumpkin-angelfish-of-temperance-853268-mkl@pengutronix.de>
Date: Thu, 6 Feb 2025 08:57:17 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Alexander Hölzl <alexander.hoelzl@....net>
Cc: robin@...tonic.nl, socketcan@...tkopp.net, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com, corbet@....net,
kernel@...gutronix.de, linux-can@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] j1939: fix unable to send messages with data length zero
On 05.02.2025 18:46:51, Alexander Hölzl wrote:
> The J1939 standard requires the transmission of messages of length 0.
> For example the proprietary messages are specified with a data length
> of 0 to 1785. The transmission of such messages was not possible.
> Sending such a message resulted in no error being returned but no
> corresponding can frame being generated.
> This patch enables the transmission of zero length J1939 messages.
> In order to facilitate this two changes were necessary.
>
> First when the transmission of a new message is requested from userspace
> the message is segmented in j1939_sk_send_loop. The segmentation did
> account for zero length messages and terminated immediately without
> queuing the corresponding skb.
>
> Second in j1939_session_skb_get_by_offset, when selecting the next skb to
> transmit for a session, it was not checked that there now might be a
> zero length skb in the queue.
>
> Signed-off-by: Alexander Hölzl <alexander.hoelzl@....net>
Rephrased commit message to imperative style and added Oleksij's
Acked-by:
can: j1939: j1939_sk_send_loop(): fix unable to send messages with data length zero
The J1939 standard requires the transmission of messages of length 0.
For example proprietary messages are specified with a data length of 0
to 1785. The transmission of such messages is not possible. Sending
results in no error being returned but no corresponding can frame
being generated.
Enable the transmission of zero length J1939 messages. In order to
facilitate this two changes are necessary:
1) If the transmission of a new message is requested from user space
the message is segmented in j1939_sk_send_loop(). Let the segmentation
take into account zero length messages, do not terminate immediately,
queue the corresponding skb.
2) j1939_session_skb_get_by_offset() selects the next skb to transmit
for a session. Take into account that there might be zero length skbs
in the queue.
Signed-off-by: Alexander Hölzl <alexander.hoelzl@....net>
Acked-by: Oleksij Rempel <o.rempel@...gutronix.de>
Link: https://patch.msgid.link/20250205174651.103238-1-alexander.hoelzl@gmx.net
Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
[mkl: commit message rephrased]
Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
Added to linux-can.
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists