Skip to content

Commit 81feec7

Browse files
ZTE-EBASE王平10304955
andauthored
Fix putIntoUnackQueueRing function logic for Intercontect interfaces:loss advance method
Co-authored-by: 王平10304955 <wang.ping20@zte.com.cn>
1 parent 3f4c688 commit 81feec7

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎contrib/interconnect/udp/ic_udpifc.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7025,8 +7025,14 @@ putIntoUnackQueueRing(UnackQueueRing *uqr, ICBuffer *buf, uint64 expTime, uint64
70257025
}
70267026
else if (diff < TIMER_SPAN_LOSS)
70277027
{
7028-
diff = diff < TIMER_SPAN_LOSS ? TIMER_SPAN_LOSS : diff;
7028+
diff = TIMER_SPAN_LOSS;
70297029
}
7030+
7031+
idx = (uqr->idx + diff / TIMER_SPAN_LOSS) % UNACK_QUEUE_RING_SLOTS_NUM;
7032+
7033+
#ifdef AMS_VERBOSE_LOGGING
7034+
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);
7035+
#endif
70307036
}
70317037
else
70327038
{
@@ -7053,12 +7059,6 @@ putIntoUnackQueueRing(UnackQueueRing *uqr, ICBuffer *buf, uint64 expTime, uint64
70537059
#endif
70547060
}
70557061

7056-
idx = (uqr->idx + diff / TIMER_SPAN) % UNACK_QUEUE_RING_SLOTS_NUM;
7057-
7058-
#ifdef AMS_VERBOSE_LOGGING
7059-
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);
7060-
#endif
7061-
70627062
buf->unackQueueRingSlot = idx;
70637063
icBufferListAppend(&unack_queue_ring.slots[idx], buf);
70647064
}

‎contrib/udp2/ic_common/udp2/ic_udp2.cpp‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3049,8 +3049,14 @@ putIntoUnackQueueRing(UnackQueueRing *uqr, ICBuffer *buf, uint64 expTime, uint64
30493049
}
30503050
else if (diff < TIMER_SPAN_LOSS)
30513051
{
3052-
diff = diff < TIMER_SPAN_LOSS ? TIMER_SPAN_LOSS : diff;
3052+
diff = TIMER_SPAN_LOSS;
30533053
}
3054+
3055+
idx = (uqr->idx + diff / TIMER_SPAN_LOSS) % UNACK_QUEUE_RING_SLOTS_NUM;
3056+
3057+
#ifdef AMS_VERBOSE_LOGGING
3058+
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);
3059+
#endif
30543060
}
30553061
else
30563062
{
@@ -3077,12 +3083,6 @@ putIntoUnackQueueRing(UnackQueueRing *uqr, ICBuffer *buf, uint64 expTime, uint64
30773083
#endif
30783084
}
30793085

3080-
idx = (uqr->idx + diff / TIMER_SPAN) % UNACK_QUEUE_RING_SLOTS_NUM;
3081-
3082-
#ifdef AMS_VERBOSE_LOGGING
3083-
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);
3084-
#endif
3085-
30863086
buf->unackQueueRingSlot = idx;
30873087
unack_queue_ring.slots[idx].append(buf);
30883088
}

0 commit comments

Comments
 (0)