Don't use avgDelay in interleaved mode

The interleaved mode's single packet set MUST always have 0 delay
for accurate rate.

Before latency code, the interleaved packet set was added implicitly
and had 0 delay. Latency code added explicit packet set and used
avgDelay for the set. The avgDelay was needed for the original algo
used to determine when to send ttag packets. That algo is no longer
used (ttag markers are now explicitly configured by AbstractPort).

Turbo still needs avgDelay for other use, but changes will be made in
Turbo code for that.
This commit is contained in:
Srivats P 2023-05-08 12:01:56 +05:30
parent 6f71844f7c
commit accc47fa34

View File

@ -715,19 +715,12 @@ int AbstractPort::updatePacketListInterleaved()
} }
} while ((sec < durSec) || ((sec == durSec) && (nsec < durNsec))); } while ((sec < durSec) || ((sec == durSec) && (nsec < durNsec)));
// XXX: Ideally, for interleaved mode, we have a single packet set and // XXX: For interleaved mode, we ALWAYS have a single packet set with
// the set's delay should be 0. // one repeat and 0n set loop delay
// However, Ttag and Turbo both use the set delay field to derive loopNextPacketSet(totalPkts, 1, 0, 0);
// the set's avg pps (needed for their own functionality), so we set the qDebug("Interleaved single PacketSet of size %lld, duration %llu.%09llu "
// avgDelay here instead of 0. "repeat 1 and delay 0",
long avgDelay = (lastPktTxSec*long(1e9) + lastPktTxNsec totalPkts, durSec, durNsec);
+ (durSec - lastPktTxSec)*long(1e9)
+ (durNsec - lastPktTxNsec))
/totalPkts;
loopNextPacketSet(totalPkts, 1, 0, avgDelay);
qDebug("Interleaved PacketSet of size %lld, duration %llu.%09llu "
"repeat 1 and avg delay %ldns",
totalPkts, durSec, durNsec, avgDelay);
// Reset working sched/counts before building the packet list // Reset working sched/counts before building the packet list
sec = nsec = 0; sec = nsec = 0;