我一直在尝试使 krring 模块工作,可以在这里找到:http ://git.openfabrics.org/?p=~sgrimberg/krping.git;a=summary
[ 446.242534] rdma_krping: Unknown symbol ib_alloc_fast_reg_page_list (err -22)
[ 446.242542] rdma_krping: disagrees about version of symbol rdma_resolve_addr
[ 446.242542] rdma_krping: Unknown symbol rdma_resolve_addr (err -22)
[ 446.242549] rdma_krping: disagrees about version of symbol ib_reg_phys_mr
**and so on...**
我通过 Mellanox ofed kernel 3.3 安装驱动程序。已经从 ofa-kernel/default 复制了 Module.symvers 但它不起作用。
我已经在 ubuntu 12.04 和 14.04 的不同内核上尝试过它。我使用的内核是 3.18、3.5 和 4.0。但是,每次我遇到同样的问题。如果有人编译了 krping 并且可以帮助解决这个问题?特别是内核版本、操作系统和安装他们使用的驱动程序的过程。
制作文件1
KSRC=/lib/modules/`uname -r`/build
KOBJ=/lib/modules/`uname -r`/build
obj-m += rdma_krping.o
rdma_krping-y := getopt.o krping.o
default:
make -C $(KSRC) M=`pwd` modules
install:
make -C $(KSRC) M=`pwd` modules_install
depmod -a
clean:
rm -f *.o
rm -f *.ko
rm -f rdma_krping.mod.c
rm -f Module.symvers
rm -f Module.markers
生成文件2
KSRC=/lib/modules/$(shell uname -r)/build
KOBJ=/lib/modules/$(shell uname -r)/build
EXTRA_CFLAGS += -DLINUX -D__KERNEL__ -DMODULE -O2 -pipe -Wall
EXTRA_CFLAGS += $(shell echo $(BACKPORT_INCLUDES) | sed -e 's@/var/tmp/OFED_topdir/BUILD@/usr/src@')
EXTRA_CFLAGS += $(shell [ -f $(KOBJ)/include/linux/modversions.h ] && \
echo "-DMODVERSIONS -DEXPORT_SYMTAB \
-include $(KSRC)/include/linux/modversions.h")
EXTRA_CFLAGS += $(shell [ -f $(KOBJ)/include/config/modversions.h ] && \
echo "-DMODVERSIONS -DEXPORT_SYMTAB \
-include $(KSRC)/include/config/modversions.h")
autoconf_h=$(shell /bin/ls -1 $(KSRC)/include/*/autoconf.h 2> /dev/null | head -1)
kconfig_h=$(shell /bin/ls -1 $(KSRC)/include/*/kconfig.h 2> /dev/null | head -1)
ifneq ($(kconfig_h),)
KCONFIG_H = -include $(kconfig_h)
endif
ofa_autoconf_h=$(shell /bin/ls -1 $(OFA)/include/*/autoconf.h 2> /dev/null | head -1)
ifneq ($(ofa_autoconf_h),)
OFA_AUTOCONF_H = -include $(ofa_autoconf_h)
endif
obj-m += rdma_krping.o
rdma_krping-y := getopt.o krping.o
default:
-cp -f $(OFA)/Module*.symvers $(TEST_SRC)/Module.symvers
make -C $(KSRC) O=$(KOBJ) SUBDIRS=$(shell pwd) \
LINUXINCLUDE=' \
-D__OFED_BUILD__ \
$(EXTRA_CFLAGS) \
-include $(autoconf_h) \
$(OFA_AUTOCONF_H) \
$(KCONFIG_H) \
-I$(OFA)/include \
$(INCLUDE_COMPAT) \
$$(if $$(CONFIG_XEN),-D__XEN_INTERFACE_VERSION__=$$(CONFIG_XEN_INTERFACE_VERSION)) \
$$(if $$(CONFIG_XEN),-I$$(srctree)/arch/x86/include/mach-xen) \
-I$$(srctree)/arch/$$(SRCARCH)/include \
-Iarch/$$(SRCARCH)/include/generated \
-Iinclude \
-I$$(srctree)/arch/$$(SRCARCH)/include/uapi \
-Iarch/$$(SRCARCH)/include/generated/uapi \
-I$$(srctree)/include \
-I$$(srctree)/include/uapi \
-Iinclude/generated/uapi \
$$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) \
-I$$(srctree)/arch/$$(SRCARCH)/include \
-Iarch/$$(SRCARCH)/include/generated \
' \
modulesymfile=$(TEST_SRC)/Module.symvers \
modules
install:
make -C $(KSRC) O=$(KOBJ) SUBDIRS=$(shell pwd) modules_install
depmod -a
clean:
rm -f *.o
rm -f *.ko
rm -f rdma_krping.mod.c
rm -f Module*.symvers
以上是我尝试编译模块的两个makefile。建议我可以尝试的任何更改。