Commit 2af15344 authored by Jim Harris's avatar Jim Harris
Browse files

bdev: add iSCSI initiator bdev module



This uses libiscsi to implement an iSCSI initiator bdev
module for SPDK.  Still a lots of work to do on this - posting
it in case anyone is interested in working on this further.

A number of todo items are listed in a README in the lib/bdev/iscsi
directory.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Signed-off-by: default avatarZiye Yang <optimistyzy@gmail.com>
Change-Id: I060e33de0cd6796246789bf0e1bb4f2df59d8f71
Reviewed-on: https://review.gerrithub.io/390313


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 7ca10f4f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -53,6 +53,12 @@ The prototype for spdk_poller_fn() has been modified; it now returns a value ind
whether or not the poller did any work.  Existing pollers will need to be updated to
return a value.

### iSCSI initiator

An iSCSI initiator bdev module has been added to SPDK.  This module should be considered
experimental pending additional features and tests.  More details can be found in
lib/bdev/iscsi/README.

## v18.01: Blobstore Thin Provisioning

### Build System
+3 −0
Original line number Diff line number Diff line
@@ -95,3 +95,6 @@ CONFIG_NVML?=n

# Build with VPP
CONFIG_VPP?=n

# Requires libiscsi development libraries.
CONFIG_ISCSI_INITIATOR?=n
+11 −0
Original line number Diff line number Diff line
@@ -47,6 +47,8 @@ function usage()
	echo "                           No path required."
	echo " rdma                      [disabled]"
	echo "                           No path required."
	echo " iscsi-initiator           [disabled]"
	echo "                           No path required."
	echo " vtune                     Required to profile I/O under Intel VTune Amplifier XE."
	echo "                           example: /opt/intel/vtune_amplifier_xe_version"
	echo ""
@@ -133,6 +135,12 @@ for i in "$@"; do
		--without-rdma)
			CONFIG_RDMA=n
			;;
		--with-iscsi-initiator)
			CONFIG_ISCSI_INITIATOR=y
			;;
		--without-iscsi-initiator)
			CONFIG_ISCSI_INITIATOR=n
			;;
		--with-dpdk=*)
			check_dir "$i"
			CONFIG_DPDK_DIR=$(readlink -f ${i#*=})
@@ -306,6 +314,9 @@ fi
if [ -n "$CONFIG_RDMA" ]; then
	echo "CONFIG_RDMA?=$CONFIG_RDMA" >> CONFIG.local
fi
if [ -n "$CONFIG_ISCSI_INITIATOR" ]; then
	echo "CONFIG_ISCSI_INITIATOR?=$CONFIG_ISCSI_INITIATOR" >> CONFIG.local
fi
if [ -n "$CONFIG_RBD" ]; then
	echo "CONFIG_RBD?=$CONFIG_RBD" >> CONFIG.local
fi
+1 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ DIRS-y += error gpt lvol malloc null nvme passthru rpc split

ifeq ($(OS),Linux)
DIRS-y += aio
DIRS-$(CONFIG_ISCSI_INITIATOR) += iscsi
DIRS-$(CONFIG_VIRTIO) += virtio
DIRS-$(CONFIG_NVML) += pmem
endif
+46 −0
Original line number Diff line number Diff line
#
#  BSD LICENSE
#
#  Copyright (c) Intel Corporation.
#  All rights reserved.
#
#  Redistribution and use in source and binary forms, with or without
#  modification, are permitted provided that the following conditions
#  are met:
#
#    * Redistributions of source code must retain the above copyright
#      notice, this list of conditions and the following disclaimer.
#    * Redistributions in binary form must reproduce the above copyright
#      notice, this list of conditions and the following disclaimer in
#      the documentation and/or other materials provided with the
#      distribution.
#    * Neither the name of Intel Corporation nor the names of its
#      contributors may be used to endorse or promote products derived
#      from this software without specific prior written permission.
#
#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk

CFLAGS += -I$(SPDK_ROOT_DIR)/lib/bdev/
# CentOS 7 libiscsi package has functions declared inline but not
# defined in the header file.  Not aware of any way to disable
# this warning so just make sure the warning isn't treated as
# an error.
CFLAGS += -Wno-error
C_SRCS = bdev_iscsi.c
LIBNAME = bdev_iscsi

include $(SPDK_ROOT_DIR)/mk/spdk.lib.mk
Loading