aboutsummaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2019-03-02 01:03:55 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2019-03-02 01:03:55 +0000
commit8bdc5521368ade1b8ecaecf194f03ad74f845fed (patch)
tree790ea0d014de7d3a5922794b336c848ac5d5533a /testing
parent9ddcd0ac08f1c6a46d681bc349f3f523e8da4fcf (diff)
downloadsg3_utils-8bdc5521368ade1b8ecaecf194f03ad74f845fed.tar.gz
sg_lib: extend small SNTL to support read capacity
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@812 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'testing')
-rw-r--r--testing/Makefile1
-rw-r--r--testing/sgh_dd.c25
-rw-r--r--testing/uapi_sg.h2
3 files changed, 26 insertions, 2 deletions
diff --git a/testing/Makefile b/testing/Makefile
index 7ff39a44..518eb5cb 100644
--- a/testing/Makefile
+++ b/testing/Makefile
@@ -90,6 +90,7 @@ sgs_dd: sgs_dd.o $(LIBFILESOLD)
sg_tst_bidi: sg_tst_bidi.o $(LIBFILESNEW)
$(LD) -o $@ $(LDFLAGS) $^
+
install: $(EXECS)
install -d $(INSTDIR)
for name in $^; \
diff --git a/testing/sgh_dd.c b/testing/sgh_dd.c
index adcf7818..5ff9e710 100644
--- a/testing/sgh_dd.c
+++ b/testing/sgh_dd.c
@@ -98,7 +98,7 @@
#include "sg_pr2serr.h"
-static const char * version_str = "1.19 20190210";
+static const char * version_str = "1.20 20190212";
#ifdef __GNUC__
#ifndef __clang__
@@ -106,6 +106,9 @@ static const char * version_str = "1.19 20190210";
#endif
#endif
+/* <<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>> xxxxxxxxxx beware next line */
+#define SGH_DD_READ_COMPLET_AFTER 1
+
#define DEF_BLOCK_SIZE 512
#define DEF_BLOCKS_PER_TRANSFER 128
#define DEF_BLOCKS_PER_2048TRANSFER 32
@@ -559,6 +562,10 @@ usage(int pg_num)
"It expects one or both IFILE\nand OFILE to be sg devices. It "
"is Linux specific and uses the v4 sg driver\n'share' capability "
"if available. Use '-hh' or '-hhh' for more information.\n"
+#ifdef SGH_DD_READ_COMPLET_AFTER
+ "\nIn this version oflag=swait does read completion _after_ "
+ "write completion\n"
+#endif
);
return;
page2:
@@ -1777,6 +1784,12 @@ sg_in_out_interleave(Gbl_coll *clp, Rq_elem * rep)
status = pthread_mutex_unlock(&clp->in_mutex);
if (0 != status) err_exit(status, "unlock in_mutex");
+#ifdef SGH_DD_READ_COMPLET_AFTER
+#warning "SGH_DD_READ_COMPLET_AFTER is set (testing)"
+ goto write_complet;
+read_complet:
+#endif
+
/* finish READ */
rep->rq_id = pid_read;
rep->wr = false;
@@ -1832,6 +1845,12 @@ sg_in_out_interleave(Gbl_coll *clp, Rq_elem * rep)
break;
}
+
+#ifdef SGH_DD_READ_COMPLET_AFTER
+ return;
+
+write_complet:
+#endif
/* finish WRITE, no lock held */
rep->rq_id = pid_write;
rep->wr = true;
@@ -1871,6 +1890,10 @@ sg_in_out_interleave(Gbl_coll *clp, Rq_elem * rep)
clp->out_rem_count -= rep->num_blks;
status = pthread_mutex_unlock(&clp->in_mutex);
if (0 != status) err_exit(status, "unlock out_mutex");
+
+#ifdef SGH_DD_READ_COMPLET_AFTER
+ goto read_complet;
+#endif
return;
default:
pr2serr_lk("error finishing sg out command (%d)\n", res);
diff --git a/testing/uapi_sg.h b/testing/uapi_sg.h
index d6cbf14d..f109690d 100644
--- a/testing/uapi_sg.h
+++ b/testing/uapi_sg.h
@@ -14,7 +14,7 @@
* Later extensions (versions 2, 3 and 4) to driver:
* Copyright (C) 1998 - 2018 Douglas Gilbert
*
- * Version 4.0.06 (20190201)
+ * Version 4.0.06 (20190210)
* This version is for Linux 2.6, 3, 4 and 5 series kernels.
*
* Documentation