Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp8025760pxb; Fri, 19 Feb 2021 05:44:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbajzv3MydQJsPGo8I5YKq1RguIfDEJOdEK2U55uXq1t/pjQ2ZtWW8AMXA2/n1e5pQCmdu X-Received: by 2002:a17:906:33c5:: with SMTP id w5mr8740501eja.319.1613742265672; Fri, 19 Feb 2021 05:44:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613742265; cv=none; d=google.com; s=arc-20160816; b=a58Ant1MDkeYgy99C2MIdrNjAPgDuey9VT5NZJb/XyCeNPT17QR0F4+TKwrTehUKmA 1zBM0V5+hSVKoEkao08yrIU2tVresjjX1KgHB4WZ6HU5ruKDttUsxS0C7JkaEKSJwU/F Yc2tA3SNkwA48a7ZnMvVtzLkQucuRs32oZBoArKWcVcbeWmCR7V0EekjFKx30JwbYfgv 73gv6mP6F/BWXkotWEG12PJSotCao/6X7Z59KxxvG3h5lmcstZaqYco5mS+E69/YgBVP 5u+3+cBcWatHNE0eBdkOfhW1qcvlI//ahjnGI0JLh7HITjH8zqHA9SCZxnTD6Kg0KmT8 SIXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=yoVL2D4+LT7sKASDLnQ/LSymbuFdWmRjWO8AU2rt+7A=; b=xN7C8CGTjv42W3T37j2gDf4jH0cW6WH+AARYzCM7vlHHPoft/i3S4kdsgQLKCOmUfF NjT7Pj6Nvjb77Jpt5thqlWdZtgDv41763ba1K3B6HWuwd/NCJf5A8F0/53huOUXiJNTH dmUeziJniUeCnKATppnAm0GOmVm6Ueb0zChWueblKTcauBgJn3mtkNUmp6RrBdVjq4Q8 eaC1HReEknh0ajMf9ltFSFvw3wW0zPvumqchqGbH5xCWkwitKwGpmBd34GctHtjwaqDR MM+Q6EfNkjauhUxVRhik833yJwa1/AAqGjazgQSxTlBNGVfr1JLub9lUbaWsfz+bO9H9 O/GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LhUmTuBc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z2si6098525edp.392.2021.02.19.05.43.58; Fri, 19 Feb 2021 05:44:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LhUmTuBc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229998AbhBSNlj (ORCPT + 99 others); Fri, 19 Feb 2021 08:41:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbhBSNlh (ORCPT ); Fri, 19 Feb 2021 08:41:37 -0500 Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B2C2C061574; Fri, 19 Feb 2021 05:40:57 -0800 (PST) Received: by mail-oi1-x234.google.com with SMTP id w1so5888457oic.0; Fri, 19 Feb 2021 05:40:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yoVL2D4+LT7sKASDLnQ/LSymbuFdWmRjWO8AU2rt+7A=; b=LhUmTuBcAD/VgVzTrhbFgzpOw+cDCcGx9fGim4njjQD4l+uqQ36DZV++8c5KCrVLGV NHfwG5pPyK0uWvihdSc05zco8vtk6+xxKF96K22qBQOM/xPrFAMddl4s9vaI5+FD2IgF U5IbH9m1ACEfxIPei/HrnXKOXQ0Blu91rASX739VcvLuh+WY0qsMntmO1ysLuX+5pdSg OQfT887DoXX+as24iTx0tUErMqCsGsCy4bIRHlxx17P1qIFnQxctGboZVevClnBuBIjt qrXktc2/uuDAkSVPz6KWsGzmCx7xr++zQeRInbk3KcYrg4dqp/TQKl9h145YTIsSrLRn HMzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yoVL2D4+LT7sKASDLnQ/LSymbuFdWmRjWO8AU2rt+7A=; b=jFo262A1GIEFncq4dCZuWzAqG+fpa60zeGutB1DPLraCKryPr7t3gUzpkChxPBQbgg 9wV+ON9E9k7Gh3HWCwORGkODn8eWubMzccYyLhY7DcAGD6is6GPlbu6n/X6AtUqDPi9w rIOHQoyLar9vPzKOz/9fgW790iyYU6ZFJ5jOOL0jOD8TVRr8ZLQ1t9nRM9ch9wmriIw7 w54za12ChDhkobLdvn1Qz/hIv4B7m/R2XLkmcNVyEosQnPD3GM2VDF5DDEfgaMzcyMg2 gFY7L8OGBNwi0kYQM6o/ewmWqhk6j6huciRi5nfEk+Otn8YjE7c1qvvWUosYNWCCivcj Z3fQ== X-Gm-Message-State: AOAM533KuV9KR28Pmx0owq6iQJo2gG4UfZkXfbRn/1DTcWwcAPpqEAIb V0VUQBZSCTtDEnUtorunV1XeKtyXofNpvVq9BQ== X-Received: by 2002:aca:da83:: with SMTP id r125mr6745884oig.127.1613742056820; Fri, 19 Feb 2021 05:40:56 -0800 (PST) MIME-Version: 1.0 References: <20210218150116.1521-1-marco.wenzel@a-eberle.de> <65ce3da11b8b4a3197835c5a85c40ce5@EXCH-SVR2013.eberle.local> In-Reply-To: <65ce3da11b8b4a3197835c5a85c40ce5@EXCH-SVR2013.eberle.local> From: George McCollister Date: Fri, 19 Feb 2021 07:40:44 -0600 Message-ID: Subject: Re: [PATCH] net: hsr: add support for EntryForgetTime To: "Wenzel, Marco" Cc: "David S. Miller" , Jakub Kicinski , Murali Karicheri , Taehee Yoo , Amol Grover , YueHaibing , Arvid Brodin , "netdev@vger.kernel.org" , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 19, 2021 at 2:27 AM Wenzel, Marco wrote: > > On Thu, Feb 18, 2021 at 6:06 PM : George McCollister wrote: > > > > On Thu, Feb 18, 2021 at 9:01 AM Marco Wenzel > eberle.de> wrote: > > > > > > In IEC 62439-3 EntryForgetTime is defined with a value of 400 ms. When > > > a node does not send any frame within this time, the sequence number > > > check for can be ignored. This solves communication issues with Cisco > > > IE 2000 in Redbox mode. > > > > > > Fixes: f421436a591d ("net/hsr: Add support for the High-availability > > > Seamless Redundancy protocol (HSRv0)") > > > Signed-off-by: Marco Wenzel > > > --- > > > net/hsr/hsr_framereg.c | 9 +++++++-- > > > net/hsr/hsr_framereg.h | 1 + > > > net/hsr/hsr_main.h | 1 + > > > 3 files changed, 9 insertions(+), 2 deletions(-) > > > > > > diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c index > > > 5c97de459905..805f974923b9 100644 > > > --- a/net/hsr/hsr_framereg.c > > > +++ b/net/hsr/hsr_framereg.c > > > @@ -164,8 +164,10 @@ static struct hsr_node *hsr_add_node(struct > > hsr_priv *hsr, > > > * as initialization. (0 could trigger an spurious ring error warning). > > > */ > > > now = jiffies; > > > - for (i = 0; i < HSR_PT_PORTS; i++) > > > + for (i = 0; i < HSR_PT_PORTS; i++) { > > > new_node->time_in[i] = now; > > > + new_node->time_out[i] = now; > > > + } > > > for (i = 0; i < HSR_PT_PORTS; i++) > > > new_node->seq_out[i] = seq_out; > > > > > > @@ -411,9 +413,12 @@ void hsr_register_frame_in(struct hsr_node > > *node, > > > struct hsr_port *port, int hsr_register_frame_out(struct hsr_port *port, > > struct hsr_node *node, > > > u16 sequence_nr) { > > > - if (seq_nr_before_or_eq(sequence_nr, node->seq_out[port->type])) > > > + if (seq_nr_before_or_eq(sequence_nr, node->seq_out[port->type]) > > && > > > + time_is_after_jiffies(node->time_out[port->type] + > > > + msecs_to_jiffies(HSR_ENTRY_FORGET_TIME))) > > > return 1; > > > > > > + node->time_out[port->type] = jiffies; > > > node->seq_out[port->type] = sequence_nr; > > > return 0; > > > } > > > diff --git a/net/hsr/hsr_framereg.h b/net/hsr/hsr_framereg.h index > > > 86b43f539f2c..d9628e7a5f05 100644 > > > --- a/net/hsr/hsr_framereg.h > > > +++ b/net/hsr/hsr_framereg.h > > > @@ -75,6 +75,7 @@ struct hsr_node { > > > enum hsr_port_type addr_B_port; > > > unsigned long time_in[HSR_PT_PORTS]; > > > bool time_in_stale[HSR_PT_PORTS]; > > > + unsigned long time_out[HSR_PT_PORTS]; > > > /* if the node is a SAN */ > > > bool san_a; > > > bool san_b; > > > diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h index > > > 7dc92ce5a134..f79ca55d6986 100644 > > > --- a/net/hsr/hsr_main.h > > > +++ b/net/hsr/hsr_main.h > > > @@ -21,6 +21,7 @@ > > > #define HSR_LIFE_CHECK_INTERVAL 2000 /* ms */ > > > #define HSR_NODE_FORGET_TIME 60000 /* ms */ > > > #define HSR_ANNOUNCE_INTERVAL 100 /* ms */ > > > +#define HSR_ENTRY_FORGET_TIME 400 /* ms */ > > > > > > /* By how much may slave1 and slave2 timestamps of latest received > > frame from > > > * each node differ before we notify of communication problem? > > > -- > > > 2.30.0 > > > > > > > scripts/checkpatch.pl gives errors about DOS line endings but once that is > > resolved this looks good. I tested it on an HSR network with the software > > implementation and the xrs700x which uses offloading and everything still > > works. I don't have a way to force anything on the HSR network to reuse > > sequence numbers after 400ms. > > > > Reviewed-by: George McCollister > Tested-by: George McCollister > Thank you very much for reviewing, testing and supporting! > > Where do you see the incorrect line endings? I just ran scripts/checkpath.pl as git commit hook and it did not report any errors. When I run it again manually, it also does not report any errors: > > # ./scripts/checkpatch.pl --strict /tmp/0001-net-hsr-add-support-for-EntryForgetTime.patch > total: 0 errors, 0 warnings, 0 checks, 38 lines checked > > /tmp/0001-net-hsr-add-support-for-EntryForgetTime.patch has no obvious style problems and is ready for submission. Sorry about this. It seems when I downloaded the patch with Chromium from gmail in Linux it added DOS new lines (this is unexpected). When I downloaded it from lore.kernel.org it's fine. Reviewed-by: George McCollister Tested-by: George McCollister > > > Regards, > Marco Wenzel