Received: by 2002:aa6:c429:0:b029:98:93ff:f56f with SMTP id g9csp3390798lkq; Mon, 23 Nov 2020 04:37:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwIX3ZOsGris/48eMrwT/wv4x3C5GFQQeHUMdHgMfEzunSmh7gXPUDhnTuei/OLF3LI9TY8 X-Received: by 2002:a17:906:d20e:: with SMTP id w14mr44268109ejz.479.1606135037951; Mon, 23 Nov 2020 04:37:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606135037; cv=none; d=google.com; s=arc-20160816; b=GQ7MVH3AxF5MPR6dT3fLpM55DqbUd6QTyq+pECODcVDDom6xetqSTOZ2eSO+Vf/3fY bl+Jfzradzc6QRSijbJYGoIbCSIhVNOUcssoZQz8oLgUya4JN8dD58RE7vByYk/Z4u66 BmyDFDfbgxJIx18droykJ9Jw5GrMB8xZzpiQ/3wPWaKhGp8gYqHLB7ykhZBUUank63/x lKfrCoL8VvrAsuplpApfGU2gU7k3q8ZBeyuVzpMzK9QzH6GBqrgKEHTw38ABQLI+wrdv ZZm1USe5WpAZxgb1UsPMpKqVkvURGwFeY1xaf9Sad7HKqgPNxYuAfuv9pt5Dvt4TyK/5 IeFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :dkim-signature; bh=1zfMGECe0m9U2k3Woye+0PcohKmYwAGeCuvCBZfWklY=; b=Y6tHjL8IYT130bk8HsDt+zuCiW+ZwsDfVyUnEsMcRLdpTkrztFwq51nd14Ffv52YBr wk6M2xKdWNPJdZUQrVl0ayDlosjz1nyMfKgkQMRihJ06U1byzr2KhVZc+BkpoOJ+uudg bXz1CyMQhKpGgiS7e6+vlklAHArkEnQCmYvqhSChDFYIIKiUHNz6pUGOs1r61z76Wuk6 y+HweGSHRI7Irnh9imgmaVHozMZrnkuipPGAtggM3ULytemy2YedjTc0NCGwuLd8fJpk bljtf/axAIXiE+QNxAEfB1RXOOcZ6A6I+nlFj0QcS4lYzGEvIsz0dqMK731omhaZrwUP kKEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=YyLXJqDJ; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cf25si6588000edb.205.2020.11.23.04.36.55; Mon, 23 Nov 2020 04:37:17 -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=fail header.i=@microchip.com header.s=mchp header.b=YyLXJqDJ; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731006AbgKWMcD (ORCPT + 99 others); Mon, 23 Nov 2020 07:32:03 -0500 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:11277 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730871AbgKWMbe (ORCPT ); Mon, 23 Nov 2020 07:31:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1606134693; x=1637670693; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=OLdDCWuWqpqn05lwFSC/SLaom41YK6TRggAoCaO8jHE=; b=YyLXJqDJRuEo2Lspc8ndXQLnntQzuH5h7frRuPjOFYmyRJ0hvBijKUuV qjW03Ji6CaVxJWKdnIfcIwe9NzYy96J/zm4aNolxfra+m3BW6j1cglrpJ mzCJhbBxv4RxddLOhO7l2PtLAM5Z52mtOaav4/ZL1nPSEMAZ4AQlDDtic CN4BUtO6yj8vLwycM4clLSRAMW7lxyZUJC/Ow7RYsFPstbTKtz+S8lxFD 9818iwdoiYz52A5atnKQtLdfvI2YWallO/442NQIajqVWnpirP1h2/bAr 56RJJ0mmfZFt8wSJY7BGGfocytDY6rGzSXVgeUJtNi+J2e7Eoex8O0vA6 w==; IronPort-SDR: W1ICdDpcMDhkKJbW/LJNxdyht0qv+Lb3C6KtSDBZLXpFLT5xBuHnhmD4lq485Rt0Z8bJnQdpli RSCSJ7P2D8Y/0zYBA/aMtlRuwcs+qM9I+SLo6IwcJ5gJd2KCASjnVvZzfNE96V97CzGOO/jbl8 h5RdhB+MNoEsa1/+7C3Xwg1GxEEtRM435BScIL0xb5SZcRUHksP5W2kHN4VEFCHXztnTIY/0m+ hi8lXsaEthvgNR+mP9C9tnRgdDRMkO6Tei3RahQcyfrQ5Lsl4Pb9Uu3j7zBqqJKsElrkp+SXUx lJ8= X-IronPort-AV: E=Sophos;i="5.78,363,1599548400"; d="scan'208";a="100056419" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 23 Nov 2020 05:31:33 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 23 Nov 2020 05:31:33 -0700 Received: from localhost (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Mon, 23 Nov 2020 05:31:32 -0700 Date: Mon, 23 Nov 2020 13:31:32 +0100 From: Horatiu Vultur To: Nikolay Aleksandrov CC: , , , , , Subject: Re: [PATCH net-next] bridge: mrp: Implement LC mode for MRP Message-ID: <20201123123132.uxvec6uwuegioc25@soft-dev3.localdomain> References: <20201123111401.136952-1-horatiu.vultur@microchip.com> <5ffa6f9f-d1f3-adc7-ddb8-e8107ea78da5@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <5ffa6f9f-d1f3-adc7-ddb8-e8107ea78da5@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 11/23/2020 14:13, Nikolay Aleksandrov wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > On 23/11/2020 13:14, Horatiu Vultur wrote: > > Extend MRP to support LC mode(link check) for the interconnect port. > > This applies only to the interconnect ring. > > > > Opposite to RC mode(ring check) the LC mode is using CFM frames to > > detect when the link goes up or down and based on that the userspace > > will need to react. > > One advantage of the LC mode over RC mode is that there will be fewer > > frames in the normal rings. Because RC mode generates InTest on all > > ports while LC mode sends CFM frame only on the interconnect port. > > > > All 4 nodes part of the interconnect ring needs to have the same mode. > > And it is not possible to have running LC and RC mode at the same time > > on a node. > > > > Whenever the MIM starts it needs to detect the status of the other 3 > > nodes in the interconnect ring so it would send a frame called > > InLinkStatus, on which the clients needs to reply with their link > > status. > > > > This patch adds the frame header for the frame InLinkStatus and > > extends existing rules on how to forward this frame. > > > > Signed-off-by: Horatiu Vultur > > --- > > include/uapi/linux/mrp_bridge.h | 7 +++++++ > > net/bridge/br_mrp.c | 18 +++++++++++++++--- > > 2 files changed, 22 insertions(+), 3 deletions(-) > > > > Hi Horatiu, > The patch looks good overall, just one question below. Hi Nik, Thanks for taking time to review the patch. > > > diff --git a/include/uapi/linux/mrp_bridge.h b/include/uapi/linux/mrp_bridge.h > > index 6aeb13ef0b1e..450f6941a5a1 100644 > > --- a/include/uapi/linux/mrp_bridge.h > > +++ b/include/uapi/linux/mrp_bridge.h > > @@ -61,6 +61,7 @@ enum br_mrp_tlv_header_type { > > BR_MRP_TLV_HEADER_IN_TOPO = 0x7, > > BR_MRP_TLV_HEADER_IN_LINK_DOWN = 0x8, > > BR_MRP_TLV_HEADER_IN_LINK_UP = 0x9, > > + BR_MRP_TLV_HEADER_IN_LINK_STATUS = 0xa, > > BR_MRP_TLV_HEADER_OPTION = 0x7f, > > }; > > > > @@ -156,4 +157,10 @@ struct br_mrp_in_link_hdr { > > __be16 interval; > > }; > > > > +struct br_mrp_in_link_status_hdr { > > + __u8 sa[ETH_ALEN]; > > + __be16 port_role; > > + __be16 id; > > +}; > > + > > I didn't see this struct used anywhere, am I missing anything? Yes, you are right, the struct is not used any. But I put it there as I put the other frame types for MRP. > > Cheers, > Nik > > > #endif > > diff --git a/net/bridge/br_mrp.c b/net/bridge/br_mrp.c > > index bb12fbf9aaf2..cec2c4e4561d 100644 > > --- a/net/bridge/br_mrp.c > > +++ b/net/bridge/br_mrp.c > > @@ -858,7 +858,8 @@ static bool br_mrp_in_frame(struct sk_buff *skb) > > if (hdr->type == BR_MRP_TLV_HEADER_IN_TEST || > > hdr->type == BR_MRP_TLV_HEADER_IN_TOPO || > > hdr->type == BR_MRP_TLV_HEADER_IN_LINK_DOWN || > > - hdr->type == BR_MRP_TLV_HEADER_IN_LINK_UP) > > + hdr->type == BR_MRP_TLV_HEADER_IN_LINK_UP || > > + hdr->type == BR_MRP_TLV_HEADER_IN_LINK_STATUS) > > return true; > > > > return false; > > @@ -1126,9 +1127,9 @@ static int br_mrp_rcv(struct net_bridge_port *p, > > goto no_forward; > > } > > } else { > > - /* MIM should forward IntLinkChange and > > + /* MIM should forward IntLinkChange/Status and > > * IntTopoChange between ring ports but MIM > > - * should not forward IntLinkChange and > > + * should not forward IntLinkChange/Status and > > * IntTopoChange if the frame was received at > > * the interconnect port > > */ > > @@ -1155,6 +1156,17 @@ static int br_mrp_rcv(struct net_bridge_port *p, > > in_type == BR_MRP_TLV_HEADER_IN_LINK_DOWN)) > > goto forward; > > > > + /* MIC should forward IntLinkStatus frames only to > > + * interconnect port if it was received on a ring port. > > + * If it is received on interconnect port then, it > > + * should be forward on both ring ports > > + */ > > + if (br_mrp_is_ring_port(p_port, s_port, p) && > > + in_type == BR_MRP_TLV_HEADER_IN_LINK_STATUS) { > > + p_dst = NULL; > > + s_dst = NULL; > > + } > > + > > /* Should forward the InTopo frames only between the > > * ring ports > > */ > > > -- /Horatiu