All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sctp: Add counters for out data chunk discards
@ 2015-07-06 17:37 ` Vitaly Andrianov
  0 siblings, 0 replies; 4+ messages in thread
From: Vitaly Andrianov @ 2015-07-06 17:37 UTC (permalink / raw)
  To: vyasevich, nhorman, davem, linux-sctp, netdev, linux-kernel,
	m-karicheri2
  Cc: Vitaly Andrianov

This commit adds a MIB entry for out data chunk discards.
Number of outgoing SCTP DATA chunks for a SCTP association for which no
problems were encountered to prevent their transmission but were discarded.
Data chunks are discarded due to ungraceful closing of the SCTP
association.

Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
---
 include/net/sctp/sctp.h | 1 +
 net/sctp/outqueue.c     | 1 +
 net/sctp/proc.c         | 2 ++
 3 files changed, 4 insertions(+)

diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index ce13cf2..fd806ea 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -216,6 +216,7 @@ enum {
 	SCTP_MIB_IN_PKT_BACKLOG,
 	SCTP_MIB_IN_PKT_DISCARDS,
 	SCTP_MIB_IN_DATA_CHUNK_DISCARDS,
+	SCTP_MIB_OUT_DATA_CHUNK_DISCARDS,
 	__SCTP_MIB_MAX
 };
 
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index 7e8f0a1..dc1a40f 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -315,6 +315,7 @@ int sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk)
 		case SCTP_STATE_SHUTDOWN_RECEIVED:
 		case SCTP_STATE_SHUTDOWN_ACK_SENT:
 			/* Cannot send after transport endpoint shutdown */
+			SCTP_INC_STATS(net, SCTP_MIB_OUT_DATA_CHUNK_DISCARDS);
 			error = -ESHUTDOWN;
 			break;
 
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 0697eda..1a10b81 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -67,6 +67,8 @@ static const struct snmp_mib sctp_snmp_list[] = {
 	SNMP_MIB_ITEM("SctpInPktBacklog", SCTP_MIB_IN_PKT_BACKLOG),
 	SNMP_MIB_ITEM("SctpInPktDiscards", SCTP_MIB_IN_PKT_DISCARDS),
 	SNMP_MIB_ITEM("SctpInDataChunkDiscards", SCTP_MIB_IN_DATA_CHUNK_DISCARDS),
+	SNMP_MIB_ITEM("SctpOutDataChunkDiscards",
+		      SCTP_MIB_OUT_DATA_CHUNK_DISCARDS),
 	SNMP_MIB_SENTINEL
 };
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-06 18:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-06 17:37 [PATCH] sctp: Add counters for out data chunk discards Vitaly Andrianov
2015-07-06 17:37 ` Vitaly Andrianov
2015-07-06 18:46 ` Vlad Yasevich
2015-07-06 18:46   ` Vlad Yasevich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.