MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bbr_do_send_accounting

Function bbr_do_send_accounting

freebsd/netinet/tcp_stacks/bbr.c:11821–11886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11819}
11820
11821static inline void
11822bbr_do_send_accounting(struct tcpcb *tp, struct tcp_bbr *bbr, struct bbr_sendmap *rsm, int32_t len, int32_t error)
11823{
11824 if (error) {
11825 bbr_do_error_accounting(tp, bbr, rsm, len, error);
11826 return;
11827 }
11828 if (rsm) {
11829 if (rsm->r_flags & BBR_TLP) {
11830 /*
11831 * TLP should not count in retran count, but in its
11832 * own bin
11833 */
11834#ifdef NETFLIX_STATS
11835 tp->t_sndtlppack++;
11836 tp->t_sndtlpbyte += len;
11837 KMOD_TCPSTAT_INC(tcps_tlpresends);
11838 KMOD_TCPSTAT_ADD(tcps_tlpresend_bytes, len);
11839#endif
11840 } else {
11841 /* Retransmit */
11842 tp->t_sndrexmitpack++;
11843 KMOD_TCPSTAT_INC(tcps_sndrexmitpack);
11844 KMOD_TCPSTAT_ADD(tcps_sndrexmitbyte, len);
11845#ifdef STATS
11846 stats_voi_update_abs_u32(tp->t_stats, VOI_TCP_RETXPB,
11847 len);
11848#endif
11849 }
11850 /*
11851 * Logs in 0 - 8, 8 is all non probe_bw states 0-7 is
11852 * sub-state
11853 */
11854 counter_u64_add(bbr_state_lost[rsm->r_bbr_state], len);
11855 if (bbr->rc_bbr_state != BBR_STATE_PROBE_BW) {
11856 /* Non probe_bw log in 1, 2, or 4. */
11857 counter_u64_add(bbr_state_resend[bbr->rc_bbr_state], len);
11858 } else {
11859 /*
11860 * Log our probe state 3, and log also 5-13 to show
11861 * us the recovery sub-state for the send. This
11862 * means that 3 == (5+6+7+8+9+10+11+12+13)
11863 */
11864 counter_u64_add(bbr_state_resend[BBR_STATE_PROBE_BW], len);
11865 counter_u64_add(bbr_state_resend[(bbr_state_val(bbr) + 5)], len);
11866 }
11867 /* Place in both 16's the totals of retransmitted */
11868 counter_u64_add(bbr_state_lost[16], len);
11869 counter_u64_add(bbr_state_resend[16], len);
11870 /* Place in 17's the total sent */
11871 counter_u64_add(bbr_state_resend[17], len);
11872 counter_u64_add(bbr_state_lost[17], len);
11873
11874 } else {
11875 /* New sends */
11876 KMOD_TCPSTAT_INC(tcps_sndpack);
11877 KMOD_TCPSTAT_ADD(tcps_sndbyte, len);
11878 /* Place in 17's the total sent */

Callers 1

bbr.cFile · 0.85

Calls 5

bbr_do_error_accountingFunction · 0.85
stats_voi_update_abs_u32Function · 0.85
bbr_state_valFunction · 0.85
stats_voi_update_abs_u64Function · 0.85
counter_u64_addFunction · 0.50

Tested by

no test coverage detected