Re: please re-send [RFC PATCH] can: isotp: fix poll() to not report false positive EPOLLOUT events

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

 



Hi Oliver,

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? 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.

With it, I detect lost message in mainline Linux 6.2, but sometimes, it
takes quite long time (a minute) before it happens.

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

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.

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.

Best regards,
-Michal



[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