anchao commented on a change in pull request #4070:
URL: https://github.com/apache/incubator-nuttx/pull/4070#discussion_r663992243



##########
File path: net/tcp/Kconfig
##########
@@ -106,6 +106,27 @@ config NET_TCP_FAST_RETRANSMIT_WATERMARK
                        missing segment, without waiting for a retransmission 
timer to
                        expire.
 
+config NET_TCP_WINDOW_SCALE
+       bool "Enable TCP/IP Window Scale Option"
+       default n
+       ---help---
+               RFC1323:
+               2. TCP WINDOW SCALE OPTION
+                       The window scale extension expands the definition of 
the TCP
+                       window to 32 bits and then uses a scale factor to carry 
this 32-
+                       bit value in the 16-bit Window field of the TCP header 
(SEG.WND in
+                       RFC-793).
+
+if NET_TCP_WINDOW_SCALE
+
+config NET_TCP_WINDOW_SCALE_FACTOR
+       int "TCP/IP Window Scale Factor"
+       default 7

Review comment:
       I just noticed that most of the network configurations are 
CONFIG_IOB_BUFSIZE is greater than 128, so the scale factor is set to 7. is it 
better to set the default value to 0?

##########
File path: net/tcp/Kconfig
##########
@@ -106,6 +106,27 @@ config NET_TCP_FAST_RETRANSMIT_WATERMARK
                        missing segment, without waiting for a retransmission 
timer to
                        expire.
 
+config NET_TCP_WINDOW_SCALE
+       bool "Enable TCP/IP Window Scale Option"
+       default n
+       ---help---
+               RFC1323:
+               2. TCP WINDOW SCALE OPTION
+                       The window scale extension expands the definition of 
the TCP
+                       window to 32 bits and then uses a scale factor to carry 
this 32-
+                       bit value in the 16-bit Window field of the TCP header 
(SEG.WND in
+                       RFC-793).
+
+if NET_TCP_WINDOW_SCALE
+
+config NET_TCP_WINDOW_SCALE_FACTOR
+       int "TCP/IP Window Scale Factor"
+       default 7

Review comment:
       This factor only affects the sliding window size of receive and send, 
which does not help for performance. The window factor is best to be consistent 
with the iob buffer size,maybe we can calculate the scale from it.

##########
File path: net/tcp/Kconfig
##########
@@ -106,6 +106,27 @@ config NET_TCP_FAST_RETRANSMIT_WATERMARK
                        missing segment, without waiting for a retransmission 
timer to
                        expire.
 
+config NET_TCP_WINDOW_SCALE
+       bool "Enable TCP/IP Window Scale Option"
+       default n
+       ---help---
+               RFC1323:
+               2. TCP WINDOW SCALE OPTION
+                       The window scale extension expands the definition of 
the TCP
+                       window to 32 bits and then uses a scale factor to carry 
this 32-
+                       bit value in the 16-bit Window field of the TCP header 
(SEG.WND in
+                       RFC-793).
+
+if NET_TCP_WINDOW_SCALE
+
+config NET_TCP_WINDOW_SCALE_FACTOR
+       int "TCP/IP Window Scale Factor"
+       default 7

Review comment:
       Let us do this optimization in the next PR, I think maybe you have 
already thought of a better solution 

##########
File path: net/sixlowpan/sixlowpan_tcpsend.c
##########
@@ -258,7 +258,12 @@ static int sixlowpan_tcp_header(FAR struct tcp_conn_s 
*conn,
       /* Update the TCP received window based on I/O buffer availability */
 
       uint32_t rcvseq = tcp_getsequence(conn->rcvseq);
-      uint16_t recvwndo = tcp_get_recvwindow(dev, conn);
+      uint32_t recvwndo = tcp_get_recvwindow(dev, conn);
+
+      if (recvwndo > UINT16_MAX)
+        {
+          recvwndo = UINT16_MAX;
+        }
 

Review comment:
       Yes, the current sixlowpan stack does not support optdata:
   
https://github.com/apache/incubator-nuttx/blob/b901f22c27bb26630a1289605466b04b96707050/net/sixlowpan/sixlowpan_tcpsend.c#L231




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to