netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: Chunbo Luo <chunbo.luo@windriver.com>
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
Date: Tue, 25 Aug 2009 15:36:59 +0800	[thread overview]
Message-ID: <4A93949B.2020404@cn.fujitsu.com> (raw)
In-Reply-To: <1251106637-434-1-git-send-email-chunbo.luo@windriver.com>

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 <chunbo.luo@windriver.com>
> ---
>  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:

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);
 	}

       reply	other threads:[~2009-08-25  7:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1251106637-434-1-git-send-email-chunbo.luo@windriver.com>
2009-08-25  7:36 ` Wei Yongjun [this message]
2009-08-25  8:22   ` [PATCH v2] sctp: fix the check for path failure detection Luo Chunbo
2009-08-25 13:31     ` Vlad Yasevich

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=4A93949B.2020404@cn.fujitsu.com \
    --to=yjwei@cn.fujitsu.com \
    --cc=chunbo.luo@windriver.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).