anchao commented on code in PR #9262:
URL: https://github.com/apache/nuttx/pull/9262#discussion_r1193124467
##########
net/tcp/tcp.h:
##########
@@ -71,7 +71,7 @@
# define TCP_WBPKTLEN(wrb) ((wrb)->wb_iob->io_pktlen)
# define TCP_WBSENT(wrb) ((wrb)->wb_sent)
# define TCP_WBNRTX(wrb) ((wrb)->wb_nrtx)
-#ifdef CONFIG_NET_TCP_FAST_RETRANSMIT
+#if defined(CONFIG_NET_TCP_FAST_RETRANSMIT) &&
!defined(CONFIG_NET_TCP_CC_NEWRENO)
# define TCP_WBNACK(wrb) ((wrb)->wb_nack)
Review Comment:
Should we reuse the nack from connection instance and remove this member?
##########
net/tcp/tcp_send_buffered.c:
##########
@@ -614,11 +619,12 @@ static uint16_t psock_send_eventhandler(FAR struct
net_driver_s *dev,
/* Do fast retransmit */
rexmitno = ackno;
-#endif
-
+#if !defined(CONFIG_NET_TCP_CC_NEWRENO)
Review Comment:
ifndef
##########
net/tcp/tcp_cc.c:
##########
@@ -0,0 +1,293 @@
+/****************************************************************************
+ * net/tcp/tcp_cc.c
+ * Handling TCP congestion control
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <debug.h>
+
+#include "tcp/tcp.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Calculate the Initial Window, also used as Restart Window
+ * RFC5681 Section 3.1 specifies the default conservative values.
+ */
+
+#define CC_INIT_CWND(cwnd, mss) \
+ do { \
+ if ((mss) > 2190) \
+ { \
+ (cwnd) = 2 * (mss); \
+ } \
+ else if ((mss) > 1095) \
Review Comment:
ditto
##########
net/tcp/tcp_cc.c:
##########
@@ -0,0 +1,293 @@
+/****************************************************************************
+ * net/tcp/tcp_cc.c
+ * Handling TCP congestion control
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <debug.h>
+
+#include "tcp/tcp.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Calculate the Initial Window, also used as Restart Window
+ * RFC5681 Section 3.1 specifies the default conservative values.
+ */
+
+#define CC_INIT_CWND(cwnd, mss) \
+ do { \
+ if ((mss) > 2190) \
Review Comment:
magic number to marco
##########
net/tcp/tcp_send_buffered.c:
##########
@@ -584,6 +584,10 @@ static uint16_t psock_send_eventhandler(FAR struct
net_driver_s *dev,
}
else if (ackno == TCP_WBSEQNO(wrb))
{
+#ifdef CONFIG_NET_TCP_CC_NEWRENO
+ if ((flags & TCP_ACKDATA) != 0 &&
Review Comment:
why need to check TCP_ACKDATA?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]