Changeset View
Standalone View
sys/netinet/tcp_input.c
Show First 20 Lines • Show All 291 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
cc_ack_received(struct tcpcb *tp, struct tcphdr *th, uint16_t nsegs, | cc_ack_received(struct tcpcb *tp, struct tcphdr *th, uint16_t nsegs, | ||||
uint16_t type) | uint16_t type) | ||||
{ | { | ||||
INP_WLOCK_ASSERT(tp->t_inpcb); | INP_WLOCK_ASSERT(tp->t_inpcb); | ||||
tp->ccv->nsegs = nsegs; | tp->ccv->nsegs = nsegs; | ||||
tp->ccv->bytes_this_ack = BYTES_THIS_ACK(tp, th); | tp->ccv->bytes_this_ack = BYTES_THIS_ACK(tp, th); | ||||
if (tp->snd_cwnd <= tp->snd_wnd) | if ((tp->snd_cwnd <= tp->snd_wnd) && | ||||
(tp->snd_cwnd < (tcp_compute_pipe(tp) * 2))) | |||||
tp->ccv->flags |= CCF_CWND_LIMITED; | tp->ccv->flags |= CCF_CWND_LIMITED; | ||||
cc: Can save some parentheses like this:
if ((!V_tcp_do_newcwv && tp->snd_cwnd <= tp… | |||||
Done Inline Actionsleaving the brackets aroung the arithmetic evaluations to be clear about evaluation ordering, while removing other superfluous brackets here. rscheff: leaving the brackets aroung the arithmetic evaluations to be clear about evaluation ordering… | |||||
Done Inline ActionsNeed one more space of indent on the third line to indicate the third line is part of the second condition: (V_tcp_do_newcwv && (tp->snd_cwnd <= tp->snd_wnd) && cc: Need one more space of indent on the third line to indicate the third line is part of the… | |||||
Done Inline ActionsFBSD style guide states, to use only tab (8 space) first level indentation, and to break up any lengthy single line statement with 4 space 2nd level indentation. However, there is precedent to this, e.g. tcp_input.c:1635, 1835, 1853, 2371 and more (and couple ~1/3 few instances, where 2nd level indentation was done with one superfluous space). Since IMHO this does improve readability, will add this space. rscheff: FBSD style guide states, to use only tab (8 space) first level indentation, and to break up any… | |||||
else | else | ||||
tp->ccv->flags &= ~CCF_CWND_LIMITED; | tp->ccv->flags &= ~CCF_CWND_LIMITED; | ||||
if (type == CC_ACK) { | if (type == CC_ACK) { | ||||
if (tp->snd_cwnd > tp->snd_ssthresh) { | if (tp->snd_cwnd > tp->snd_ssthresh) { | ||||
tp->t_bytes_acked += min(tp->ccv->bytes_this_ack, | tp->t_bytes_acked += min(tp->ccv->bytes_this_ack, | ||||
nsegs * V_tcp_abc_l_var * tcp_maxseg(tp)); | nsegs * V_tcp_abc_l_var * tcp_maxseg(tp)); | ||||
if (tp->t_bytes_acked >= tp->snd_cwnd) { | if (tp->t_bytes_acked >= tp->snd_cwnd) { | ||||
▲ Show 20 Lines • Show All 3,565 Lines • Show Last 20 Lines |
Can save some parentheses like this: