Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7472955pxb; Thu, 18 Feb 2021 10:56:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxz8/3WYM6ApMii8aAXhWROUsZb5kX7QmysKWT+SBFi+P/Je1/KzDryLDLCloUwVg/H5yMn X-Received: by 2002:a17:906:48d7:: with SMTP id d23mr4168237ejt.275.1613674611493; Thu, 18 Feb 2021 10:56:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613674611; cv=none; d=google.com; s=arc-20160816; b=NoF8zdxQ4RnPow5Yb8xzXwqug+dNZt90EpCGFTKTLy1mBnP1X8a480uDJnfiVUekeM ZQ4ISW5rM64xI0VWttWVpUd8cfEub0dLzmjE6c2CnaeDqWXdEUYzB4vxOVbILF0mRAgZ O0+bU08WfCVeuV/KKqZfrIqcoN5Ju/4EcWuXPH6VQHiBjtzHnPMcS7xx+5I6V3aZp7g5 zYJeQ6LKPTilb+zSGrC046eXOEqho09WUVkNdVp2S48E8rt7vqPTDqPLUurhrNi5kYzL 3h2mhsh3rEP5H5jxm9BzwiqrDZug5QArfXit1WY0mV8vqhLnz0xauUn0/UwhQCfkJcKM V0yw== 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=IAeHU+ZuCyviiLpYZa0pCGB0W5e4M4NB3l+n2M4fYZU=; b=Gm7IrNrx8b4ZXEXWO/GPPTVFvg63NX40I/JSCySZdSWFB765rHln9vETEuJ+1s3Awr +czwhbhG6nXIUOsTRbuoyK8RpUqJN6rxS3VM42dxR6nvEl/imtZQUkZfxunSd1rDE+Az OMwJItklN6AWXmHlRon3VoQJQcZjDEAcAv5c+7JrDzULDnjVi3bYa256qQH9P9UvTQdl PsyLPP1UUr2oFUSm3ksuFsoZ4cqN+rzwsB7VY6DfvjRf0CbZ1Z5ROtxc/wnbSCgMlHwF dyyt5Y5UohimnyzpDFITx5b3oO3DrxvYt/JOTX7OhKLL2C9573fignanUCcd181LgexK 1Mvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W2AmWeei; 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 r9si5165161edc.218.2021.02.18.10.56.26; Thu, 18 Feb 2021 10:56:51 -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=W2AmWeei; 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 S230218AbhBRSzr (ORCPT + 99 others); Thu, 18 Feb 2021 13:55:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231901AbhBRRHU (ORCPT ); Thu, 18 Feb 2021 12:07:20 -0500 Received: from mail-oo1-xc36.google.com (mail-oo1-xc36.google.com [IPv6:2607:f8b0:4864:20::c36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10278C0613D6; Thu, 18 Feb 2021 09:06:25 -0800 (PST) Received: by mail-oo1-xc36.google.com with SMTP id f1so619590oou.0; Thu, 18 Feb 2021 09:06:25 -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=IAeHU+ZuCyviiLpYZa0pCGB0W5e4M4NB3l+n2M4fYZU=; b=W2AmWeei+CA/GEK4JmFfGdwEachPjWFFyto0odTBPeQ9zEqX03doEOA5p0/5q0mKPj 0S258LiVaiGbW6XdWkEPWad8Sy2NgjgtGYgoEWba8jvfvi4W29kEFHPCk5IbtaqGF/Di lzGz1a5wWVwxEb7RjYCCQTpL/smiWu4C1jvcesTdXtwg4pyWORStNl8a8Xdfnirkfq7K 7i7F2/0va7wYCUFn/ZNzrgKjdQkZKOS2QuI2NSyf/FBRuDFaSaXpvR45ClXslV1QHkRB 9MnVmR6SCOIIe/BdWmf0keMfx7BEQ4TpWNJgekyxZrjx2nxg99hjV7U0Ac8+ka7kIIre YXWw== 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=IAeHU+ZuCyviiLpYZa0pCGB0W5e4M4NB3l+n2M4fYZU=; b=omP92B0k9VSgzMeYEDxxL7ZFnSMBb7/rE4jsKpAACyqaqjMt/vGUZfcShKr5dMIgkU eMnlIpZiyJAyjj5XvtciCIWLOg9ecr1ZTOzbB5wBk5lNWpGpNKDwVlz1retkB5AA6++Z GgtiE9p6DnZT0/ghitYd80hiTi8r0D/ixyi7tuWPUTZ5Cc09DW11XuutDD1K2DsF4tLP 6sH1VhprcpcYKjbJr9wXLyihSecMPpXa7tWvVcCcWHTgVnzYhCB03/WbXHO3jGCvkXwk yy//KidvfZWS7f72Yjj2riaIlVL2+ljtb9HW7l2NtEETteY2+w1cXpYOW2K7PUW4x9cE L8mw== X-Gm-Message-State: AOAM533sN86lzvhtToAW+f58637m8a2VoSjwvn+mKBnsyJagCRljU4Xk huEDE5s+xANuZgy3PhtdiEeTRR+He/QJIoVbtA== X-Received: by 2002:a4a:3407:: with SMTP id b7mr3732250ooa.43.1613667984444; Thu, 18 Feb 2021 09:06:24 -0800 (PST) MIME-Version: 1.0 References: <20210218150116.1521-1-marco.wenzel@a-eberle.de> In-Reply-To: <20210218150116.1521-1-marco.wenzel@a-eberle.de> From: George McCollister Date: Thu, 18 Feb 2021 11:06:12 -0600 Message-ID: Subject: Re: [PATCH] net: hsr: add support for EntryForgetTime To: Marco Wenzel 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 Thu, Feb 18, 2021 at 9:01 AM Marco Wenzel 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