Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp651186pxv; Thu, 15 Jul 2021 12:29:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWeyFohEy99ZFzb2bkQS25d1/g9dg1lY4jm8/XJimINFsjBDeATd3Bm2wXmgikDeo9Tpo1 X-Received: by 2002:aa7:cb19:: with SMTP id s25mr9331683edt.194.1626377392595; Thu, 15 Jul 2021 12:29:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626377392; cv=none; d=google.com; s=arc-20160816; b=I0Im/crtaJqoQgUZ1MrQSXsHXzETOf8S69R8AuSHSSTmOGRLrQmJVLcC3onOmTHi8G Pq/JdxKYdZobi09gUGivKRmiCeayb5UwKOv49DE+JbDvSm/Bv6eMz4Sal3yGYRQ+4kJq /GJjVSphXfAVjjjw2y7qkG0l7Wy2RD6NQVNiN1DDI6F/I4/q0hI8izym0a7wU2CrIFd3 NyndOlWpuBQDfkDBJPS5quux2XhWUdzSlKHFh8DqE8jbxe7dgW2AqrXfRfG/b+T26dsk /DoDNPYDMdGpQfPvblOZxveRvbJX8JGAdAT+7gVIzmuuIZmnEG3CsPhZzAlnRniNwmP0 PAew== 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=fz0KP3QKlw9FqpoTzU8YY3Kh8wmZ8M7X6zHqiX09Ahs=; b=ZRbMcuVKP15lgMx9v8HL8lMIwYIoFJTOt8jxiR/zIVMuQmpUH+LOyj7LDN5PeLWvRx QF2hLCRxOcby1z9uOi1lcpsUdfvuRDSneVnQ9JF8GI98JK/fUgAcOLoFoWlpx2n2iaPw DU5hLumGu6PUGcjEiG3Iiz4F3R7jFV3Mqx+gLlZSoKNA6FdRDn1z3R6g3yy2ilda5TrV aA83XGtIySGq2SUDnHiGl8dqZVysDa9vrsxp7Wy7nU8CipKhTawixfVlEeLJXvMh3Hn2 tuNWgAHP17LP9Ic+Yeqsz5y302vwX8hedqMMBrn7ByLavL+zcaXARxMVhj7ShcNlOfoq Q4eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sV7P9cgr; 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 q18si10012185edi.63.2021.07.15.12.29.30; Thu, 15 Jul 2021 12:29:52 -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=sV7P9cgr; 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 S1344586AbhGOT3y (ORCPT + 99 others); Thu, 15 Jul 2021 15:29:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:45710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243953AbhGOTKQ (ORCPT ); Thu, 15 Jul 2021 15:10:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 702BE613CA; Thu, 15 Jul 2021 19:07:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376035; bh=UIZQa9iSQhxcVaXMJJxbl1bvgrn5SEdBhZXIr0j9owk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sV7P9cgrlaHFkZRvy4GVkBztBrrnJkcy2No+ufsBuOR1yoGD1qqgte4K7fiJLWi/J yZ2pXqz8Y2vMmXgMKLSic8D0SmltFbD5LPv5sf/3clQ5CKEIa/BkMXJsowTH+MuGRl 1jCvQebER6qROBRN83GLNx37LNUNhzyq71p2c6RI= 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.13 072/266] net: bridge: mrp: Update ring transitions. Date: Thu, 15 Jul 2021 20:37:07 +0200 Message-Id: <20210715182626.883099035@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@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 cd2b1e424e54..f7012b7d7ce4 100644 --- a/net/bridge/br_mrp.c +++ b/net/bridge/br_mrp.c @@ -627,8 +627,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; @@ -715,8 +714,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