Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754588AbbGFSqi (ORCPT ); Mon, 6 Jul 2015 14:46:38 -0400 Received: from mail-qk0-f182.google.com ([209.85.220.182]:33111 "EHLO mail-qk0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752304AbbGFSqf (ORCPT ); Mon, 6 Jul 2015 14:46:35 -0400 Message-ID: <559ACD08.1080902@gmail.com> Date: Mon, 06 Jul 2015 14:46:32 -0400 From: Vlad Yasevich User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Vitaly Andrianov , 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 References: <1436204245-21645-1-git-send-email-vitalya@ti.com> In-Reply-To: <1436204245-21645-1-git-send-email-vitalya@ti.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2478 Lines: 66 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 > --- > 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 > }; > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/