version 1.1.1.2, 2021/03/17 00:36:46
|
version 1.1.1.3, 2023/09/27 11:14:54
|
Line 1
|
Line 1
|
/* |
/* |
* iperf, Copyright (c) 2014, 2015, 2017, 2019, The Regents of the University of | * iperf, Copyright (c) 2014-2022, The Regents of the University of |
* California, through Lawrence Berkeley National Laboratory (subject |
* California, through Lawrence Berkeley National Laboratory (subject |
* to receipt of any required approvals from the U.S. Dept. of |
* to receipt of any required approvals from the U.S. Dept. of |
* Energy). All rights reserved. |
* Energy). All rights reserved. |
Line 62 main(int argc, char **argv)
|
Line 62 main(int argc, char **argv)
|
// XXX: Setting the process affinity requires root on most systems. |
// XXX: Setting the process affinity requires root on most systems. |
// Is this a feature we really need? |
// Is this a feature we really need? |
#ifdef TEST_PROC_AFFINITY |
#ifdef TEST_PROC_AFFINITY |
/* didnt seem to work.... */ | /* didn't seem to work.... */ |
/* |
/* |
* increasing the priority of the process to minimise packet generation |
* increasing the priority of the process to minimise packet generation |
* delay |
* delay |
Line 74 main(int argc, char **argv)
|
Line 74 main(int argc, char **argv)
|
fprintf(stderr, "setting priority to valid level\n"); |
fprintf(stderr, "setting priority to valid level\n"); |
rc = setpriority(PRIO_PROCESS, 0, 0); |
rc = setpriority(PRIO_PROCESS, 0, 0); |
} |
} |
| |
/* setting the affinity of the process */ |
/* setting the affinity of the process */ |
cpu_set_t cpu_set; |
cpu_set_t cpu_set; |
int affinity = -1; |
int affinity = -1; |
Line 101 main(int argc, char **argv)
|
Line 101 main(int argc, char **argv)
|
if (iperf_parse_arguments(test, argc, argv) < 0) { |
if (iperf_parse_arguments(test, argc, argv) < 0) { |
iperf_err(test, "parameter error - %s", iperf_strerror(i_errno)); |
iperf_err(test, "parameter error - %s", iperf_strerror(i_errno)); |
fprintf(stderr, "\n"); |
fprintf(stderr, "\n"); |
usage_long(stdout); | usage(); |
exit(1); |
exit(1); |
} |
} |
|
|
Line 151 run(struct iperf_test *test)
|
Line 151 run(struct iperf_test *test)
|
for (;;) { |
for (;;) { |
int rc; |
int rc; |
rc = iperf_run_server(test); |
rc = iperf_run_server(test); |
|
test->server_last_run_rc = rc; |
if (rc < 0) { |
if (rc < 0) { |
iperf_err(test, "error - %s", iperf_strerror(i_errno)); |
iperf_err(test, "error - %s", iperf_strerror(i_errno)); |
|
if (test->json_output) { |
|
if (iperf_json_finish(test) < 0) |
|
return -1; |
|
} |
|
iflush(test); |
|
|
if (rc < -1) { |
if (rc < -1) { |
iperf_errexit(test, "exiting"); |
iperf_errexit(test, "exiting"); |
} |
} |
} |
} |
iperf_reset_test(test); |
iperf_reset_test(test); |
if (iperf_get_test_one_off(test)) { | if (iperf_get_test_one_off(test) && rc != 2) { |
/* Authentication failure doesn't count for 1-off test */ |
/* Authentication failure doesn't count for 1-off test */ |
if (rc < 0 && i_errno == IEAUTHTEST) { |
if (rc < 0 && i_errno == IEAUTHTEST) { |
continue; |
continue; |
Line 169 run(struct iperf_test *test)
|
Line 176 run(struct iperf_test *test)
|
iperf_delete_pidfile(test); |
iperf_delete_pidfile(test); |
break; |
break; |
case 'c': |
case 'c': |
|
if (iperf_create_pidfile(test) < 0) { |
|
i_errno = IEPIDFILE; |
|
iperf_errexit(test, "error - %s", iperf_strerror(i_errno)); |
|
} |
if (iperf_run_client(test) < 0) |
if (iperf_run_client(test) < 0) |
iperf_errexit(test, "error - %s", iperf_strerror(i_errno)); |
iperf_errexit(test, "error - %s", iperf_strerror(i_errno)); |
|
iperf_delete_pidfile(test); |
break; |
break; |
default: |
default: |
usage(); |
usage(); |