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

Function ctf_decay_count

freebsd/netinet/tcp_stacks/rack_bbr_common.c:895–919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

893}
894
895uint32_t
896ctf_decay_count(uint32_t count, uint32_t decay)
897{
898 /*
899 * Given a count, decay it by a set percentage. The
900 * percentage is in thousands i.e. 100% = 1000,
901 * 19.3% = 193.
902 */
903 uint64_t perc_count, decay_per;
904 uint32_t decayed_count;
905 if (decay > 1000) {
906 /* We don't raise it */
907 return (count);
908 }
909 perc_count = count;
910 decay_per = decay;
911 perc_count *= decay_per;
912 perc_count /= 1000;
913 /*
914 * So now perc_count holds the
915 * count decay value.
916 */
917 decayed_count = count - (uint32_t)perc_count;
918 return(decayed_count);
919}
920
921int32_t
922ctf_progress_timeout_check(struct tcpcb *tp, bool log)

Callers 1

rack_do_decayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected