[openfabrics-ewg] [PATCH 1/4] IB/iSER: Integrate open-iscsi into the OFED build scripts

Vladimir Sokolovsky vlad at dev.mellanox.co.il
Wed Jan 3 05:47:34 PST 2007


Erez Zilber wrote:
> Add open-iscsi into configure & Makefile.
>
> Signed-off-by: Erez Zilber <erezz at voltaire.com>
>
> diff -ruN ofa_1_2_kernel-20061228-0200/Makefile ofa_1_2_kernel-20061228-0200-open-iscsi/Makefile
> --- ofa_1_2_kernel-20061228-0200/Makefile	2006-12-31 14:49:38.000000000 +0200
> +++ ofa_1_2_kernel-20061228-0200-open-iscsi/Makefile	2006-12-31 14:32:38.000000000 +0200
> @@ -15,6 +15,8 @@
>          export KERNEL_MEMTRACK_CFLAGS =
>  endif
>  
> +export OPEN_ISCSI_MODULES = iscsi_tcp.ko libiscsi.ko scsi_transport_iscsi.ko
> +
>  configure.mk:
>  	@echo Please run ./configure.kernel
>  	@exit 1
> @@ -75,6 +77,22 @@
>  		' \
>  		modules
>  
> +	if [ "$(CONFIG_INFINIBAND_ISER)" == "m" ]; then \
> +		echo "Building open-iscsi"; \
> +		$(MAKE) -C $(KSRC) SUBDIRS="$(CWD)/drivers/scsi" KERNELRELEASE=$(KVERSION) \
> +			EXTRAVERSION=$(EXTRAVERSION) V=1 $(WITH_MAKE_PARAMS) \
> +			CONFIG_SCSI_ISCSI_ATTRS=$(CONFIG_SCSI_ISCSI_ATTRS) \
> +			CONFIG_ISCSI_TCP=$(CONFIG_ISCSI_TCP) \
> +			LINUXINCLUDE=' \
> +			$(BACKPORT_INCLUDES) \
> +			-I$(CWD)/include \
> +			-Iinclude \
> +			$$(if $$(KBUILD_SRC),-Iinclude2 -I$$(srctree)/include) \
> +			-include include/linux/autoconf.h \
> +			-include $(CWD)/include/linux/autoconf.h \
> +			' \
> +			modules; \
> +	fi		
>  
>  #########################
>  #	Install kernel	#
> @@ -88,8 +106,15 @@
>  		KERNELRELEASE=$(KVERSION) EXTRAVERSION=$(EXTRAVERSION) \
>  		INSTALL_MOD_DIR="infiniband" INSTALL_MOD_PATH=$(CWD) \
>  		$(WITH_MAKE_PARAMS) modules_install
> +	
> +	if [ "$(CONFIG_INFINIBAND_ISER)" == "m" ]; then \
> +		$(MAKE) -C $(KSRC) SUBDIRS="$(CWD)/drivers/scsi" \
> +			KERNELRELEASE=$(KVERSION) EXTRAVERSION=$(EXTRAVERSION) \
> +			INSTALL_MOD_DIR="scsi" INSTALL_MOD_PATH=$(CWD) \
> +			$(WITH_MAKE_PARAMS) modules_install; \
> +	fi
>  
> -	# Backup original infiniband kernel modules
> +	# Backup original infiniband (and open-iscsi if iSER was selected) kernel modules
>  	# under 'prefix'/backup directory
>  	
>  	if [ -d $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/infiniband ]; then \
> @@ -100,7 +125,25 @@
>  			mv $(DESTDIR)/$(prefix)/backup/infko_tmp.tgz $(DESTDIR)/$(prefix)/backup/infiniband_ko-$(KVERSION).tgz; \
>  		fi; \
>  		/bin/rm -rf $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/infiniband; \
> -	fi
> +	fi;
> +
> +	if [ "$(CONFIG_INFINIBAND_ISER)" == "m" ]; then \
> +		if [ -d $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/scsi ]; then \
> +			mkdir -p $(DESTDIR)/$(prefix)/backup; \
> +			if [ ! -f $(DESTDIR)/$(prefix)/backup/open_iscsi_ko-$(KVERSION).tgz ]; then \
> +				open_iscsi_mods_full_path=""; \
> +				for open_iscsi_module in $(OPEN_ISCSI_MODULES); \
> +				do \
> +					open_iscsi_mods_full_path="$(DESTDIR)/$(MODULES_DIR)/kernel/drivers/scsi/$$open_iscsi_module $$open_iscsi_mods_full_path"; \
> +				done; \
> +				tar czfP $(DESTDIR)/$(prefix)/backup/open_iscsi_ko-$(KVERSION).tgz $$open_iscsi_mods_full_path; \
> +			fi; \
> +			for open_iscsi_module in $(OPEN_ISCSI_MODULES); \
> +			do \
> +				(/bin/rm -f $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/scsi/$$open_iscsi_module ); \
> +			done; \
> +		fi; \
> +	fi;
>  	
>  	# Copy new infiniband kernel modules to $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/infiniband
>  	if [ -d $(CWD)/lib/modules/$(KVERSION)/infiniband ]; then \
> @@ -112,6 +155,24 @@
>  		mv $(CWD)/lib/modules/$(KVERSION)/extra $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/infiniband; \
>  	fi
>  
> +	# If iSER was selected, Copy new open-iscsi kernel modules to $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/scsi	
> +	if [ "$(CONFIG_INFINIBAND_ISER)" == "m" ]; then \
> +		if [ -d $(CWD)/lib/modules/$(KVERSION)/scsi ]; then \
> +			mkdir -p $(DESTDIR)/$(MODULES_DIR)/kernel/drivers; \
> +			for open_iscsi_module in $(OPEN_ISCSI_MODULES); \
> +			do \
> +				(mv $(CWD)/lib/modules/$(KVERSION)/scsi/$$open_iscsi_module $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/scsi ); \
> +			done; \
> +		fi; \
> +		if [ -d $(CWD)/lib/modules/$(KVERSION)/extra ]; then \
> +			mkdir -p $(DESTDIR)/$(MODULES_DIR)/kernel/drivers; \
> +                        for open_iscsi_module in $(OPEN_ISCSI_MODULES); \
> +			do \
> +				(mv $(CWD)/lib/modules/$(KVERSION)/extra/$$open_iscsi_module $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/scsi ); \
> +			done; \
> +		fi; \
> +	fi;
> +
>  	$(DEPMOD) -r -ae $(KVERSION)
>  
>  clean: clean_kernel
> @@ -125,6 +186,16 @@
>  		tar xzfP $(DESTDIR)/$(prefix)/backup/infiniband_ko-$(KVERSION).tgz; \
>  		/bin/rm -f $(DESTDIR)/$(prefix)/backup/infiniband_ko-$(KVERSION).tgz; \
>  	fi
> +	if [ "$(CONFIG_INFINIBAND_ISER)" == "m" ]; then \
> +		if [ -f $(DESTDIR)/$(prefix)/backup/open_iscsi_ko-$(KVERSION).tgz ]; then \
> +                        for open_iscsi_module in $(OPEN_ISCSI_MODULES); \
> +                        do \
> +                               (/bin/rm $(DESTDIR)/$(MODULES_DIR)/kernel/drivers/scsi/$$open_iscsi_module ); \
> +                        done; \
> +                        tar xzfP $(DESTDIR)/$(prefix)/backup/open_iscsi_ko-$(KVERSION).tgz; \
> +                        /bin/rm -f $(DESTDIR)/$(prefix)/backup/open_iscsi_ko-$(KVERSION).tgz; \
> +		fi; \
> +	fi;
>  
>  	$(DEPMOD) -r -ae $(KVERSION)
>  
> diff -ruN ofa_1_2_kernel-20061228-0200/configure ofa_1_2_kernel-20061228-0200-open-iscsi/configure
> --- ofa_1_2_kernel-20061228-0200/configure	2006-12-31 14:49:38.000000000 +0200
> +++ ofa_1_2_kernel-20061228-0200-open-iscsi/configure	2006-12-31 14:53:45.000000000 +0200
> @@ -555,9 +555,13 @@
>                          ;;
>                          --with-iser-mod)
>                              CONFIG_INFINIBAND_ISER="m"
> +                            CONFIG_SCSI_ISCSI_ATTRS="m"
> +                            CONFIG_ISCSI_TCP="m"
>                          ;;
>                          --without-iser-mod)
>                              CONFIG_INFINIBAND_ISER=
> +                            CONFIG_SCSI_ISCSI_ATTRS=
> +                            CONFIG_ISCSI_TCP=
>                          ;;
>                          --with-ehca-mod)
>                              CONFIG_INFINIBAND_EHCA="m"
> @@ -667,6 +671,8 @@
>  
>  CONFIG_INFINIBAND_IPOIB_DEBUG=${CONFIG_INFINIBAND_IPOIB_DEBUG:-''}
>  CONFIG_INFINIBAND_ISER=${CONFIG_INFINIBAND_ISER:-''}
> +CONFIG_SCSI_ISCSI_ATTRS=${CONFIG_SCSI_ISCSI_ATTRS:-''}
> +CONFIG_ISCSI_TCP=${CONFIG_ISCSI_TCP:-''}
>  CONFIG_INFINIBAND_EHCA=${CONFIG_INFINIBAND_EHCA:-''}
>  CONFIG_INFINIBAND_EHCA_SCALING=${CONFIG_INFINIBAND_EHCA_SCALING:-''}
>  CONFIG_INFINIBAND_RDS=${CONFIG_INFINIBAND_RDS:-''}
> @@ -728,6 +734,8 @@
>  
>  CONFIG_INFINIBAND_IPOIB_DEBUG=${CONFIG_INFINIBAND_IPOIB_DEBUG}
>  CONFIG_INFINIBAND_ISER=${CONFIG_INFINIBAND_ISER}
> +CONFIG_SCSI_ISCSI_ATTRS=${CONFIG_SCSI_ISCSI_ATTRS}
> +CONFIG_ISCSI_TCP=${CONFIG_ISCSI_TCP}
>  CONFIG_INFINIBAND_EHCA=${CONFIG_INFINIBAND_EHCA}
>  CONFIG_INFINIBAND_EHCA_SCALING=${CONFIG_INFINIBAND_EHCA_SCALING}
>  CONFIG_INFINIBAND_RDS=${CONFIG_INFINIBAND_RDS}
> @@ -797,8 +805,12 @@
>  fi
>  if [ "X${CONFIG_INFINIBAND_ISER}" == "Xm" ]; then
>          DEFINE_INFINIBAND_ISER="#define CONFIG_INFINIBAND_ISER 1"
> +        DEFINE_SCSI_ISCSI_ATTRS="#define CONFIG_SCSI_ISCSI_ATTRS 1"
> +        DEFINE_ISCSI_TCP="#define CONFIG_ISCSI_TCP 1"
>  else
>          DEFINE_INFINIBAND_ISER="#undef CONFIG_INFINIBAND_ISER"
> +        DEFINE_SCSI_ISCSI_ATTRS="#undef CONFIG_SCSI_ISCSI_ATTRS"
> +        DEFINE_ISCSI_TCP="#undef CONFIG_ISCSI_TCP"
>  fi
>  if [ "X${CONFIG_INFINIBAND_EHCA}" == "Xm" ]; then
>          DEFINE_INFINIBAND_EHCA="#define CONFIG_INFINIBAND_EHCA 1"
> @@ -918,6 +930,8 @@
>  
>  ${DEFINE_INFINIBAND_IPOIB_DEBUG}
>  ${DEFINE_INFINIBAND_ISER}
> +${DEFINE_SCSI_ISCSI_ATTRS}
> +${DEFINE_ISCSI_TCP}
>  ${DEFINE_INFINIBAND_EHCA}
>  ${DEFINE_INFINIBAND_RDS}
>  ${DEFINE_INFINIBAND_RDS_DEBUG}
>
>
>
> _______________________________________________
> openfabrics-ewg mailing list
> openfabrics-ewg at openib.org
> http://openib.org/mailman/listinfo/openfabrics-ewg
>   
Hi Erez,
I got the following compilation error while compiling iscsi on 
2.6.16.21-0.8-smp kernel (SLES10 x86_64)

  gcc 
-Wp,-MD,/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/.libiscsi.o.d  
-nostdinc -isystem /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include 
-D__KERNEL__ 
-I/tmp/gen2_devel_kernel-20070102-1823/kernel_addons/backport/2.6.16_sles10/include/  
-I/tmp/gen2_devel_kernel-20070102-1823/include  -Iinclude  -Iinclude2 
-I/usr/src/linux-2.6.16.21-0.8/include  -include 
include/linux/autoconf.h  -include 
/tmp/gen2_devel_kernel-20070102-1823/include/linux/autoconf.h    
-I/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi  -Wall -Wundef 
-Wstrict-prototypes -Wno-trigraphs -Werror-implicit-function-declaration 
-fno-strict-aliasing -fno-common -ffreestanding -Os -fomit-frame-pointer 
-mtune=generic -m64 -mno-red-zone -mcmodel=kernel -pipe 
-fno-reorder-blocks -Wno-sign-compare -fno-asynchronous-unwind-tables 
-funit-at-a-time -mno-sse -mno-mmx -mno-sse2 -mno-3dnow 
-Wdeclaration-after-statement -Wno-pointer-sign -DMODULE 
-D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(libiscsi)"  
-D"KBUILD_MODNAME=KBUILD_STR(libiscsi)" -c -o 
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/.tmp_libiscsi.o 
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/libiscsi.c
  gcc 
-Wp,-MD,/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/.iscsi_tcp.o.d  
-nostdinc -isystem /usr/lib64/gcc/x86_64-suse-linux/4.1.0/include 
-D__KERNEL__ 
-I/tmp/gen2_devel_kernel-20070102-1823/kernel_addons/backport/2.6.16_sles10/include/  
-I/tmp/gen2_devel_kernel-20070102-1823/include  -Iinclude  -Iinclude2 
-I/usr/src/linux-2.6.16.21-0.8/include  -include 
include/linux/autoconf.h  -include 
/tmp/gen2_devel_kernel-20070102-1823/include/linux/autoconf.h    
-I/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi  -Wall -Wundef 
-Wstrict-prototypes -Wno-trigraphs -Werror-implicit-function-declaration 
-fno-strict-aliasing -fno-common -ffreestanding -Os -fomit-frame-pointer 
-mtune=generic -m64 -mno-red-zone -mcmodel=kernel -pipe 
-fno-reorder-blocks -Wno-sign-compare -fno-asynchronous-unwind-tables 
-funit-at-a-time -mno-sse -mno-mmx -mno-sse2 -mno-3dnow 
-Wdeclaration-after-statement -Wno-pointer-sign -DMODULE 
-D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(iscsi_tcp)"  
-D"KBUILD_MODNAME=KBUILD_STR(iscsi_tcp)" -c -o 
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/.tmp_iscsi_tcp.o 
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.c
In file included from 
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.c:44:
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.h:96: error: 
field ?tx_hash? has incomplete type
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.h:97: error: 
field ?rx_hash? has incomplete type
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.c: In 
function ?iscsi_hdr_digest?:
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.c:111: 
error: implicit declaration of function ?crypto_hash_digest?
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.c: In 
function ?partial_sg_digest_update?:
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.c:687: 
error: implicit declaration of function ?crypto_hash_update?
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.c: In 
function ?iscsi_tcp_data_recv?:
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.c:890: 
error: implicit declaration of function ?crypto_hash_init?
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.c:950: 
error: implicit declaration of function ?crypto_hash_final?
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.c: In 
function ?iscsi_tcp_conn_create?:
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.c:1777: 
error: implicit declaration of function ?crypto_alloc_hash?
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.c:1778: 
error: ?CRYPTO_ALG_ASYNC? undeclared (first use in this function)
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.c:1778: 
error: (Each undeclared identifier is reported only once
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.c:1778: 
error: for each function it appears in.)
/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.c:1792: 
error: implicit declaration of function ?crypto_free_hash?
make[4]: *** 
[/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi/iscsi_tcp.o] Error 1
make[3]: *** [_module_/tmp/gen2_devel_kernel-20070102-1823/drivers/scsi] 
Error 2
make[2]: *** [modules] Error 2
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.16.21-0.8-obj/x86_64/smp'
make: *** [kernel] Error 2

Did I missed something?

Regards,
Vladimir




More information about the ewg mailing list