From 463a5519df9d2f7c12f3e5c03832cb579fde6518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=B9=B310304955?= Date: Fri, 11 Sep 2026 15:56:52 +0800 Subject: [PATCH 1/2] Fix putIntoUnackQueueRing function logic for Intercontect interfaces:loss advance method --- contrib/interconnect/udp/ic_udpifc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib/interconnect/udp/ic_udpifc.c b/contrib/interconnect/udp/ic_udpifc.c index 0f23ecaad8e..77f3772eab6 100644 --- a/contrib/interconnect/udp/ic_udpifc.c +++ b/contrib/interconnect/udp/ic_udpifc.c @@ -7027,8 +7027,14 @@ putIntoUnackQueueRing(UnackQueueRing *uqr, ICBuffer *buf, uint64 expTime, uint64 } else if (diff < TIMER_SPAN_LOSS) { - diff = diff < TIMER_SPAN_LOSS ? TIMER_SPAN_LOSS : diff; + diff = TIMER_SPAN_LOSS; } + + idx = (uqr->idx + diff / TIMER_SPAN_LOSS) % UNACK_QUEUE_RING_SLOTS_NUM; + +#ifdef AMS_VERBOSE_LOGGING + write_log("PUTTW: curtime " UINT64_FORMAT " now " UINT64_FORMAT " (diff " UINT64_FORMAT ") expTime " UINT64_FORMAT " previdx %d, nowidx %d, nextidx %d", uqr->currentTime, now, diff, expTime, buf->unackQueueRingSlot, uqr->idx, idx); +#endif } else { @@ -7055,12 +7061,6 @@ putIntoUnackQueueRing(UnackQueueRing *uqr, ICBuffer *buf, uint64 expTime, uint64 #endif } - idx = (uqr->idx + diff / TIMER_SPAN) % UNACK_QUEUE_RING_SLOTS_NUM; - -#ifdef AMS_VERBOSE_LOGGING - write_log("PUTTW: curtime " UINT64_FORMAT " now " UINT64_FORMAT " (diff " UINT64_FORMAT ") expTime " UINT64_FORMAT " previdx %d, nowidx %d, nextidx %d", uqr->currentTime, now, diff, expTime, buf->unackQueueRingSlot, uqr->idx, idx); -#endif - buf->unackQueueRingSlot = idx; icBufferListAppend(&unack_queue_ring.slots[idx], buf); } From 651f37cc848c5892cf4678ac6b15c85ca82a6d21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=B9=B310304955?= Date: Fri, 11 Sep 2026 16:03:08 +0800 Subject: [PATCH 2/2] Fix putIntoUnackQueueRing function logic for Intercontect interfaces:loss advance method(udp2) --- contrib/udp2/ic_common/udp2/ic_udp2.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib/udp2/ic_common/udp2/ic_udp2.cpp b/contrib/udp2/ic_common/udp2/ic_udp2.cpp index ca001646151..f56e0198b46 100644 --- a/contrib/udp2/ic_common/udp2/ic_udp2.cpp +++ b/contrib/udp2/ic_common/udp2/ic_udp2.cpp @@ -3049,8 +3049,14 @@ putIntoUnackQueueRing(UnackQueueRing *uqr, ICBuffer *buf, uint64 expTime, uint64 } else if (diff < TIMER_SPAN_LOSS) { - diff = diff < TIMER_SPAN_LOSS ? TIMER_SPAN_LOSS : diff; + diff = TIMER_SPAN_LOSS; } + + idx = (uqr->idx + diff / TIMER_SPAN_LOSS) % UNACK_QUEUE_RING_SLOTS_NUM; + +#ifdef AMS_VERBOSE_LOGGING + LOG(INFO, "PUTTW: curtime %lu now %lu (diff %lu) expTime %lu previdx %d, nowidx %d, nextidx %d", uqr->currentTime, now, diff, expTime, buf->unackQueueRingSlot, uqr->idx, idx); +#endif } else { @@ -3077,12 +3083,6 @@ putIntoUnackQueueRing(UnackQueueRing *uqr, ICBuffer *buf, uint64 expTime, uint64 #endif } - idx = (uqr->idx + diff / TIMER_SPAN) % UNACK_QUEUE_RING_SLOTS_NUM; - -#ifdef AMS_VERBOSE_LOGGING - LOG(INFO, "PUTTW: curtime %lu now %lu (diff %lu) expTime %lu previdx %d, nowidx %d, nextidx %d", uqr->currentTime, now, diff, expTime, buf->unackQueueRingSlot, uqr->idx, idx); -#endif - buf->unackQueueRingSlot = idx; unack_queue_ring.slots[idx].append(buf); }