| 11819 | } |
| 11820 | |
| 11821 | static inline void |
| 11822 | bbr_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 */ |
no test coverage detected