bdev/fio_plugin: Add trim support

Change-Id: I4b046e63a669d52c875efffb5a91e99845fc623d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/370383
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Ben Walker 2017-07-19 14:55:03 -07:00 committed by Jim Harris
parent c0de8a8b0e
commit 77bcc2454d
3 changed files with 31 additions and 6 deletions

View File

@ -501,6 +501,11 @@ spdk_fio_queue(struct thread_data *td, struct io_u *io_u)
io_u->buf, io_u->offset, io_u->xfer_buflen,
spdk_fio_completion_cb, fio_req);
break;
case DDIR_TRIM:
rc = spdk_bdev_unmap(target->desc, target->ch,
io_u->offset, io_u->xfer_buflen,
spdk_fio_completion_cb, fio_req);
break;
default:
assert(false);
break;

View File

@ -400,6 +400,8 @@ EOL
if [ "$workload" == "verify" ]; then
echo "verify=sha1" >> $config_file
echo "rw=randwrite" >> $config_file
elif [ "$workload" == "trim" ]; then
echo "rw=trimwrite" >> $config_file
else
echo "rw=$workload" >> $config_file
fi

View File

@ -33,6 +33,7 @@ timing_exit bdev_svc
if [ -d /usr/src/fio ] && [ $SPDK_RUN_ASAN -eq 0 ]; then
timing_enter fio
timing_enter fio_rw_verify
# Generate the fio config file given the list of all unclaimed bdevs
fio_config_gen $testdir/bdev.fio verify
for b in $(echo $bdevs | jq -r '.name'); do
@ -49,18 +50,35 @@ if [ -d /usr/src/fio ] && [ $SPDK_RUN_ASAN -eq 0 ]; then
rm -f *.state
rm -f $testdir/bdev.fio
timing_exit fio_rw_verify
timing_enter fio_trim
# Generate the fio config file given the list of all unclaimed bdevs that support unmap
fio_config_gen $testdir/bdev.fio trim
for b in $(echo $bdevs | jq -r 'select(.supported_io_types.unmap == true) | .name'); do
fio_config_add_job $testdir/bdev.fio $b
done
if [ $RUN_NIGHTLY -eq 0 ]; then
LD_PRELOAD=$plugindir/fio_plugin /usr/src/fio/fio --ioengine=spdk_bdev --spdk_conf=./test/lib/bdev/bdev.conf --iodepth=8 --bs=4k --runtime=10 $testdir/bdev.fio
else
# Use size 192KB which both exceeds typical 128KB max NVMe I/O
# size and will cross 128KB Intel DC P3700 stripe boundaries.
LD_PRELOAD=$plugindir/fio_plugin /usr/src/fio/fio --ioengine=spdk_bdev --spdk_conf=./test/lib/bdev/bdev.conf --iodepth=128 --bs=192k --runtime=100 $testdir/bdev.fio
fi
rm -f *.state
rm -f $testdir/bdev.fio
timing_exit fio_trim
timing_exit fio
fi
if [ $RUN_NIGHTLY -eq 1 ]; then
# Temporarily disabled - infinite loop
#timing_enter reset
timing_enter reset
#$testdir/bdevperf/bdevperf -c $testdir/bdev.conf -q 16 -w reset -s 4096 -t 60
#timing_exit reset
timing_enter unmap
$testdir/bdevperf/bdevperf -c $testdir/bdev.conf -q 1 -w unmap -s 4096 -t 60
timing_exit unmap
timing_exit reset
fi
rm -f /tmp/aiofile