Skip to content

Commit

Permalink
[MOD] uNVMe v18.11
Browse files Browse the repository at this point in the history
    - API and BM Tool changes to support general KV SSD features (key size: 4~255 / value size 0~2048KB / iterate )
    - update to spdk 18.04.1 / dpdk 18.05
    - bug fixes and refactorings
  • Loading branch information
KyungsanKim committed Nov 6, 2018
1 parent c80ea2e commit dfb875c
Show file tree
Hide file tree
Showing 5,514 changed files with 1,708,975 additions and 446,562 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
*.kdev4
*.ko
*.log
*.map
*.o
*.pyc
*.so
*.swp
tags
cscope.out
dpdk-*
CUnit-Memory-Dump.xml
config.h
CONFIG.local
Expand Down
12 changes: 0 additions & 12 deletions app/Makefile

This file was deleted.

8 changes: 5 additions & 3 deletions app/fio_plugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ ifeq ($(KV_DIR),)
export KV_DIR = $(shell pwd)/../../
endif

include $(KV_DIR)/mk/unvme.mk

# if you want specific version fio instead of system's fio, enable both below options
# ex) fio-3.3 -> FIO_MAJOR_VERSION=3, FIO_MINOR_VERSION=3
#FIO_MAJOR_VERSION=3
Expand Down Expand Up @@ -34,9 +36,9 @@ endif

CURRENT_DIR=$(shell pwd)
FIO_SOURCE_DIR := fio-$(SYSTEM_FIO_VERSION)
LIBS += $(KV_DIR)/bin/libuio.a -lm -pthread -lrt -ldl
CFLAGS += -O2 -march=native -m64 -D_GNU_SOURCE -I../../include -I../../driver/include -I../external/fio/$(FIO_SOURCE_DIR) -I../../driver/external/spdk/include -std=gnu99 -fPIC -DFIO_MAJOR_VERSION=$(FIO_MAJOR_VERSION) -DFIO_MINOR_VERSION=$(FIO_MINOR_VERSION)
LDFLAGS += -shared -rdynamic
LIBS += $(KV_DIR)/bin/libuio.a -lm -pthread -lrt -ldl -luuid
CFLAGS += -O2 -march=native -m64 -D_GNU_SOURCE -I../../include -I../../driver/include -I../external/fio/$(FIO_SOURCE_DIR) -I../../driver/external/$(SPDK_PATH)/include -std=gnu99 -fPIC -DFIO_MAJOR_VERSION=$(FIO_MAJOR_VERSION) -DFIO_MINOR_VERSION=$(FIO_MINOR_VERSION)
override LDFLAGS += -shared -rdynamic

APP = unvme2_fio_plugin
C_SRCS = $(APP:%=%.c)
Expand Down
65 changes: 65 additions & 0 deletions app/fio_plugin/Makefile.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
KV_DD_LIB = ../../bin/libuio_20180905.a

ifeq ($(KV_DIR),)
export KV_DIR = $(shell pwd)/../../
endif


# if you want specific version fio instead of system's fio, enable both below options
# ex) fio-3.3 -> FIO_MAJOR_VERSION=3, FIO_MINOR_VERSION=3
#FIO_MAJOR_VERSION=3
#FIO_MINOR_VERSION=3

ifneq ($(FIO_MAJOR_VERSION), )
ifneq ($(FIO_MINOR_VERSION), )
SYSTEM_FIO_VERSION = fio-$(FIO_MAJOR_VERSION).$(FIO_MINOR_VERSION)
endif
endif

ifeq ($(SYSTEM_FIO_VERSION), )
SYSTEM_FIO_VERSION := $(shell fio -version)
VERSION_ONLY = $(shell echo $(SYSTEM_FIO_VERSION) |cut -d'-' -f 2)
FIO_MAJOR_VERSION := $(shell echo $(VERSION_ONLY) |cut -d'.' -f 1)
FIO_MINOR_VERSION := $(shell echo $(VERSION_ONLY) |cut -d'.' -f 2)
endif

# if system fio does not existing
ifeq ($(SYSTEM_FIO_VERSION), )
$(error fio not found)
endif

CURRENT_DIR=$(shell pwd)
ifeq (,$(wildcard $(CURRENT_DIR)/fio/$(SYSTEM_FIO_VERSION).tar.gz))
NOT_SUPPORTED_FIO_VERSION = 1
FIO_MAJOR_VERSION = 2
FIO_MINOR_VERSION = 18
SYSTEM_FIO_VERSION = fio-$(FIO_MAJOR_VERSION).$(FIO_MINOR_VERSION)
endif

FIO_SOURCE_DIR := fio-$(SYSTEM_FIO_VERSION)
LIBS += $(KV_DD_LIB) -lm -pthread -lrt -ldl -luuid
CFLAGS += -O2 -march=native -m64 -D_GNU_SOURCE -I../../include -I../../driver/include -I$(CURRENT_DIR)/fio/$(FIO_SOURCE_DIR) -I$(KV_DIR)/include -std=gnu99 -fPIC -DFIO_MAJOR_VERSION=$(FIO_MAJOR_VERSION) -DFIO_MINOR_VERSION=$(FIO_MINOR_VERSION)
override LDFLAGS += -shared -rdynamic

APP = unvme2_fio_plugin
C_SRCS = $(APP:%=%.c)
OBJS = $(C_SRCS:.c=.o)
LINK_C = $(CC) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)

ifeq (,$(wildcard $(CURRENT_DIR)/fio/$(FIO_SOURCE_DIR)/config-host.h))
all: prepare $(APP)
else
all: $(APP)
endif

$(APP): $(OBJS)
$(LINK_C)
@cd $(CURRENT_DIR)/fio/$(FIO_SOURCE_DIR) && cp fio $(CURRENT_DIR)/$(SYSTEM_FIO_VERSION)
ifdef NOT_SUPPORTED_FIO_VERSION
$(info **** NOTE:: Your system's FIO version is not supported. Use default(fio-$(FIO_MAJOR_VERSION).$(FIO_MINOR_VERSION)))
endif
prepare:
@cd $(CURRENT_DIR)/fio && tar -xvf $(SYSTEM_FIO_VERSION).tar.gz
@cd $(CURRENT_DIR)/fio/$(FIO_SOURCE_DIR) && ./configure && make -j 4
clean:
rm -f $(OBJS) $(APP) fio-*
3 changes: 3 additions & 0 deletions app/fio_plugin/Sample_Write.fio
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[global]
ioengine=./unvme2_fio_plugin
json_path=./unvme2_config.json
clat_percentiles=1
percentile_list=1.0:5.0:10.0:20.0:30.0:40.0:50.0:60.0:70.0:90.0:95.0:99.0:99.5:99.9:99.99:99.999:99.9999
thread=1
group_reporting=1
direct=1
Expand All @@ -11,6 +13,7 @@ runtime=5
rw=write
iodepth=128
bs=4k
ks=16

[test]
filename=0000.02.00.0
Expand Down
3 changes: 3 additions & 0 deletions app/fio_plugin/Sample_Write_Multi.fio
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[global]
ioengine=./unvme2_fio_plugin
json_path=./unvme2_config_multi.json
clat_percentiles=1
percentile_list=1.0:5.0:10.0:20.0:30.0:40.0:50.0:60.0:70.0:90.0:95.0:99.0:99.5:99.9:99.99:99.999:99.9999
thread=1
group_reporting=0
direct=1
Expand All @@ -12,6 +14,7 @@ offset_increment=10G
rw=write
iodepth=128
bs=4k
ks=16

[test0]
filename=0000.01.00.0
Expand Down
159 changes: 159 additions & 0 deletions app/fio_plugin/basic_validation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
#!/bin/bash

#### JSON DESCRIPTION
SSD_TYPE=lba

#### FIO DESCRIPTION
BLOCKSIZE=4k
TIME_BASED=0
RAMP_TIME=0
RUNTIME=0
SIZE=10G

#### DO NOT MODIFY BELOW
IOENGINE=./unvme2_fio_plugin
JSON_CONF=./basic_test_config.json
FIO_JOB_FILE=./basic_test_config.fio
FIO=`ls | grep fio-`

# make_json(dev_id, core_mask(, dev_id2, core_mask2))
make_json()
{
if [ -f $JSON_CONF ]; then
rm -f $JSON_CONF
fi

echo "{" > $JSON_CONF
echo \"ssd_type\":\"$SSD_TYPE\", >> $JSON_CONF
echo \"device_description\":"[" >> $JSON_CONF
echo "{" >> $JSON_CONF
echo \"dev_id\":\"$1\", >> $JSON_CONF
echo \"core_mask\":\"$2\" >> $JSON_CONF
if [ ! -z $3 ]; then
echo "}," >> $JSON_CONF
echo "{" >> $JSON_CONF
echo \"dev_id\":\"$3\", >> $JSON_CONF
echo \"core_mask\":\"$4\" >> $JSON_CONF
fi
echo "}" >> $JSON_CONF
echo "]" >> $JSON_CONF
echo "}" >> $JSON_CONF
}

# make_fio_description(numjobs, device_bdf(, device_bdf2))
make_fio_description()
{
if [ -f $FIO_JOB_FILE ]; then
rm -f $FIO_JOB_FILE
fi

echo "[global]" > $FIO_JOB_FILE
echo "ioengine=$IOENGINE" >> $FIO_JOB_FILE
echo "json_path=$JSON_CONF" >> $FIO_JOB_FILE
echo "size=$SIZE" >> $FIO_JOB_FILE
echo "time_based=$TIME_BASED" >> $FIO_JOB_FILE
echo "ramp_time=$RAMP_TIME" >> $FIO_JOB_FILE
echo "runtime=$RUNTIME" >> $FIO_JOB_FILE
echo "blocksize=$BLOCKSIZE" >> $FIO_JOB_FILE
echo "thread=1" >> $FIO_JOB_FILE
echo "direct=1" >> $FIO_JOB_FILE
echo "group_reporting=1" >> $FIO_JOB_FILE
echo "verify=0" >> $FIO_JOB_FILE
echo "norandommap=1" >> $FIO_JOB_FILE

echo "[test0]" >> $FIO_JOB_FILE
FILE_LEN=${#2}
if [ $FILE_LEN -le 12 ]; then
echo "filename=`echo $2 | sed -e s/:/./g`" >> $FIO_JOB_FILE
else
echo "filename=$2" >> $FIO_JOB_FILE
fi
echo "numjobs=$1" >> $FIO_JOB_FILE
if [ ! -z $3 ]; then
echo "[test1]" >> $FIO_JOB_FILE
echo "filename=`echo $3 | sed -e s/:/./g`" >> $FIO_JOB_FILE
echo "numjobs=$1" >> $FIO_JOB_FILE
fi
}

# run_fio()
run_fio()
{
for OP in "write" "read"
do
for IODEPTH in 1 4 16 64 256
do
echo "[OP: $OP IODEPTH: $IODEPTH]"
./$FIO --readwrite=$OP --iodepth=$IODEPTH $FIO_JOB_FILE
done
done
}



if [ -z $FIO ];then
echo "Please install FIO and uNVMe FIO plugin first"
exit 0
fi

if [ -z $1 ]; then
echo "Please specify devices(max 2)"
echo "e.g) ./basic_validation.sh 0000:01:00.0"
echo " ./basic_validation.sh 0000:01:00.0 0000:02:00.0"
exit 0
fi

DEVICE_BDF=$1
if [ ! -z $2 ]; then
DEVICE_BDF2=$2
fi

#======================= Single Device =========================
# Device : Job = 1 : 1
CORE_MASK=0x1
NUMJOBS=1
make_json $DEVICE_BDF $CORE_MASK
make_fio_description $NUMJOBS $DEVICE_BDF
run_fio

# 1 : N
CORE_MASK=0xF
NUMJOBS=4
make_json $DEVICE_BDF $CORE_MASK
make_fio_description $NUMJOBS $DEVICE_BDF
run_fio
#===============================================================

if [ -z $DEVICE_BDF2 ]; then
exit 0
fi

#======================= Multiple Devices ======================
# Device : Job = N : 1
CORE_MASK=0x1
CORE_MASK2=0x1
NUMJOBS=1
FILENAME="`echo $DEVICE_BDF | sed -e s/:/./g`:`echo $DEVICE_BDF2 | sed -e s/:/./g`"
make_json $DEVICE_BDF $CORE_MASK $DEVICE_BDF2 $CORE_MASK2
make_fio_description $NUMJOBS $FILENAME
run_fio

# N : N
CORE_MASK=0x1
CORE_MASK2=0x2
NUMJOBS=1
make_json $DEVICE_BDF $CORE_MASK $DEVICE_BDF2 $CORE_MASK2
make_fio_description $NUMJOBS $DEVICE_BDF $DEVICE_BDF2
run_fio

# N : M*N
CORE_MASK=0xF
CORE_MASK2=0xF0
NUMJOBS=4
make_json $DEVICE_BDF $CORE_MASK $DEVICE_BDF2 $CORE_MASK2
make_fio_description $NUMJOBS $DEVICE_BDF $DEVICE_BDF2
run_fio
#===============================================================

rm -f $JSON_CONF
rm -f $FIO_JOB_FILE
Loading

0 comments on commit dfb875c

Please sign in to comment.