aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsharath <sharathkumarboyanapally@gmail.com>2019-02-06 20:28:09 +0530
committersharath <sharathkumarboyanapally@gmail.com>2019-02-11 14:21:34 +0530
commitab0c198b32bebf85f88a241de8fab08f5653f90e (patch)
treed819c1adec9cf81d9114f1bdde2df6e560821645
parent840dc98676773c027e699bd6efc3793118a5f1ef (diff)
Fix: LWIP performance enhancement [iperf tool]
Change-Id: I46b12bcb3e40ef7af4038e3ba456a4b20b658740 Signed-off-by: sharath <sharathkumarboyanapally@gmail.com>
-rw-r--r--src/framework/log/nstack_log.c8
-rw-r--r--src/nSocket/nstack/event/select/nstack_select.c2
-rw-r--r--stacks/lwip_stack/lwip_src/api/spl_api_msg.c2
-rw-r--r--stacks/lwip_stack/lwip_src/common/stackxopts.h2
-rw-r--r--stacks/lwip_stack/release/lwip_helper_files/include/lwipopts.h10
-rwxr-xr-xstacks/lwip_stack/release/script/nstack_fun.sh7
-rw-r--r--stacks/lwip_stack/run_stackx.txt3
-rwxr-xr-xstacks/lwip_stack/vagrant/start_nstackMain.sh7
8 files changed, 35 insertions, 6 deletions
diff --git a/src/framework/log/nstack_log.c b/src/framework/log/nstack_log.c
index 6678996..483a10a 100644
--- a/src/framework/log/nstack_log.c
+++ b/src/framework/log/nstack_log.c
@@ -305,6 +305,10 @@ int nstack_log_init()
{
log_level = NSLOG_EMG;
}
+ else if (strcmp (pst_temp, "PERF") == 0)
+ {
+ ctrl_log_switch = 1;
+ }
else
{
log_level = NSLOG_ERR;
@@ -657,6 +661,10 @@ nstack_log_init_app ()
{
log_level = NSLOG_EMG;
}
+ else if (strcmp (pc_temp, "PERF") == 0)
+ {
+ ctrl_log_switch = 1;
+ }
else
{
log_level = NSLOG_ERR;
diff --git a/src/nSocket/nstack/event/select/nstack_select.c b/src/nSocket/nstack/event/select/nstack_select.c
index 930f1db..f61b326 100644
--- a/src/nSocket/nstack/event/select/nstack_select.c
+++ b/src/nSocket/nstack/event/select/nstack_select.c
@@ -601,7 +601,7 @@ void *
nstack_select_thread (void *arg)
{
-#define SELECT_SLEEP_TIME 800 //us
+#define SELECT_SLEEP_TIME 100 //us
i32 inx;
nstack_fd_set *readfd;
diff --git a/stacks/lwip_stack/lwip_src/api/spl_api_msg.c b/stacks/lwip_stack/lwip_src/api/spl_api_msg.c
index f437bce..b7ea24b 100644
--- a/stacks/lwip_stack/lwip_src/api/spl_api_msg.c
+++ b/stacks/lwip_stack/lwip_src/api/spl_api_msg.c
@@ -647,7 +647,7 @@ spl_sent_tcp (void *arg, struct tcp_pcb * pcb, u16_t len)
/* conn is already checked for NULL above with ASSERT */
/* If the queued byte- or pbuf-count drops below the configured low-water limit,
let select mark this pcb as writable again. */
- if (conn->snd_buf > TCP_SNDLOWAT)
+ if (pcb->snd_buf > TCP_SNDLOWAT)
{
conn->flags &= ~SPL_NETCONN_FLAG_CHECK_WRITESPACE;
if (((struct common_pcb *) conn->comm_pcb_data)->model == SOCKET_STACKX)
diff --git a/stacks/lwip_stack/lwip_src/common/stackxopts.h b/stacks/lwip_stack/lwip_src/common/stackxopts.h
index 15fc6b8..04ff67d 100644
--- a/stacks/lwip_stack/lwip_src/common/stackxopts.h
+++ b/stacks/lwip_stack/lwip_src/common/stackxopts.h
@@ -48,6 +48,6 @@ extern struct memory_statics memory_used_size[80];
#define SPL_TCP_HLEN 20
#define SPL_TCP_MAX_OPTION_LEN 40
#define SPL_FRAME_MTU 1500
-#define SPL_TCP_SEND_MAX_SEG_PER_MSG 5
+#define SPL_TCP_SEND_MAX_SEG_PER_MSG 25
#endif
diff --git a/stacks/lwip_stack/release/lwip_helper_files/include/lwipopts.h b/stacks/lwip_stack/release/lwip_helper_files/include/lwipopts.h
index 4b1cf4f..46c4af2 100644
--- a/stacks/lwip_stack/release/lwip_helper_files/include/lwipopts.h
+++ b/stacks/lwip_stack/release/lwip_helper_files/include/lwipopts.h
@@ -35,5 +35,13 @@
#define LWIP_TCP_KEEPALIVE 1
#define LWIP_TIMEVAL_PRIVATE 0
#define LWIP_COMPAT_MUTEX 1
-
+#ifdef TCP_MSS
+#undef TCP_MSS
+#endif
+#define TCP_MSS 1460
+#define TCP_WND (20 * TCP_MSS)
+#define TCP_SND_BUF (10 * TCP_MSS)
+#define TCP_SND_QUEUELEN ((20 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS))
+#define LWIP_WND_SCALE 1
+#define TCP_RCV_SCALE 7
#endif
diff --git a/stacks/lwip_stack/release/script/nstack_fun.sh b/stacks/lwip_stack/release/script/nstack_fun.sh
index fed3588..df62e1e 100755
--- a/stacks/lwip_stack/release/script/nstack_fun.sh
+++ b/stacks/lwip_stack/release/script/nstack_fun.sh
@@ -326,7 +326,12 @@ run_nStackMain()
local script_path=$(cd "$(dirname "$0")"; pwd)
export NSTACK_CONFIG_PATH=${script_path}/../configure
export LD_LIBRARY_PATH=${script_path}/lib64/:$LD_LIBRARY_PATH
- export NSTACK_LOG_ON=INF
+ if [ "$NSTACK_LOG_ON" = "PERF" ]
+ then
+ export NSTACK_LOG_ON=PERF
+ else
+ export NSTACK_LOG_ON=INF
+ fi
log $LINENO "$env NSTACK_CONFIG_PATH=$NSTACK_CONFIG_PATH"
log $LINENO "$env DPDK_TOOL_DIR=$DPDK_TOOL_DIR"
diff --git a/stacks/lwip_stack/run_stackx.txt b/stacks/lwip_stack/run_stackx.txt
index 71cdd20..dbc936e 100644
--- a/stacks/lwip_stack/run_stackx.txt
+++ b/stacks/lwip_stack/run_stackx.txt
@@ -43,6 +43,9 @@
#client
./vc_epoll -p 20000 -d {ser_ip} -a 10000 -s {client_ip} -l 200 -t 50000 -i 1000 -f 1 -r 20000 -n 1 -w 10 -u 10000 -e 10 -x 1
+ #perf
+ for better performance set environment variable NSTACK_LOG_ON=PERF before running nStakMain and app
+
#stop nStackMain:
================
cd dmm/stacks/lwip_stack/release
diff --git a/stacks/lwip_stack/vagrant/start_nstackMain.sh b/stacks/lwip_stack/vagrant/start_nstackMain.sh
index 674562a..fb25b6f 100755
--- a/stacks/lwip_stack/vagrant/start_nstackMain.sh
+++ b/stacks/lwip_stack/vagrant/start_nstackMain.sh
@@ -90,7 +90,12 @@ sudo mkdir -p /var/run/ip_module/
sudo mkdir -p /var/log/nStack/ip_module/
export LD_LIBRARY_PATH=$LIB_PATH
-export NSTACK_LOG_ON=DBG
+if [ "$NSTACK_LOG_ON" = "PERF" ]
+then
+ export NSTACK_LOG_ON=PERF
+else
+ export NSTACK_LOG_ON=DBG
+fi
cd $LWIP_BUILD_DIR/../release
bash -x ./stop_nstack.sh