Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1973934pxb; Fri, 5 Mar 2021 04:31:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyx283aFP0L3YZpkqYHIq99RN+rvrgPuPOwSPyUaTRlurqVu3CDbLh7uY98VSX6jUqOd5/M X-Received: by 2002:a17:906:90d8:: with SMTP id v24mr1959676ejw.547.1614947507873; Fri, 05 Mar 2021 04:31:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614947507; cv=none; d=google.com; s=arc-20160816; b=Stwwu5tmdb+5nbvEc/4AtJ/QBY1ix92t+FobIJUnR7hg133/4obUad/YpqedsP3upZ k9vL9vqBu9pEmU2IcRytUlFL3j7E+VJXMJRqqkRFe+uPr3AQV9ImmyChSkbY5m6u9/yd P7FHA72CKWxWqSo8UdkFJ0R8nnQroM+/18nmwZP6IUNdOAUiaoXpBNJyJXU/z30GuAeJ e1jnvvMe5Tzk1xdAdZpbfMnYMImYateBF64GZhToXgoJqQ3xCtKMuZlKtRF6HKh9a1Eu kB+SckE/QqtbeqW3kfk7c2/1nX/q2vrbIdMMmXcmB4PkPCBGgpc1mKENWHHclxrXgPNr e0vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=a+pOEJWDcXn8lqzD5VXKc2XRejLiWes8Y8dtjIH2/zk=; b=E3rsTq9Lsx9SLkUedJn2/DUQeZuvoJ7YpXPP0TaWGw5q2pl6gma8QimoUBir1axhLC wkHdO7Gy142SZkVY+iIGJCEGrurP4FYp5oCz8K6AuYQfxOBdr9O1CT9OIjZ0101SDj5Y vevJ4hOZywtcfWAWILyI8HwUipLKBbn+9V6ffMDXRm30g2P/HuQPSKkW783mcHB0yaNd yprc0yaEiL60YjU3cKoCn3dEmRLGV4dMPmQy+7Km356SIyyjguMv20vdFA603TjRZZcM kNzuLj60BoH2GdeLI+FSBAPqpq1cgOdxD8XPrRG/YYBO4xCalJbMl2LOJAJymUzVV75b CLKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wR8wJv8Y; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 11si1582405edw.195.2021.03.05.04.31.24; Fri, 05 Mar 2021 04:31:47 -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=@linuxfoundation.org header.s=korg header.b=wR8wJv8Y; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232240AbhCEM3V (ORCPT + 99 others); Fri, 5 Mar 2021 07:29:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:37722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230423AbhCEM2z (ORCPT ); Fri, 5 Mar 2021 07:28:55 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0484665013; Fri, 5 Mar 2021 12:28:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614947335; bh=2Wgx6MVISznKDkpBBkDYzJNMeTM6PiEZhJpfXbZ2p9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wR8wJv8YCiM0qqPcgSqlt8I5rEhfyODZvCYP2ANIWCM5v2Qiu3x5BF8S6QE4OWA9e nwGYnudcK4vB9oorzTUetlkhLCOWx3RfqcqyV7q0VYjNdwWEa5CrNtUJLYqMDVmnLg fXOUo7wubfQihY3ldzKZZmvmRGWGRlB4TwpJ5rSc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marco Wenzel , George McCollister , Andrew Lunn , Jakub Kicinski Subject: [PATCH 5.10 029/102] net: hsr: add support for EntryForgetTime Date: Fri, 5 Mar 2021 13:20:48 +0100 Message-Id: <20210305120904.712123059@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210305120903.276489876@linuxfoundation.org> References: <20210305120903.276489876@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marco Wenzel commit f176411401127a07a9360dec14eca448eb2e9d45 upstream. 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 Reviewed-by: George McCollister Tested-by: George McCollister Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20210224094653.1440-1-marco.wenzel@a-eberle.de Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- 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(-) --- a/net/hsr/hsr_framereg.c +++ b/net/hsr/hsr_framereg.c @@ -164,8 +164,10 @@ static struct hsr_node *hsr_add_node(str * 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_no 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; } --- 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; --- 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?