From patchwork Tue Aug 25 07:36:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 32024 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 5CCB8B7B61 for ; Tue, 25 Aug 2009 17:40:29 +1000 (EST) Received: by ozlabs.org (Postfix) id 4EC78DDD0B; Tue, 25 Aug 2009 17:40:29 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id D7AFBDDD04 for ; Tue, 25 Aug 2009 17:40:28 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754584AbZHYHji (ORCPT ); Tue, 25 Aug 2009 03:39:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754403AbZHYHji (ORCPT ); Tue, 25 Aug 2009 03:39:38 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:59820 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1753994AbZHYHjh (ORCPT ); Tue, 25 Aug 2009 03:39:37 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 72907170044; Tue, 25 Aug 2009 15:39:37 +0800 (CST) Received: from fnst.cn.fujitsu.com (localhost.localdomain [127.0.0.1]) by tang.cn.fujitsu.com (8.13.1/8.13.1) with ESMTP id n7P7n1Es004838; Tue, 25 Aug 2009 15:49:01 +0800 Received: from [127.0.0.1] (unknown [10.167.141.76]) by fnst.cn.fujitsu.com (Postfix) with ESMTP id 8AEE0D410B; Tue, 25 Aug 2009 15:44:24 +0800 (CST) Message-ID: <4A93949B.2020404@cn.fujitsu.com> Date: Tue, 25 Aug 2009 15:36:59 +0800 From: Wei Yongjun User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Chunbo Luo CC: davem@davemloft.net, netdev@vger.kernel.org, linux-sctp@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] sctp: fix the check for path failure detection References: <1251106637-434-1-git-send-email-chunbo.luo@windriver.com> In-Reply-To: <1251106637-434-1-git-send-email-chunbo.luo@windriver.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Chunbo Luo wrote: > The transport error count should be incremented when an outstanding > HB is not acknowledged. And the path failure detection should be done > before sending out the HB. > > Signed-off-by: Chunbo Luo > --- > net/sctp/sm_sideeffect.c | 6 +++++- > net/sctp/sm_statefuns.c | 8 ++++---- > 2 files changed, 9 insertions(+), 5 deletions(-) > > diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c > index 86426aa..fbdf4de 100644 > --- a/net/sctp/sm_sideeffect.c > +++ b/net/sctp/sm_sideeffect.c > @@ -446,7 +446,11 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc, > if (transport->state != SCTP_UNCONFIRMED) > asoc->overall_error_count++; > > - if (transport->state != SCTP_INACTIVE && > + /* > + * The transport error count is incremented when an outstanding HB > + * is not acknowledged. > + */ > T3-rtx timer expires also need to increment error count. > + if (transport->hb_sent && transport->state != SCTP_INACTIVE && > (transport->error_count++ >= transport->pathmaxrxt)) { > SCTP_DEBUG_PRINTK_IPADDR("transport_strike:association %p", > " transport IP: port:%d failed.\n", > diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c > index 7288192..7f77099 100644 > --- a/net/sctp/sm_statefuns.c > +++ b/net/sctp/sm_statefuns.c > @@ -981,10 +981,6 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep, > */ > > if (transport->param_flags & SPP_HB_ENABLE) { > - if (SCTP_DISPOSITION_NOMEM == > - sctp_sf_heartbeat(ep, asoc, type, arg, > - commands)) > - return SCTP_DISPOSITION_NOMEM; > /* Set transport error counter and association error counter > * when sending heartbeat. > */ > @@ -992,6 +988,10 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep, > SCTP_TRANSPORT(transport)); > sctp_add_cmd_sf(commands, SCTP_CMD_TRANSPORT_HB_SENT, > SCTP_TRANSPORT(transport)); > + if (SCTP_DISPOSITION_NOMEM == > + sctp_sf_heartbeat(ep, asoc, type, arg, > + commands)) > + return SCTP_DISPOSITION_NOMEM; > } > sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMER_UPDATE, > SCTP_TRANSPORT(transport)); > How about this one: --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 86426aa..fb723dd 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c @@ -447,7 +447,7 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc, asoc->overall_error_count++; if (transport->state != SCTP_INACTIVE && - (transport->error_count++ >= transport->pathmaxrxt)) { + (transport->error_count >= transport->pathmaxrxt)) { SCTP_DEBUG_PRINTK_IPADDR("transport_strike:association %p", " transport IP: port:%d failed.\n", asoc, @@ -468,6 +468,7 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc, * that indicates that we have an outstanding HB. */ if (!is_hb || transport->hb_sent) { + transport->error_count++; transport->last_rto = transport->rto; transport->rto = min((transport->rto * 2), transport->asoc->rto_max); }