Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp606506ybz; Fri, 24 Apr 2020 06:17:12 -0700 (PDT) X-Google-Smtp-Source: APiQypI0bN+0EvC3Tp2XAdx7iKvw22gwKl0p7JY9psN5zHFX4wmzAmgQNwUKxuKOVXjMt2ddSoQ9 X-Received: by 2002:aa7:dd53:: with SMTP id o19mr6871802edw.180.1587734231921; Fri, 24 Apr 2020 06:17:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587734231; cv=none; d=google.com; s=arc-20160816; b=TguHvPbVeAtiIbCoHwHERrr7naZJYl3ghcVfqsTZvZWWK8M6uZA38x//GUktvlOl2Q 09aZ3kkS36C4/gKZweoxsnUn0LRmiNJcdwu4UugM4nYWoJpI0m5WrKMeZkyzE6+6wKHv rm8Nf5pDuWvyVpMpnWRIuBwr1umMjkh4qm5vmXwT8ejG0NGDMRlKpwdhMmk1yCuR4KjU Q7wH8UKqqLLkQyJ8NhY7OhgiYYAwW74KxsXzDiwU6tq+R1fM44085l5VGarwU2EAiTzc Z0zh+35+fzskBuUupVqwgTLEM3w0p+EYaKyKXqhvkwibFWAI7f+sgL6NdfB80qzqml1A F9Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=nDPT+ZJV2CPq97DCHIlmvXZGmifjSJc4mNEmnMWJwWM=; b=sUChdPJwPrxLAP+AU/4RYuuv2E2dG0vA6GguJtgcLHXa9itIP5HhWy2no3Y1GXpnnt Dw24+MZqjwCMBo3vMGo6FWDiLtoWv5xpMx8UOLnfkPdOprGs0R1mGGcxR5mv9P+Szy92 9Ybl+RV7dj+QA8VrEZatK7KVsfi1mxTwr1NjYRqNvsDjmKNNYxfHY/xIr008X2T2y0c0 q0GkXNjc+n4Zw7F8nStXVX6Krea6O9b/4UgkXwExTigLWqulww5hkf2jJXWAenU53BX8 8LG2aAwKjx/9tlNFCjSXnYGZ4xkaEm3uP3/VgrFOeN9bjDI/u3R2A2rlINe50mVRg0rM /rgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cumulusnetworks.com header.s=google header.b="WRLW/bbm"; 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=cumulusnetworks.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g14si3155918ejo.108.2020.04.24.06.16.48; Fri, 24 Apr 2020 06:17:11 -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=@cumulusnetworks.com header.s=google header.b="WRLW/bbm"; 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=cumulusnetworks.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727966AbgDXNN0 (ORCPT + 99 others); Fri, 24 Apr 2020 09:13:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726301AbgDXNN0 (ORCPT ); Fri, 24 Apr 2020 09:13:26 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFF61C09B045 for ; Fri, 24 Apr 2020 06:13:25 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id f18so9851168lja.13 for ; Fri, 24 Apr 2020 06:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cumulusnetworks.com; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=nDPT+ZJV2CPq97DCHIlmvXZGmifjSJc4mNEmnMWJwWM=; b=WRLW/bbmRMkfS9O1ECWVAAWtvAPmuPSSoAM3jlf2LRvXEY9zNzbfxDoSugIiOxISkc 6RnGh/1395GKZqaUR+3rh2sqZxh/QmuRJ1o+RIk1YI+S7dITrAKAyeSL16PkK1KsLvPY Gz4mjzkpzQGUJIRpMQJl2BLDptZPAthVvlPGU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=nDPT+ZJV2CPq97DCHIlmvXZGmifjSJc4mNEmnMWJwWM=; b=NznisJHvuBLsN7gbZaWGKF7N9/GAsgAGVn4XcPQ5g/d5a8TnhIbdOTg4/TCFjvVjsH mPBAj17/FlvkVMCT4OTTVrmJrZdtFo2PCJokGsAN6E7HAzln8hnHv2tsSu0I6tEJbknR yMuJsh2eO2bT6Q9tS3pMQqw4iONfeiG6fIF6/eoF4Io/o6xfjQfZNzlu32QrQiwtwa7m SDOuLqA+msOi2mI86c5FbB8+qkL94Iv4h/7u25tPvdFZEdq2QV9IeU02ASlv0R5i6AsL 6swJrnCxFsuGozxQpTA+we0k14NWgwUO+gze3OPrgFDiz+g8xi4txtuF2ncIaM5FrYdt 3rkQ== X-Gm-Message-State: AGi0PuZqDueu2CnJmJ6avu4tdMdgt8n/j2ie3uXVYe5aBldFfeDT9NqI 20uNKF7rAl5sDz7QumJNEY0K5w== X-Received: by 2002:a2e:90cd:: with SMTP id o13mr6214339ljg.220.1587734003888; Fri, 24 Apr 2020 06:13:23 -0700 (PDT) Received: from [192.168.0.109] (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id s30sm4489540lfc.93.2020.04.24.06.13.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Apr 2020 06:13:23 -0700 (PDT) Subject: Re: [PATCH net-next v3 05/11] bridge: mrp: Add MRP interface. To: Horatiu Vultur , davem@davemloft.net, jiri@resnulli.us, ivecera@redhat.com, kuba@kernel.org, roopa@cumulusnetworks.com, olteanv@gmail.com, andrew@lunn.ch, UNGLinuxDriver@microchip.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bridge@lists.linux-foundation.org References: <20200422161833.1123-1-horatiu.vultur@microchip.com> <20200422161833.1123-6-horatiu.vultur@microchip.com> From: Nikolay Aleksandrov Message-ID: <67f65f7e-9c1e-a420-b527-bc379f9563c1@cumulusnetworks.com> Date: Fri, 24 Apr 2020 16:13:19 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200422161833.1123-6-horatiu.vultur@microchip.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/04/2020 19:18, Horatiu Vultur wrote: > Define the MRP interface. > This interface is used by the netlink to update the MRP instances and by the MRP > to make the calls to switchdev to offload it to HW. > > It defines an MRP instance 'struct br_mrp' which is a list of MRP instances. > Which will be part of the 'struct net_bridge'. Each instance has 2 ring ports, > a bridge and an ID. > > In case the HW can't generate MRP Test frames then the SW will generate those. > > br_mrp_add - adds a new MRP instance. > > br_mrp_del - deletes an existing MRP instance. Each instance has an ID(ring_id). > > br_mrp_set_port_state - changes the port state. The port can be in forwarding > state, which means that the frames can pass through or in blocked state which > means that the frames can't pass through except MRP frames. This will > eventually call the switchdev API to notify the HW. This information is used > also by the SW bridge to know how to forward frames in case the HW doesn't > have this capability. > > br_mrp_set_port_role - a port role can be primary or secondary. This > information is required to be pushed to HW in case the HW can generate > MRP_Test frames. Because the MRP_Test frames contains a file with this > information. Otherwise the HW will not be able to generate the frames > correctly. > > br_mrp_set_ring_state - a ring can be in state open or closed. State open means > that the mrp port stopped receiving MRP_Test frames, while closed means that > the mrp port received MRP_Test frames. Similar with br_mrp_port_role, this > information is pushed in HW because the MRP_Test frames contain this > information. > > br_mrp_set_ring_role - a ring can have the following roles MRM or MRC. For the > role MRM it is expected that the HW can terminate the MRP frames, notify the > SW that it stopped receiving MRP_Test frames and trapp all the other MRP > frames. While for MRC mode it is expected that the HW can forward the MRP > frames only between the MRP ports and copy MRP_Topology frames to CPU. In > case the HW doesn't support a role it needs to return an error code different > than -EOPNOTSUPP. > > br_mrp_start_test - this starts/stops the generation of MRP_Test frames. To stop > the generation of frames the interval needs to have a value of 0. In this case > the userspace needs to know if the HW supports this or not. Not to have > duplicate frames(generated by HW and SW). Because if the HW supports this then > the SW will not generate anymore frames and will expect that the HW will > notify when it stopped receiving MRP frames using the function > br_mrp_port_open. > > br_mrp_port_open - this function is used by drivers to notify the userspace via > a netlink callback that one of the ports stopped receiving MRP_Test frames. > This function is called only when the node has the role MRM. It is not > supposed to be called from userspace. > > br_mrp_port_switchdev_add - this corresponds to the function br_mrp_add, > and will notify the HW that a MRP instance is added. The function gets > as parameter the MRP instance. > > br_mrp_port_switchdev_del - this corresponds to the function br_mrp_del, > and will notify the HW that a MRP instance is removed. The function > gets as parameter the ID of the MRP instance that is removed. > > br_mrp_port_switchdev_set_state - this corresponds to the function > br_mrp_set_port_state. It would notify the HW if it should block or not > non-MRP frames. > > br_mrp_port_switchdev_set_port - this corresponds to the function > br_mrp_set_port_role. It would set the port role, primary or secondary. > > br_mrp_switchdev_set_role - this corresponds to the function > br_mrp_set_ring_role and would set one of the role MRM or MRC. > > br_mrp_switchdev_set_ring_state - this corresponds to the function > br_mrp_set_ring_state and would set the ring to be open or closed. > > br_mrp_switchdev_send_ring_test - this corresponds to the function > br_mrp_start_test. This will notify the HW to start or stop generating > MRP_Test frames. Value 0 for the interval parameter means to stop generating > the frames. > > br_mrp_port_open - this function is used to notify the userspace that the port > lost the continuity of MRP Test frames. > > Signed-off-by: Horatiu Vultur > --- > net/bridge/br_private_mrp.h | 63 +++++++++++++++++++++++++++++++++++++ > 1 file changed, 63 insertions(+) > create mode 100644 net/bridge/br_private_mrp.h > Reviewed-by: Nikolay Aleksandrov