#define QUIC_FL_TX_PACKET_CC (1UL << 2)
/* Flag a sent packet as containg an ACK frame */
#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. */
struct quic_tx_packet {
/* Skip the empty packet (they have already been retransmitted) */
while (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;
node = eb64_next(node);
}
/* Skip the empty packet (they have already been retransmitted) */
while (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;
node = eb64_next(node);
}
if (!first_pkt)
first_pkt = cur_pkt;
/* Attach the current one to the previous one */
- if (prv_pkt)
+ if (prv_pkt) {
prv_pkt->next = cur_pkt;
+ cur_pkt->flags |= QUIC_FL_TX_PACKET_COALESCED;
+ }
/* Let's say we have to build a new dgram */
prv_pkt = NULL;
dglen += cur_pkt->len;