From: Patrick Menschel <menschel.p@posteo.de>
To: Sebastien FABRE <sebastien.fabre@actia.fr>,
"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: J1939: Send messages without acknowledging
Date: Mon, 17 Oct 2022 19:48:20 +0000 [thread overview]
Message-ID: <d822d70a-717a-e2b6-06a4-d6e276615bc1@posteo.de> (raw)
In-Reply-To: <PR0P264MB23096FC238E648331A32B5A492299@PR0P264MB2309.FRAP264.PROD.OUTLOOK.COM>
[-- Attachment #1.1: Type: text/plain, Size: 1539 bytes --]
Am 17.10.22 um 16:55 schrieb Sebastien FABRE:
> Hello,
>
> I am working on 5.4 kernel, and I have the same behavior with 5.10 kernel version.
> I reproduce the behavior with a custom application. A j1939 socket is created with SO_BROADCAST and SO_J1939_PROMISC options and is binded. The application sends a claim message then 50 broadcast messages in loop (without waiting) with size greater than 8 bytes (50).
>
> Every sendto methods return success directly and sessions are stored in sk_session_queue.
> If the can is 'on' but nobody acknowledges, after some times, trames are no longer sent (ENOBUFS) but the application does not have this information (sendto returned success).
> Moreover, txqueuelen does not have impact to this behavior (queue size seems to be infinite).
> To finish, closing socket will take a long time depending on sk_session_queue size because of J1939_XTP_TX_RETRY_LIMIT: kernel seems to try to send every message 100 times if ENOBUFS is received.
>
> Is it the expected behavior? How can the application know that messages are no longer sent?
>
Hello,
I haven't done J1939 for a while but the typical scenario is that you
set up a Can Raw Socket with some filters and timeout socket option to
receive your own messages in application.
You drop everything until that socket timeout happens which is the
trigger to stop unconditional sending in application until something is
received again.
Actually I would be interested if there are better ways to do this.
--
Patrick
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
next prev parent reply other threads:[~2022-10-17 19:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-17 14:55 J1939: Send messages without acknowledging Sebastien FABRE
2022-10-17 19:48 ` Patrick Menschel [this message]
2022-10-18 11:00 ` Marc Kleine-Budde
2022-10-20 13:17 ` Sebastien FABRE
2022-10-21 13:44 ` Oleksij Rempel
2022-10-24 16:15 ` Sebastien FABRE
2022-10-24 16:55 ` Oleksij Rempel
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=d822d70a-717a-e2b6-06a4-d6e276615bc1@posteo.de \
--to=menschel.p@posteo.de \
--cc=linux-can@vger.kernel.org \
--cc=sebastien.fabre@actia.fr \
/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