1
1

Merge pull request #1204 from davidBar-On/zerocopy_in_server_for_reverse_mode

Support zerocopy by Reverse mode
Этот коммит содержится в:
Bruce A. Mah 2021-09-27 13:19:45 -07:00 коммит произвёл GitHub
родитель b3ab30cbc3 b788ec0405
Коммит 16d13e96fd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23

Просмотреть файл

@ -2048,6 +2048,8 @@ send_parameters(struct iperf_test *test)
cJSON_AddNumberToObject(j, "udp_counters_64bit", iperf_get_test_udp_counters_64bit(test)); cJSON_AddNumberToObject(j, "udp_counters_64bit", iperf_get_test_udp_counters_64bit(test));
if (test->repeating_payload) if (test->repeating_payload)
cJSON_AddNumberToObject(j, "repeating_payload", test->repeating_payload); cJSON_AddNumberToObject(j, "repeating_payload", test->repeating_payload);
if (test->zerocopy)
cJSON_AddNumberToObject(j, "zerocopy", test->zerocopy);
#if defined(HAVE_DONT_FRAGMENT) #if defined(HAVE_DONT_FRAGMENT)
if (test->settings->dont_fragment) if (test->settings->dont_fragment)
cJSON_AddNumberToObject(j, "dont_fragment", test->settings->dont_fragment); cJSON_AddNumberToObject(j, "dont_fragment", test->settings->dont_fragment);
@ -2160,6 +2162,8 @@ get_parameters(struct iperf_test *test)
iperf_set_test_udp_counters_64bit(test, 1); iperf_set_test_udp_counters_64bit(test, 1);
if ((j_p = cJSON_GetObjectItem(j, "repeating_payload")) != NULL) if ((j_p = cJSON_GetObjectItem(j, "repeating_payload")) != NULL)
test->repeating_payload = 1; test->repeating_payload = 1;
if ((j_p = cJSON_GetObjectItem(j, "zerocopy")) != NULL)
test->zerocopy = j_p->valueint;
#if defined(HAVE_DONT_FRAGMENT) #if defined(HAVE_DONT_FRAGMENT)
if ((j_p = cJSON_GetObjectItem(j, "dont_fragment")) != NULL) if ((j_p = cJSON_GetObjectItem(j, "dont_fragment")) != NULL)
test->settings->dont_fragment = j_p->valueint; test->settings->dont_fragment = j_p->valueint;
@ -2676,6 +2680,7 @@ iperf_defaults(struct iperf_test *testp)
testp->settings->connect_timeout = -1; testp->settings->connect_timeout = -1;
testp->settings->rcv_timeout.secs = DEFAULT_NO_MSG_RCVD_TIMEOUT / SEC_TO_mS; testp->settings->rcv_timeout.secs = DEFAULT_NO_MSG_RCVD_TIMEOUT / SEC_TO_mS;
testp->settings->rcv_timeout.usecs = (DEFAULT_NO_MSG_RCVD_TIMEOUT % SEC_TO_mS) * mS_TO_US; testp->settings->rcv_timeout.usecs = (DEFAULT_NO_MSG_RCVD_TIMEOUT % SEC_TO_mS) * mS_TO_US;
testp->zerocopy = 0;
memset(testp->cookie, 0, COOKIE_SIZE); memset(testp->cookie, 0, COOKIE_SIZE);
@ -2963,6 +2968,7 @@ iperf_reset_test(struct iperf_test *test)
test->settings->mss = 0; test->settings->mss = 0;
test->settings->tos = 0; test->settings->tos = 0;
test->settings->dont_fragment = 0; test->settings->dont_fragment = 0;
test->zerocopy = 0;
#if defined(HAVE_SSL) #if defined(HAVE_SSL)
if (test->settings->authtoken) { if (test->settings->authtoken) {