All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sri Subramanian <sridhar.subramanian@gmail.com>
To: Philippe Gerum <rpm@xenomai.org>
Cc: xenomai@xenomai.org
Subject: Re: Xenomai 4 / oob_sendmsg crashes kernel from tidbits/oob-net-icmp
Date: Thu, 14 Jul 2022 17:59:02 -0700	[thread overview]
Message-ID: <CAAm9oxq0qzdxx+KnbROMCHgNvp-xEZ99O90omY4zOxXtxsEpsA@mail.gmail.com> (raw)
In-Reply-To: <87fsj3d827.fsf@xenomai.org>

On Thu, Jul 14, 2022 at 8:32 AM Philippe Gerum <rpm@xenomai.org> wrote:
>
>
> Sri Subramanian <sridhar.subramanian@gmail.com> writes:
>
> > Hello,
> >
> > I am trying to optimize sending ethernet raw packets (for an Ethercat
> > fieldbus application) on a RaspberryPi/CM4 environment.
> >
>
> No NIC driver currently implements the EVL out-of-band protocol fully
> yet, so at the moment, although the EVL network stack does improve the
> timings, there is still some work on the device side to get a full
> real-time path from the application to the wire.
>
> i.e. today we have:
>
> (app) <---> EVL netstack <--/ non-rt /--> (NIC driver via in-band context)
>
> we aim at a full real-time path next:
>
> (app) <---> EVL netstack <-------> (NIC driver via out-of-band context)
>

Understood! Thanks for the explanation. Our current application
occasionally gets hit with ~100us latency on the linux send() call,
so we're hoping this will be an improvement.

>
> > Before implementing the application, I thought I'd try getting an ICMP
> > echo using the "tidbits" sample program oob-net-icmp.
> >
> > I am using eth0 from a RaspberryPI (used to ping) connected to another
> > PI device (CM4 on an IO board) also on eth0, which is echoing back the
> > pings using oob-net-icmp. I set up vlan 42 as documented in the
> > program, for both the devices. (I verify the network connection is
> > good  prior to this by sending pings and verifying the echo responses,
> > through the standard Linux stack on eth0).
> >
> > I also set up the ping-receiving device so the Xenomai kernel can
> > route the packets up the Xenomai mini stack, setting:
> >
> > echo 1> /sys/class/net/eth0.42/oob_port
> > echo 42 > /sys/class/evl/control/net_vlans
> >
> > On the first ping, the kernel crashes with the stack as below. I've
> > tested on both versions 5.15 and 5.17 (both with CONFIG_NET_OOB=y).
> > Thanks for any help or guidance.
> >
> > -Sri Subramanian
> >
<snip>
>
> This patch may help:
> https://source.denx.de/Xenomai/xenomai4/linux-evl/-/commit/2ad6b2207f9f1669f64f6816428a20e1bbd6357c
>
> Feedback on this fix welcome, so that we may assume the issue is closed.
>

The fix doesn't crash the kernel, thanks for the quick response.

oob-net-icmp successfully sends the response and prints stats on the console.
I am puzzled that the sending ping program doesn't ack the echo responses.
oob_port is not enabled for the sending side, so the echo responses should go
up the Linux network stack and 'ping' should see them.

ifconfig stats on eth0.42 also show that the Rx packets were not received.

I've tried this both on NET_OOB -enabled and -disabled kernels with the same
behavior. I'll try using a hardware sniffer next to make sure.

> PS: EVL is maintained for the latest LTS and SLTS releases, and follows
> the mainline development tip closely too. This means v5.10-stable,
> v5.15-stable and v5.19 at the moment. Other releases published may not
> include all available patches: if you want to use them nevertheless, you
> will need to cherry-pick fixes from maintained trees.
>

Will do. Cheers!
Sri

> Thanks,
>
> --
> Philippe.

  reply	other threads:[~2022-07-15  1:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12  1:10 Xenomai 4 / oob_sendmsg crashes kernel from tidbits/oob-net-icmp Sri Subramanian
2022-07-14  8:16 ` Philippe Gerum
2022-07-14 15:18 ` Philippe Gerum
2022-07-15  0:59   ` Sri Subramanian [this message]
2022-07-19 15:29     ` Sri Subramanian
2022-07-20  8:42       ` Philippe Gerum
2022-07-20 16:35         ` Sri Subramanian
2022-07-20 17:41           ` Philippe Gerum
2022-07-20 19:48             ` Sri Subramanian
2022-07-21  0:38             ` Sri Subramanian
2022-07-21  7:39               ` Philippe Gerum
2022-07-21 14:21                 ` Philippe Gerum
2022-07-22 17:06                   ` Philippe Gerum
2022-07-22 19:30                     ` Sri Subramanian

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=CAAm9oxq0qzdxx+KnbROMCHgNvp-xEZ99O90omY4zOxXtxsEpsA@mail.gmail.com \
    --to=sridhar.subramanian@gmail.com \
    --cc=rpm@xenomai.org \
    --cc=xenomai@xenomai.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.