Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions usrsctplib/netinet/sctp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -7812,7 +7812,8 @@ sctp_move_to_outqueue(struct sctp_tcb *stcb,
int *giveup,
int eeor_mode,
int *bail,
int so_locked)
int so_locked,
int cwnd_almost_full)
{
/* Move from the stream to the send_queue keeping track of the total */
struct sctp_association *asoc;
Expand Down Expand Up @@ -7970,7 +7971,8 @@ sctp_move_to_outqueue(struct sctp_tcb *stcb,
rcv_flags |= SCTP_DATA_UNORDERED;
}
if (SCTP_BASE_SYSCTL(sctp_enable_sack_immediately) &&
(sp->sinfo_flags & SCTP_EOF) == SCTP_EOF) {
((sp->sinfo_flags & SCTP_EOF) == SCTP_EOF ||
cwnd_almost_full > 0)) {
rcv_flags |= SCTP_DATA_SACK_IMMEDIATELY;
}
/* clear out the chunk before setting up */
Expand Down Expand Up @@ -8275,7 +8277,7 @@ sctp_move_to_outqueue(struct sctp_tcb *stcb,
static void
sctp_fill_outqueue(struct sctp_tcb *stcb, struct sctp_nets *net,
uint32_t frag_point, int eeor_mode, int *quit_now,
int so_locked)
int so_locked, int cwnd_almost_full)
{
struct sctp_association *asoc;
struct sctp_stream_out *strq;
Expand Down Expand Up @@ -8317,7 +8319,7 @@ sctp_fill_outqueue(struct sctp_tcb *stcb, struct sctp_nets *net,
while ((space_left > 0) && (strq != NULL)) {
moved = sctp_move_to_outqueue(stcb, net, strq, space_left,
frag_point, &giveup, eeor_mode,
&bail, so_locked);
&bail, so_locked, cwnd_almost_full);
if ((giveup != 0) || (bail != 0)) {
break;
}
Expand Down Expand Up @@ -8433,6 +8435,7 @@ sctp_med_chunk_output(struct sctp_inpcb *inp,
int override_ok = 1;
int skip_fill_up = 0;
int data_auth_reqd = 0;
int cwnd_almost_full = 0;
/* JRS 5/14/07 - Add flag for whether a heartbeat is sent to
the destination. */
int quit_now = 0;
Expand Down Expand Up @@ -8560,10 +8563,13 @@ sctp_med_chunk_output(struct sctp_inpcb *inp,
}
continue;
}
if (net->flight_size + net->mtu >= net->cwnd) {
cwnd_almost_full = 1;
}
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) {
sctp_log_cwnd(stcb, net, 4, SCTP_CWND_LOG_FILL_OUTQ_CALLED);
}
sctp_fill_outqueue(stcb, net, frag_point, eeor_mode, &quit_now, so_locked);
sctp_fill_outqueue(stcb, net, frag_point, eeor_mode, &quit_now, so_locked, cwnd_almost_full);
if (quit_now) {
/* memory alloc failure */
no_data_chunks = 1;
Expand Down