diff --git a/lib/Makefile b/lib/Makefile index 5ab423f81..e00b7ff56 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -47,6 +47,7 @@ DIRS-$(CONFIG_OCF) += env_ocf DIRS-$(CONFIG_VHOST) += vhost DIRS-$(CONFIG_VIRTIO) += virtio DIRS-$(CONFIG_REDUCE) += reduce +DIRS-$(CONFIG_VHOST_INTERNAL_LIB) += rte_vhost # If CONFIG_ENV is pointing at a directory in lib, build it. # Out-of-tree env implementations must be built separately by the user. diff --git a/lib/vhost/rte_vhost/Makefile b/lib/rte_vhost/Makefile similarity index 97% rename from lib/vhost/rte_vhost/Makefile rename to lib/rte_vhost/Makefile index b0ae63358..ca7abb3a6 100644 --- a/lib/vhost/rte_vhost/Makefile +++ b/lib/rte_vhost/Makefile @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..) +SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk CFLAGS += -I. diff --git a/lib/vhost/rte_vhost/fd_man.c b/lib/rte_vhost/fd_man.c similarity index 100% rename from lib/vhost/rte_vhost/fd_man.c rename to lib/rte_vhost/fd_man.c diff --git a/lib/vhost/rte_vhost/fd_man.h b/lib/rte_vhost/fd_man.h similarity index 100% rename from lib/vhost/rte_vhost/fd_man.h rename to lib/rte_vhost/fd_man.h diff --git a/lib/vhost/rte_vhost/rte_vhost.h b/lib/rte_vhost/rte_vhost.h similarity index 100% rename from lib/vhost/rte_vhost/rte_vhost.h rename to lib/rte_vhost/rte_vhost.h diff --git a/lib/vhost/rte_vhost/socket.c b/lib/rte_vhost/socket.c similarity index 100% rename from lib/vhost/rte_vhost/socket.c rename to lib/rte_vhost/socket.c diff --git a/lib/vhost/rte_vhost/vhost.c b/lib/rte_vhost/vhost.c similarity index 100% rename from lib/vhost/rte_vhost/vhost.c rename to lib/rte_vhost/vhost.c diff --git a/lib/vhost/rte_vhost/vhost.h b/lib/rte_vhost/vhost.h similarity index 100% rename from lib/vhost/rte_vhost/vhost.h rename to lib/rte_vhost/vhost.h diff --git a/lib/vhost/rte_vhost/vhost_user.c b/lib/rte_vhost/vhost_user.c similarity index 100% rename from lib/vhost/rte_vhost/vhost_user.c rename to lib/rte_vhost/vhost_user.c diff --git a/lib/vhost/rte_vhost/vhost_user.h b/lib/rte_vhost/vhost_user.h similarity index 100% rename from lib/vhost/rte_vhost/vhost_user.h rename to lib/rte_vhost/vhost_user.h diff --git a/lib/vhost/Makefile b/lib/vhost/Makefile index 3d33cdb92..3d6edea95 100644 --- a/lib/vhost/Makefile +++ b/lib/vhost/Makefile @@ -41,8 +41,7 @@ C_SRCS = vhost.c vhost_rpc.c vhost_scsi.c vhost_blk.c rte_vhost_compat.c ifeq ($(CONFIG_VHOST_INTERNAL_LIB),y) C_SRCS += vhost_nvme.c -DIRS-y += rte_vhost -CFLAGS := -Irte_vhost $(CFLAGS) +CFLAGS := -I../rte_vhost $(CFLAGS) endif LIBNAME = vhost diff --git a/mk/spdk.lib_deps.mk b/mk/spdk.lib_deps.mk index 6c8e827af..cd5970490 100644 --- a/mk/spdk.lib_deps.mk +++ b/mk/spdk.lib_deps.mk @@ -42,6 +42,7 @@ JSON_LIBS := json jsonrpc rpc DEPDIRS-env_ocf := DEPDIRS-log := +DEPDIRS-rte_vhost := DEPDIRS-ioat := log DEPDIRS-sock := log @@ -77,7 +78,10 @@ DEPDIRS-nvmf := log sock util nvme thread $(JSON_LIBS) trace bdev DEPDIRS-scsi := log util thread $(JSON_LIBS) trace bdev DEPDIRS-iscsi := log sock util conf thread $(JSON_LIBS) trace event scsi -DEPDIRS-vhost := log util conf thread $(JSON_LIBS) bdev event scsi +DEPDIRS-vhost = log util conf thread $(JSON_LIBS) bdev event scsi +ifeq ($(CONFIG_VHOST_INTERNAL_LIB),y) +DEPDIRS-vhost += rte_vhost +endif # ------------------------------------------------------------------------ # Start module/ directory - This section extends the organizational pattern from diff --git a/scripts/check_format.sh b/scripts/check_format.sh index ad89a761a..fab5eb8d3 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -107,7 +107,7 @@ fi echo -n "Checking comment style..." git grep --line-number -e '/[*][^ *-]' -- '*.[ch]' > comment.log || true -git grep --line-number -e '[^ ][*]/' -- '*.[ch]' ':!lib/vhost/rte_vhost*/*' >> comment.log || true +git grep --line-number -e '[^ ][*]/' -- '*.[ch]' ':!lib/rte_vhost*/*' >> comment.log || true git grep --line-number -e '^[*]' -- '*.[ch]' >> comment.log || true git grep --line-number -e '\s//' -- '*.[ch]' >> comment.log || true git grep --line-number -e '^//' -- '*.[ch]' >> comment.log || true @@ -147,7 +147,7 @@ rm -f whitespace.log echo -n "Checking for use of forbidden library functions..." -git grep --line-number -w '\(atoi\|atol\|atoll\|strncpy\|strcpy\|strcat\|sprintf\|vsprintf\)' -- './*.c' ':!lib/vhost/rte_vhost*/**' > badfunc.log || true +git grep --line-number -w '\(atoi\|atol\|atoll\|strncpy\|strcpy\|strcat\|sprintf\|vsprintf\)' -- './*.c' ':!lib/rte_vhost*/**' > badfunc.log || true if [ -s badfunc.log ]; then echo " Forbidden library functions detected" cat badfunc.log @@ -182,7 +182,7 @@ fi rm -f eofnl.log echo -n "Checking for POSIX includes..." -git grep -I -i -f scripts/posix.txt -- './*' ':!include/spdk/stdinc.h' ':!include/linux/**' ':!lib/vhost/rte_vhost*/**' ':!scripts/posix.txt' ':!*.patch' > scripts/posix.log || true +git grep -I -i -f scripts/posix.txt -- './*' ':!include/spdk/stdinc.h' ':!include/linux/**' ':!lib/rte_vhost*/**' ':!scripts/posix.txt' ':!*.patch' > scripts/posix.log || true if [ -s scripts/posix.log ]; then echo "POSIX includes detected. Please include spdk/stdinc.h instead." cat scripts/posix.log diff --git a/test/unit/lib/vhost/vhost.c/Makefile b/test/unit/lib/vhost/vhost.c/Makefile index fd4f7b73e..23438ec4d 100644 --- a/test/unit/lib/vhost/vhost.c/Makefile +++ b/test/unit/lib/vhost/vhost.c/Makefile @@ -35,7 +35,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../../..) include $(SPDK_ROOT_DIR)/mk/config.mk ifeq ($(CONFIG_VHOST_INTERNAL_LIB),y) -CFLAGS += -I$(SPDK_ROOT_DIR)/lib/vhost/rte_vhost +CFLAGS += -I$(SPDK_ROOT_DIR)/lib/rte_vhost endif CFLAGS += $(ENV_CFLAGS)