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:
parent
c0de8a8b0e
commit
77bcc2454d
@ -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,
|
io_u->buf, io_u->offset, io_u->xfer_buflen,
|
||||||
spdk_fio_completion_cb, fio_req);
|
spdk_fio_completion_cb, fio_req);
|
||||||
break;
|
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:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
break;
|
break;
|
||||||
|
@ -400,6 +400,8 @@ EOL
|
|||||||
if [ "$workload" == "verify" ]; then
|
if [ "$workload" == "verify" ]; then
|
||||||
echo "verify=sha1" >> $config_file
|
echo "verify=sha1" >> $config_file
|
||||||
echo "rw=randwrite" >> $config_file
|
echo "rw=randwrite" >> $config_file
|
||||||
|
elif [ "$workload" == "trim" ]; then
|
||||||
|
echo "rw=trimwrite" >> $config_file
|
||||||
else
|
else
|
||||||
echo "rw=$workload" >> $config_file
|
echo "rw=$workload" >> $config_file
|
||||||
fi
|
fi
|
||||||
|
@ -33,6 +33,7 @@ timing_exit bdev_svc
|
|||||||
if [ -d /usr/src/fio ] && [ $SPDK_RUN_ASAN -eq 0 ]; then
|
if [ -d /usr/src/fio ] && [ $SPDK_RUN_ASAN -eq 0 ]; then
|
||||||
timing_enter fio
|
timing_enter fio
|
||||||
|
|
||||||
|
timing_enter fio_rw_verify
|
||||||
# Generate the fio config file given the list of all unclaimed bdevs
|
# Generate the fio config file given the list of all unclaimed bdevs
|
||||||
fio_config_gen $testdir/bdev.fio verify
|
fio_config_gen $testdir/bdev.fio verify
|
||||||
for b in $(echo $bdevs | jq -r '.name'); do
|
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 *.state
|
||||||
rm -f $testdir/bdev.fio
|
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
|
timing_exit fio
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $RUN_NIGHTLY -eq 1 ]; then
|
if [ $RUN_NIGHTLY -eq 1 ]; then
|
||||||
# Temporarily disabled - infinite loop
|
# 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
|
#$testdir/bdevperf/bdevperf -c $testdir/bdev.conf -q 16 -w reset -s 4096 -t 60
|
||||||
#timing_exit reset
|
timing_exit reset
|
||||||
|
|
||||||
timing_enter unmap
|
|
||||||
$testdir/bdevperf/bdevperf -c $testdir/bdev.conf -q 1 -w unmap -s 4096 -t 60
|
|
||||||
timing_exit unmap
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f /tmp/aiofile
|
rm -f /tmp/aiofile
|
||||||
|
Loading…
Reference in New Issue
Block a user