Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp707951pxv; Thu, 15 Jul 2021 14:04:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmfbmDbNFmHzI74yv/VA1JNcsUKCa0eQqhI9I3k8sysJxTlYJxdmCJ75rXBrQz9AmcajdB X-Received: by 2002:a50:cb8c:: with SMTP id k12mr9805479edi.386.1626383047709; Thu, 15 Jul 2021 14:04:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383047; cv=none; d=google.com; s=arc-20160816; b=K+N6EaKIZ60qlcfiIeoHQENghtQxFeEm8OKZ2u0knybHa2LuHjsma5It/liaLKBnjJ FgVwwnPy3qLUZHtPN1PRwuXxwBVEaqZASCy/YqZ+4p94skm7A++3b5GHavfFzK5Znt9K NpuBvIeWJLFpEJjpQWagy5xatBTcY7RPFywN82H74hb4+3hSpgWXvIr+51yG9JeIdoQy 5RQEE7Aby4mY+vdfkHRC3zCdGgZz8ScyY56XHGoZiGI2+ErgsYYoFCUpaP7sK/T64EAQ jqYjOAtVN+Z2XmyQK85Aj7pVMle1wtAVsLGGOAlkR9wvyhZB2Y3d7HyTWeHwRfrDZ/JG uOOQ== 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=N2jg4zi7Iv4QvpowdGtKUGTcy45zb6BWWH8FURqY3X4=; b=TRB4WMPaNCOis6aSHfQIXRPwkNND2p+3Rc0RVqjIdPXVtygArC+RdyUwma9p/8JAHe n469XBLHAW5Kx0rJ3KrL1DLdYGoUGY8dLJUu2LY/iHewpyX2j3VP9WdwTn5Ios+tH/En 5qrxZpolKcozF+fyAjiwpuqXdVnGGdC5tING6faPAeZHmOfO3diUEKr6vbUNL7cIiBB0 wKpA0f3IK5Uu1HwJe3JjspdpCSVCiU7gSXV2TD6cTPcxHTe8f7utCGDVaVXk8kuAdbKU IoaPqquYI98uY5h+snFJ+8iB/XwVgspyAQwL/rRpfItcFVXP7dJ64AQxtQh26k2OXmz5 mjJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jS7JagA5; 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 eb8si9672754edb.495.2021.07.15.14.03.44; Thu, 15 Jul 2021 14:04:07 -0700 (PDT) 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=jS7JagA5; 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 S244159AbhGOTON (ORCPT + 99 others); Thu, 15 Jul 2021 15:14:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:33970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242296AbhGOS7g (ORCPT ); Thu, 15 Jul 2021 14:59:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3AF8D613E9; Thu, 15 Jul 2021 18:56:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375377; bh=6BREJ0k9L9mE1E4tZx8e9Dg/2tIQvEdSjFwZmz7JpRU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jS7JagA5a6DPzzdXtIe0OoCpPnQwyWWm6SIZ4K+i/9dPxVBvydiPEgNSGbVVeSypU R+N/PcmZUy9DVYZNghTTFk2IlPim18US4GrZr6FQblGtj/5fB9dgETzeF7FK1EzJAj CA0vsb82trsqNFmf+KM8x89uHAnNcv02IKQN1+q0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Horatiu Vultur , "David S. Miller" , Sasha Levin Subject: [PATCH 5.12 060/242] net: bridge: mrp: Update ring transitions. Date: Thu, 15 Jul 2021 20:37:02 +0200 Message-Id: <20210715182603.002669275@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@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: Horatiu Vultur [ Upstream commit fcb34635854a5a5814227628867ea914a9805384 ] According to the standard IEC 62439-2, the number of transitions needs to be counted for each transition 'between' ring state open and ring state closed and not from open state to closed state. Therefore fix this for both ring and interconnect ring. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/bridge/br_mrp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c index 12487f6fe9b4..58254fbfda85 100644 --- a/net/bridge/br_mrp.c +++ b/net/bridge/br_mrp.c @@ -620,8 +620,7 @@ int br_mrp_set_ring_state(struct net_bridge *br, if (!mrp) return -EINVAL; - if (mrp->ring_state == BR_MRP_RING_STATE_CLOSED && - state->ring_state != BR_MRP_RING_STATE_CLOSED) + if (mrp->ring_state != state->ring_state) mrp->ring_transitions++; mrp->ring_state = state->ring_state; @@ -708,8 +707,7 @@ int br_mrp_set_in_state(struct net_bridge *br, struct br_mrp_in_state *state) if (!mrp) return -EINVAL; - if (mrp->in_state == BR_MRP_IN_STATE_CLOSED && - state->in_state != BR_MRP_IN_STATE_CLOSED) + if (mrp->in_state != state->in_state) mrp->in_transitions++; mrp->in_state = state->in_state; -- 2.30.2