MINOR: quic: Do not retransmit frames from coalesced packets

Add QUIC_FL_TX_PACKET_COALESCED flag to mark a TX packet as coalesced with others
to build a datagram.
Ensure we do not directly retransmit frames from such coalesced packets. They must
be retransmitted from their packet number spaces to avoid duplications.
This commit is contained in:
Frédéric Lécaille 2022-04-21 17:58:46 +02:00 committed by Amaury Denoyelle
parent b917191817
commit b44cbc68a6
2 changed files with 7 additions and 3 deletions

View File

@ -518,6 +518,8 @@ struct quic_rx_strm_frm {
#define QUIC_FL_TX_PACKET_CC (1UL << 2) #define QUIC_FL_TX_PACKET_CC (1UL << 2)
/* Flag a sent packet as containg an ACK frame */ /* Flag a sent packet as containg an ACK frame */
#define QUIC_FL_TX_PACKET_ACK (1UL << 3) #define QUIC_FL_TX_PACKET_ACK (1UL << 3)
/* Flag a sent packet as being coalesced to another one in the same datagram */
#define QUIC_FL_TX_PACKET_COALESCED (1UL << 4)
/* Structure to store enough information about TX QUIC packets. */ /* Structure to store enough information about TX QUIC packets. */
struct quic_tx_packet { struct quic_tx_packet {

View File

@ -2339,7 +2339,7 @@ static void qc_prep_fast_retrans(struct quic_enc_level *qel,
/* Skip the empty packet (they have already been retransmitted) */ /* Skip the empty packet (they have already been retransmitted) */
while (node) { while (node) {
pkt = eb64_entry(&node->node, struct quic_tx_packet, pn_node); pkt = eb64_entry(&node->node, struct quic_tx_packet, pn_node);
if (!LIST_ISEMPTY(&pkt->frms)) if (!LIST_ISEMPTY(&pkt->frms) && !(pkt->flags & QUIC_FL_TX_PACKET_COALESCED))
break; break;
node = eb64_next(node); node = eb64_next(node);
} }
@ -2395,7 +2395,7 @@ static void qc_prep_hdshk_fast_retrans(struct quic_conn *qc)
/* Skip the empty packet (they have already been retransmitted) */ /* Skip the empty packet (they have already been retransmitted) */
while (node) { while (node) {
pkt = eb64_entry(&node->node, struct quic_tx_packet, pn_node); pkt = eb64_entry(&node->node, struct quic_tx_packet, pn_node);
if (!LIST_ISEMPTY(&pkt->frms)) if (!LIST_ISEMPTY(&pkt->frms) && !(pkt->flags & QUIC_FL_TX_PACKET_COALESCED))
break; break;
node = eb64_next(node); node = eb64_next(node);
} }
@ -2961,8 +2961,10 @@ static int qc_prep_pkts(struct quic_conn *qc, struct qring *qr,
if (!first_pkt) if (!first_pkt)
first_pkt = cur_pkt; first_pkt = cur_pkt;
/* Attach the current one to the previous one */ /* Attach the current one to the previous one */
if (prv_pkt) if (prv_pkt) {
prv_pkt->next = cur_pkt; prv_pkt->next = cur_pkt;
cur_pkt->flags |= QUIC_FL_TX_PACKET_COALESCED;
}
/* Let's say we have to build a new dgram */ /* Let's say we have to build a new dgram */
prv_pkt = NULL; prv_pkt = NULL;
dglen += cur_pkt->len; dglen += cur_pkt->len;