Commit 602dbe5
committed
BUG/MEDIUM: quic: correct pacing perf by fixing qc_prep_pkts() return
qc_prep_pkts() is a QUIC transport level function which encodes one or
several datagrams in a buffer before sending them. It returns the number
of encoded datagram. This is especially important when pacing is used to
ensure to limit packet bursts.
This datagram accounting was not trivial as qc_prep_pkts() used several
code paths depending on the condition of the current encoded packet.
Thus, there were several places were the local variable dgram_cnt could
have been incremented. This was implemented by the following commit :
commit 5cb8f8a
MINOR: quic: support a max number of built packet per send iteration
However, there is a bug due to a missing increment when all frames from
the current QEL have been encoded. In this case, the encoding continue
in the same datagram to coalesce a futur packet. However, if this is the
last QEL, encoding loop will then break. As first_pkt is not NULL,
qc_txb_store() is called outside but dgram_cnt is yet not incremented.
In particular, this causes qc_prep_pkts() to return 0 when there is only
small STREAM frames to emit for application QEL. In qc_send(), this is
interpreted as a value which prevents further emission for the current
invokation. Thus, it may hurts performance, both without and with
pacing.
The most notable case where it is visible is when using cubic with
pacing without any burst with quic-cc-algo cubic(,1). In this case,
transfert bandwidth could sometimes fall dramatically for a particular
stream before returning to the normal on the next one.
No need to backport.1 parent 2ffea50 commit 602dbe5
1 file changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
| 647 | + | |
| 648 | + | |
647 | 649 | | |
648 | 650 | | |
649 | 651 | | |
| |||
696 | 698 | | |
697 | 699 | | |
698 | 700 | | |
699 | | - | |
700 | 701 | | |
701 | 702 | | |
702 | 703 | | |
| |||
766 | 767 | | |
767 | 768 | | |
768 | 769 | | |
769 | | - | |
770 | | - | |
771 | 770 | | |
772 | 771 | | |
773 | 772 | | |
| |||
781 | 780 | | |
782 | 781 | | |
783 | 782 | | |
784 | | - | |
785 | 783 | | |
786 | 784 | | |
787 | 785 | | |
| |||
0 commit comments