From: Simon Horman <horms@kernel.org>
To: Lukasz Majewski <lukma@denx.de>
Cc: Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Oleksij Rempel <o.rempel@pengutronix.de>,
Tristram.Ha@microchip.com,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Ravi Gunasekaran <r-gunasekaran@ti.com>,
Nikita Zhandarovich <n.zhandarovich@fintech.ru>,
Murali Karicheri <m-karicheri2@ti.com>,
Arvid Brodin <Arvid.Brodin@xdin.com>,
Dan Carpenter <dan.carpenter@linaro.org>,
"Ricardo B. Marliere" <ricardo@marliere.net>,
Casper Andersson <casper.casan@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [net PATCH v2] hsr: Simplify code for announcing HSR nodes timer setup
Date: Wed, 8 May 2024 11:14:46 +0100 [thread overview]
Message-ID: <20240508101446.GC1736038@kernel.org> (raw)
In-Reply-To: <20240507111214.3519800-1-lukma@denx.de>
On Tue, May 07, 2024 at 01:12:14PM +0200, Lukasz Majewski wrote:
> Up till now the code to start HSR announce timer, which triggers sending
> supervisory frames, was assuming that hsr_netdev_notify() would be called
> at least twice for hsrX interface. This was required to have different
> values for old and current values of network device's operstate.
>
> This is problematic for a case where hsrX interface is already in the
> operational state when hsr_netdev_notify() is called, so timer is not
> configured to trigger and as a result the hsrX is not sending supervisory
> frames to HSR ring.
>
> This error has been discovered when hsr_ping.sh script was run. To be
> more specific - for the hsr1 and hsr2 the hsr_netdev_notify() was
> called at least twice with different IF_OPER_{LOWERDOWN|DOWN|UP} states
> assigned in hsr_check_carrier_and_operstate(hsr). As a result there was
> no issue with sending supervisory frames.
> However, with hsr3, the notify function was called only once with
> operstate set to IF_OPER_UP and timer responsible for triggering
> supervisory frames was not fired.
>
> The solution is to use netif_oper_up() and netif_running() helper
> functions to assess if network hsrX device is up.
> Only then, when the timer is not already pending, it is started.
> Otherwise it is deactivated.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
>
> Fixes: f421436a591d ("net/hsr: Add support for the High-availability Seamless Redundancy protocol (HSRv0)")
> ---
> Changes for v2:
>
> - Add extra condition to check if the hsr network device is running
> (not only up).
>
> - Only start announce timer when it is not pending (to avoid period
> shortening/violation)
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2024-05-08 10:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-07 11:12 [net PATCH v2] hsr: Simplify code for announcing HSR nodes timer setup Lukasz Majewski
2024-05-08 10:14 ` Simon Horman [this message]
2024-05-09 2:00 ` patchwork-bot+netdevbpf
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=20240508101446.GC1736038@kernel.org \
--to=horms@kernel.org \
--cc=Arvid.Brodin@xdin.com \
--cc=Tristram.Ha@microchip.com \
--cc=bigeasy@linutronix.de \
--cc=casper.casan@gmail.com \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukma@denx.de \
--cc=m-karicheri2@ti.com \
--cc=n.zhandarovich@fintech.ru \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=r-gunasekaran@ti.com \
--cc=ricardo@marliere.net \
/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).