laurentiuduca / rtnet-preempt_rt

9 stars 2 forks source link

UDP uses RTDM #2

Open NikolaSzucsich opened 1 year ago

NikolaSzucsich commented 1 year ago

Hi Laurentiu,

looks as if none of your drivers compiles. rtdm_lock_t is used in rtskb.h which is used by udp.c. As stated in the previous issue, rtdm_lock_t is Xenomai and not preempt_rt.

In file included from net/rtnet/stack/ipv4/udp/udp.c:40:
net/rtnet/stack/include/rtskb.h:803:8: error: unknown type name ‘rtdm_lock_t’
  803 | extern rtdm_lock_t rtcap_lock;
      |        ^~~~~~~~~~~
In file included from ./include/linux/mmzone.h:8,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/mm.h:10,
                 from ./include/linux/bvec.h:13,
                 from ./include/linux/skbuff.h:17,
                 from ./include/linux/ip.h:16,
                 from net/rtnet/stack/ipv4/udp/udp.c:32:
net/rtnet/stack/include/rtskb.h: In function ‘rtcap_report_incoming’:
net/rtnet/stack/include/rtskb.h:817:27: error: passing argument 1 of ‘_raw_spin_lock_irqsave’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  817 |     raw_spin_lock_irqsave(&rtcap_lock, context);
      |                           ^~~~~~~~~~~
      |                           |
      |                           int *
./include/linux/spinlock.h:252:34: note: in definition of macro ‘raw_spin_lock_irqsave’
  252 |   flags = _raw_spin_lock_irqsave(lock); \
      |                                  ^~~~
In file included from ./include/linux/spinlock.h:322,
                 from ./include/linux/mmzone.h:8,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/mm.h:10,
                 from ./include/linux/bvec.h:13,
                 from ./include/linux/skbuff.h:17,
                 from ./include/linux/ip.h:16,
                 from net/rtnet/stack/ipv4/udp/udp.c:32:
./include/linux/spinlock_api_smp.h:32:65: note: expected ‘raw_spinlock_t *’ {aka ‘struct raw_spinlock *’} but argument is of type ‘int *’
   32 | unsigned long __lockfunc _raw_spin_lock_irqsave(raw_spinlock_t *lock)
      |                                                 ~~~~~~~~~~~~~~~~^~~~
In file included from ./include/linux/mmzone.h:8,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/mm.h:10,
                 from ./include/linux/bvec.h:13,
                 from ./include/linux/skbuff.h:17,
                 from ./include/linux/ip.h:16,
                 from net/rtnet/stack/ipv4/udp/udp.c:32:
net/rtnet/stack/include/rtskb.h:821:32: error: passing argument 1 of ‘_raw_spin_unlock_irqrestore’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  821 |     raw_spin_unlock_irqrestore(&rtcap_lock, context);
      |                                ^~~~~~~~~~~
      |                                |
      |                                int *
./include/linux/spinlock.h:290:31: note: in definition of macro ‘raw_spin_unlock_irqrestore’
  290 |   _raw_spin_unlock_irqrestore(lock, flags); \
      |                               ^~~~
In file included from ./include/linux/spinlock.h:322,
                 from ./include/linux/mmzone.h:8,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/mm.h:10,
                 from ./include/linux/bvec.h:13,
                 from ./include/linux/skbuff.h:17,
                 from ./include/linux/ip.h:16,
                 from net/rtnet/stack/ipv4/udp/udp.c:32:
./include/linux/spinlock_api_smp.h:43:45: note: expected ‘raw_spinlock_t *’ {aka ‘struct raw_spinlock *’} but argument is of type ‘int *’
   43 | _raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags)
      |                             ~~~~~~~~~~~~~~~~^~~~
In file included from net/rtnet/stack/ipv4/udp/udp.c:40:
net/rtnet/stack/include/rtskb.h: In function ‘rtcap_mark_rtmac_enqueue’:
net/rtnet/stack/include/rtskb.h:828:28: error: implicit declaration of function ‘rtdm_clock_read’ [-Werror=implicit-function-declaration]
  828 |     skb->cap_rtmac_stamp = rtdm_clock_read();
      |                            ^~~~~~~~~~~~~~~
net/rtnet/stack/ipv4/udp/udp.c: In function ‘rt_udp_recvmsg’:
net/rtnet/stack/ipv4/udp/udp.c:470:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
  470 |    ret = -EAGAIN;
net/rtnet/stack/ipv4/udp/udp.c:471:3: note: here
  471 |   case -EWOULDBLOCK:
      |   ^~~~
cc1: some warnings being treated as errors
make[5]: *** [scripts/Makefile.build:283: net/rtnet/stack/ipv4/udp/udp.o] Error 1
make[4]: *** [scripts/Makefile.build:500: net/rtnet/stack/ipv4/udp] Error 2
make[3]: *** [scripts/Makefile.build:500: net/rtnet/stack/ipv4] Error 2
make[2]: *** [scripts/Makefile.build:500: net/rtnet/stack] Error 2
make[1]: *** [scripts/Makefile.build:500: net/rtnet] Error 2

Best regards, Nikola

laurentiuduca commented 1 year ago

hello, here is an example for orange pi - follow the site instructions compile for orange pi mkdir modules cd linux-5.9 patch -p1 < ../rtnet-v11b-preempt_rt-linux-5.9.patch cd .. git clone https://github.com/laurentiuduca/rtnet-preempt_rt cd linux-5.9 cp ../rtnet-preempt_rt/orangepi-one/syscall.tbl arch/arm/tools/ Use buildroot to setup a rootfs for the target board Configure linux make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- sunxi_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig Preemption Model (Fully Preemptible Kernel (Real-Time)) .. Select Networking Support - RTnet, Protocol Stack -> (32) Size of central RX-FIFO, Real-Time IPv4, ICMP support, (32) Maximum host routing table entries, UDP support, Real-Time Packet Socket Support. The rest must be unselected. Drivers -> the driver for the target computer STMicroelectronics Multi-Gigabit Ethernet driver │ STMMAC Platform bus support (NEW) │ Allwinner sun8i GMAC support (NEW) Add-Ons -> IP protocol proxy for Linux be sure to disable the non-RTnet network drivers from net/ethernet Device Drivers -> Network device support -> Ethernet driver support -> Broadcom, STMicroelectronics devices, TI, etc make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- CONFIG_DEBUG_INFO=y INSTALL_MOD_PATH=/home/laur/lucru/rtnet-test-o/modules zImage sun8i-h3-orangepi-one.dtb -j5 Kernel: arch/arm/boot/zImage is ready make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- CONFIG_DEBUG_INFO=y INSTALL_MOD_PATH=/home/laur/lucru/rtnet-test-o/modules zImage sun8i-h3-orangepi-one.dtb modules modules_install -j5

laurentiuduca commented 1 year ago

config-orange-pi.txt