Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/sctp_usrreq.c
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | |||||
sctp_init(void) | sctp_init(void) | ||||
{ | { | ||||
u_long sb_max_adj; | u_long sb_max_adj; | ||||
/* Initialize and modify the sysctled variables */ | /* Initialize and modify the sysctled variables */ | ||||
sctp_init_sysctls(); | sctp_init_sysctls(); | ||||
if ((nmbclusters / 8) > SCTP_ASOC_MAX_CHUNKS_ON_QUEUE) | if ((nmbclusters / 8) > SCTP_ASOC_MAX_CHUNKS_ON_QUEUE) | ||||
SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue) = (nmbclusters / 8); | SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue) = (nmbclusters / 8); | ||||
/* | /* | ||||
markj: I forgot to add the code to register SCTP for IPv6, will fix. | |||||
* Allow a user to take no more than 1/2 the number of clusters or | * Allow a user to take no more than 1/2 the number of clusters or | ||||
* the SB_MAX, whichever is smaller, for the send window. | * the SB_MAX, whichever is smaller, for the send window. | ||||
*/ | */ | ||||
sb_max_adj = (u_long)((u_quad_t)(SB_MAX) * MCLBYTES / (MSIZE + MCLBYTES)); | sb_max_adj = (u_long)((u_quad_t)(SB_MAX) * MCLBYTES / (MSIZE + MCLBYTES)); | ||||
SCTP_BASE_SYSCTL(sctp_sendspace) = min(sb_max_adj, | SCTP_BASE_SYSCTL(sctp_sendspace) = min(sb_max_adj, | ||||
(((uint32_t)nmbclusters / 2) * SCTP_DEFAULT_MAXSEGMENT)); | (((uint32_t)nmbclusters / 2) * SCTP_DEFAULT_MAXSEGMENT)); | ||||
/* | /* | ||||
* Now for the recv window, should we take the same amount? or | * Now for the recv window, should we take the same amount? or | ||||
Show All 12 Lines | #endif | ||||
SCTP_BASE_VAR(eh_tag) = EVENTHANDLER_REGISTER(rt_addrmsg, | SCTP_BASE_VAR(eh_tag) = EVENTHANDLER_REGISTER(rt_addrmsg, | ||||
sctp_addr_change_event_handler, NULL, EVENTHANDLER_PRI_FIRST); | sctp_addr_change_event_handler, NULL, EVENTHANDLER_PRI_FIRST); | ||||
} | } | ||||
#ifdef VIMAGE | #ifdef VIMAGE | ||||
static void | static void | ||||
sctp_finish(void *unused __unused) | sctp_finish(void *unused __unused) | ||||
{ | { | ||||
EVENTHANDLER_DEREGISTER(rt_addrmsg, SCTP_BASE_VAR(eh_tag)); | |||||
sctp_pcb_finish(); | sctp_pcb_finish(); | ||||
} | } | ||||
VNET_SYSUNINIT(sctp, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, sctp_finish, NULL); | VNET_SYSUNINIT(sctp, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, sctp_finish, NULL); | ||||
#endif | #endif | ||||
void | void | ||||
sctp_pathmtu_adjustment(struct sctp_tcb *stcb, uint16_t nxtsz) | sctp_pathmtu_adjustment(struct sctp_tcb *stcb, uint16_t nxtsz) | ||||
{ | { | ||||
struct sctp_tmit_chunk *chk; | struct sctp_tmit_chunk *chk; | ||||
uint16_t overhead; | uint16_t overhead; | ||||
Show All 18 Lines | if ((chk->send_size + overhead) > nxtsz) { | ||||
*/ | */ | ||||
chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; | chk->flags |= CHUNK_FLAGS_FRAGMENT_OK; | ||||
if (chk->sent < SCTP_DATAGRAM_RESEND) { | if (chk->sent < SCTP_DATAGRAM_RESEND) { | ||||
sctp_flight_size_decrease(chk); | sctp_flight_size_decrease(chk); | ||||
sctp_total_flight_decrease(stcb, chk); | sctp_total_flight_decrease(stcb, chk); | ||||
chk->sent = SCTP_DATAGRAM_RESEND; | chk->sent = SCTP_DATAGRAM_RESEND; | ||||
sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); | sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); | ||||
chk->rec.data.doing_fast_retransmit = 0; | chk->rec.data.doing_fast_retransmit = 0; | ||||
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { | if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { | ||||
Not Done Inline ActionsI would prefer to have almost all this stuff in a separate file, sctp_module.c, for example. tuexen: I would prefer to have almost all this stuff in a separate file, `sctp_module.c`, for example. | |||||
Done Inline ActionsOk markj: Ok | |||||
sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_PMTU, | sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_PMTU, | ||||
chk->whoTo->flight_size, | chk->whoTo->flight_size, | ||||
chk->book_size, | chk->book_size, | ||||
(uint32_t)(uintptr_t)chk->whoTo, | (uint32_t)(uintptr_t)chk->whoTo, | ||||
chk->rec.data.tsn); | chk->rec.data.tsn); | ||||
} | } | ||||
/* Clear any time so NO RTT is being done */ | /* Clear any time so NO RTT is being done */ | ||||
if (chk->do_rtt == 1) { | if (chk->do_rtt == 1) { | ||||
▲ Show 20 Lines • Show All 7,438 Lines • Show Last 20 Lines |
I forgot to add the code to register SCTP for IPv6, will fix.