From: David Miller <davem@davemloft.net>
To: kwiecienmaciek@gmail.com
Cc: linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
alexander.sverdlin@nokia.com, maciej.kwiecien@nokia.com
Subject: Re: [PATCH] sctp: don't compare hb_timer expire date before starting it
Date: Fri, 22 Feb 2019 11:22:22 -0800 (PST) [thread overview]
Message-ID: <20190222.112222.1641489327512557605.davem@davemloft.net> (raw)
In-Reply-To: <20190222084526.8214-1-maciej.kwiecien@nokia.com>
From: kwiecienmaciek@gmail.com
Date: Fri, 22 Feb 2019 09:45:26 +0100
> From: Maciej Kwiecien <maciej.kwiecien@nokia.com>
>
> hb_timer might not start at all for a particular transport because its
> start is conditional. In a result a node is not sending heartbeats.
>
> Function sctp_transport_reset_hb_timer has two roles:
> - initial start of hb_timer for a given transport,
> - update expire date of hb_timer for a given transport.
> The function is optimized to update timer's expire only if it is before
> a new calculated one but this comparison is invalid for a timer which
> has not yet started. Such a timer has expire == 0 and if a new expire
> value is bigger than (MAX_JIFFIES / 2 + 2) then "time_before" macro will
> fail and timer will not start resulting in no heartbeat packets send by
> the node.
>
> This was found when association was initialized within first 5 mins
> after system boot due to jiffies init value which is near to MAX_JIFFIES.
>
> Test kernel version: 4.9.154 (ARCH=arm)
> hb_timer.expire = 0; //initialized, not started timer
> new_expire = MAX_JIFFIES / 2 + 2; //or more
> time_before(hb_timer.expire, new_expire) == false
>
> Fixes: ba6f5e33bdbb ("sctp: avoid refreshing heartbeat timer too often")
> Reported-by: Marcin Stojek <marcin.stojek@nokia.com>
> Tested-by: Marcin Stojek <marcin.stojek@nokia.com>
> Signed-off-by: Maciej Kwiecien <maciej.kwiecien@nokia.com>
Applied and queued up for -stable, thank you.
prev parent reply other threads:[~2019-02-22 19:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-22 8:45 [PATCH] sctp: don't compare hb_timer expire date before starting it kwiecienmaciek
2019-02-22 10:03 ` Sverdlin, Alexander (Nokia - DE/Ulm)
2019-02-22 12:49 ` Marcelo Ricardo Leitner
2019-02-22 19:22 ` David Miller [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=20190222.112222.1641489327512557605.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=alexander.sverdlin@nokia.com \
--cc=kwiecienmaciek@gmail.com \
--cc=linux-sctp@vger.kernel.org \
--cc=maciej.kwiecien@nokia.com \
--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).