HW-QoS needed userspace tool

Hello.

For the HW-QoS configuration, some userspace tool would be needed. Rummaging through the network I found the following: Mediatek Document Xilinx QDMA Driver

but Xilinx driver unfortunately fails to compile due to an error:

from /opt/QDMA/dma_ip_drivers/QDMA/linux-kernel/drv/cdev.c:22: /opt/QDMA/dma_ip_drivers/QDMA/linux-kernel/drv/cdev.c: In function ‘qdma_cdev_create’: ./include/linux/kern_levels.h:5:18: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Werror=format=] #define KERN_SOH “\001” /* ASCII Start Of Header / ./include/linux/kern_levels.h:14:19: note: in expansion of macro ‘KERN_SOH’ #define KERN_INFO KERN_SOH “6” / informational */

./include/linux/printk.h:313:9: note: in expansion of macro ‘KERN_INFO’ printk(KERN_INFO pr_fmt(fmt), ##VA_ARGS) /opt/QDMA/dma_ip_drivers/QDMA/linux-kernel/drv/cdev.c:621:3: note: in expansion of macro ‘pr_info’
pr_info("%s OOM %lu.\n", qconf->name, sizeof(struct qdma_cdev));

/opt/QDMA/dma_ip_drivers/QDMA/linux-kernel/drv/cdev.c:623:38: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Werror=format=] rv = sprintf(ebuf, “%s cdev OOM %lu.\n”,
~~^
%u cc1: all warnings being treated as errors

Someone could help?

Regards

mt_werty

Try remove “l” from %lu

now, after a few corrections similar to the previous one, I have an error:

from /opt/QDMA/dma_ip_drivers/QDMA/linux-kernel/drv/libqdma/qdma_st_c2h.c:22: ./arch/armv7l/include/asm/spinlock_types.h:13:3: error: unknown type name ‘u32’ u32 slock; ./arch/armv7l/include/asm/spinlock_types.h:19:4: error: unknown type name ‘u16’ u16 owner; ./arch/armv7l/include/asm/spinlock_types.h:20:4: error: unknown type name ‘u16’ u16 next; ./arch/armv7l/include/asm/spinlock_types.h:29:2: error: unknown type name ‘u32’ u32 lock; make[3]: *** [scripts/Makefile.build:327: /opt/QDMA/dma_ip_drivers/QDMA/linux-kernel/drv/libqdma/qdma_st_c2h.o] Error 1

You need to search header-file where u32 is defined. Usually one from std/compiler.

Which (cross) compiler do you use?

Kernel: Frank-FW 4.14.149. Gentoo. Compile natively on BPI-R2. GCC-8.3.0-R1, glibc-2.29-r2.

CC [M] /opt/QDMA/dma_ip_drivers/QDMA/linux-kernel/drv/libqdma/qdma_st_c2h.o In file included from ./include/linux/spinlock_types.h:13:0, from /opt/QDMA/dma_ip_drivers/QDMA/linux-kernel/drv/libqdma/qdma_descq.h:27, from /opt/QDMA/dma_ip_drivers/QDMA/linux-kernel/drv/libqdma/qdma_st_c2h.c:22: ./arch/armv7l/include/asm/spinlock_types.h:13:3: error: unknown type name ‘u32’ u32 slock; ./arch/armv7l/include/asm/spinlock_types.h:19:4: error: unknown type name ‘u16’ u16 owner; ./arch/armv7l/include/asm/spinlock_types.h:20:4: error: unknown type name ‘u16’ u16 next;

./arch/armv7l/include/asm/spinlock_types.h:29:2: error: unknown type name ‘u32’ u32 lock;

make[3]: *** [scripts/Makefile.build:327: /opt/QDMA/dma_ip_drivers/QDMA/linux-kernel/drv/libqdma/qdma_st_c2h.o] Error 1

u32, u16, are defined in linux/types.h which is included in qdma_descq.h …

Maybe you miss a -I option (include) to your kernel include directory (in makefile)?

you are using my kernel? the packages do not contain sources…so you don’t have include/linux/types.h

just try to copy it to /usr/src/linux

Kernel compiled myself from git repo. Git repo is linked to /usr/src/linux. I have got linux/types.h …

Compile now working?

tried crosscompiling it, but it looks like it compiles my kernel again…

git clone https://github.com/Xilinx/dma_ip_drivers.git
cd dma_ip_drivers/QDMA/linux-kernel/
make KDIR=/media/data_fast/bpi/kernel/BPI-R2-4.14 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

i see dmactl is compiled, but mod_pf failed…maybe because i tried with 5.4-rc4 :wink:

#######################
#### PF drv          ####
#######################
make[1]: Entering directory '/home/frank/git/dma_ip_drivers/QDMA/linux-kernel/drv'
srcdir = /home/frank/git/dma_ip_drivers/QDMA/linux-kernel.
KSRC = /media/data_fast/bpi/kernel/BPI-R2-4.14.
VF = 0.
CROSS_COMPILE_FLAG = arm-linux-gnueabihf-.
ARCH = arm.
EXTRA_FLAGS = .
ccflags-y = -D__READ_ONCE_DEFINED__.
make[2]: Entering directory '/media/data_fast/bpi/kernel/BPI-R2-4.14'
  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  Building modules, stage 2.
  MODPOST 146 modules
make[2]: Leaving directory '/media/data_fast/bpi/kernel/BPI-R2-4.14'
cp: cannot stat 'qdma.ko': No such file or directory
Makefile:80: recipe for target 'build' failed
make[1]: *** [build] Error 1
make[1]: Leaving directory '/home/frank/git/dma_ip_drivers/QDMA/linux-kernel/drv'
Makefile:205: recipe for target 'mod_pf' failed
make: *** [mod_pf] Error 2

No, there is still a problem with the types u32, u16,

I haven’t had time to do this lately

is “linux” the link? Afair you need a directory inside named like kernelversion

ln -s /path/to/git-repo /usr/src/linux/$(uname -r)