ndt-dev - [ndt-dev] [ndt] r995 committed - Cleanup set cwnd limit
Subject: NDT-DEV email list created
List archive
- From:
- To:
- Subject: [ndt-dev] [ndt] r995 committed - Cleanup set cwnd limit
- Date: Mon, 10 Mar 2014 13:46:35 +0000
Revision: 995
Author:
Date: Mon Mar 10 13:43:13 2014 UTC
Log: Cleanup set cwnd limit
http://code.google.com/p/ndt/source/detail?r=995
Modified:
/branches/aaron-tcp_stats_cleanup/src/test_c2s_srv.c
/branches/aaron-tcp_stats_cleanup/src/test_s2c_srv.c
/branches/aaron-tcp_stats_cleanup/src/testoptions.c
/branches/aaron-tcp_stats_cleanup/src/web100-util.c
/branches/aaron-tcp_stats_cleanup/src/web100srv.c
/branches/aaron-tcp_stats_cleanup/src/web100srv.h
=======================================
--- /branches/aaron-tcp_stats_cleanup/src/test_c2s_srv.c Mon Mar 10 13:42:11 2014 UTC
+++ /branches/aaron-tcp_stats_cleanup/src/test_c2s_srv.c Mon Mar 10 13:43:13 2014 UTC
@@ -304,7 +304,9 @@
mon_pipe[0], mon_pipe[1]);
// experimental code, delete when finished
- setCwndlimit(conn, group, agent, options);
+ if (options->limit > 0) {
+ tcp_stats_set_cwnd_limit(agent, conn, group, options->limit);
+ }
// Create C->S snaplog directories, and perform some initialization based on
// options
=======================================
--- /branches/aaron-tcp_stats_cleanup/src/test_s2c_srv.c Mon Mar 10 13:42:11 2014 UTC
+++ /branches/aaron-tcp_stats_cleanup/src/test_s2c_srv.c Mon Mar 10 13:43:13 2014 UTC
@@ -335,7 +335,10 @@
}
/* experimental code, delete when finished */
- setCwndlimit(conn, group, agent, options);
+ if (options->limit > 0) {
+ tcp_stats_set_cwnd_limit(agent, conn, group, options->limit);
+ }
+
/* End of test code */
// create directory to write web100 snaplog trace
=======================================
--- /branches/aaron-tcp_stats_cleanup/src/testoptions.c Mon Mar 10 13:42:42 2014 UTC
+++ /branches/aaron-tcp_stats_cleanup/src/testoptions.c Mon Mar 10 13:43:13 2014 UTC
@@ -411,61 +411,6 @@
close(monpipe_arr[0]);
close(monpipe_arr[1]);
}
-
-/**
- * Set Cwnd limit
- * @param connarg tcp_stat_connection pointer
- * @param group_arg tcp_stat group pointer
- * @param agentarg tcp_stat agent pointer
- * */
-void setCwndlimit(tcp_stat_connection connarg, tcp_stat_group* grouparg,
- tcp_stat_agent* agentarg, Options* optionsarg) {
-#if USE_WEB100
- web100_var *LimRwin, *yar;
-#elif USE_WEB10G
- struct estats_val yar;
-#endif
-
- u_int32_t limrwin_val;
-
- if (optionsarg->limit > 0) {
- log_print(1, "Setting Cwnd limit - ");
-
-#if USE_WEB100
- if (connarg != NULL) {
- log_println(1,
- "Got web100 connection pointer for recvsfd socket\n");
- char yuff[32];
- web100_agent_find_var_and_group(agentarg, "CurMSS", &grouparg,
- &yar);
- web100_raw_read(yar, connarg, yuff);
- log_println(1, "MSS = %s, multiplication factor = %d",
- web100_value_to_text(web100_get_var_type(yar), yuff),
- optionsarg->limit);
- limrwin_val = optionsarg->limit
- * (atoi(
- web100_value_to_text(web100_get_var_type(yar),
- yuff)));
- web100_agent_find_var_and_group(agentarg, "LimRwin", &grouparg,
- &LimRwin);
- log_print(1, "now write %d to limit the Receive window",
- limrwin_val);
- web100_raw_write(LimRwin, connarg, &limrwin_val);
-#elif USE_WEB10G
- if (connarg != -1) {
- log_println(1,
- "Got web10g connection for recvsfd socket\n");
- web10g_get_val(agentarg, connarg, "CurMSS", &yar);
- log_println(1, "MSS = %s, multiplication factor = %d",
- yar.uv32, optionsarg->limit);
- limrwin_val = optionsarg->limit * yar.uv32;
- log_print(1, "now write %d to limit the Receive window", limrwin_val);
- estats_write_var("LimRwin", limrwin_val, connarg, agentarg);
-#endif
- log_println(1, " --- Done");
- }
- }
-}
/**
* Check if receiver is clogged and use decision to temporarily
=======================================
--- /branches/aaron-tcp_stats_cleanup/src/web100-util.c Mon Mar 10 13:42:42 2014 UTC
+++ /branches/aaron-tcp_stats_cleanup/src/web100-util.c Mon Mar 10 13:43:13 2014 UTC
@@ -1177,3 +1177,30 @@
#endif
return;
}
+
+void tcp_stats_set_cwnd_limit(tcp_stat_agent *agent, tcp_stat_connection conn, tcp_stat_group* group, uint32_t limit) {
+ uint32_t limrwin_val;
+
+#if USE_WEB100
+ web100_var *LimRwin, *yar;
+ char yuff[24];
+
+ web100_agent_find_var_and_group(agent, "CurMSS", &group, &yar);
+ web100_raw_read(yar, conn, yuff);
+ limrwin_val = limit
+ * (atoi(
+ web100_value_to_text(web100_get_var_type(yar),
+ yuff)));
+ web100_agent_find_var_and_group(agent, "LimRwin", &group,
+ &LimRwin);
+ web100_raw_write(LimRwin, conn, &limrwin_val);
+#elif USE_WEB10G
+ struct estats_val yar;
+ web10g_get_val(agentarg, conn, "CurMSS", &yar);
+ limrwin_val = limit * yar.uv32;
+ estats_write_var("LimRwin", limrwin_val, conn, agent);
+#endif
+ return;
+}
+
+
=======================================
--- /branches/aaron-tcp_stats_cleanup/src/web100srv.c Mon Mar 10 13:42:11 2014 UTC
+++ /branches/aaron-tcp_stats_cleanup/src/web100srv.c Mon Mar 10 13:43:13 2014 UTC
@@ -882,11 +882,7 @@
int run_test(tcp_stat_agent* agent, int ctlsockfd, TestOptions* testopt,
char *test_suite) {
-#if USE_WEB100
tcp_stat_connection conn = NULL;
-#elif USE_WEB10G
- tcp_stat_connection conn = -1;
-#endif
char date[32]; // date indicator
char spds[4][256]; // speed "bin" array containing counters for speeds
char logstr1[4096], logstr2[1024]; // log
=======================================
--- /branches/aaron-tcp_stats_cleanup/src/web100srv.h Mon Mar 10 13:42:42 2014 UTC
+++ /branches/aaron-tcp_stats_cleanup/src/web100srv.h Mon Mar 10 13:43:13 2014 UTC
@@ -323,6 +323,9 @@
tcp_stat_log *tcp_stats_open_log(char *filename, tcp_stat_connection conn, tcp_stat_group *group);
void tcp_stats_close_log(tcp_stat_log *log);
+void tcp_stats_set_cwnd_limit(tcp_stat_agent *agent, tcp_stat_connection conn, tcp_stat_group* group, uint32_t limit);
+
+
int tcp_stat_autotune(int sock, tcp_stat_agent* agent, tcp_stat_connection cn);
void tcp_stat_middlebox(int sock, tcp_stat_agent* agent, tcp_stat_connection cn,
char *results, size_t results_strlen);
- [ndt-dev] [ndt] r995 committed - Cleanup set cwnd limit, ndt, 03/10/2014
Archive powered by MHonArc 2.6.16.