diff options
author | tuexen <tuexen@FreeBSD.org> | 2012-11-07 22:11:38 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2012-11-07 22:11:38 +0000 |
commit | 2e86daf6ac341d6133cfdfc77b6a2a4bf01172e5 (patch) | |
tree | 5fc728a115893eb242d7cb194eda516b9e5d30c0 /sys/netinet/sctputil.c | |
parent | 79b7e755b41a4f7e2a36e4a7c6122f35fba258eb (diff) | |
download | FreeBSD-src-2e86daf6ac341d6133cfdfc77b6a2a4bf01172e5.zip FreeBSD-src-2e86daf6ac341d6133cfdfc77b6a2a4bf01172e5.tar.gz |
Add per outgoing stream accounting for chunks in the send
and sent queue. This provides no functional change, but is
a preparation for an upcoming stream reset improvement.
Done with rrs@.
MFC after: 1 week
Diffstat (limited to 'sys/netinet/sctputil.c')
-rw-r--r-- | sys/netinet/sctputil.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index d636c28..72dc34e 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -3727,6 +3727,15 @@ sctp_report_all_outbound(struct sctp_tcb *stcb, uint16_t error, int holds_lock, TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); asoc->sent_queue_cnt--; + if (chk->sent != SCTP_DATAGRAM_NR_MARKED) { + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", chk->rec.data.stream_number); +#endif + } + } if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); sctp_ulp_notify(SCTP_NOTIFY_SENT_DG_FAIL, stcb, @@ -3743,6 +3752,13 @@ sctp_report_all_outbound(struct sctp_tcb *stcb, uint16_t error, int holds_lock, TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) { TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); asoc->send_queue_cnt--; + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", chk->rec.data.stream_number); +#endif + } if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, |