diff options
author | Michele Baldessari <michele@acksyn.org> | 2012-11-30 23:49:42 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-12-03 13:32:15 -0500 |
commit | 196d67593439b03088913227093e374235596e33 (patch) | |
tree | d8d1580673e3cf878d6db230bf86b71187bf3550 /net/sctp/output.c | |
parent | 96070ae4d08eefe62ac534904ce21a01e1a5c9c4 (diff) |
sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call
The current SCTP stack is lacking a mechanism to have per association
statistics. This is an implementation modeled after OpenSolaris'
SCTP_GET_ASSOC_STATS.
Userspace part will follow on lksctp if/when there is a general ACK on
this.
V4:
- Move ipackets++ before q->immediate.func() for consistency reasons
- Move sctp_max_rto() at the end of sctp_transport_update_rto() to avoid
returning bogus RTO values
- return asoc->rto_min when max_obs_rto value has not changed
V3:
- Increase ictrlchunks in sctp_assoc_bh_rcv() as well
- Move ipackets++ to sctp_inq_push()
- return 0 when no rto updates took place since the last call
V2:
- Implement partial retrieval of stat struct to cope for future expansion
- Kill the rtxpackets counter as it cannot be precise anyway
- Rename outseqtsns to outofseqtsns to make it clearer that these are out
of sequence unexpected TSNs
- Move asoc->ipackets++ under a lock to avoid potential miscounts
- Fold asoc->opackets++ into the already existing asoc check
- Kill unneeded (q->asoc) test when increasing rtxchunks
- Do not count octrlchunks if sending failed (SCTP_XMIT_OK != 0)
- Don't count SHUTDOWNs as SACKs
- Move SCTP_GET_ASSOC_STATS to the private space API
- Adjust the len check in sctp_getsockopt_assoc_stats() to allow for
future struct growth
- Move association statistics in their own struct
- Update idupchunks when we send a SACK with dup TSNs
- return min_rto in max_rto when RTO has not changed. Also return the
transport when max_rto last changed.
Signed-off: Michele Baldessari <michele@acksyn.org>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/output.c')
-rw-r--r-- | net/sctp/output.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/net/sctp/output.c b/net/sctp/output.c index 4e90188bf489..f5200a2ad852 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
@@ -311,6 +311,8 @@ static sctp_xmit_t __sctp_packet_append_chunk(struct sctp_packet *packet, | |||
311 | 311 | ||
312 | case SCTP_CID_SACK: | 312 | case SCTP_CID_SACK: |
313 | packet->has_sack = 1; | 313 | packet->has_sack = 1; |
314 | if (chunk->asoc) | ||
315 | chunk->asoc->stats.osacks++; | ||
314 | break; | 316 | break; |
315 | 317 | ||
316 | case SCTP_CID_AUTH: | 318 | case SCTP_CID_AUTH: |
@@ -584,11 +586,13 @@ int sctp_packet_transmit(struct sctp_packet *packet) | |||
584 | */ | 586 | */ |
585 | 587 | ||
586 | /* Dump that on IP! */ | 588 | /* Dump that on IP! */ |
587 | if (asoc && asoc->peer.last_sent_to != tp) { | 589 | if (asoc) { |
588 | /* Considering the multiple CPU scenario, this is a | 590 | asoc->stats.opackets++; |
589 | * "correcter" place for last_sent_to. --xguo | 591 | if (asoc->peer.last_sent_to != tp) |
590 | */ | 592 | /* Considering the multiple CPU scenario, this is a |
591 | asoc->peer.last_sent_to = tp; | 593 | * "correcter" place for last_sent_to. --xguo |
594 | */ | ||
595 | asoc->peer.last_sent_to = tp; | ||
592 | } | 596 | } |
593 | 597 | ||
594 | if (has_data) { | 598 | if (has_data) { |