perf: Add cli option to configure default sock impl

Change-Id: I165e6c9287ed576bdf7e34e02c5f27f3052a6456
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4329
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Alexey Marchuk 2020-09-21 17:59:08 +03:00 committed by Tomasz Zawadzki
parent 89d9fe558a
commit 8614d3fe3a

View File

@ -1432,6 +1432,7 @@ static void usage(char *program_name)
printf("\t[-Z enable zero copy send for the given sock implementation. Default for posix impl]\n");
printf("\t[-A IO buffer alignment. Must be power of 2 and not less than cache line (%u)]\n",
SPDK_CACHE_LINE_SIZE);
printf("\t[-S set the default sock impl, e.g. \"posix\"]\n");
#ifdef SPDK_CONFIG_URING
printf("\t[-R enable using liburing to drive kernel devices (Default: libaio)]\n");
#endif
@ -1846,7 +1847,7 @@ parse_args(int argc, char **argv)
long int val;
int rc;
while ((op = getopt(argc, argv, "a:c:e:i:lo:q:r:k:s:t:w:z:A:C:DGHILM:NP:RT:U:VZ:")) != -1) {
while ((op = getopt(argc, argv, "a:c:e:i:lo:q:r:k:s:t:w:z:A:C:DGHILM:NP:RS:T:U:VZ:")) != -1) {
switch (op) {
case 'a':
case 'A':
@ -1992,6 +1993,13 @@ parse_args(int argc, char **argv)
case 'Z':
perf_set_sock_zcopy(optarg, true);
break;
case 'S':
rc = spdk_sock_set_default_impl(optarg);
if (rc) {
fprintf(stderr, "Failed to set sock impl %s, err %d (%s)\n", optarg, errno, strerror(errno));
return 1;
}
break;
default:
usage(argv[0]);
return 1;