Add ->sent_pkt counter to quic_conn struct to count the packet at QUIC connection
level. Then, when the connection is released, the ->sent_pkt counter value
is added to the one for the listener.
Must be backported to 2.7.
long long socket_full; /* total number of EAGAIN errors on sendto() calls */
long long sendto_err; /* total number of errors on sendto() calls, EAGAIN excepted */
long long sendto_err_unknown; /* total number of errors on sendto() calls which are currently not supported */
+ long long sent_pkt; /* total number of sent packets */
long long lost_pkt; /* total number of lost packets */
long long conn_migration_done; /* total number of connection migration handled */
/* Streams related counters */
QUIC_ST_SOCKET_FULL,
QUIC_ST_SENDTO_ERR,
QUIC_ST_SENDTO_ERR_UNKNWN,
+ QUIC_ST_SENT_PACKET,
QUIC_ST_LOST_PACKET,
QUIC_ST_TOO_SHORT_INITIAL_DGRAM,
QUIC_ST_RETRY_SENT,
long long socket_full; /* total number of EAGAIN errors on sendto() calls */
long long sendto_err; /* total number of errors on sendto() calls, EAGAIN excepted */
long long sendto_err_unknown; /* total number of errors on sendto() calls which are currently not supported */
+ long long sent_pkt; /* total number of sent packets */
long long lost_pkt; /* total number of lost packets */
long long too_short_initial_dgram; /* total number of too short datagrams with Initial packets */
long long retry_sent; /* total number of Retry sent */
* Initial packets to at least the smallest allowed maximum datagram size of
* 1200 bytes.
*/
+ qc->cntrs.sent_pkt++;
BUG_ON_HOT(pkt->type == QUIC_PACKET_TYPE_INITIAL &&
(pkt->flags & QUIC_FL_TX_PACKET_ACK_ELICITING) &&
dglen < QUIC_INITIAL_PACKET_MINLEN);
HA_ATOMIC_ADD(&qc->prx_counters->socket_full, qc->cntrs.socket_full);
HA_ATOMIC_ADD(&qc->prx_counters->sendto_err, qc->cntrs.sendto_err);
HA_ATOMIC_ADD(&qc->prx_counters->sendto_err_unknown, qc->cntrs.sendto_err_unknown);
+ HA_ATOMIC_ADD(&qc->prx_counters->sent_pkt, qc->cntrs.sent_pkt);
HA_ATOMIC_ADD(&qc->prx_counters->lost_pkt, qc->path->loss.nb_lost_pkt);
HA_ATOMIC_ADD(&qc->prx_counters->conn_migration_done, qc->cntrs.conn_migration_done);
/* Stream related counters */
.desc = "Total number of error on sendto() calls, EAGAIN excepted" },
[QUIC_ST_SENDTO_ERR_UNKNWN] = { .name = "quic_sendto_err_unknwn",
.desc = "Total number of error on sendto() calls not explicitly listed" },
+ [QUIC_ST_SENT_PACKET] = { .name = "quic_sent_pkt",
+ .desc = "Total number of sent packets" },
[QUIC_ST_LOST_PACKET] = { .name = "quic_lost_pkt",
.desc = "Total number of lost sent packets" },
[QUIC_ST_TOO_SHORT_INITIAL_DGRAM] = { .name = "quic_too_short_dgram",
stats[QUIC_ST_SOCKET_FULL] = mkf_u64(FN_COUNTER, counters->socket_full);
stats[QUIC_ST_SENDTO_ERR] = mkf_u64(FN_COUNTER, counters->sendto_err);
stats[QUIC_ST_SENDTO_ERR_UNKNWN] = mkf_u64(FN_COUNTER, counters->sendto_err_unknown);
+ stats[QUIC_ST_SENT_PACKET] = mkf_u64(FN_COUNTER, counters->sent_pkt);
stats[QUIC_ST_LOST_PACKET] = mkf_u64(FN_COUNTER, counters->lost_pkt);
stats[QUIC_ST_TOO_SHORT_INITIAL_DGRAM] = mkf_u64(FN_COUNTER, counters->too_short_initial_dgram);
stats[QUIC_ST_RETRY_SENT] = mkf_u64(FN_COUNTER, counters->retry_sent);