All of lore.kernel.org
 help / color / mirror / Atom feed
* RTNET setup issue
@ 2022-03-23  9:48 Paal Tamas
  2022-03-23 11:05 ` François Legal
  0 siblings, 1 reply; 9+ messages in thread
From: Paal Tamas @ 2022-03-23  9:48 UTC (permalink / raw)
  To: xenomai

Dear All,   I am trying to set up RTNET using the latest xenomai_3.2.1 on an x86_64 system. I need only the raw packet (e.g rtpacket layer). I tried a lot of things but I still got errors like:  ioctl: Inappropriate ioctl for device    I try to use this PCI device: 
01:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
    Subsystem: Intel Corporation Gigabit ET Dual Port Server Adapter
    Kernel driver in use: rt_igb
    Kernel modules: igb, rt_igb   What I do is: ifconfig enp1s0f0 down
ifconfig enp1s0f1 down
rmmod igbmodprobe rtnet
modprobe rtpacket
modprobe rt_igb
modprobe rtipv4
modprobe rtudp  set up the rtnet.conf file and start rtnet: /usr/xenomai/sbin$ sudo ./rtnet start
ioctl: Inappropriate ioctl for device
ioctl: Inappropriate ioctl for device
ioctl: Inappropriate ioctl for device
Stage 1: searching for master...ioctl: Inappropriate ioctl for deviceStage 2: waiting for other slaves...
Stage 3: waiting for common setup completion...ioctl: Inappropriate ioctl for deviceclickandmove@clickandmove-desktop:/usr/xenomai/sbin$ sudo /usr/xenomai/sbin/rtifconfig -a
ioctl: Inappropriate ioctl for device   The kernel log:  [   50.360253] igb 0000:01:00.1: removed PHC on enp1s0f1
[   50.553797] igb 0000:01:00.0: removed PHC on enp1s0f0
[   81.769798] RTnet: registered rteth0
[   81.769802] rt_igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
[   81.769804] rt_igb 0000:01:00.0: rteth0: (PCIe:2.5Gb/s:Width x1) 6c:b3:11:56:2e:32
[   81.769807] rt_igb 0000:01:00.0: rteth0: PBA No: Unknown
[   81.769808] rt_igb 0000:01:00.0: Using MSI-X interrupts. 1 rx queue(s), 1 tx queue(s)
[   81.777139] rt_loopback: initializing loopback interface...
[   81.777315] RTnet: registered rtlo
[   81.787311] RTcfg: init real-time configuration distribution protocol
[   81.793326] RTmac: init realtime media access control
[   81.800424] RTmac/TDMA: init time division multiple access control mechanism   Even rtifconfig returns the same error  /usr/xenomai/sbin/rtifconfig -aioctl: Inappropriate ioctl for device   What am I doing wrong? Thank you,Tamas
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RTNET setup issue
  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
  0 siblings, 1 reply; 9+ messages in thread
From: François Legal @ 2022-03-23 11:05 UTC (permalink / raw)
  To: Paal Tamas; +Cc: xenomai

Le Mercredi, Mars 23, 2022 10:48 CET, Paal Tamas via Xenomai <xenomai@xenomai.org> a écrit:

> Dear All,   I am trying to set up RTNET using the latest xenomai_3.2.1 on an x86_64 system. I need only the raw packet (e.g rtpacket layer). I tried a lot of things but I still got errors like:  ioctl: Inappropriate ioctl for device    I try to use this PCI device:
> 01:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
>     Subsystem: Intel Corporation Gigabit ET Dual Port Server Adapter
>     Kernel driver in use: rt_igb
>     Kernel modules: igb, rt_igb   What I do is: ifconfig enp1s0f0 down
> ifconfig enp1s0f1 down
> rmmod igbmodprobe rtnet
> modprobe rtpacket
> modprobe rt_igb
> modprobe rtipv4
> modprobe rtudp  set up the rtnet.conf file and start rtnet: /usr/xenomai/sbin$ sudo ./rtnet start
> ioctl: Inappropriate ioctl for device
> ioctl: Inappropriate ioctl for device
> ioctl: Inappropriate ioctl for device
> Stage 1: searching for master...ioctl: Inappropriate ioctl for deviceStage 2: waiting for other slaves...
> Stage 3: waiting for common setup completion...ioctl: Inappropriate ioctl for deviceclickandmove@clickandmove-desktop:/usr/xenomai/sbin$ sudo /usr/xenomai/sbin/rtifconfig -a
> ioctl: Inappropriate ioctl for device   The kernel log:  [   50.360253] igb 0000:01:00.1: removed PHC on enp1s0f1
> [   50.553797] igb 0000:01:00.0: removed PHC on enp1s0f0
> [   81.769798] RTnet: registered rteth0
> [   81.769802] rt_igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
> [   81.769804] rt_igb 0000:01:00.0: rteth0: (PCIe:2.5Gb/s:Width x1) 6c:b3:11:56:2e:32
> [   81.769807] rt_igb 0000:01:00.0: rteth0: PBA No: Unknown
> [   81.769808] rt_igb 0000:01:00.0: Using MSI-X interrupts. 1 rx queue(s), 1 tx queue(s)
> [   81.777139] rt_loopback: initializing loopback interface...
> [   81.777315] RTnet: registered rtlo
> [   81.787311] RTcfg: init real-time configuration distribution protocol
> [   81.793326] RTmac: init realtime media access control
> [   81.800424] RTmac/TDMA: init time division multiple access control mechanism   Even rtifconfig returns the same error  /usr/xenomai/sbin/rtifconfig -aioctl: Inappropriate ioctl for device   What am I doing wrong? Thank you,Tamas
>

 Hello,

what makes you think it does not work ? Using the rtnet script, you're trying to configure rtmac & rtcfg which you stated are not necessary for your setup.

Have you tried only rtifconfig rteth* up and checked the Tx/Rx counters displayed there ?

François



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RTNET setup issue
  2022-03-23 11:05 ` François Legal
@ 2022-03-23 13:07   ` Paal Tamas
  2022-03-23 13:37     ` François Legal
  0 siblings, 1 reply; 9+ messages in thread
From: Paal Tamas @ 2022-03-23 13:07 UTC (permalink / raw)
  To: François Legal, xenomai

 
"François Legal" <devel@thom.fr.eu.org> írta:
>Le Mercredi, Mars 23, 2022 10:48 CET, Paal Tamas via Xenomai <xenomai@xenomai.org> a écrit:
>
>> Dear All,   I am trying to set up RTNET using the latest xenomai_3.2.1 on an x86_64 system. I need only the raw packet (e.g rtpacket layer). I tried a lot of things but I still got errors like:  ioctl: Inappropriate ioctl for device    I try to use this PCI device:
>> 01:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
>>     Subsystem: Intel Corporation Gigabit ET Dual Port Server Adapter
>>     Kernel driver in use: rt_igb
>>     Kernel modules: igb, rt_igb   What I do is: ifconfig enp1s0f0 down
>> ifconfig enp1s0f1 down
>> rmmod igbmodprobe rtnet
>> modprobe rtpacket
>> modprobe rt_igb
>> modprobe rtipv4
>> modprobe rtudp  set up the rtnet.conf file and start rtnet: /usr/xenomai/sbin$ sudo ./rtnet start
>> ioctl: Inappropriate ioctl for device
>> ioctl: Inappropriate ioctl for device
>> ioctl: Inappropriate ioctl for device
>> Stage 1: searching for master...ioctl: Inappropriate ioctl for deviceStage 2: waiting for other slaves...
>> Stage 3: waiting for common setup completion...ioctl: Inappropriate ioctl for deviceclickandmove@clickandmove-desktop:/usr/xenomai/sbin$ sudo /usr/xenomai/sbin/rtifconfig -a
>> ioctl: Inappropriate ioctl for device   The kernel log:  [   50.360253] igb 0000:01:00.1: removed PHC on enp1s0f1
>> [   50.553797] igb 0000:01:00.0: removed PHC on enp1s0f0
>> [   81.769798] RTnet: registered rteth0
>> [   81.769802] rt_igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
>> [   81.769804] rt_igb 0000:01:00.0: rteth0: (PCIe:2.5Gb/s:Width x1) 6c:b3:11:56:2e:32
>> [   81.769807] rt_igb 0000:01:00.0: rteth0: PBA No: Unknown
>> [   81.769808] rt_igb 0000:01:00.0: Using MSI-X interrupts. 1 rx queue(s), 1 tx queue(s)
>> [   81.777139] rt_loopback: initializing loopback interface...
>> [   81.777315] RTnet: registered rtlo
>> [   81.787311] RTcfg: init real-time configuration distribution protocol
>> [   81.793326] RTmac: init realtime media access control
>> [   81.800424] RTmac/TDMA: init time division multiple access control mechanism   Even rtifconfig returns the same error  /usr/xenomai/sbin/rtifconfig -aioctl: Inappropriate ioctl for device   What am I doing wrong? Thank you,Tamas
>>
>
> Hello,
>
>what makes you think it does not work ? Using the rtnet script, you&#39;re trying to configure rtmac & rtcfg which you stated are not necessary for your setup.
>
>Have you tried only rtifconfig rteth* up and checked the Tx/Rx counters displayed there ?
>
>François

>Hello,  The "rtifconfig rteth0 up" command returns the  "ioctl: Inappropriate ioctl for device" error too. That&#39;s why I think something is wrong. Thank you,Tamas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RTNET setup issue
  2022-03-23 13:07   ` Paal Tamas
@ 2022-03-23 13:37     ` François Legal
  2022-03-23 14:12       ` Paal Tamas
  0 siblings, 1 reply; 9+ messages in thread
From: François Legal @ 2022-03-23 13:37 UTC (permalink / raw)
  To: Paal Tamas; +Cc: xenomai

Le Mercredi, Mars 23, 2022 14:07 CET, Paal Tamas <paal_to@freemail.hu> a écrit:

>
> "François Legal" <devel@thom.fr.eu.org> írta:
> >Le Mercredi, Mars 23, 2022 10:48 CET, Paal Tamas via Xenomai <xenomai@xenomai.org> a écrit:
> >
> >> Dear All,   I am trying to set up RTNET using the latest xenomai_3.2.1 on an x86_64 system. I need only the raw packet (e.g rtpacket layer). I tried a lot of things but I still got errors like:  ioctl: Inappropriate ioctl for device    I try to use this PCI device:
> >> 01:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
> >>     Subsystem: Intel Corporation Gigabit ET Dual Port Server Adapter
> >>     Kernel driver in use: rt_igb
> >>     Kernel modules: igb, rt_igb   What I do is: ifconfig enp1s0f0 down
> >> ifconfig enp1s0f1 down
> >> rmmod igbmodprobe rtnet
> >> modprobe rtpacket
> >> modprobe rt_igb
> >> modprobe rtipv4
> >> modprobe rtudp  set up the rtnet.conf file and start rtnet: /usr/xenomai/sbin$ sudo ./rtnet start
> >> ioctl: Inappropriate ioctl for device
> >> ioctl: Inappropriate ioctl for device
> >> ioctl: Inappropriate ioctl for device
> >> Stage 1: searching for master...ioctl: Inappropriate ioctl for deviceStage 2: waiting for other slaves...
> >> Stage 3: waiting for common setup completion...ioctl: Inappropriate ioctl for deviceclickandmove@clickandmove-desktop:/usr/xenomai/sbin$ sudo /usr/xenomai/sbin/rtifconfig -a
> >> ioctl: Inappropriate ioctl for device   The kernel log:  [   50.360253] igb 0000:01:00.1: removed PHC on enp1s0f1
> >> [   50.553797] igb 0000:01:00.0: removed PHC on enp1s0f0
> >> [   81.769798] RTnet: registered rteth0
> >> [   81.769802] rt_igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
> >> [   81.769804] rt_igb 0000:01:00.0: rteth0: (PCIe:2.5Gb/s:Width x1) 6c:b3:11:56:2e:32
> >> [   81.769807] rt_igb 0000:01:00.0: rteth0: PBA No: Unknown
> >> [   81.769808] rt_igb 0000:01:00.0: Using MSI-X interrupts. 1 rx queue(s), 1 tx queue(s)
> >> [   81.777139] rt_loopback: initializing loopback interface...
> >> [   81.777315] RTnet: registered rtlo
> >> [   81.787311] RTcfg: init real-time configuration distribution protocol
> >> [   81.793326] RTmac: init realtime media access control
> >> [   81.800424] RTmac/TDMA: init time division multiple access control mechanism   Even rtifconfig returns the same error  /usr/xenomai/sbin/rtifconfig -aioctl: Inappropriate ioctl for device   What am I doing wrong? Thank you,Tamas
> >>
> >
> > Hello,
> >
> >what makes you think it does not work ? Using the rtnet script, you&#39;re trying to configure rtmac & rtcfg which you stated are not necessary for your setup.
> >
> >Have you tried only rtifconfig rteth* up and checked the Tx/Rx counters displayed there ?
> >
> >François
>
> >Hello,  The "rtifconfig rteth0 up" command returns the  "ioctl: Inappropriate ioctl for device" error too. That&#39;s why I think something is wrong. Thank you,Tamas

 Alright,

then you might want to take a look at the source code of the e1000 driver to verify that your device is supported by the xenomai release your using (you should find the PCI dev/prod id in some header file)

François



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RTNET setup issue
  2022-03-23 13:37     ` François Legal
@ 2022-03-23 14:12       ` Paal Tamas
  2022-03-23 15:02         ` Paal Tamas
  0 siblings, 1 reply; 9+ messages in thread
From: Paal Tamas @ 2022-03-23 14:12 UTC (permalink / raw)
  To: François Legal; +Cc: xenomai

 
"François Legal" <devel@thom.fr.eu.org> írta:
>Le Mercredi, Mars 23, 2022 14:07 CET, Paal Tamas <paal_to@freemail.hu> a écrit:
>
>>
>> "François Legal" <devel@thom.fr.eu.org> írta:
>> >Le Mercredi, Mars 23, 2022 10:48 CET, Paal Tamas via Xenomai <xenomai@xenomai.org> a écrit:
>> >
>> >> Dear All,   I am trying to set up RTNET using the latest xenomai_3.2.1 on an x86_64 system. I need only the raw packet (e.g rtpacket layer). I tried a lot of things but I still got errors like:  ioctl: Inappropriate ioctl for device    I try to use this PCI device:
>> >> 01:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
>> >>     Subsystem: Intel Corporation Gigabit ET Dual Port Server Adapter
>> >>     Kernel driver in use: rt_igb
>> >>     Kernel modules: igb, rt_igb   What I do is: ifconfig enp1s0f0 down
>> >> ifconfig enp1s0f1 down
>> >> rmmod igbmodprobe rtnet
>> >> modprobe rtpacket
>> >> modprobe rt_igb
>> >> modprobe rtipv4
>> >> modprobe rtudp  set up the rtnet.conf file and start rtnet: /usr/xenomai/sbin$ sudo ./rtnet start
>> >> ioctl: Inappropriate ioctl for device
>> >> ioctl: Inappropriate ioctl for device
>> >> ioctl: Inappropriate ioctl for device
>> >> Stage 1: searching for master...ioctl: Inappropriate ioctl for deviceStage 2: waiting for other slaves...
>> >> Stage 3: waiting for common setup completion...ioctl: Inappropriate ioctl for deviceclickandmove@clickandmove-desktop:/usr/xenomai/sbin$ sudo /usr/xenomai/sbin/rtifconfig -a
>> >> ioctl: Inappropriate ioctl for device   The kernel log:  [   50.360253] igb 0000:01:00.1: removed PHC on enp1s0f1
>> >> [   50.553797] igb 0000:01:00.0: removed PHC on enp1s0f0
>> >> [   81.769798] RTnet: registered rteth0
>> >> [   81.769802] rt_igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
>> >> [   81.769804] rt_igb 0000:01:00.0: rteth0: (PCIe:2.5Gb/s:Width x1) 6c:b3:11:56:2e:32
>> >> [   81.769807] rt_igb 0000:01:00.0: rteth0: PBA No: Unknown
>> >> [   81.769808] rt_igb 0000:01:00.0: Using MSI-X interrupts. 1 rx queue(s), 1 tx queue(s)
>> >> [   81.777139] rt_loopback: initializing loopback interface...
>> >> [   81.777315] RTnet: registered rtlo
>> >> [   81.787311] RTcfg: init real-time configuration distribution protocol
>> >> [   81.793326] RTmac: init realtime media access control
>> >> [   81.800424] RTmac/TDMA: init time division multiple access control mechanism   Even rtifconfig returns the same error  /usr/xenomai/sbin/rtifconfig -aioctl: Inappropriate ioctl for device   What am I doing wrong? Thank you,Tamas
>> >>
>> >
>> > Hello,
>> >
>> >what makes you think it does not work ? Using the rtnet script, you&#39;re trying to configure rtmac & rtcfg which you stated are not necessary for your setup.
>> >
>> >Have you tried only rtifconfig rteth* up and checked the Tx/Rx counters displayed there ?
>> >
>> >François
>>
>> >Hello,  The "rtifconfig rteth0 up" command returns the  "ioctl: Inappropriate ioctl for device" error too. That&#39;s why I think something is wrong. Thank you,Tamas
>
> Alright,
>
>then you might want to take a look at the source code of the e1000 driver to verify that your device is supported by the xenomai release your using (you should find the PCI dev/prod id in some header file)
>
>François
> 

>Yes. The first lines of the /igb/e1000hw.h file mentions the 82576 device:

> 

>#define E1000_DEV_ID_82576            0x10C9
>#define E1000_DEV_ID_82576_FIBER        0x10E6
>#define E1000_DEV_ID_82576_SERDES        0x10E7
>#define E1000_DEV_ID_82576_QUAD_COPPER        0x10E8
>#define E1000_DEV_ID_82576_QUAD_COPPER_ET2    0x1526
>#define E1000_DEV_ID_82576_NS            0x150A
>#define E1000_DEV_ID_82576_NS_SERDES        0x1518
>#define E1000_DEV_ID_82576_SERDES_QUAD        0x150D
The kernel log above shows that the driver has been succesfully loaded and binded.What I suspect to be the cause of the problem is my "setup". I have a 64bit kernel and compiled the userspace to be 32bit mode (using -m32 compiler switch), because I have 32bit application that need to work under Xenomai. This is a legal case. Everything else is working fine. Only RTNET has issues. It is not impossible that the 64bit RTNET kernel layer is not "compatible" with 32bit userland. I saw some issues like this on the mailing list for the CAN interface too a few month ago.I try to create 64bit userspace and give RTNET a try there. This is not a solution for me, because I need 32bit userspace, but can bring closer to the solution of this issue.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RTNET setup issue
  2022-03-23 14:12       ` Paal Tamas
@ 2022-03-23 15:02         ` Paal Tamas
  2022-03-23 16:41           ` Bezdeka, Florian
  0 siblings, 1 reply; 9+ messages in thread
From: Paal Tamas @ 2022-03-23 15:02 UTC (permalink / raw)
  To: xenomai

 
Paal Tamas via Xenomai <xenomai@xenomai.org> írta:
> 
>"François Legal" <devel@thom.fr.eu.org> írta:
>>Le Mercredi, Mars 23, 2022 14:07 CET, Paal Tamas <paal_to@freemail.hu> a écrit:
>>
>>>
>>> "François Legal" <devel@thom.fr.eu.org> írta:
>>> >Le Mercredi, Mars 23, 2022 10:48 CET, Paal Tamas via Xenomai <xenomai@xenomai.org> a écrit:
>>> >
>>> >> Dear All,   I am trying to set up RTNET using the latest xenomai_3.2.1 on an x86_64 system. I need only the raw packet (e.g rtpacket layer). I tried a lot of things but I still got errors like:  ioctl: Inappropriate ioctl for device    I try to use this PCI device:
>>> >> 01:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
>>> >>     Subsystem: Intel Corporation Gigabit ET Dual Port Server Adapter
>>> >>     Kernel driver in use: rt_igb
>>> >>     Kernel modules: igb, rt_igb   What I do is: ifconfig enp1s0f0 down
>>> >> ifconfig enp1s0f1 down
>>> >> rmmod igbmodprobe rtnet
>>> >> modprobe rtpacket
>>> >> modprobe rt_igb
>>> >> modprobe rtipv4
>>> >> modprobe rtudp  set up the rtnet.conf file and start rtnet: /usr/xenomai/sbin$ sudo ./rtnet start
>>> >> ioctl: Inappropriate ioctl for device
>>> >> ioctl: Inappropriate ioctl for device
>>> >> ioctl: Inappropriate ioctl for device
>>> >> Stage 1: searching for master...ioctl: Inappropriate ioctl for deviceStage 2: waiting for other slaves...
>>> >> Stage 3: waiting for common setup completion...ioctl: Inappropriate ioctl for deviceclickandmove@clickandmove-desktop:/usr/xenomai/sbin$ sudo /usr/xenomai/sbin/rtifconfig -a
>>> >> ioctl: Inappropriate ioctl for device   The kernel log:  [   50.360253] igb 0000:01:00.1: removed PHC on enp1s0f1
>>> >> [   50.553797] igb 0000:01:00.0: removed PHC on enp1s0f0
>>> >> [   81.769798] RTnet: registered rteth0
>>> >> [   81.769802] rt_igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
>>> >> [   81.769804] rt_igb 0000:01:00.0: rteth0: (PCIe:2.5Gb/s:Width x1) 6c:b3:11:56:2e:32
>>> >> [   81.769807] rt_igb 0000:01:00.0: rteth0: PBA No: Unknown
>>> >> [   81.769808] rt_igb 0000:01:00.0: Using MSI-X interrupts. 1 rx queue(s), 1 tx queue(s)
>>> >> [   81.777139] rt_loopback: initializing loopback interface...
>>> >> [   81.777315] RTnet: registered rtlo
>>> >> [   81.787311] RTcfg: init real-time configuration distribution protocol
>>> >> [   81.793326] RTmac: init realtime media access control
>>> >> [   81.800424] RTmac/TDMA: init time division multiple access control mechanism   Even rtifconfig returns the same error  /usr/xenomai/sbin/rtifconfig -aioctl: Inappropriate ioctl for device   What am I doing wrong? Thank you,Tamas
>>> >>
>>> >
>>> > Hello,
>>> >
>>> >what makes you think it does not work ? Using the rtnet script, you&#39;re trying to configure rtmac & rtcfg which you stated are not necessary for your setup.
>>> >
>>> >Have you tried only rtifconfig rteth* up and checked the Tx/Rx counters displayed there ?
>>> >
>>> >François
>>>
>>> >Hello,  The "rtifconfig rteth0 up" command returns the  "ioctl: Inappropriate ioctl for device" error too. That&#39;s why I think something is wrong. Thank you,Tamas
>>
>> Alright,
>>
>>then you might want to take a look at the source code of the e1000 driver to verify that your device is supported by the xenomai release your using (you should find the PCI dev/prod id in some header file)
>>
>>François
>> 
>
>>Yes. The first lines of the /igb/e1000hw.h file mentions the 82576 device:
>
>> 
>
>>#define E1000_DEV_ID_82576            0x10C9
>>#define E1000_DEV_ID_82576_FIBER        0x10E6
>>#define E1000_DEV_ID_82576_SERDES        0x10E7
>>#define E1000_DEV_ID_82576_QUAD_COPPER        0x10E8
>>#define E1000_DEV_ID_82576_QUAD_COPPER_ET2    0x1526
>>#define E1000_DEV_ID_82576_NS            0x150A
>>#define E1000_DEV_ID_82576_NS_SERDES        0x1518
>>#define E1000_DEV_ID_82576_SERDES_QUAD        0x150D
>The kernel log above shows that the driver has been succesfully loaded and binded.What I suspect to be the cause of the problem is my "setup". I have a 64bit kernel and compiled the userspace to be 32bit mode (using -m32 compiler switch), because I have 32bit application that need to work under Xenomai. This is a legal case. Everything else is working fine. Only RTNET has issues. It is not impossible that the 64bit RTNET kernel layer is not "compatible" with 32bit userland. I saw some issues like this on the mailing list for the CAN interface too a few month ago.I try to create 64bit userspace and give RTNET a try there. This is not a solution for me, because I need 32bit userspace, but can bring closer to the solution of this issue.

> 

> 

>OK. I rebuilt the userspace to 64bit. Now RTNET works as expected.

>The question is how to make RTNET to work, when the userspace is configured like this:

>/configure --with-core=cobalt --enable-smp --enable-pshared \
>  --host=i686-linux CFLAGS="-m32 -D_FILE_OFFSET_BITS=64" \
>  LDFLAGS=-m32 host_alias=i686-linux

> 

>Thank you,

>Tamas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RTNET setup issue
  2022-03-23 15:02         ` Paal Tamas
@ 2022-03-23 16:41           ` Bezdeka, Florian
  2022-03-24 15:27             ` Paal Tamas
  0 siblings, 1 reply; 9+ messages in thread
From: Bezdeka, Florian @ 2022-03-23 16:41 UTC (permalink / raw)
  To: xenomai, paal_to

On Wed, 2022-03-23 at 16:02 +0100, Paal Tamas via Xenomai wrote:
>  
> Paal Tamas via Xenomai <xenomai@xenomai.org> írta:
> > 
> > "François Legal" <devel@thom.fr.eu.org> írta:
> > > Le Mercredi, Mars 23, 2022 14:07 CET, Paal Tamas <paal_to@freemail.hu> a écrit:
> > > 
> > > > 
> > > > "François Legal" <devel@thom.fr.eu.org> írta:
> > > > > Le Mercredi, Mars 23, 2022 10:48 CET, Paal Tamas via Xenomai <xenomai@xenomai.org> a écrit:
> > > > > 
> > > > > > Dear All,   I am trying to set up RTNET using the latest xenomai_3.2.1 on an x86_64 system. I need only the raw packet (e.g rtpacket layer). I tried a lot of things but I still got errors like:  ioctl: Inappropriate ioctl for device    I try to use this PCI device:
> > > > > > 01:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
> > > > > >     Subsystem: Intel Corporation Gigabit ET Dual Port Server Adapter
> > > > > >     Kernel driver in use: rt_igb
> > > > > >     Kernel modules: igb, rt_igb   What I do is: ifconfig enp1s0f0 down
> > > > > > ifconfig enp1s0f1 down
> > > > > > rmmod igbmodprobe rtnet
> > > > > > modprobe rtpacket
> > > > > > modprobe rt_igb
> > > > > > modprobe rtipv4
> > > > > > modprobe rtudp  set up the rtnet.conf file and start rtnet: /usr/xenomai/sbin$ sudo ./rtnet start
> > > > > > ioctl: Inappropriate ioctl for device
> > > > > > ioctl: Inappropriate ioctl for device
> > > > > > ioctl: Inappropriate ioctl for device
> > > > > > Stage 1: searching for master...ioctl: Inappropriate ioctl for deviceStage 2: waiting for other slaves...
> > > > > > Stage 3: waiting for common setup completion...ioctl: Inappropriate ioctl for deviceclickandmove@clickandmove-desktop:/usr/xenomai/sbin$ sudo /usr/xenomai/sbin/rtifconfig -a
> > > > > > ioctl: Inappropriate ioctl for device   The kernel log:  [   50.360253] igb 0000:01:00.1: removed PHC on enp1s0f1
> > > > > > [   50.553797] igb 0000:01:00.0: removed PHC on enp1s0f0
> > > > > > [   81.769798] RTnet: registered rteth0
> > > > > > [   81.769802] rt_igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
> > > > > > [   81.769804] rt_igb 0000:01:00.0: rteth0: (PCIe:2.5Gb/s:Width x1) 6c:b3:11:56:2e:32
> > > > > > [   81.769807] rt_igb 0000:01:00.0: rteth0: PBA No: Unknown
> > > > > > [   81.769808] rt_igb 0000:01:00.0: Using MSI-X interrupts. 1 rx queue(s), 1 tx queue(s)
> > > > > > [   81.777139] rt_loopback: initializing loopback interface...
> > > > > > [   81.777315] RTnet: registered rtlo
> > > > > > [   81.787311] RTcfg: init real-time configuration distribution protocol
> > > > > > [   81.793326] RTmac: init realtime media access control
> > > > > > [   81.800424] RTmac/TDMA: init time division multiple access control mechanism   Even rtifconfig returns the same error  /usr/xenomai/sbin/rtifconfig -aioctl: Inappropriate ioctl for device   What am I doing wrong? Thank you,Tamas
> > > > > > 
> > > > > 
> > > > > Hello,
> > > > > 
> > > > > what makes you think it does not work ? Using the rtnet script, you&#39;re trying to configure rtmac & rtcfg which you stated are not necessary for your setup.
> > > > > 
> > > > > Have you tried only rtifconfig rteth* up and checked the Tx/Rx counters displayed there ?
> > > > > 
> > > > > François
> > > > 
> > > > > Hello,  The "rtifconfig rteth0 up" command returns the  "ioctl: Inappropriate ioctl for device" error too. That&#39;s why I think something is wrong. Thank you,Tamas
> > > 
> > > Alright,
> > > 
> > > then you might want to take a look at the source code of the e1000 driver to verify that your device is supported by the xenomai release your using (you should find the PCI dev/prod id in some header file)
> > > 
> > > François
> > > 
> > 
> > > Yes. The first lines of the /igb/e1000hw.h file mentions the 82576 device:
> > 
> > > 
> > 
> > > #define E1000_DEV_ID_82576            0x10C9
> > > #define E1000_DEV_ID_82576_FIBER        0x10E6
> > > #define E1000_DEV_ID_82576_SERDES        0x10E7
> > > #define E1000_DEV_ID_82576_QUAD_COPPER        0x10E8
> > > #define E1000_DEV_ID_82576_QUAD_COPPER_ET2    0x1526
> > > #define E1000_DEV_ID_82576_NS            0x150A
> > > #define E1000_DEV_ID_82576_NS_SERDES        0x1518
> > > #define E1000_DEV_ID_82576_SERDES_QUAD        0x150D
> > The kernel log above shows that the driver has been succesfully loaded and binded.What I suspect to be the cause of the problem is my "setup". I have a 64bit kernel and compiled the userspace to be 32bit mode (using -m32 compiler switch), because I have 32bit application that need to work under Xenomai. This is a legal case. Everything else is working fine. Only RTNET has issues. It is not impossible that the 64bit RTNET kernel layer is not "compatible" with 32bit userland. I saw some issues like this on the mailing list for the CAN interface too a few month ago.I try to create 64bit userspace and give RTNET a try there. This is not a solution for me, because I need 32bit userspace, but can bring closer to the solution of this issue.
> 

That might be a compat issue again. Maybe the rtnet ioctl syscall is
not properly handled in compat mode (32 bit app on 64 bit kernel)

You might want to check if all affected code paths deal with different
type sizes (eg. sizeof(long) is different between kernel and
application) accordingly.

> > 
> 
> > 
> 
> > OK. I rebuilt the userspace to 64bit. Now RTNET works as expected.
> 
> > The question is how to make RTNET to work, when the userspace is configured like this:
> 
> > /configure --with-core=cobalt --enable-smp --enable-pshared \
> >  --host=i686-linux CFLAGS="-m32 -D_FILE_OFFSET_BITS=64" \
> >  LDFLAGS=-m32 host_alias=i686-linux
> 
> > 
> 
> > Thank you,
> 
> > Tamas


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RTNET setup issue
  2022-03-23 16:41           ` Bezdeka, Florian
@ 2022-03-24 15:27             ` Paal Tamas
  2022-03-29  9:08               ` Bezdeka, Florian
  0 siblings, 1 reply; 9+ messages in thread
From: Paal Tamas @ 2022-03-24 15:27 UTC (permalink / raw)
  To: Bezdeka, Florian; +Cc: xenomai

 
"Bezdeka, Florian" <florian.bezdeka@siemens.com> írta:
>On Wed, 2022-03-23 at 16:02 +0100, Paal Tamas via Xenomai wrote:
>>  
>> Paal Tamas via Xenomai <xenomai@xenomai.org> írta:
>> > 
>> > "François Legal" <devel@thom.fr.eu.org> írta:
>> > > Le Mercredi, Mars 23, 2022 14:07 CET, Paal Tamas <paal_to@freemail.hu> a écrit:
>> > > 
>> > > > 
>> > > > "François Legal" <devel@thom.fr.eu.org> írta:
>> > > > > Le Mercredi, Mars 23, 2022 10:48 CET, Paal Tamas via Xenomai <xenomai@xenomai.org> a écrit:
>> > > > > 
>> > > > > > Dear All,   I am trying to set up RTNET using the latest xenomai_3.2.1 on an x86_64 system. I need only the raw packet (e.g rtpacket layer). I tried a lot of things but I still got errors like:  ioctl: Inappropriate ioctl for device    I try to use this PCI device:
>> > > > > > 01:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
>> > > > > >     Subsystem: Intel Corporation Gigabit ET Dual Port Server Adapter
>> > > > > >     Kernel driver in use: rt_igb
>> > > > > >     Kernel modules: igb, rt_igb   What I do is: ifconfig enp1s0f0 down
>> > > > > > ifconfig enp1s0f1 down
>> > > > > > rmmod igbmodprobe rtnet
>> > > > > > modprobe rtpacket
>> > > > > > modprobe rt_igb
>> > > > > > modprobe rtipv4
>> > > > > > modprobe rtudp  set up the rtnet.conf file and start rtnet: /usr/xenomai/sbin$ sudo ./rtnet start
>> > > > > > ioctl: Inappropriate ioctl for device
>> > > > > > ioctl: Inappropriate ioctl for device
>> > > > > > ioctl: Inappropriate ioctl for device
>> > > > > > Stage 1: searching for master...ioctl: Inappropriate ioctl for deviceStage 2: waiting for other slaves...
>> > > > > > Stage 3: waiting for common setup completion...ioctl: Inappropriate ioctl for deviceclickandmove@clickandmove-desktop:/usr/xenomai/sbin$ sudo /usr/xenomai/sbin/rtifconfig -a
>> > > > > > ioctl: Inappropriate ioctl for device   The kernel log:  [   50.360253] igb 0000:01:00.1: removed PHC on enp1s0f1
>> > > > > > [   50.553797] igb 0000:01:00.0: removed PHC on enp1s0f0
>> > > > > > [   81.769798] RTnet: registered rteth0
>> > > > > > [   81.769802] rt_igb 0000:01:00.0: Intel(R) Gigabit Ethernet Network Connection
>> > > > > > [   81.769804] rt_igb 0000:01:00.0: rteth0: (PCIe:2.5Gb/s:Width x1) 6c:b3:11:56:2e:32
>> > > > > > [   81.769807] rt_igb 0000:01:00.0: rteth0: PBA No: Unknown
>> > > > > > [   81.769808] rt_igb 0000:01:00.0: Using MSI-X interrupts. 1 rx queue(s), 1 tx queue(s)
>> > > > > > [   81.777139] rt_loopback: initializing loopback interface...
>> > > > > > [   81.777315] RTnet: registered rtlo
>> > > > > > [   81.787311] RTcfg: init real-time configuration distribution protocol
>> > > > > > [   81.793326] RTmac: init realtime media access control
>> > > > > > [   81.800424] RTmac/TDMA: init time division multiple access control mechanism   Even rtifconfig returns the same error  /usr/xenomai/sbin/rtifconfig -aioctl: Inappropriate ioctl for device   What am I doing wrong? Thank you,Tamas
>> > > > > > 
>> > > > > 
>> > > > > Hello,
>> > > > > 
>> > > > > what makes you think it does not work ? Using the rtnet script, you&#39;re trying to configure rtmac & rtcfg which you stated are not necessary for your setup.
>> > > > > 
>> > > > > Have you tried only rtifconfig rteth* up and checked the Tx/Rx counters displayed there ?
>> > > > > 
>> > > > > François
>> > > > 
>> > > > > Hello,  The "rtifconfig rteth0 up" command returns the  "ioctl: Inappropriate ioctl for device" error too. That&#39;s why I think something is wrong. Thank you,Tamas
>> > > 
>> > > Alright,
>> > > 
>> > > then you might want to take a look at the source code of the e1000 driver to verify that your device is supported by the xenomai release your using (you should find the PCI dev/prod id in some header file)
>> > > 
>> > > François
>> > > 
>> > 
>> > > Yes. The first lines of the /igb/e1000hw.h file mentions the 82576 device:
>> > 
>> > > 
>> > 
>> > > #define E1000_DEV_ID_82576            0x10C9
>> > > #define E1000_DEV_ID_82576_FIBER        0x10E6
>> > > #define E1000_DEV_ID_82576_SERDES        0x10E7
>> > > #define E1000_DEV_ID_82576_QUAD_COPPER        0x10E8
>> > > #define E1000_DEV_ID_82576_QUAD_COPPER_ET2    0x1526
>> > > #define E1000_DEV_ID_82576_NS            0x150A
>> > > #define E1000_DEV_ID_82576_NS_SERDES        0x1518
>> > > #define E1000_DEV_ID_82576_SERDES_QUAD        0x150D
>> > The kernel log above shows that the driver has been succesfully loaded and binded.What I suspect to be the cause of the problem is my "setup". I have a 64bit kernel and compiled the userspace to be 32bit mode (using -m32 compiler switch), because I have 32bit application that need to work under Xenomai. This is a legal case. Everything else is working fine. Only RTNET has issues. It is not impossible that the 64bit RTNET kernel layer is not "compatible" with 32bit userland. I saw some issues like this on the mailing list for the CAN interface too a few month ago.I try to create 64bit userspace and give RTNET a try there. This is not a solution for me, because I need 32bit userspace, but can bring closer to the solution of this issue.
>> 
>
>That might be a compat issue again. Maybe the rtnet ioctl syscall is
>not properly handled in compat mode (32 bit app on 64 bit kernel)
>
>You might want to check if all affected code paths deal with different
>type sizes (eg. sizeof(long) is different between kernel and
>application) accordingly.
>
>> > 
>> 
>> > 
>> 
>> > OK. I rebuilt the userspace to 64bit. Now RTNET works as expected.
>> 
>> > The question is how to make RTNET to work, when the userspace is configured like this:
>> 
>> > /configure --with-core=cobalt --enable-smp --enable-pshared \
>> >  --host=i686-linux CFLAGS="-m32 -D_FILE_OFFSET_BITS=64" \
>> >  LDFLAGS=-m32 host_alias=i686-linux
>> 
>> > 
>> 
>> > Thank you,
>> 
>> > Tamas
> 

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RTNET setup issue
  2022-03-24 15:27             ` Paal Tamas
@ 2022-03-29  9:08               ` Bezdeka, Florian
  0 siblings, 0 replies; 9+ messages in thread
From: Bezdeka, Florian @ 2022-03-29  9:08 UTC (permalink / raw)
  To: paal_to; +Cc: xenomai

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



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-03-29  9:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.