netmap-unipi / netmap-tutorial

Netmap tutorial at SIGCOMM 2017 and AsiaBSDCon 2018
83 stars 16 forks source link

Cannot load mymodule_lin.ko #3

Open Linerd opened 6 years ago

Linerd commented 6 years ago

mymodule_lin: Unknown symbol netmap_bdg_ctl (err 0) mymodule_lin: Unknown symbol netmap_bdg_learning (err 0)

These are the errors printed by "dmesg | tail"

I downloaded this repo, and in "mymodule/LINUX" I typed: make KSRC=/usr/src/linux-headers-XXX NSRC=/home/XXX/netmap or make KSRC=/usr/src/linux-sources-XXX NSRC=/home/XXX/netmap

neither worked

vmaffione commented 6 years ago

I'm not the author of the VALE tutorial part, but here it seems you haven't loaded the netmap module.

Linerd commented 6 years ago

Actually I loaded it, I was able to perform all other netmap related tests On Fri, Feb 2, 2018 at 11:31 AM Vincenzo Maffione notifications@github.com wrote:

I'm not the author of the VALE tutorial part, but here it seems you haven't loaded the netmap module.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vmaffione/netmap-tutorial/issues/3#issuecomment-362611916, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVEvMFHpSGvgM_KcojJmoAWzE9ePfNcks5tQyUEgaJpZM4R2Yor .

vmaffione commented 6 years ago

You could grep the symbol to check it's there

 $ grep netmap_bdg_ /proc/kallsyms
Linerd commented 6 years ago

it's there, please see the make output:

make NSRC=/home/yikai/netmap KSRC=/usr/src/linux-headers-4.4.0-103-generic/ make -C /usr/src/linux-headers-4.4.0-103-generic/ M=/home/yikai/netmap-tutorial/mymodule/LINUX \ CONFIG_NETMAP=m CONFIG_NETMAP_VALE=y CONFIG_MYMODULE=m \ EXTRA_CFLAGS='-I/home/yikai/netmap/ -I/home/yikai/netmap/LINUX -I/home/yikai/netmap/sys -I/home/yikai/netmap-tutorial/mymodule/LINUX/../sys -DCONFIG_NETMAP' KBUILD_EXTRA_SYMBOLS=/home/yikai/netmap/Module.symvers make[1]: Entering directory '/usr/src/linux-headers-4.4.0-103-generic' LD /home/yikai/netmap-tutorial/mymodule/LINUX/built-in.o CC [M] /home/yikai/netmap-tutorial/mymodule/LINUX/mymodule.o LD [M] /home/yikai/netmap-tutorial/mymodule/LINUX/mymodule_lin.o Building modules, stage 2. MODPOST 1 modules WARNING: could not find /home/yikai/netmap-tutorial/mymodule/LINUX/.mymodule.o.cmd for /home/yikai/netmap-tutorial/mymodule/LINUX/mymodule.o WARNING: "netmap_bdg_learning" [/home/yikai/netmap-tutorial/mymodule/LINUX/mymodule_lin.ko] undefined! WARNING: "netmap_bdg_ctl" [/home/yikai/netmap-tutorial/mymodule/LINUX/mymodule_lin.ko] undefined! CC /home/yikai/netmap-tutorial/mymodule/LINUX/mymodule_lin.mod.o LD [M] /home/yikai/netmap-tutorial/mymodule/LINUX/mymodule_lin.ko make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-103-generic' ls -l find . -name \*.ko -rw-rw-r-- 1 yikai yikai 6296 Feb 2 13:35 ./mymodule_lin.ko

Linerd commented 6 years ago

and this is when I use linux-source instead of headers:

make NSRC=/home/yikai/netmap KSRC=/usr/src/linux-source-4.4.0 make -C /usr/src/linux-source-4.4.0 M=/home/yikai/netmap-tutorial/mymodule/LINUX \ CONFIG_NETMAP=m CONFIG_NETMAP_VALE=y CONFIG_MYMODULE=m \ EXTRA_CFLAGS='-I/home/yikai/netmap/ -I/home/yikai/netmap/LINUX -I/home/yikai/netmap/sys -I/home/yikai/netmap-tutorial/mymodule/LINUX/../sys -DCONFIG_NETMAP' KBUILD_EXTRA_SYMBOLS=/home/yikai/netmap/Module.symvers make[1]: Entering directory '/usr/src/linux-source-4.4.0'

WARNING: Symbol version dump ./Module.symvers is missing; modules will have no dependencies and modversions.

Building modules, stage 2. MODPOST 1 modules WARNING: could not find /home/yikai/netmap-tutorial/mymodule/LINUX/.mymodule.o.cmd for /home/yikai/netmap-tutorial/mymodule/LINUX/mymodule.o make[1]: Leaving directory '/usr/src/linux-source-4.4.0' ls -l find . -name \*.ko -rw-rw-r-- 1 yikai yikai 65640 Feb 2 13:37 ./mymodule_lin.ko

vmaffione commented 6 years ago

Yeah, I'm not even able to compile, actually. Can you ask the author https://github.com/micchie/mymodule ?