Hi Michal,
On 02.03.23 10:20, Michal Sojka wrote:
On Wed, Mar 01 2023, Oliver Hartkopp wrote:
I can not see problems or drops when using
./isotpsend vcan0 -s 123 -d 321 -D 9 -li
as data producer where I added a counter:
Really?
Yes ;-)
I tried to modify my test program to also support blocking
operation (without poll()) and setting CAN_ISOTP_WAIT_TX_DONE. It's
available at https://github.com/wentasah/isotp-poll-test/blob/fd095b2242c49dc5d3e36faf5ac9f4f47fd002c7/isotp-poll-test.c.
Cloned it.
With it, I detect lost message in mainline Linux 6.2, but sometimes, it
takes quite long time (a minute) before it happens.
Hm. Everything fine here with 6.2.0-12944-ge492250d5252.
What happens is well visible with strace. When I run the receiver as (-b
stands for blocking operation without poll()):
strace ./isotp-poll-test -s 321 -d 123 -i -a -b -q
and then the sender (-w means to use CAN_ISOTP_WAIT_TX_DONE):
strace ./isotp-poll-test -s 123 -d 321 -o -w -b -q
Running these two (without strace) for 15 mins now:
Hello20160713
and counting ...
The output of the receiver is:
read(3, "Hello122813", 99) = 11
read(3, "Hello122814", 99) = 11
read(3, "Hello122815", 99) = 11
read(3, "Hello122816", 99) = 11
read(3, "Hello122817", 99) = 11
read(3, "Hello122847", 99) = 11
write(2, "isotp-poll-test: ", 17isotp-poll-test: ) = 17
write(2, "Lost messages. Expected: #122818"..., 50Lost messages. Expected: #122818, received #122847) = 50
write(2, "\n", 1
) = 1
exit_group(1) = ?
Sender's output looks as follows:
write(3, "Hello122813", 11) = 11
write(3, "Hello122814", 11) = 11
write(3, "Hello122815", 11) = 11
write(3, "Hello122816", 11) = 11
write(3, "Hello122817", 11) = 11
write(3, "Hello122818", 11) = 11
write(3, "Hello122819", 11) = 11
write(3, "Hello122820", 11) = 11
...
write(3, "Hello123116", 11) = 11
write(3, "Hello123117", 11) = 11
write(3, "Hello123118", 11) = 11
write(3, "Hello123119", 11) = -1 ECOMM (Communication error on send)
write(2, "isotp-poll-test: ", 17isotp-poll-test: ) = 17
write(2, "write(sock, str, strlen(str))", 29write(sock, str, strlen(str))) = 29
write(2, ": Communication error on send\n", 30: Communication error on send
) = 30
exit_group(1) = ?
So my impression is that this does not relate to poll() implementation
changes.
With strace too.
strace ./isotp-poll-test -s 123 -d 321 -o -b -q
strace ./isotp-poll-test -s 321 -d 123 -i -a -b -q
No problems with your V2 patch either.
I also tried to update my poll patch to take into account the so->wait
wait queue. But the result is the same as without it. I will send it in
a separate mail.
I only get a problem when removing '-b'
strace ./isotp-poll-test -s 321 -d 123 -i -a -q
poll([{fd=3, events=POLLIN}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
read(3, "Hello716", 99) = 8
write(2, "isotp-poll-test: ", 17isotp-poll-test: ) = 17
write(2, "Lost messages. Expected: #715, r"..., 44Lost messages.
Expected: #715, received #716) = 44
write(2, "\n", 1
) = 1
exit_group(1) = ?
+++ exited with 1 +++
Hm.
Best regards,
Oliver