Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_subr.c
Show First 20 Lines • Show All 1,724 Lines • ▼ Show 20 Lines | CK_LIST_FOREACH(inp, &V_tcb, inp_list) { | ||||
* By holding INP_WLOCK here, we are assured | * By holding INP_WLOCK here, we are assured | ||||
* that the connection is not currently | * that the connection is not currently | ||||
* executing inside the CC module's functions | * executing inside the CC module's functions | ||||
* i.e. it is safe to make the switch back to | * i.e. it is safe to make the switch back to | ||||
* NewReno. | * NewReno. | ||||
*/ | */ | ||||
if (CC_ALGO(tp) == unload_algo) { | if (CC_ALGO(tp) == unload_algo) { | ||||
tmpalgo = CC_ALGO(tp); | tmpalgo = CC_ALGO(tp); | ||||
/* NewReno does not require any init. */ | |||||
CC_ALGO(tp) = &newreno_cc_algo; | |||||
if (tmpalgo->cb_destroy != NULL) | if (tmpalgo->cb_destroy != NULL) | ||||
tmpalgo->cb_destroy(tp->ccv); | tmpalgo->cb_destroy(tp->ccv); | ||||
KASSERT(CC_DATA(tp) == NULL, | |||||
("cc should have nullified ", | |||||
"cc_data in %s", __func__)); | |||||
/* NewReno shall internally init cc_data | |||||
lstewart: This comment shouldn't be ABE specific. Perhaps something along the lines of:
"NewReno may… | |||||
* if ABE sockopt is re-called. | |||||
*/ | |||||
CC_ALGO(tp) = &newreno_cc_algo; | |||||
} | } | ||||
} | } | ||||
INP_WUNLOCK(inp); | INP_WUNLOCK(inp); | ||||
} | } | ||||
INP_INFO_WUNLOCK(&V_tcbinfo); | INP_INFO_WUNLOCK(&V_tcbinfo); | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
} | } | ||||
VNET_LIST_RUNLOCK(); | VNET_LIST_RUNLOCK(); | ||||
▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | #ifdef TCPPCAP | ||||
/* Free the TCP PCAP queues. */ | /* Free the TCP PCAP queues. */ | ||||
tcp_pcap_drain(&(tp->t_inpkts)); | tcp_pcap_drain(&(tp->t_inpkts)); | ||||
tcp_pcap_drain(&(tp->t_outpkts)); | tcp_pcap_drain(&(tp->t_outpkts)); | ||||
#endif | #endif | ||||
/* Allow the CC algorithm to clean up after itself. */ | /* Allow the CC algorithm to clean up after itself. */ | ||||
if (CC_ALGO(tp)->cb_destroy != NULL) | if (CC_ALGO(tp)->cb_destroy != NULL) | ||||
CC_ALGO(tp)->cb_destroy(tp->ccv); | CC_ALGO(tp)->cb_destroy(tp->ccv); | ||||
KASSERT(CC_DATA(tp) == NULL, ("cc should have nullified cc_data in %s", | |||||
__func__)); | |||||
#ifdef TCP_HHOOK | #ifdef TCP_HHOOK | ||||
khelp_destroy_osd(tp->osd); | khelp_destroy_osd(tp->osd); | ||||
#endif | #endif | ||||
CC_ALGO(tp) = NULL; | CC_ALGO(tp) = NULL; | ||||
inp->inp_ppcb = NULL; | inp->inp_ppcb = NULL; | ||||
if (tp->t_timers->tt_draincnt == 0) { | if (tp->t_timers->tt_draincnt == 0) { | ||||
▲ Show 20 Lines • Show All 1,331 Lines • Show Last 20 Lines |
This comment shouldn't be ABE specific. Perhaps something along the lines of:
"NewReno may allocate memory on demand for certain stateful configuration as needed, but is coded in such a way as to never fail because of a memory allocation failure so that it can always act as a fail safe fallback."
Also, style(9) nit, multline comments always start/end with /* and */ on their own lines without any comment text.