From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Yongjun Date: Mon, 24 Aug 2009 07:54:28 +0000 Subject: Re: [PATCH] sctp: fix the check for path failure detection Message-Id: <4A924734.6000702@cn.fujitsu.com> List-Id: References: <1250838275-7444-1-git-send-email-chunbo.luo@windriver.com> <4A8F15F5.3020901@hp.com> <1251080117.6513.11.camel@pek-cluo-desktop> In-Reply-To: <1251080117.6513.11.camel@pek-cluo-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Luo Chunbo Cc: Vlad Yasevich , davem@davemloft.net, netdev@vger.kernel.org, linux-sctp@vger.kernel.org, linux-kernel@vger.kernel.org Luo Chunbo =D0=B4=B5=C0: > On Fri, 2009-08-21 at 17:47 -0400, Vlad Yasevich wrote: > =20 >> Chunbo Luo wrote: >> =20 >>> The transport is marked DOWN immediately after sending the max+1 HB, >>> which is equal to not sending the max+1 HB at all. We should wait >>> a next period and make sure the last HB is not acknowledged. >>> >>> =20 >> I don't think this code does what you want either... >> >> Let's say path_max_rxt =3D 2. What we'll get is: >> timeout: >> err++ (1) >> if (err > 2) false >> send HB >> reset timer >> timeout: >> err++ (2) >> if (err > 2) false >> send HB >> reset timer >> timeout: >> err++ (3) >> if (err > 2) >> set transport DOWN >> send HB >> reset timer. >> >> We only had 2 unacknowledged HB when we should have had 3. >> =20 > > The error count is increment after the HB was sent, and the error count > check is before sending HB. > > Let's say path_max_rxt =3D2 . What we really get is: > > timeout: > if( err > 2) false > send HB > err++ (1) > reset timer > timeout: > if( err > 2) false > send HB > err++ (2) > reset timer > timeout: > if( err > 2) false > send HB > err++ (3) > reset timer > timeout: > if( err > 2) > set transport DOWN > send HB > reset timer > > Here We had 3 unacknowledged HBs But with Vlad's advice, you just need to do little change to the kernel codes, may be two lines's patch, and it can do the same thing. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752034AbZHXH5S (ORCPT ); Mon, 24 Aug 2009 03:57:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752010AbZHXH5P (ORCPT ); Mon, 24 Aug 2009 03:57:15 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:60487 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752002AbZHXH5N (ORCPT ); Mon, 24 Aug 2009 03:57:13 -0400 Message-ID: <4A924734.6000702@cn.fujitsu.com> Date: Mon, 24 Aug 2009 15:54:28 +0800 From: Wei Yongjun User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Luo Chunbo CC: Vlad Yasevich , davem@davemloft.net, netdev@vger.kernel.org, linux-sctp@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sctp: fix the check for path failure detection References: <1250838275-7444-1-git-send-email-chunbo.luo@windriver.com> <4A8F15F5.3020901@hp.com> <1251080117.6513.11.camel@pek-cluo-desktop> In-Reply-To: <1251080117.6513.11.camel@pek-cluo-desktop> Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Luo Chunbo дµÀ: > On Fri, 2009-08-21 at 17:47 -0400, Vlad Yasevich wrote: > >> Chunbo Luo wrote: >> >>> The transport is marked DOWN immediately after sending the max+1 HB, >>> which is equal to not sending the max+1 HB at all. We should wait >>> a next period and make sure the last HB is not acknowledged. >>> >>> >> I don't think this code does what you want either... >> >> Let's say path_max_rxt = 2. What we'll get is: >> timeout: >> err++ (1) >> if (err > 2) false >> send HB >> reset timer >> timeout: >> err++ (2) >> if (err > 2) false >> send HB >> reset timer >> timeout: >> err++ (3) >> if (err > 2) >> set transport DOWN >> send HB >> reset timer. >> >> We only had 2 unacknowledged HB when we should have had 3. >> > > The error count is increment after the HB was sent, and the error count > check is before sending HB. > > Let's say path_max_rxt =2 . What we really get is: > > timeout: > if( err > 2) false > send HB > err++ (1) > reset timer > timeout: > if( err > 2) false > send HB > err++ (2) > reset timer > timeout: > if( err > 2) false > send HB > err++ (3) > reset timer > timeout: > if( err > 2) > set transport DOWN > send HB > reset timer > > Here We had 3 unacknowledged HBs But with Vlad's advice, you just need to do little change to the kernel codes, may be two lines's patch, and it can do the same thing.