All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bezdeka, Florian" <florian.bezdeka@siemens.com>
To: "paal_to@freemail.hu" <paal_to@freemail.hu>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: RTNET setup issue
Date: Tue, 29 Mar 2022 09:08:56 +0000	[thread overview]
Message-ID: <b1575b6a318df05c75d39502700af4775ea73b2c.camel@siemens.com> (raw)
In-Reply-To: <freemail.20220324162711.86768.1@fmxmldata10.freemail.hu>

On Thu, 2022-03-24 at 16:27 +0100, Paal Tamas wrote:
> > I started the debug session using the rtifconfig.c file, since the
> > rtifconfig command "fails fine". I added some trace to the
> > rtifconfig.c (into the do_display() function) and rtnet_chrdev.c
> > (into the rtnet_core_ioctl() function) files. In "all 64bit mode",
> > when RTNET works as expected I see the followings in the user mode
> > console and kernel trace:
> > do_display enter
> > do_display: IOC_RT_IFINFO=0xc0500082, sizeof(rtnet_core_cmd)=80
> >  
> > [   36.616917] rtnet_core_ioctl:
> > request=0xc0500082,sizeof(rtnet_core_cmd)=80
> > [   36.616919] rtnet_core_ioctl: IOC_RT_IFINFO decoded
> >  
> > This means the ioctl() call hit the target succesfully.
> >  
> > When I compile the userland to 32bit the user mode trace is the
> > following:
> >  
> > do_display enter
> > do_display: IOC_RT_IFINFO=0xc0500082, sizeof(rtnet_core_cmd)=80
> > do_display: ret=-1
> > ioctl: Inappropriate ioctl for device
> >  
> > but nothing appears in the kernel trace. This means to me that the
> > ioctl() call did not reach the rtnet_core_ioctl() funtion, rather
> > failed somewhere in between the userspace and that kernel function
> > call.
> >  
> > I need some help here. I need to add more traces to the system, to
> > find the place where the ioctl() call hits the wall. When the
> > do_display() function of rtifconfig.c calls ioctl(), where can I
> > find that certain ioctl() function? I am lost in the jungle of
> > macros...

Your mail client has a strange configuration / citation style. Took
some time to realize that there is a question.

Whenever you call ioctl() you end up in the Xenomai (libcobalt)
wrapper. See lib/cobalt/rtdm.c (~ line 195). If do_ioctl (which
triggers the Xenomai / RT syscall) fails, it will fall back to the
Linux / NON-RT path. I guess that is where the "Inappropriate ioctl for
device" is coming from. Linux simply doesn't know the requested call.

I guess you have to figure out why the RT path fails. The interesting
entry point inside the kernel should be in kernel/cobalt/posix/io.c
(~line 63) calling rtdm_fd_ioctl() located in kernel/cobalt/rtdm/fd.c.

rtdm_fd_ioctl() might bail out in some error conditions before
triggering the trace infrastructure. That might be the reason why your
trace did not mention any RT syscall.

CONFIG_XENO_ARCH_SYS3264 is enabled on your end?

HTH,
Florian



      reply	other threads:[~2022-03-29  9:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-23  9:48 RTNET setup issue Paal Tamas
2022-03-23 11:05 ` François Legal
2022-03-23 13:07   ` Paal Tamas
2022-03-23 13:37     ` François Legal
2022-03-23 14:12       ` Paal Tamas
2022-03-23 15:02         ` Paal Tamas
2022-03-23 16:41           ` Bezdeka, Florian
2022-03-24 15:27             ` Paal Tamas
2022-03-29  9:08               ` Bezdeka, Florian [this message]

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=b1575b6a318df05c75d39502700af4775ea73b2c.camel@siemens.com \
    --to=florian.bezdeka@siemens.com \
    --cc=paal_to@freemail.hu \
    --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.