Skip to content

Commit

Permalink
[access lists] allow knet_bench to enable/disable access lists
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Feb 18, 2019
1 parent 5140ca8 commit a3acdf2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion libknet/tests/knet_bench.c
Expand Up @@ -45,6 +45,7 @@ static int wait_for_perf_rx = 0;
static char *compresscfg = NULL;
static char *cryptocfg = NULL;
static int machine_output = 0;
static int use_access_lists = 0;

static int bench_shutdown_in_progress = 0;
static pthread_mutex_t shutdown_mutex = PTHREAD_MUTEX_INITIALIZER;
Expand Down Expand Up @@ -77,6 +78,7 @@ static void print_help(void)
printf("knet_bench usage:\n");
printf(" -h print this help (no really)\n");
printf(" -d enable debug logs (default INFO)\n");
printf(" -f enable use of access lists (default: off)\n");
printf(" -c [implementation]:[crypto]:[hashing] crypto configuration. (default disabled)\n");
printf(" Example: -c nss:aes128:sha1\n");
printf(" -z [implementation]:[level]:[threshold] compress configuration. (default disabled)\n");
Expand Down Expand Up @@ -247,7 +249,7 @@ static void setup_knet(int argc, char *argv[])

memset(nodes, 0, sizeof(nodes));

while ((rv = getopt(argc, argv, "aCT:S:s:ldom:wb:t:n:c:p:X::P:z:h")) != EOF) {
while ((rv = getopt(argc, argv, "aCT:S:s:ldfom:wb:t:n:c:p:X::P:z:h")) != EOF) {
switch(rv) {
case 'h':
print_help();
Expand All @@ -259,6 +261,9 @@ static void setup_knet(int argc, char *argv[])
case 'd':
debug = KNET_LOG_DEBUG;
break;
case 'f':
use_access_lists = 1;
break;
case 'c':
if (cryptocfg) {
printf("Error: -c can only be specified once\n");
Expand Down Expand Up @@ -455,6 +460,11 @@ static void setup_knet(int argc, char *argv[])
exit(FAIL);
}

if (knet_handle_enable_access_lists(knet_h, use_access_lists) < 0) {
printf("Unable to knet_handle_enable_access_lists: %s\n", strerror(errno));
exit(FAIL);
}

if (cryptocfg) {
memset(&knet_handle_crypto_cfg, 0, sizeof(knet_handle_crypto_cfg));
cryptomodel = strtok(cryptocfg, ":");
Expand Down

0 comments on commit a3acdf2

Please sign in to comment.