From: Vlad Yasevich <vyasevich@gmail.com>
To: Vitaly Andrianov <vitalya@ti.com>,
nhorman@tuxdriver.com, davem@davemloft.net,
linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, m-karicheri2@ti.com
Subject: Re: [PATCH] sctp: Add counters for out data chunk discards
Date: Mon, 06 Jul 2015 14:46:32 -0400 [thread overview]
Message-ID: <559ACD08.1080902@gmail.com> (raw)
In-Reply-To: <1436204245-21645-1-git-send-email-vitalya@ti.com>
On 07/06/2015 01:37 PM, Vitaly Andrianov wrote:
> 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;
First, this is not the only case where a chunk is discarded on output. If you
are going to add an OUT_DATA_DISCARDS counter, you need to catch all such discards.
Second, in this particular case, you will count discarded messages, not chunks since
sctp_outq_tail is guaranteed to queue the whole message or none of it.
-vlad
>
> 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
> };
>
>
prev parent reply other threads:[~2015-07-06 18:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-06 17:37 [PATCH] sctp: Add counters for out data chunk discards Vitaly Andrianov
2015-07-06 18:46 ` Vlad Yasevich [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=559ACD08.1080902@gmail.com \
--to=vyasevich@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sctp@vger.kernel.org \
--cc=m-karicheri2@ti.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=vitalya@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).