MLNX_OFED Kernel module support

Hi,

I am working on a kernel module using RDMA ib verbs with MLNX_OFED. When I load the kernel module I see error logs like below kernel logs on kernel 4.15 and Ubuntu 18.04. When I ran this on kernel 3.13 and Ubuntu 14.04, it runs well without any issues because I was able to add below line in Makefile.

KSYMVERS = /var/lib/dkms/mlnx-ofed-kernel/3.1/build/Module.symvers

I realized there is no mlnox-ofed kernel package on /var/lib/dkms in kernel 4.15 and Ubuntu 18.04 after I install MLNX_OFED 5.0-2.1.8.0.

Where can I find the Module.symvers in MLNX_OFED 5.0-2.1.8.0 driver ?

error logs in dmsg when loading kernel module that I am working on.

Unknown symbol ib_create_cq (err 0)

Unknown symbol ib_dereg_mr (err 0)

Unknown symbol ib_destroy_cq (err 0)

Unknown symbol rdma_create_id (err 0)

Unknown symbol ib_get_client_data (err 0)

Unknown symbol rdma_accept (err 0)

Unknown symbol ib_dealloc_pd (err 0)

#Ubuntu version

Distributor ID: Ubuntu

Description: Ubuntu 18.04.1 LTS

Release: 18.04

Codename: bionic

#Kernel vesion

4.15.0-101-generic

#MLNX_OFED version

5.0-2.1.8.0

MLNX_OFED_LINUX-5.0-2.1.8.0-ubuntu18.04-x86_64.tgz

Warm regards,

Juhyun Bae

Hi,

If you unpack the sources from this package, (under src) and unpack the mlnx-ofa_kernel-5.0, build it from the command line like :

./configure --with-core-mod --with-user_mad-mod --with-user_access-mod --with-addr_trans-mod --with-mlxfw-mod --with-mlx4-mod --with-mlx4_en-mod --with-mlx5-mod --with-ipoib-mod --with-innova-flex --with-mdev-mod --with-srp-mod --with-iser-mod --with-nfsrdma-mod --with-isert-mod

./make -j

It will create a Module.symvers on the root.

Regards

Marc

Hi Marc,

Thank you for the reply.

Should I load modules that I compiled ? I installed MLNX_OFED 5.0-2.1.8.0 driver with below command on the host and got Module.symvers after I compiled as you mentioned. Then I compiled my kernel module again with Module.symvers but I still see “Unknown symbol ib_create_cq”

sudo ./mlnxofedinstall --add-kernel-support --without-fw-update --force

This is how I added Module.symvers in Makefile. I set include directory in OFED_CFLAGS and connect Module.symvers in Make command line as nbdX does.

OFED_CFLAGS = -I/users/jbae91/MLNX_OFED_LINUX-5.0-2.1.8.0-ubuntu18.04-x86_64/src/MLNX_OFED_SRC-5.0-2.1.8.0/SOURCES/mlnx-ofed-kernel-5.0/include

KSYMVERS = ./Module.symvers

all-spec:

$(MAKE) -C $(build_dir)/build SUBDIRS=pwd KBUILD_EXTRA_SYMBOLS="$(KSYMVERS)" modules