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

Function bbr_log_output

freebsd/netinet/tcp_stacks/bbr.c:5911–6133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5909}
5910
5911static void
5912bbr_log_output(struct tcp_bbr *bbr, struct tcpcb *tp, struct tcpopt *to, int32_t len,
5913 uint32_t seq_out, uint8_t th_flags, int32_t err, uint32_t cts,
5914 struct mbuf *mb, int32_t * abandon, struct bbr_sendmap *hintrsm, uint32_t delay_calc,
5915 struct sockbuf *sb)
5916{
5917
5918 struct bbr_sendmap *rsm, *nrsm;
5919 register uint32_t snd_max, snd_una;
5920 uint32_t pacing_time;
5921 /*
5922 * Add to the RACK log of packets in flight or retransmitted. If
5923 * there is a TS option we will use the TS echoed, if not we will
5924 * grab a TS.
5925 *
5926 * Retransmissions will increment the count and move the ts to its
5927 * proper place. Note that if options do not include TS's then we
5928 * won't be able to effectively use the ACK for an RTT on a retran.
5929 *
5930 * Notes about r_start and r_end. Lets consider a send starting at
5931 * sequence 1 for 10 bytes. In such an example the r_start would be
5932 * 1 (starting sequence) but the r_end would be r_start+len i.e. 11.
5933 * This means that r_end is actually the first sequence for the next
5934 * slot (11).
5935 *
5936 */
5937 INP_WLOCK_ASSERT(tp->t_inpcb);
5938 if (err) {
5939 /*
5940 * We don't log errors -- we could but snd_max does not
5941 * advance in this case either.
5942 */
5943 return;
5944 }
5945 if (th_flags & TH_RST) {
5946 /*
5947 * We don't log resets and we return immediately from
5948 * sending
5949 */
5950 *abandon = 1;
5951 return;
5952 }
5953 snd_una = tp->snd_una;
5954 if (th_flags & (TH_SYN | TH_FIN) && (hintrsm == NULL)) {
5955 /*
5956 * The call to bbr_log_output is made before bumping
5957 * snd_max. This means we can record one extra byte on a SYN
5958 * or FIN if seq_out is adding more on and a FIN is present
5959 * (and we are not resending).
5960 */
5961 if ((th_flags & TH_SYN) && (tp->iss == seq_out))
5962 len++;
5963 if (th_flags & TH_FIN)
5964 len++;
5965 }
5966 if (SEQ_LEQ((seq_out + len), snd_una)) {
5967 /* Are sending an old segment to induce an ack (keep-alive)? */
5968 return;

Callers 1

bbr.cFile · 0.85

Calls 11

bbr_get_pacing_delayFunction · 0.85
bbr_allocFunction · 0.85
ctf_flight_sizeFunction · 0.85
bbr_state_valFunction · 0.85
bbr_update_entryFunction · 0.85
bbr_alloc_full_limitFunction · 0.85
bbr_update_rsmFunction · 0.85
bbr_clone_rsmFunction · 0.85
printfFunction · 0.50
panicFunction · 0.50

Tested by

no test coverage detected