Cycle every payload pattern per packet and always run both directions
This commit is contained in:
@@ -24,10 +24,14 @@ type txWorker struct {
|
||||
}
|
||||
|
||||
func (w *txWorker) run(done *atomic.Bool) {
|
||||
// The batch is not a multiple of the pattern count, so the pairing of pattern
|
||||
// to size rotates every pass rather than settling into a fixed one.
|
||||
bufs := make([][]byte, w.batch)
|
||||
pats := make([]int, w.batch)
|
||||
for i := range bufs {
|
||||
bufs[i] = make([]byte, w.spec.maxSize)
|
||||
w.spec.prefill(bufs[i])
|
||||
pats[i] = i % len(patterns)
|
||||
w.spec.prefill(bufs[i], pats[i])
|
||||
}
|
||||
hdrs, iovs := newMmsghdrs(bufs)
|
||||
sizes := make([]int, w.batch)
|
||||
@@ -44,7 +48,8 @@ func (w *txWorker) run(done *atomic.Bool) {
|
||||
si = 0
|
||||
}
|
||||
sizes[i] = size
|
||||
putHeader(bufs[i], w.spec.patIdx, w.stream, seq+uint64(i), size-minFrame, w.spec.crcFor[size])
|
||||
putHeader(bufs[i], pats[i], w.stream, seq+uint64(i), size-minFrame,
|
||||
w.spec.crcFor[pats[i]][size])
|
||||
iovs[i].Len = uint64(size)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user