gfphoenix78 commented on code in PR #1467:
URL: https://github.com/apache/cloudberry/pull/1467#discussion_r2587720188
##########
contrib/udp2/ic_common/udp2/ic_udp2_internal.hpp:
##########
@@ -434,6 +455,58 @@ ic_bswap32(uint32 x)
((x >> 24) & 0x000000ff);
}
+#define TIMEOUT_Z
+#define RTT_SHIFT_ALPHA (3) /* srtt (0.125) */
+#define LOSS_THRESH (3) /* Packet loss triggers Karn */
+#define RTO_MIN (5000) /* MIN RTO(ms) */
+#define RTO_MAX (100000) /* MAX RTO(ms) */
+#define UDP_INFINITE_SSTHRESH 0x7fffffff
+
+#define SEC_TO_USEC(t) ((t) * 1000000)
+#define SEC_TO_MSEC(t) ((t) * 1000)
+#define MSEC_TO_USEC(t) ((t) * 1000)
+#define USEC_TO_SEC(t) ((t) / 1000000)
+#define TIME_TICK (1000000/HZ)/* in us */
+
+#define UDP_INITIAL_RTO (MSEC_TO_USEC(200))
+#define UDP_DEFAULT_MSS 1460
+
+#define RTO_HASH (3000)
+
+#define UDP_SEQ_LT(a,b) ((int32_t)((a)-(b)) < 0)
+#define UDP_SEQ_LEQ(a,b) ((int32_t)((a)-(b)) <= 0)
+#define UDP_SEQ_GT(a,b) ((int32_t)((a)-(b)) > 0)
+#define UDP_SEQ_GEQ(a,b) ((int32_t)((a)-(b)) >= 0)
+
+#ifndef MAX
+#define MAX(a, b) ((a)>(b)?(a):(b))
+#endif
+#ifndef MIN
+#define MIN(a, b) ((a)<(b)?(a):(b))
+#endif
Review Comment:
use std::max and std::min?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]